summaryrefslogtreecommitdiffstats
path: root/samba_wizard
diff options
context:
space:
mode:
authorFlorent Villard <warly@mandriva.com>2003-09-17 17:41:09 +0000
committerFlorent Villard <warly@mandriva.com>2003-09-17 17:41:09 +0000
commit986a271663c7f37797bec011b2ee9379e82ac4fe (patch)
treeadd300da8273c0c5dc56f0e13ac72066a80399d1 /samba_wizard
parentb5974747d1a6f7669052ddd42d4a45e4eb7072c1 (diff)
downloaddrakwizard-986a271663c7f37797bec011b2ee9379e82ac4fe.tar
drakwizard-986a271663c7f37797bec011b2ee9379e82ac4fe.tar.gz
drakwizard-986a271663c7f37797bec011b2ee9379e82ac4fe.tar.bz2
drakwizard-986a271663c7f37797bec011b2ee9379e82ac4fe.tar.xz
drakwizard-986a271663c7f37797bec011b2ee9379e82ac4fe.zip
better check of ip addresses in dhcp
check that server has been run in client dns check that the program is run as root in drakwizard remove bad quotes in po
Diffstat (limited to 'samba_wizard')
-rwxr-xr-xsamba_wizard/Samba.pm59
1 files changed, 23 insertions, 36 deletions
diff --git a/samba_wizard/Samba.pm b/samba_wizard/Samba.pm
index e192d0d2..160d2103 100755
--- a/samba_wizard/Samba.pm
+++ b/samba_wizard/Samba.pm
@@ -76,10 +76,7 @@ $o->{pages} = {
next => 'ask_banner'
},
error_in_workgroup => {
- name => N('Error.'),
- data => [
- { label => N('The Workgroup is wrong') },
- ],
+ name => N('Error.') . "\n\n" . N('The Workgroup is wrong'),
post => \&check_workgroup,
next => 'ask_workgroup'
},
@@ -95,10 +92,8 @@ $o->{pages} = {
next => 'ask_net'
},
error_in_banner => {
- name => N('Error.'),
- data => [
- { label => N('The Server Banner is incorrect') },
- ],
+ name => N('Error.') . "\n\n" . N('The Server Banner is incorrect'),
+ ignore => 1,
next => 'ask_banner'
},
ask_net => {
@@ -143,6 +138,7 @@ $o->{pages} = {
warn_smbpasswd => {
name => N('Warning.') . "\n\n" . N('You have selected to allow user access their home directories via samba but you/they must use smbpasswd to set a password.'),
post => \&ask_dir,
+ ignore => 1,
next => 'summary'
},
ask_dir => {
@@ -157,10 +153,8 @@ $o->{pages} = {
next => 'ask_access'
},
error_in_dir => {
- name => N('Error.'),
- data => [
- { label => N('The path you entered does not exist.') },
- ],
+ name => N('Error.') . "\n\n" . N('The path you entered does not exist.'),
+ ignore => 1,
next => 'ask_dir'
},
ask_access => {
@@ -192,11 +186,13 @@ $o->{pages} = {
warning => {
name => N('Warning.'),
data => [ { label => N('') } ],
+ ignore => 1,
next => 'summary'
},
error => {
name => N('Error.'),
data => [ { label => N('') } ],
+ ignore => 1,
next => 'config'
},
summary => {
@@ -221,8 +217,7 @@ configure Samba.') . "\n\n" . N('To accept these values, and configure your serv
next => 'end'
},
end => {
- name => N('Congratulation'),
- data => [ { label => N('The wizard successfully configured your Samba server.') } ],
+ name => N('Congratulation') . "\n\n" . N('The wizard successfully configured your Samba server.'),
end => 1,
next => 0
},
@@ -289,10 +284,10 @@ sub write_conf {
foreach (@{$self->{tab}}) {
if (/^\s*\;?\s*\[(.*)\].*/) {
$menu = $1;
- print FH "$self->{conf}->{$menu}{__comment}"."[$menu]\n";
+ print FH "$self->{conf}->{$menu}{__comment}\[$menu\]\n";
}
elsif (/^(?!\#)\s*\;*\s*(.*?)\s*=/) {
- print FH "$self->{conf}->{$menu}{$1}{comment}"."$1" ." = ". "$self->{conf}->{$menu}{$1}{value}\n";
+ print FH "$self->{conf}->{$menu}{$1}{comment}$1 = $self->{conf}->{$menu}{$1}{value}\n";
}
else {
print FH $_;
@@ -305,7 +300,7 @@ sub add_printer {
my $self = shift;
my ($printer) = @_;
- if (exists $self->{conf}->{$printer}) {
+ if (exists $self->{conf}{$printer}) {
$self->comment_menu($printer, " ");
}
else {
@@ -343,10 +338,10 @@ sub comment_menu {
my ($menu, $str) = @_;
return if (!$menu or !exists $self->{conf}->{$menu});
- $self->{conf}->{$menu}{__comment} = $str;
+ $self->{conf}{$menu}{__comment} = $str;
foreach (keys %{$self->{conf}->{$menu}}) {
($_ eq "__comment") and next;
- $self->{conf}->{$menu}{$_}{comment} = $str;
+ $self->{conf}{$menu}{$_}{comment} = $str;
}
}
@@ -369,19 +364,14 @@ sub printer_sharing {
my $self = shift;
if ($o->{var}{wiz_all_printers}) {
- $self->comment_menu("printers", " ");
- foreach my $printer (keys (%::bool)) {
- $self->comment_menu($printer, ";");
- }
- }
- else {
+ $self->comment_menu('printers', " ");
+ } else {
$self->comment_menu("printers", ";");
- foreach my $printer (keys (%::bool)) {
- if (int($::bool{$printer})) {
- $self->comment_menu($printer, " ");
+ for(my $i; $i < @{$o->{var}{wiz_box_list}}; $i++) {
+ my $printer = $o->{var}{list_printers}[$i];
+ if ($o->{var}{wiz_box_list}[$i]) {
$self->add_printer($printer);
- }
- else {
+ } else {
$self->comment_menu($printer, ";");
}
}
@@ -497,13 +487,10 @@ sub do_it {
if ($o->{var}{wiz_do_printer_sharing}) {
standalone->explanations("Enabling printer sharing");
$conf->printer_sharing();
- }
- else {
+ } else {
standalone->explanations("Disabling printer sharing");
- foreach my $printer (keys (%::bool)) {
- if (!int($::bool{$printer})) {
- $conf->comment_menu("$printer", ";");
- }
+ for(my $i; $i < @{$o->{var}{wiz_box_list}}; $i++) {
+ $conf->comment_menu("$o->{var}{list_printers}[$i]", ";");
}
$conf->comment_menu("printers", ";");
}