summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile3
-rw-r--r--dhcp_wizard/scripts/Dhcpconf.pm7
-rwxr-xr-xdrakwizard.pl44
-rw-r--r--ftp_wizard/ftp.wiz76
-rw-r--r--ftp_wizard/scripts/ProFtpconf.pm49
-rw-r--r--news_wizard/news.wiz1
-rw-r--r--nfs_wizard/nfs.wiz84
-rw-r--r--nfs_wizard/scripts/NFSConf.pm11
-rw-r--r--postfix_wizard/postfix.wiz1
-rw-r--r--proxy_wizard/proxy.wiz10
-rw-r--r--proxy_wizard/scripts/Squidconf.pm1
-rw-r--r--samba_wizard/samba.wiz12
-rwxr-xr-xsamba_wizard/scripts/Smbconf.pm53
-rw-r--r--samba_wizard/scripts/smb.conf.default10
-rw-r--r--time_wizard/scripts/NTPConf.pm8
-rw-r--r--time_wizard/time.wiz74
-rw-r--r--web_wizard/scripts/Webconf.pm32
-rw-r--r--web_wizard/web.wiz14
18 files changed, 308 insertions, 182 deletions
diff --git a/Makefile b/Makefile
index a535cb2b..3b22ea19 100644
--- a/Makefile
+++ b/Makefile
@@ -51,8 +51,9 @@ clean_test:
rm -rf test
test: clean_test
+ @date
mkdir test
cp -r $(WIZ) test
- cp Wizard.dtd Makefile drakwizard.pl drakwizard.spec test
+ cp Wizard.dtd Makefile drakwizard.pl drakwizard.spec test.pl test
find test -regex ".*\.wiz$$\|.*\.pm$$\|.*\.sh$$" -exec \
perl -i -pe "s|__WIZ_HOME__|$(PWD)/test|g" \{\} \;
diff --git a/dhcp_wizard/scripts/Dhcpconf.pm b/dhcp_wizard/scripts/Dhcpconf.pm
index 40c1bc5e..4cb9a21a 100644
--- a/dhcp_wizard/scripts/Dhcpconf.pm
+++ b/dhcp_wizard/scripts/Dhcpconf.pm
@@ -85,7 +85,7 @@ sub do_it {
#[ -f /etc/sysconfig/dhcpd ] && cp -f /etc/sysconfig/dhcpd /var/tmp/wiz_bck/orig/dhcpd
my $file = "/etc/sysconfig/dhcpd";
- MDK::Common::cp_af($file, $file.".orig");
+ -f $file and MDK::Common::cp_af($file, $file.".orig");
$file = "/etc/rc.d/init.d/dhcpd";
# now patching etc/rc.d/init.d/dhcpd
@@ -134,6 +134,11 @@ mask = $wiz_ip_netmask, rng1 = $wiz_ip_range1, rng2 = $wiz_ip_range2, dname = $w
standalone::explanations("$file: lease_file = $mdk{lease_file}, interfaces = $mdk{interfaces}");
Vareqval->commit($file, \%mdk);
}
+ !$ENV{wiz_authoritative} and output($file, map {
+ s|^\s*not\s*authoritative.*|\#$&|i;
+ $_;
+ } cat_ ("/etc/dhcpd.conf"));
+
system("/etc/rc.d/init.d/dhcpd restart");
10;
}
diff --git a/drakwizard.pl b/drakwizard.pl
index bc5a7ce6..77ee0095 100755
--- a/drakwizard.pl
+++ b/drakwizard.pl
@@ -138,22 +138,7 @@ sub map_freetext {
my @data = map {
my $toto = $_->{variableName};
- if ($_->{main_order} eq 'combo') {
- if($_->{fillScript}){
- @liste = ();
- $valeur = `. $lib_script && $_->{fillScript}`;
- while( $valeur =~ /(.+)\n/g){
- push @liste, $1;
- $chooser_hash{$1} = $1;
- }
- }
- if ($_->{fillfunc}){
- @liste = $::{$perl_module_name."::"}{"$_->{fillfunc}"}->();
- }
- else {
- @liste = @{$_->{Option}};
- }
- }
+
if ($_->{fillScript}) {
$ENV{$variable{$_->{variableName}}} = `. $lib_script && $_->{fillScript}`;
}
@@ -167,8 +152,8 @@ sub map_freetext {
help => $_->{help}}
}
elsif ($_->{main_order} eq 'bool') {
- if ($_->{fillfunc}) {
- my @checklist = $::{$perl_module_name."::"}{"$_->{fillfunc}"}->();
+ if ($_->{listfunc}) {
+ my @checklist = $::{$perl_module_name."::"}{"$_->{listfunc}"}->();
my $i = 21 - scalar @checklist;
# workaround to get get the scrollbar
if (!$::isSummary) {
@@ -204,6 +189,20 @@ sub map_freetext {
}
}
elsif ($_->{main_order} eq 'combo') {
+ if($_->{fillScript}){
+ @liste = ();
+ $valeur = `. $lib_script && $_->{fillScript}`;
+ while( $valeur =~ /(.+)\n/g){
+ push @liste, $1;
+ $chooser_hash{$1} = $1;
+ }
+ }
+ elsif ($_->{fillfunc}){
+ @liste = $::{$perl_module_name."::"}{"$_->{fillfunc}"}->();
+ }
+ else {
+ @liste = @{$_->{Option}};
+ }
{ label => _($_->{helpText}),
val => \$ENV{$variable{$_->{variableName}}},
list => [@liste], type => $_->{main_order},
@@ -251,14 +250,15 @@ sub get_parameter {
$leaf->{helpText} = translate($leaf->{helpText});
if ($leaf->{fontName} eq "Monospaced") {
chomp($leaf->{helpText});
- $leaf->{helpText} = $leaf->{helpText} ? "$leaf->{helpText}\n$leaf->{helpText}" : "$leaf->{helpText}\n";
+ $leaf->{helpText} = $leaf->{helpText} ?
+ "$leaf->{helpText}\n$leaf->{helpText}" : "$leaf->{helpText}\n";
}
$page->{info} = xml_text($leaf->{helpText} ?
"$page->{info}\n$leaf->{helpText}" : "$page->{info}\n");
$page->{info} = c::from_utf8($page->{info});
- if ($leaf->{fillScript}) {
- $page->{info} .= translate(`source $lib_script; $leaf->{fillScript}`);
- }
+
+ $page->{info} .= translate(`source $lib_script; $leaf->{fillScript}`) if
+ ($leaf->{fillScript})
},
Freetext => $common_freetext_chooser = sub {
my $main_order = ($tag eq 'Chooser') ? 'combo'
diff --git a/ftp_wizard/ftp.wiz b/ftp_wizard/ftp.wiz
index 12e6b9f9..63ad0024 100644
--- a/ftp_wizard/ftp.wiz
+++ b/ftp_wizard/ftp.wiz
@@ -9,6 +9,7 @@
defaultImage="__WIZ_HOME__/ftp_wizard/images/FTP"
perlModule="__WIZ_HOME__/ftp_wizard/scripts/ProFtpconf.pm"
rpm="proftpd"
+ summaryFunc="do_it"
>
<Variable
@@ -33,6 +34,11 @@
shellVariable="wiz_ftp_external"
>
</Variable>
+ <Variable
+ name="shared_dir"
+ shellVariable="wiz_dir"
+ >
+ </Variable>
<Page
helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-ftp.html"
name="welcome"
@@ -159,6 +165,67 @@
</Page>
<Page
+ name="ask_dir"
+ func="check_dir"
+ executionLevel="NORMAL"
+ nextFinish="false"
+ canBack="true"
+ canCancel="true"
+ >
+
+ <Target
+ targetName="error_in_dir"
+ jumpIndex="1"
+ >
+ </Target>
+
+ <Target
+ targetName="confirmation"
+ jumpIndex="10"
+ >
+ </Target>
+
+ <Info
+ helpText="Shared dir:"
+ >
+ </Info>
+
+
+ <Info
+ helpText="Type the path of the directory you want being shared."
+ >
+ </Info>
+
+ <Freetext
+ name="freetext_dir"
+ variableName="shared_dir"
+ helpText="Shared dir:"
+ editable="true"
+ fillfunc="get_dir"
+ >
+ </Freetext>
+ </Page>
+
+
+ <Page
+ helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-samba.html"
+ name="error_in_dir"
+ jumpPage="ask_dir"
+ nextButtonText="Fix it"
+ executionLevel="NORMAL"
+ nextFinish="false"
+ canBack="true"
+ canCancel="true"
+ >
+
+ <Info
+ helpText="The path you entered does not exist."
+ >
+ </Info>
+ </Page>
+
+
+ <Page
helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-ftp.html"
name="confirmation"
func="do_it"
@@ -182,9 +249,7 @@ needed to configure your FTP Server"
>
</Info>
-
<Freetext
- name="freetext1"
variableName="wiz_ftp_internal"
helpText="Intranet FTP Server:"
editable="false"
@@ -192,13 +257,18 @@ needed to configure your FTP Server"
</Freetext>
<Freetext
- name="freetext2"
variableName="wiz_ftp_external"
helpText="Internet FTP Server:"
editable="false"
>
</Freetext>
+ <Freetext
+ variableName="shared_dir"
+ helpText="Public directory:"
+ editable="false"
+ >
+ </Freetext>
<Info
helpText="To accept these values, and configure your server, click the Next button or use the Back button to correct them."
diff --git a/ftp_wizard/scripts/ProFtpconf.pm b/ftp_wizard/scripts/ProFtpconf.pm
index a53a1023..85ecfd4d 100644
--- a/ftp_wizard/scripts/ProFtpconf.pm
+++ b/ftp_wizard/scripts/ProFtpconf.pm
@@ -15,6 +15,22 @@ sub true {
0;
}
+sub check_dir {
+ -d ($ENV{wiz_dir}) and return 10;
+ 1;
+}
+
+sub get_dir {
+ while (<NEW>) { # we need 3 elements to consider section as known
+ if (m/^\s*<drakwizard>/s...m/^\s*<\/drakwizard>/s ) {
+ if (m/^\s*<Anonymous\s*(.*)>/s ) {
+ return $1;
+ }
+ }
+ }
+ "";
+}
+
my $o = DrakconnectConf->new();
sub check {
@@ -23,6 +39,23 @@ sub check {
0;
}
+sub print_anonymous() {
+ print '
+#<drakwizard>
+<Anonymous '.$_[0].'>
+ User ftp
+ Group ftp
+ UserAlias anonymous ftp
+ MaxClients 10
+ <Limit WRITE>
+ DenyAll
+ </Limit>
+</Anonymous>
+#</drakwizard>
+';
+EOF
+}
+
sub do_it {
my $wiz_ftp_internal = $ENV{wiz_ftp_external} ? 1 : true $ENV{wiz_ftp_internal};
my $wiz_ftp_external = true $ENV{wiz_ftp_external};
@@ -41,23 +74,23 @@ sub do_it {
my $file = "/etc/proftpd.conf";
open (NEW, "< $file");
my $exist = 0;
- while (<NEW>) {
+ while (<NEW>) { # we need 3 elements to consider section as known
if (m/^\s*<Global>/s...m/^\s*<\/Global>/s ) {
if (m/^\s*<Limit LOGIN>/s...m/^\s*<\/Limit>/s ) {
if (/^\s*(?!\#)\s*Order .*$/) {
- $exist += 1;
+ $exist++;
}
if (/^\s*(?!\#)\s*Allow .*$/) {
- $exist += 1;
+ $exist++;
}
if (/^\s*(?!\#)\s*Deny .*$/) {
- $exist += 1;
+ $exist++;
}
}
}
}
close (NEW);
- if ($exist < 3) {
+ if ($exist < 3) { # Odd parameters are commented if exists to then add a known section
substInFile {
if (m/^\s*<Global>/s...m/^\s*<\/Global>/s ) {
if (m/^\s*<Limit LOGIN>/s...m/^\s*<\/Limit>/s ) {
@@ -69,16 +102,18 @@ sub do_it {
} $file;
open (NEW, ">> $file");
print NEW '
+#<drakwizard>
<Global>
<Limit LOGIN>
Order allow,deny
Allow from '.$allow.'
Deny from all
</Limit>
-</Global>';
+</Global>
+#</drakwizard>';
close NEW;
}
- else {
+ else { # the known section (3 parameters ) is replaced with our needs
substInFile {
if (m/^\s*<Global>/s...m/^\s*<\/Global>/s ) {
if (m/^\s*<Limit LOGIN>/s...m/^\s*<\/Limit>/s ) {
diff --git a/news_wizard/news.wiz b/news_wizard/news.wiz
index 2306333c..516ad650 100644
--- a/news_wizard/news.wiz
+++ b/news_wizard/news.wiz
@@ -9,6 +9,7 @@
defaultImage="__WIZ_HOME__/news_wizard/images/news"
perlModule="__WIZ_HOME__/news_wizard/scripts/Newsconf.pm"
rpm="leafnode"
+ summaryFunc="do_it"
>
<Variable
diff --git a/nfs_wizard/nfs.wiz b/nfs_wizard/nfs.wiz
index 4373259c..a2c232e2 100644
--- a/nfs_wizard/nfs.wiz
+++ b/nfs_wizard/nfs.wiz
@@ -9,6 +9,7 @@
defaultImage="__WIZ_HOME__/nfs_wizard/images/NFS"
perlModule="__WIZ_HOME__/nfs_wizard/scripts/NFSConf.pm"
rpm="nfs-utils"
+ summaryFunc="do_it"
>
<Variable
@@ -138,7 +139,7 @@
>
<Target
- targetName="congratulations"
+ targetName="doit"
jumpIndex="1"
>
</Target>
@@ -168,7 +169,6 @@
<Chooser
name="chooser1"
variableName="wiz_nfs_level"
- helpFontName="Default"
>
<Option
@@ -186,11 +186,11 @@
</Page>
<Page
name="shownet"
- func="do_it"
helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-proxy.html"
- jumpPage="congratulations"
+ jumpPage="doit"
executionLevel="NORMAL"
nextFinish="false"
+ is="wiz_nfs_level=2"
canBack="true"
canCancel="true"
>
@@ -217,6 +217,59 @@
</Page>
<Page
+ helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-samba.html"
+ name="doit"
+ func="do_it"
+ nextButtonText="Configure"
+ executionLevel="NORMAL"
+ nextFinish="false"
+ canBack="true"
+ canCancel="true"
+ >
+ <Target
+ targetName="catastrophic_exit"
+ jumpIndex="2"
+ >
+ </Target>
+
+ <Target
+ targetName="congratulations"
+ jumpIndex="10"
+ >
+ </Target>
+
+ <Info
+ helpText="The wizard collected the following parameters."
+ >
+ </Info>
+
+ <Freetext
+ name="freetext"
+ variableName="varwiz_nfs_dir"
+ helpText="Exported dir:"
+ editable="false"
+ >
+ </Freetext>
+
+ <Freetext
+ name="freetext"
+ variableName="wiz_nfs_level"
+ helpText="Access :"
+ editable="false"
+ >
+ </Freetext>
+
+ <Freetext
+ name="freetext1"
+ variableName="wiz_netmask"
+ helpText="Netmask :"
+ editable="false"
+ >
+ </Freetext>
+
+ </Page>
+
+ <Page
helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-nfs.html"
name="congratulations"
nextButtonText="Quit"
@@ -227,34 +280,11 @@
>
<Info
- name="info23"
- alignement="Center"
helpText="Congratulations"
- guiType="label"
- fontName="Default"
- fontStyle="bold"
- fontSize="14"
>
</Info>
-
<Info
- name="info20"
- alignement="Center"
- guiType="label"
- fontName="Default"
- fontStyle="plain"
- fontSize="11"
- >
- </Info>
-
- <Info
- name="info24"
- alignement="Center"
helpText="The wizard successfully configured your NFS Server"
- guiType="label"
- fontName="Default"
- fontStyle="plain"
- fontSize="11"
>
</Info>
</Page>
diff --git a/nfs_wizard/scripts/NFSConf.pm b/nfs_wizard/scripts/NFSConf.pm
index 673f571a..10387805 100644
--- a/nfs_wizard/scripts/NFSConf.pm
+++ b/nfs_wizard/scripts/NFSConf.pm
@@ -17,9 +17,6 @@ sub network_mask {
}
sub chooser {
- if ($ENV{wiz_nfs_level} == 1) {
- do_it();
- }
$ENV{wiz_nfs_level};
}
@@ -35,15 +32,15 @@ sub do_it {
else {
$line = "$ENV{wiz_nfs_dir} *(rw,no_root_squash)\n";
}
- print "$line\n";
my $t;
foreach (cat_($file)) {
- if (/.*(?!\#).*$ENV{wiz_nfs_dir}\s.*/) {
+ if (/^(?!\#).*$ENV{wiz_nfs_dir}\s.*/) {
$t = $_;
last;
}
}
- if ($t) {substInFile { s|.*(?!\#).*$ENV{wiz_nfs_dir}\s.*|\#$&|} $file }
+ substInFile { s|^(?!\#).*$ENV{wiz_nfs_dir}\s.*|\#$&|} $file;
append_to_file($file, $line);
- system("/usr/sbin/exportfs -a")
+ system("/usr/sbin/exportfs -a");
+ 10;
}
diff --git a/postfix_wizard/postfix.wiz b/postfix_wizard/postfix.wiz
index e0806740..439e9b8f 100644
--- a/postfix_wizard/postfix.wiz
+++ b/postfix_wizard/postfix.wiz
@@ -9,6 +9,7 @@
defaultImage="__WIZ_HOME__/postfix_wizard/images/courrier"
perlModule="__WIZ_HOME__/postfix_wizard/scripts/Postfixconf.pm"
rpm="postfix"
+ summaryFunc="do_it"
>
<Variable
diff --git a/proxy_wizard/proxy.wiz b/proxy_wizard/proxy.wiz
index 354f2a35..37d7006c 100644
--- a/proxy_wizard/proxy.wiz
+++ b/proxy_wizard/proxy.wiz
@@ -9,10 +9,10 @@
defaultImage="__WIZ_HOME__/proxy_wizard/images/proxy"
perlModule="__WIZ_HOME__/proxy_wizard/scripts/Squidconf.pm"
rpm="squid"
+ summaryFunc="do_it_squid"
>
-
<Variable
- name="wiz_squid_level"
+ name="var_wiz_squid_level"
comment="The proxy access control level"
shellVariable="wiz_squid_level"
defaultValue="2"
@@ -263,10 +263,9 @@
>
</Info>
-
<Chooser
name="chooser1"
- variableName="wiz_squid_level"
+ variableName="var_wiz_squid_level"
helpFontName="Default"
helpFontStyle="plain"
helpFontSize="12"
@@ -331,6 +330,7 @@
helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-proxy.html"
jumpPage="cachepeer"
executionLevel="NORMAL"
+ is="var_wiz_squid_level=2"
nextFinish="false"
canBack="true"
canCancel="true"
@@ -359,6 +359,7 @@
fillfunc="network_mask"
helpText="Authorised network:"
editable="true"
+ help="Use numeric format like \q192.168.1.0/255.255.255.0\q or a text format like \q.domain.net\q"
>
</Freetext>
@@ -434,6 +435,7 @@
jumpPage="doit"
executionLevel="NORMAL"
nextFinish="false"
+ is="wiz_squid_menupeer=2"
canBack="true"
canCancel="true"
>
diff --git a/proxy_wizard/scripts/Squidconf.pm b/proxy_wizard/scripts/Squidconf.pm
index b586b711..3c343b8f 100644
--- a/proxy_wizard/scripts/Squidconf.pm
+++ b/proxy_wizard/scripts/Squidconf.pm
@@ -49,6 +49,7 @@ sub do_it_squid {
standalone::explanations("$file: cache_dir = $ENV{wiz_squid_defdir} $ENV{wiz_squid_disk}
mynetw = $ENV{wiz_squid_mynetw} cache_mem = $ENV{wiz_squid_mem} http_port = $ENV{wiz_squid_port}
level = $ENV{wiz_squid_level}");
+ print "$ENV{wiz_squid_level}\n";
if ($ENV{wiz_squid_level} == 1) {
substInFile {
s|^\s*\#?\s*(http_access\s*)deny(\s*all.*)|\#$&\n$1allow$2|;
diff --git a/samba_wizard/samba.wiz b/samba_wizard/samba.wiz
index bd183fcd..00c075c2 100644
--- a/samba_wizard/samba.wiz
+++ b/samba_wizard/samba.wiz
@@ -320,24 +320,28 @@
helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-samba.html"
name="ask_printers"
jumpPage="ask_workgroup"
+ func="check_printers"
is="doPrinterSharing"
executionLevel="NORMAL"
nextFinish="false"
canBack="true"
canCancel="true"
>
+ <Info
+ helpText="toto"
+ >
+ </Info>
<Boolean
variableName="all_printers"
- helpText="Enable all printer"
+ helpText="Enable all printer"
>
</Boolean>
-
<Boolean
is="all_printers=0"
variableName="box_list"
- fillfunc="list_printers"
+ listfunc="list_printers"
>
- </Boolean>
+ </Boolean>
</Page>
<Page
diff --git a/samba_wizard/scripts/Smbconf.pm b/samba_wizard/scripts/Smbconf.pm
index ddf09ee9..1466caf0 100755
--- a/samba_wizard/scripts/Smbconf.pm
+++ b/samba_wizard/scripts/Smbconf.pm
@@ -5,7 +5,7 @@ require "__WIZ_HOME__/common/scripts/Vareqval.pm";
require "__WIZ_HOME__/common/scripts/DrakconnectConf.pm";
use MDK::Common;
use strict;
-
+use Data::Dumper;
# All possibilies in the config file must be precedeed by ";"
# This script can just comment, uncomment or/and change values
# but can not add anything.
@@ -20,8 +20,9 @@ sub check {
}
sub check_services {
- $ENV{wiz_do_homes} and return 2;
- $ENV{wiz_do_file_sharing} and return 1;
+ $ENV{wiz_do_homes} and return 3;
+ $ENV{wiz_do_file_sharing} and return 2;
+ $ENV{wiz_do_printer_sharing} and return 1;
0;
}
@@ -73,6 +74,22 @@ sub write_conf {
}
}
}
+
+sub list_printers {
+ my $file = "/etc/printcap";
+ my $i;
+
+ sort grep /^(?!\#).*/, map {
+ my @toto = split(':', $_);
+ $i++;
+ $toto[0];
+ } cat_($file);
+}
+
+sub check_users {
+ return 1 if $ENV{wiz_do_printer_sharing};
+ 0;
+}
sub comment_menu {
my $self = shift;
@@ -120,17 +137,35 @@ sub printer_sharing {
}
sub check_workgroup {
- !$ENV{workgroup} and return 1;
+ !$ENV{wiz_workgroup} and return 1;
10;
}
-sub check_banner {
- !$ENV{banner} and return 1;
+sub ask_acces {
10;
}
+sub check_printers {
+ foreach (keys %::bool) {
+ print "$::bool{$_}\n";
+ }
+}
+
my $old = read_conf("/etc/samba/smb.conf");
+sub get_write {
+ $old->{conf}->{public}{"write list"}{value};
+}
+
+sub get_read {
+ $old->{conf}->{public}{"read list"}{value};
+}
+
+sub check_banner {
+ !$ENV{wiz_banner} and return 1;
+ 10;
+}
+
sub get_workgroup {
$old->{conf}->{global}{workgroup}{value};
}
@@ -140,7 +175,9 @@ sub get_banner {
}
sub ask_dir {
- $ENV{wiz_do_file_sharing};
+ return 2 if $ENV{wiz_do_file_sharing};
+ return 1 if $ENV{wiz_do_printer_sharing};
+ 0;
}
sub get_dir {
@@ -152,6 +189,8 @@ sub do_it {
my $conf = read_conf("__WIZ_HOME__/samba_wizard/scripts/smb.conf.default");
$conf->chg_var("global", "workgroup", $ENV{wiz_workgroup});
$conf->chg_var("global", "server string", $ENV{wiz_banner});
+ $conf->chg_var("public", "write list", $ENV{wiz_write_list}) if $ENV{wiz_do_file_sharing};
+ $conf->chg_var("public", "read list", $ENV{wiz_read_list}) if $ENV{wiz_do_file_sharing};
my $ip = $o->get_from_known_dev("IP");
$conf->file_sharing() if $ENV{wiz_do_file_sharing};
$conf->printer_sharing() if $ENV{wiz_do_printer_sharing};
diff --git a/samba_wizard/scripts/smb.conf.default b/samba_wizard/scripts/smb.conf.default
index 8781db7e..a6012972 100644
--- a/samba_wizard/scripts/smb.conf.default
+++ b/samba_wizard/scripts/smb.conf.default
@@ -305,14 +305,14 @@
; read only = no
; public = yes
-# A publicly accessible directory, but read only, except for people in
-# the "staff" group
+# A publicly accessible directory
+
;[public]
; comment = Public Stuff
; path = /home/samba/public
-; public = yes
-; writable = no
-; write list = @staff
+; write list = @wheel
+; read list = nobody, @users
+; guest ok = no
# Other examples.
#
diff --git a/time_wizard/scripts/NTPConf.pm b/time_wizard/scripts/NTPConf.pm
index 77a5576c..fb37b8a6 100644
--- a/time_wizard/scripts/NTPConf.pm
+++ b/time_wizard/scripts/NTPConf.pm
@@ -25,14 +25,6 @@ use MDK::Common;
use strict;
use standalone;
-sub chooser {
- if ($ENV{chooser1} eq "local") {
- do_it();
- return 1;
- }
- 2;
-}
-
sub chooser4 {
if ($ENV{chooser4} eq "save_quit") {
do_it();
diff --git a/time_wizard/time.wiz b/time_wizard/time.wiz
index 889e0b29..65a3e05a 100644
--- a/time_wizard/time.wiz
+++ b/time_wizard/time.wiz
@@ -9,6 +9,7 @@
defaultImage="__WIZ_HOME__/time_wizard/images/Time"
perlModule="__WIZ_HOME__/time_wizard/scripts/NTPConf.pm"
rpm="ntp"
+ summaryFunc="do_it"
>
<Variable
@@ -55,13 +56,12 @@
name="welcome"
executionLevel="NORMAL"
nextFinish="false"
- jumpPage="choice_setting"
canBack="true"
canCancel="true"
>
<Info
- helpText="This wizard will help you to set the time of your server, either locally or synchronized with an external time server."
+ helpText="This wizard will help you to set the time of your server synchronized with an external time server."
>
</Info>
@@ -78,72 +78,6 @@
<Page
helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-time.html"
- name="choice_setting"
- func="chooser"
- executionLevel="NORMAL"
- nextFinish="false"
- canBack="true"
- canCancel="true"
- >
- <Target
- targetName="ciao"
- jumpIndex="1"
- >
- </Target>
-
- <Target
- targetName="choose_server"
- jumpIndex="2"
- >
- </Target>
-
- <Info
- helpText="Type of setting"
- >
- </Info>
-
-
- <Info
- helpText="You can set the time of your machine in two ways: Locally means that the setting will simply set the system clock, without synchronizing with the external world."
- >
- </Info>
-
- <Info
- helpText="If you use a time server, your machine will ask from that server the correct time."
- >
- </Info>
-
-
- <Info
- helpText="Which kind of setting would you like to do?"
- >
- </Info>
-
-
- <Chooser
- name="chooser1"
- variableName="chooser1"
- helpFontName="Default"
- helpFontStyle="bold"
- helpFontSize="14"
- editable="false"
- >
-
- <Option
- value="local"
- description="Local time setting"
- >
- </Option>
-
- <Option
- value="internet"
- description="Internet time setting (external time server)"
- >
- </Option>
- </Chooser>
- </Page>
- <Page
- helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-time.html"
name="choose_server"
executionLevel="NORMAL"
nextFinish="false"
@@ -172,12 +106,8 @@
name="chooserserver1"
variableName="varserver1"
helpText="Primary Time Server:"
- helpFontName="Default"
- helpFontStyle="plain"
- helpFontSize="12"
editable="true"
>
-
<Option
value="bernina.ethz.ch"
description="Swiss Fed. Inst. of Technology"
diff --git a/web_wizard/scripts/Webconf.pm b/web_wizard/scripts/Webconf.pm
index 4ea60b7d..fa815aee 100644
--- a/web_wizard/scripts/Webconf.pm
+++ b/web_wizard/scripts/Webconf.pm
@@ -46,27 +46,40 @@ sub chg_docroot {
}
sub is_user_mod {
- $ENV{wiz_user_mod};
+ if ($ENV{wiz_user_mod}) {
+ return 1;
+ }
+ $ENV{wiz_user_dir} = "disabled";
+ 0;
+}
+
+sub is_last_user_mod {
+ my $root = get_user_dir();
+ chomp($root);
+ !($root eq 'disabled');
}
sub get_user_dir {
- my %conf = Varspaceval->get("/etc/httpd/conf/commonhttpd.conf");
+ my %conf = Varspaceval->get("/etc/httpd/conf/commonhttpd.conf");
$conf{UserDir};
}
sub chg_user_dir {
my $root = get_user_dir();
- substInFile {
- s|(\s*)UserDir\s*$root(/?)|$1UserDir $ENV{wiz_user_dir}$2|g;
- } "/etc/httpd/conf/commonhttpd.conf";
- if ($ENV{wiz_user_dir} !~ /\s*disabled\s*/) {
- substInFile {
+ if ($ENV{wiz_user_mod}) {
+ substInFile {
s|(/home/\*/)$root(/?)|$1$ENV{wiz_user_dir}$2|g;
- } "/etc/httpd/conf/httpd.conf";
+ } "/etc/httpd/conf/commonhttpd.conf";
substInFile {
+ s|(\s*)UserDir\s*$root(/?)|$1UserDir $ENV{wiz_user_dir}$2|g;
s|(/home/\*/)$root(/?)|$1$ENV{wiz_user_dir}$2|g;
} "/etc/httpd/conf/commonhttpd.conf";
}
+ else {
+ substInFile {
+ s|(\s*)UserDir\s*$root(/?)|$1UserDir disabled$2|g;
+ } "/etc/httpd/conf/commonhttpd.conf";
+ }
10;
}
@@ -87,7 +100,8 @@ sub do_it {
{ s /^\s*Allow .*$/ Allow from $that\n/s;}
;}
} $file;
-# chg_docroot();
+ chg_docroot();
+ chg_user_dir();
system("/etc/rc.d/init.d/httpd restart");
10;
}
diff --git a/web_wizard/web.wiz b/web_wizard/web.wiz
index 8cb8880c..1ac60e6a 100644
--- a/web_wizard/web.wiz
+++ b/web_wizard/web.wiz
@@ -9,17 +9,20 @@
defaultImage="__WIZ_HOME__/web_wizard/images/apache"
perlModule="__WIZ_HOME__/web_wizard/scripts/Webconf.pm"
rpm="apache"
+ summaryFunc="do_it"
>
<Variable
name="wiz_web_internal"
shellVariable="wiz_web_internal"
+ defaultValue="1"
>
</Variable>
<Variable
name="wiz_web_external"
shellVariable="wiz_web_external"
+ defaultValue="1"
>
</Variable>
@@ -203,9 +206,9 @@
<Boolean
variableName="user_mod"
- forceEnabled="1"
- forceDisabled="0"
helpText="activate user module"
+ fillfunc="is_last_user_mod"
+ help="Allows users to get a directory in theirs homes directories available on your http server via http://www.yourserver.com/~user."
>
</Boolean>
</Page>
@@ -213,6 +216,8 @@
<Page
helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-samba.html"
name="ask_user_dir"
+ func="check_dir"
+ is="user_mod"
executionLevel="NORMAL"
nextFinish="false"
canBack="true"
@@ -229,6 +234,7 @@
helpText="user http sub-directory : ~/"
editable="true"
fillfunc="get_user_dir"
+ help="Type the name of the directory users should create in theirs homes (whitout ~/) to get it available via http://www.yourserver.com/~user"
>
</Freetext>
</Page>
@@ -270,7 +276,6 @@
</Freetext>
</Page>
-
<Page
helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-samba.html"
name="error_in_dir"
@@ -309,8 +314,7 @@
<Info
- helpText="The wizard collected the following parameters
-needed to configure your Web Server"
+ helpText="The wizard collected the following parameters needed to configure your Web Server"
>
</Info>