summaryrefslogtreecommitdiffstats
path: root/samba_wizard
diff options
context:
space:
mode:
authorAntoine Ginies <aginies@mandriva.com>2005-05-26 07:51:13 +0000
committerAntoine Ginies <aginies@mandriva.com>2005-05-26 07:51:13 +0000
commitd4010d321abd5f7db5bd4c6935fdaa32babe62c0 (patch)
tree66d4b2c393ace663a70af998d0e91b1a1751fdfe /samba_wizard
parent87e670fc20d243e204ad32b85e4e39a72e88b778 (diff)
downloaddrakwizard-d4010d321abd5f7db5bd4c6935fdaa32babe62c0.tar
drakwizard-d4010d321abd5f7db5bd4c6935fdaa32babe62c0.tar.gz
drakwizard-d4010d321abd5f7db5bd4c6935fdaa32babe62c0.tar.bz2
drakwizard-d4010d321abd5f7db5bd4c6935fdaa32babe62c0.tar.xz
drakwizard-d4010d321abd5f7db5bd4c6935fdaa32babe62c0.zip
many fix... need more
Diffstat (limited to 'samba_wizard')
-rwxr-xr-xsamba_wizard/Samba.pm42
1 files changed, 28 insertions, 14 deletions
diff --git a/samba_wizard/Samba.pm b/samba_wizard/Samba.pm
index 7b7e76b4..1130879e 100755
--- a/samba_wizard/Samba.pm
+++ b/samba_wizard/Samba.pm
@@ -5,6 +5,7 @@
#
# Authors: Arnaud Desmons <adesmons@mandrakesoft.com>
# Florent Villard <warly@mandrakesoft.com>
+# antoine Giniès <aginies@mandriva>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -29,6 +30,7 @@ use MDK::Wizard::Wizcommon;
use Data::Dumper;
use Libconf qw(:functions);
+use Libconf::Templates;
use Libconf::Glueconf::Samba::Smb_conf;
my $wiz = new MDK::Wizard::Wizcommon;
@@ -152,7 +154,7 @@ $o->{pages} = {
},
post => \&check,
data => [
- { label => N('Allow hosts:'), val => \$o->{var}{wiz_allow_host} },
+ { label => N('Allow hosts:'), val => \$o->{var}{wiz_allow_host} },
{ label => N('Deny hosts:'), val => \$o->{var}{wiz_deny_host} },
],
next => 'ask_services'
@@ -161,15 +163,21 @@ $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} ||= exists $samba->{public};
- $o->{var}{wiz_do_printer_sharing} ||= 1;
+ $o->{var}{wiz_do_printer_sharing} ||= exists $samba->{printers};
$o->{var}{wiz_do_homes} ||= exists $samba->{homes};
},
- 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('Make home directories available for their owners'), type => 'bool', val => \$o->{var}{wiz_do_homes} },
],
+ complete => sub {
+ if ($o->{var}{wiz_do_file_sharing} == 1) {
+ return 'ask_dir';
+ } else {
+ if ($o->{var}{wiz_do_printer_sharing}) { return 'ask_printers' }
+ }
+ },
next => 'ask_dir'
},
warn_smbpasswd => {
@@ -207,12 +215,16 @@ $o->{pages} = {
$o->{var}{wiz_read_list} ||= $samba->{public}{'read list'};
$o->{var}{wiz_write_list} ||= $samba->{public}{'write list'};
},
- post => \&check_users,
+ complete => sub {
+ if ($o->{var}{wiz_do_printer_sharing}) {
+ return 'ask_printers';
+ } else { return 'summary' }
+ },
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'
+ next => 'summary',
},
ask_printers => {
name => N('Select which printers you want to be accessible from known users'),
@@ -317,10 +329,6 @@ sub list_printers {
}
-sub check_users {
- return 'ask_printers' if $o->{var}{wiz_do_printer_sharing}
-}
-
sub printer_sharing {
for (my $i; $i < @{$o->{var}{wiz_box_list}}; $i++) {
my $printer = $o->{var}{list_printers}[$i];
@@ -380,6 +388,7 @@ sub do_it {
# public share
if ($o->{var}{wiz_do_file_sharing}) {
+ $samba->{public};
if ($o->{var}{wiz_write_list}) {
$samba->{public}{'write list'} = $o->{var}{wiz_write_list};
}
@@ -394,16 +403,21 @@ sub do_it {
$samba->{public}{path} = $o->{var}{wiz_dir};
} else {
standalone->explanations("Disabling samba file sharing");
- $samba->set_comment('{public}', 1);
+ delete $samba->{public};
}
# share home dir
if ($o->{var}{wiz_do_homes}) {
- standalone->explanations("Enabling samba homes sharing");
- $samba->{homes};
+ standalone->explanations("Enabling samba homes sharing");
+ $samba->{homes};
+ $samba->{homes}{comment} = "Home Directories";
+ $samba->{homes}{browseable} = "no";
+ $samba->{homes}{writable} = "yes";
+ $samba->{homes}{'create mode'} = "0700";
+ $samba->{homes}{''} = "0600";
} else {
- standalone->explanations("Disabling samba homes sharing");
- delete $samba->{homes};
+ standalone->explanations("Disabling samba homes sharing");
+ delete $samba->{homes};
}
standalone->explanations("Samba deny $o->{var}{wiz_hosts_deny}");
standalone->explanations("Samba allow $o->{var}{wiz_hosts_allow}");