From 12976c7155a0126c6abbae3e8533cd5181f32f3c Mon Sep 17 00:00:00 2001 From: Antoine Ginies Date: Mon, 2 Feb 2004 15:09:30 +0000 Subject: disable printer sharing for the moment to get a wizard working --- samba_wizard/Samba.pm | 77 ++++++++++++++++++++++++++------------------------- 1 file changed, 40 insertions(+), 37 deletions(-) diff --git a/samba_wizard/Samba.pm b/samba_wizard/Samba.pm index 01568aaf..4ee36853 100755 --- a/samba_wizard/Samba.pm +++ b/samba_wizard/Samba.pm @@ -38,8 +38,8 @@ my $o = { wiz_do_file_sharing => '', wiz_all_printers => '', wiz_level => '', - wiz_printers => '', - wiz_do_printer_sharing => '', +# wiz_printers => '', +# wiz_do_printer_sharing => '', wiz_do_homes => '', wiz_workgroup => '', wiz_dir => '', @@ -47,7 +47,7 @@ my $o = { wiz_write_list => '', wiz_read_list => '', wiz_hosts_deny => '', - list_printers => '' +# list_printers => '' }, needed_rpm => [ 'samba-server' ], defaultimage => "/usr/share/wizards/samba_wizard/images/samba.png", @@ -132,13 +132,13 @@ $o->{pages} = { name => N("Enabled Samba Services") . "\n\n" . N("Samba can provide a common file sharing area to your Windows workstation, and can also provide printer sharing for the printers connected to your server."), pre => sub { $o->{var}{wiz_do_file_sharing} ||= get_file_sharing(); - $o->{var}{wiz_do_printer_sharing} ||= 1; +# $o->{var}{wiz_do_printer_sharing} ||= 1; $o->{var}{wiz_do_homes} ||= get_home_sharing() }, post => \&check_services, data => [ { text => N("Enable file sharing area"), type => 'bool', val => \$o->{var}{wiz_do_file_sharing} }, - { text => N("Enable Server Printer Sharing"), type => 'bool', val => \$o->{var}{wiz_do_printer_sharing} }, +# { text => N("Enable Server Printer Sharing"), type => 'bool', val => \$o->{var}{wiz_do_printer_sharing} }, { text => N("Make home directories available for their owners"), type => 'bool', val => \$o->{var}{wiz_do_homes} }, ], next => 'ask_dir' @@ -171,24 +171,24 @@ $o->{pages} = { $o->{var}{wiz_read_list} ||= get_read(); $o->{var}{wiz_write_list} ||= get_write() }, - post => \&check_users, +# post => \&check_users, data => [ { label => N("read list:"), help => N("root, fred, \@users, \@wheel"), val => \$o->{var}{wiz_read_list} }, { label => N("write list:"), help => N("root, fred, \@users, \@wheel"), val => \$o->{var}{wiz_write_list} }, ], - next => 'ask_printers' - }, - ask_printers => { - name => N("Select which printers you want to be accessible from known users"), - pre => sub { - $o->{var}{list_printers} ||= [ list_printers() ]; - $o->{var}{wiz_box_list} ||= get_previous_printers($o->{var}{list_printers}) - }, - post => \&check, - data => [ - { text => N("Enable all printers"), type => 'bool', val => \$o->{var}{wiz_all_printers} }, - { val => \$o->{var}{wiz_box_list}, boolean_list => \$o->{var}{list_printers}, disabled => sub { $o->{var}{wiz_all_printers} and return 1; 0 } }, - ], +# next => 'ask_printers' +# }, +# ask_printers => { +# name => N("Select which printers you want to be accessible from known users"), +# pre => sub { +# $o->{var}{list_printers} ||= [ list_printers() ]; +# $o->{var}{wiz_box_list} ||= get_previous_printers($o->{var}{list_printers}) + # }, + # post => \&check, + # data => [ + # { text => N("Enable all printers"), type => 'bool', val => \$o->{var}{wiz_all_printers} }, + # { val => \$o->{var}{wiz_box_list}, boolean_list => \$o->{var}{list_printers}, disabled => sub { $o->{var}{wiz_all_printers} and return 1; 0 } }, + # ], next => 'summary' }, warning => { @@ -204,11 +204,12 @@ $o->{pages} = { next => 'config' }, summary => { - name => N("Configuring Samba") . "\n\n" . N(" The wizard collected the following parameters to configure Samba.") . "\n\n" . N("To accept these values, and configure your server, click the Next button or use the Back button to correct them."), + name => N("Configuring Samba") . "\n\n" . N("The wizard collected the following parameters +configure Samba.") . "\n\n" . N("To accept these values, and configure your server, click the Next button or use the Back button to correct them."), pre => sub { - $o->{var}{printers} = get_printers(); +# $o->{var}{printers} = get_printers(); $o->{var}{file_sharing} = $o->{var}{wiz_do_file_sharing} ? N("enabled") : N("disabled"); - $o->{var}{printer_sharing} = $o->{var}{wiz_do_printer_sharing} ? N("enabled") : N("disabled"); +# $o->{var}{printer_sharing} = $o->{var}{wiz_do_printer_sharing} ? N("enabled") : N("disabled"); $o->{var}{shared_homes} = $o->{var}{wiz_do_homes} ? N("enabled") : N("disabled") }, data => [ @@ -216,9 +217,9 @@ $o->{pages} = { { label => N("Server Banner:"), fixed_val => \$o->{var}{wiz_banner} }, { label => N("File Sharing:"), fixed_val => \$o->{var}{file_sharing} }, { label => N("Shared directory:"), fixed_val => \$o->{var}{wiz_dir} }, - { label => N("Print Server:"), fixed_val => \$o->{var}{printer_sharing} }, +# { label => N("Print Server:"), fixed_val => \$o->{var}{printer_sharing} }, { label => N("Home:"), fixed_val => \$o->{var}{shared_homes} }, - { label => N("Printers:"), fixed_val => \$o->{var}{printers} }, +# { label => N("Printers:"), fixed_val => \$o->{var}{printers} }, ], post => \&do_it, next => 'end' @@ -246,7 +247,7 @@ sub check { sub check_services { $o->{var}{wiz_do_homes} and return 'warn_smbpasswd'; $o->{var}{wiz_do_file_sharing} and return 'ask_dir'; - $o->{var}{wiz_do_printer_sharing} and return 'ask_printers'; +# $o->{var}{wiz_do_printer_sharing} and return 'ask_printers'; } sub check_dir { @@ -469,8 +470,9 @@ sub get_deny_host { # remember one variable cannot be commented and not in the same file. sub do_it { $::testing and return; - my $file = "/usr/share/wizards//samba_wizard/scripts/smb.conf.default"; - + my $in = 'interactive'->vnew('su', 'Samba'); + my $w = $in->wait_message(N("Samba server"), N("Configuring your Samba server...")); + my $file = "/usr/share/wizards//samba_wizard/scripts/smb.conf.default"; my $conf = read_conf($file); $conf->chg_var("global", "workgroup", $o->{var}{wiz_workgroup}); $conf->chg_var("global", "server string", $o->{var}{wiz_banner}); @@ -499,21 +501,22 @@ sub do_it { $conf->chg_var("global", "hosts deny", $o->{var}{wiz_hosts_deny}); $conf->chg_var("global", "hosts allow", $o->{var}{wiz_hosts_allow}); - if ($o->{var}{wiz_do_printer_sharing}) { - standalone->explanations("Enabling printer sharing"); - $conf->printer_sharing; - } else { - standalone->explanations("Disabling printer sharing"); - for (my $i = 0; $i < @{$o->{var}{wiz_box_list}}; $i++) { - $conf->comment_menu($o->{var}{list_printers}[$i], ";"); - } - $conf->comment_menu("printers", ";"); - } +# if ($o->{var}{wiz_do_printer_sharing}) { +# standalone->explanations("Enabling printer sharing"); +# $conf->printer_sharing; +# } else { +# standalone->explanations("Disabling printer sharing"); +# for (my $i = 0; $i < @{$o->{var}{wiz_box_list}}; $i++) { +# $conf->comment_menu($o->{var}{list_printers}[$i], ";"); +# } +# $conf->comment_menu("printers", ";"); +# } $conf->write_conf("/etc/samba/smb.conf"); if (services::is_service_running('smb')) { services::restart('smb') } else { services::start('smb') } + undef $w; } 1; -- cgit v1.2.1