diff options
author | Arnaud Desmons <adesmons@mandriva.com> | 2002-10-15 16:10:00 +0000 |
---|---|---|
committer | Arnaud Desmons <adesmons@mandriva.com> | 2002-10-15 16:10:00 +0000 |
commit | 83eca6fa0dac3c5dbf68aff23d87ff5fca2e5a5c (patch) | |
tree | 4c26d86f98f9c21e47cc27df98ab8ef90e280455 /web_wizard/scripts | |
parent | 7c9035918b08c4f2e6960a9664dbdd4e40e45c6a (diff) | |
download | drakwizard-83eca6fa0dac3c5dbf68aff23d87ff5fca2e5a5c.tar drakwizard-83eca6fa0dac3c5dbf68aff23d87ff5fca2e5a5c.tar.gz drakwizard-83eca6fa0dac3c5dbf68aff23d87ff5fca2e5a5c.tar.bz2 drakwizard-83eca6fa0dac3c5dbf68aff23d87ff5fca2e5a5c.tar.xz drakwizard-83eca6fa0dac3c5dbf68aff23d87ff5fca2e5a5c.zip |
wiz update, nfs fixed
Diffstat (limited to 'web_wizard/scripts')
-rw-r--r-- | web_wizard/scripts/Webconf.pm | 32 |
1 files changed, 23 insertions, 9 deletions
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; } |