diff options
Diffstat (limited to 'web_wizard')
-rw-r--r-- | web_wizard/scripts/Webconf.pm | 27 | ||||
-rw-r--r-- | web_wizard/web.wiz | 88 |
2 files changed, 113 insertions, 2 deletions
diff --git a/web_wizard/scripts/Webconf.pm b/web_wizard/scripts/Webconf.pm index cf9d9b55..4ea60b7d 100644 --- a/web_wizard/scripts/Webconf.pm +++ b/web_wizard/scripts/Webconf.pm @@ -1,7 +1,7 @@ #!/usr/bin/perl package Webconf; -require "__WIZ_HOME__/common/scripts/Vareqval.pm"; +require "__WIZ_HOME__/common/scripts/Varspaceval.pm"; require "__WIZ_HOME__/common/scripts/DrakconnectConf.pm"; use MDK::Common; @@ -45,6 +45,31 @@ sub chg_docroot { } "/etc/httpd/conf/commonhttpd.conf"; } +sub is_user_mod { + $ENV{wiz_user_mod}; +} + +sub get_user_dir { + 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 { + s|(/home/\*/)$root(/?)|$1$ENV{wiz_user_dir}$2|g; + } "/etc/httpd/conf/httpd.conf"; + substInFile { + s|(/home/\*/)$root(/?)|$1$ENV{wiz_user_dir}$2|g; + } "/etc/httpd/conf/commonhttpd.conf"; + } + 10; +} + sub do_it { my $file = "/etc/httpd/conf/commonhttpd.conf"; my $that = "localhost"; diff --git a/web_wizard/web.wiz b/web_wizard/web.wiz index a4bea667..8cb8880c 100644 --- a/web_wizard/web.wiz +++ b/web_wizard/web.wiz @@ -24,6 +24,18 @@ </Variable> <Variable + name="user_mod" + shellVariable="wiz_user_mod" + > + </Variable> + + <Variable + name="user_dir" + shellVariable="wiz_user_dir" + > + </Variable> + + <Variable name="shared_dir" shellVariable="wiz_dir" > @@ -155,6 +167,73 @@ </Page> <Page + helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-web.html" + name="ask_mod" + func="is_user_mod" + executionLevel="NORMAL" + nextFinish="false" + canBack="true" + canCancel="true" + > + + <Target + targetName="ask_dir" + jumpIndex="0" + > + </Target> + + + <Target + targetName="ask_user_dir" + jumpIndex="1" + > + </Target> + + <Info + helpText="Modules :" + > + </Info> + + + <Info + helpText="* User module : allows users to get a directory in theirs homes directories available on your http server via http://www.yourserver.com/~user, you will be asked for the name of this directory afterward." + > + > + </Info> + + <Boolean + variableName="user_mod" + forceEnabled="1" + forceDisabled="0" + helpText="activate user module" + > + </Boolean> + </Page> + + <Page + helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-samba.html" + name="ask_user_dir" + executionLevel="NORMAL" + nextFinish="false" + canBack="true" + canCancel="true" + > + + <Info + helpText="Type the name of the directory users should create in theirs homes (whitout ~/) to get it available via http://www.yourserver.com/~user" + > + </Info> + + <Freetext + variableName="user_dir" + helpText="user http sub-directory : ~/" + editable="true" + fillfunc="get_user_dir" + > + </Freetext> + </Page> + + <Page helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-samba.html" name="ask_dir" func="check_dir" @@ -178,7 +257,7 @@ <Info - helpText="Type the path of the directory you want being shared." + helpText="Type the path of the directory you want being the document root." > </Info> @@ -259,6 +338,13 @@ needed to configure your Web Server" > </Freetext> + <Freetext + variableName="user_dir" + helpText="user dir:" + 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." > |