summaryrefslogtreecommitdiffstats
path: root/samba_wizard
diff options
context:
space:
mode:
Diffstat (limited to 'samba_wizard')
-rw-r--r--samba_wizard/samba.wiz53
-rwxr-xr-xsamba_wizard/scripts/Smbconf.pm22
2 files changed, 53 insertions, 22 deletions
diff --git a/samba_wizard/samba.wiz b/samba_wizard/samba.wiz
index f490b5dc..4de65ece 100644
--- a/samba_wizard/samba.wiz
+++ b/samba_wizard/samba.wiz
@@ -24,7 +24,12 @@
shellVariable="wiz_do_printer_sharing"
>
</Variable>
-
+ <Variable
+ name="doHomes"
+ comment="true if samba do printer sharing"
+ shellVariable="wiz_do_homes"
+ >
+ </Variable>
<Variable
name="workgroup"
comment="The workgroup name"
@@ -87,7 +92,7 @@
<Page
helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-samba.html"
name="ask_services"
- jumpScript="__WIZ_HOME__/samba_wizard/scripts/check_services.sh"
+ func="check_services"
executionLevel="NORMAL"
nextFinish="false"
canBack="true"
@@ -95,14 +100,14 @@
>
<Target
- targetName="error_in_services"
- jumpIndex="1"
+ targetName="warn_smbpasswd"
+ jumpIndex="2"
>
</Target>
<Target
targetName="ask_workgroup"
- jumpIndex="10"
+ jumpIndex="0"
>
</Target>
@@ -123,7 +128,7 @@
variableName="doFileSharing"
forceEnabled="true"
forceDisabled="false"
- helpText="Enable Common File Sharing Area"
+ helpText="Enable /home/samba/public Sharing Area"
>
</Boolean>
@@ -135,31 +140,37 @@
helpText="Enable Server Printer Sharing"
>
</Boolean>
+ <Boolean
+ name="homesSharingBoolean"
+ variableName="doHomes"
+ forceEnabled="true"
+ forceDisabled="false"
+ helpText="Make homes directory availables for
+ theirs owners"
+ >
+ </Boolean>
+
</Page>
+
<Page
- helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-samba.html"
- name="error_in_services"
- comment="Error message for an incorrect hostname"
- jumpPage="ask_hostname"
+ name="warn_smbpasswd"
+ comment="Warning"
+ jumpPage="ask_workgroup"
nextButtonText="OK"
executionLevel="NORMAL"
- nextFinish="true"
+ nextFinish="false"
canBack="true"
canCancel="true"
>
<Info
- helpText="No Samba service has been requested"
- >
- </Info>
-
- <Info
- helpText="Press Quit to exit or Back to correct your choice"
+ helpText="You have selected to allow user access theirs home directories via samba but you/they must use smbpasswd to set a password."
>
</Info>
</Page>
+
<Page
helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-samba.html"
name="ask_workgroup"
@@ -332,6 +343,14 @@ needed to configure Samba."
</Freetext>
<Freetext
+ name="freetext2"
+ variableName="doHomes"
+ helpText="Home :"
+ editable="false"
+ >
+ </Freetext>
+
+ <Freetext
name="freetext3"
variableName="workgroup"
helpText="Workgroup:"
diff --git a/samba_wizard/scripts/Smbconf.pm b/samba_wizard/scripts/Smbconf.pm
index 577c1870..62b57ed2 100755
--- a/samba_wizard/scripts/Smbconf.pm
+++ b/samba_wizard/scripts/Smbconf.pm
@@ -3,7 +3,7 @@
package Smbconf;
require "__WIZ_HOME__/common/scripts/Vareqval.pm";
require "__WIZ_HOME__/common/scripts/DrakconnectConf.pm";
-
+use MDK::Common;
use strict;
# All possibilies in the config file must be precedeed by ";"
@@ -22,6 +22,11 @@ sub check {
0;
}
+sub check_services {
+ $ENV{wiz_do_homes} and return 2;
+ 0;
+}
+
sub read_conf {
my ($file) = @_;
my $menu;
@@ -81,14 +86,20 @@ sub chg_var {
$conf{$menu}{$var}{value} = $str;
}
-
sub file_sharing {
- standalone->explanations("Enabling samba file sharing");
- comment_menu("homes", ";");
+ mkdir_p("/home/samba/public");
+ standalone->explanations("Enabling samba /home/samba/public sharing");
+# comment_menu("homes", ";");
comment_menu("public", "");
chg_var("global", "security", "share");
}
+sub homes {
+ standalone->explanations("Enabling samba /home/samba/public sharing");
+ comment_menu("homes", "");
+ chg_var("global", "security", "share");
+}
+
sub printer_sharing {
standalone->explanations("Enabling samba printer sharing");
comment_menu("printers", "");
@@ -104,10 +115,11 @@ sub do_it {
my $ip = $o->get_from_known_dev("IP");
file_sharing() if $ENV{wiz_do_file_sharing};
printer_sharing() if $ENV{wiz_do_printer_sharing};
+ homes() if $ENV{wiz_do_homes};
chg_var("global", "hosts allow", $ip);
chg_var("global", "security", "share");
write_conf("/etc/samba/smb.conf");
- system("/etc/rc.d/init.d/smb restart >/dev/null 2>&1");
+ system("/etc/rc.d/init.d/smb restart");
10;
}
1;