From 83eca6fa0dac3c5dbf68aff23d87ff5fca2e5a5c Mon Sep 17 00:00:00 2001 From: Arnaud Desmons Date: Tue, 15 Oct 2002 16:10:00 +0000 Subject: wiz update, nfs fixed --- web_wizard/scripts/Webconf.pm | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) (limited to 'web_wizard/scripts') 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; } -- cgit v1.2.1