summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaud Desmons <adesmons@mandriva.com>2002-08-13 13:46:35 +0000
committerArnaud Desmons <adesmons@mandriva.com>2002-08-13 13:46:35 +0000
commit7766bee9c30f4a3580406846a8113c8786ecf1f5 (patch)
tree10eeb215efaea99b1106beb94c27af0fe20bbeb9
parent148485ac164383aa702a68933e9cf796fbf0579b (diff)
downloaddrakwizard-7766bee9c30f4a3580406846a8113c8786ecf1f5.tar
drakwizard-7766bee9c30f4a3580406846a8113c8786ecf1f5.tar.gz
drakwizard-7766bee9c30f4a3580406846a8113c8786ecf1f5.tar.bz2
drakwizard-7766bee9c30f4a3580406846a8113c8786ecf1f5.tar.xz
drakwizard-7766bee9c30f4a3580406846a8113c8786ecf1f5.zip
use drakconnect db
-rw-r--r--ftp_wizard/ftp.wiz90
-rw-r--r--ftp_wizard/scripts/ProFtpconf.pm33
-rw-r--r--web_wizard/scripts/Webconf.pm64
-rw-r--r--web_wizard/web.wiz82
4 files changed, 54 insertions, 215 deletions
diff --git a/ftp_wizard/ftp.wiz b/ftp_wizard/ftp.wiz
index 843b78df..e54c90c6 100644
--- a/ftp_wizard/ftp.wiz
+++ b/ftp_wizard/ftp.wiz
@@ -34,7 +34,7 @@
<Page
helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-ftp.html"
name="welcome"
- jumpScript="__WIZ_HOME__/common/scripts/check.sh root wiz_ip_net"
+ func="check"
executionLevel="NORMAL"
nextFinish="false"
canBack="true"
@@ -54,7 +54,7 @@
</Target>
<Target
- targetName="error_need_net"
+ targetName="error_dhcp"
jumpIndex="2"
>
</Target>
@@ -126,100 +126,26 @@
</Page>
<Page
- helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-ftp.html"
- name="error_need_net"
- subWizard="__WIZ_HOME__/server_wizard/server.wiz"
+ helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-web.html"
+ name="error_dhcp"
+ jumpPage="ftp connections"
executionLevel="NORMAL"
nextFinish="false"
- canBack="false"
+ canBack="true"
canCancel="true"
>
<Info
name="errorLabel"
alignement="Center"
- helpText="Network not configured yet"
- guiType="label"
- fontName="Default"
- fontStyle="bold"
- fontSize="14"
- >
- </Info>
-
- <Info
- name="info23"
- alignement="Center"
- guiType="label"
- fontName="Default"
- fontStyle="bold"
- fontSize="14"
- >
- </Info>
-
- <Info
- name="info22"
- alignement="Center"
- helpText="You have to configure the basic network parameters before launch this wizard."
- guiType="label"
- fontName="Default"
- fontStyle="plain"
- fontSize="11"
- >
- </Info>
-
- <Info
- name="info25"
- alignement="Center"
- helpText="Press next to configure these parameters now, or Cancel to exit this wizard."
- guiType="label"
- fontName="Default"
- fontStyle="plain"
- fontSize="11"
- >
- </Info>
-
- <Info
- name="info26"
- alignement="Center"
- guiType="label"
- fontName="Default"
- fontStyle="plain"
- fontSize="11"
- >
- </Info>
-
- <Info
- name="info24"
- alignement="Center"
- helpText="If you choose to configure now, you will automatically continue"
+ helpText="Warning\nYou are in dhcp, server may doesn't
+ work with your configuration."
guiType="label"
fontName="Default"
fontStyle="plain"
fontSize="11"
>
</Info>
-
- <Info
- name="info27"
- alignement="Center"
- helpText="with the FTP configuration"
- guiType="label"
- fontName="Default"
- fontStyle="plain"
- fontSize="11"
- >
- </Info>
- </Page>
-
- <Page
- helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-ftp.html"
- name="server launcher"
- jumpPage="ftp connections"
- executionLevel="DEBUG"
- nextFinish="false"
- canBack="true"
- canCancel="true"
- >
</Page>
<Page
diff --git a/ftp_wizard/scripts/ProFtpconf.pm b/ftp_wizard/scripts/ProFtpconf.pm
index 0893099d..5e737bbc 100644
--- a/ftp_wizard/scripts/ProFtpconf.pm
+++ b/ftp_wizard/scripts/ProFtpconf.pm
@@ -1,11 +1,12 @@
#!/usr/bin/perl
package ProFtpconf;
+require "__WIZ_HOME__/common/scripts/DrakconnectConf.pm";
use MDK::Common;
use strict;
require "__WIZ_HOME__/common/scripts/Vareqval.pm";
-sub true_or_false {
+sub true {
my ($val) = @_;
$val eq "1" || $val eq "\'1\'" || $val eq "\"1\"" ||
@@ -14,31 +15,25 @@ sub true_or_false {
0;
}
-sub do_it {
- my %mdk = Vareqval->get("/etc/sysconfig/mdk_serv");
- $mdk{wiz_ftp_external} = $ENV{wiz_ftp_external} if defined $ENV{wiz_ftp_external} or
- die "wiz_ftp_external not defined in env !";
- $mdk{wiz_ftp_internal} = $ENV{wiz_ftp_internal} if defined $ENV{wiz_ftp_internal} or
- die "wiz_ftp_internal not defined in env !";
- $mdk{wiz_ftp_external} = true_or_false($mdk{wiz_ftp_external});
- $mdk{wiz_ftp_internal} = $mdk{wiz_ftp_external} ? 1 : true_or_false($mdk{wiz_ftp_internal});
- my $wiz_ftp_internal = $mdk{wiz_ftp_internal};
- my $wiz_ftp_external = $mdk{wiz_ftp_external};
- my $wiz_device = $mdk{wiz_device} if defined $mdk{wiz_device} or
- die "wiz_device not in /etc/sysconfig/mdk_serv";
- Vareqval->commit("/etc/sysconfig/mdk_serv", \%mdk);
+my $o = DrakconnectConf->new();
+
+sub check {
+ $> and return 1;
+ $o->is_dhcp() and return 2;
+ 0;
+}
+
+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};
my $file = "/etc/proftpd.conf";
die "no ftp configuration file found ! warning." if (!-f $file);
MDK::Common::cp_af($file, $file . ".orig");
open(NEW, "< $file") or die "error while opening $file: $!";
my $allow = "all";
if ($wiz_ftp_internal && !$wiz_ftp_external) {
- my %mdk = Vareqval->get("/etc/sysconfig/network-scripts/ifcfg-".$wiz_device);
- my $wiz_ip_net = $mdk{NETWORK} if defined $mdk{NETWORK} or
- die "NETWORK not in /etc/sysconfig/network-scripts/ifcfg-".$wiz_device;
- ($wiz_ip_net) = ($wiz_ip_net =~ /(.*)\..*/);
- $allow = "$wiz_ip_net.";
+ ($allow) = $o->get_from_known_dev("IP") =~ qr/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.)\d{1,3}$/;
}
elsif (!$wiz_ftp_external) {
$allow = "none";
diff --git a/web_wizard/scripts/Webconf.pm b/web_wizard/scripts/Webconf.pm
index 69f99194..9be3a75e 100644
--- a/web_wizard/scripts/Webconf.pm
+++ b/web_wizard/scripts/Webconf.pm
@@ -2,61 +2,41 @@
package Webconf;
require "__WIZ_HOME__/common/scripts/Vareqval.pm";
+require "__WIZ_HOME__/common/scripts/DrakconnectConf.pm";
+use MDK::Common;
use strict;
-my $that;
-my %mdk;
-my $device;
-my $s;
+my $o = DrakconnectConf->new();
-sub finish {
- my $old = "/etc/httpd/conf/commonhttpd.conf";
- my $new = "/tmp/commonhttpd.conf";
- my $bak = "/etc/httpd/conf/commonhttpd.conf.orig";
+sub check {
+ $> and return 1;
+ $o->is_dhcp() and return 2;
+ 0;
+}
- open(OLD, "< $old") or die "can't open $old: $!";
- open(NEW, "> $new") or die "can't open $new: $!";
+sub do_it {
+ my $file = "/etc/httpd/conf/commonhttpd.conf";
+ my $that = "localhost";
if ($ENV{wiz_web_external} eq "1") {
$that = "all";
}
elsif ($ENV{wiz_web_internal} eq "1") {
- $device = $mdk{wiz_device};
- %mdk = Vareqval->get("/etc/sysconfig/network-scripts/ifcfg-".$device);
- $that = "$mdk{IPADDR}";
- }
- else {
- $that = "localhost";
- }
-
- if ($ENV{wiz_web_external} eq "1") {
- my $that = "all";
- }
- elsif ($ENV{wiz_web_internal} eq "1") {
- %mdk = Vareqval->get("/etc/sysconfig/mdk_serv");
- defined $mdk{wiz_device} and $device = $mdk{wiz_device} or die "wiz_device not found in mdk_serv\n";
- %mdk = Vareqval->get("/etc/sysconfig/network-scripts/ifcfg-".$device);
- defined $mdk{IPADDR} and $that = $mdk{IPADDR} or die "IPADDR not found in /etc/sysconfig/network-scripts/ifcfg-xxx\n";
- }
- else {
- $that = "localhost";
- print "hello\n"
+ ($that) = $o->get_from_known_dev("IP") =~ qr/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.)\d{1,3}$/;
+ $that .= " localhost";
}
- while (<OLD>) {
- if( m /^[[:space:]]*<Directory \/home/s...m/^[[:space:]]*<\/Directory>/s ) {
- { s /^[[:space:]]*Allow .*$/ Allow from $that\n/s;}
+ cp_af($file, $file.".orig");
+ substInFile {
+ if( m /^\s*<Directory \/home/s...m/^\s*<\/Directory>/s ) {
+ { s /^\s*Allow .*$/ Allow from $that\n/s;}
;}
- if( m /^[[:space:]]*<Directory \/var\/www/s...m/^[[:space:]]*<\/Directory>/s ) {
- { s /^[[:space:]]*Allow .*$/ Allow from $that\n/s;}
+ if( m /^\s*<Directory \/var\/www/s...m/^\s*<\/Directory>/s ) {
+ { s /^\s*Allow .*$/ Allow from $that\n/s;}
;}
- print NEW $_ or die "can't write to $new: $!";
- }
- close(OLD) or die "can't close $old: $!";
- close(NEW) or die "can't close $new: $!";
-
- rename($old, $bak) or die "can't rename $old to $bak: $!";
- rename($new, $old) or die "can't rename $new to $old: $!";
+ } $file;
+ system("/etc/rc.d/init.d/httpd restart");
+ 10;
}
1;
diff --git a/web_wizard/web.wiz b/web_wizard/web.wiz
index 431e5597..995b7aaa 100644
--- a/web_wizard/web.wiz
+++ b/web_wizard/web.wiz
@@ -14,6 +14,7 @@
referenceLength="425"
referenceHeight="13"
perlModule="__WIZ_HOME__/web_wizard/scripts/Webconf.pm"
+ rpm="apache-conf"
>
<Variable
@@ -33,7 +34,7 @@
<Page
helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-web.html"
name="welcome"
- jumpScript="__WIZ_HOME__/common/scripts/check.sh root wiz_ip_net"
+ func="check"
executionLevel="NORMAL"
nextFinish="false"
canBack="true"
@@ -53,7 +54,7 @@
</Target>
<Target
- targetName="error_need_net"
+ targetName="error_dhcp"
jumpIndex="2"
>
</Target>
@@ -126,82 +127,19 @@
<Page
helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-web.html"
- name="error_need_net"
- subWizard="__WIZ_HOME__/server_wizard/server.wiz"
+ name="error_dhcp"
+ jumpPage="web connections"
executionLevel="NORMAL"
nextFinish="false"
- canBack="false"
+ canBack="true"
canCancel="true"
>
<Info
name="errorLabel"
alignement="Center"
- helpText="Network not configured yet"
- guiType="label"
- fontName="Default"
- fontStyle="bold"
- fontSize="14"
- >
- </Info>
-
- <Info
- name="info23"
- alignement="Center"
- guiType="label"
- fontName="Default"
- fontStyle="bold"
- fontSize="14"
- >
- </Info>
-
- <Info
- name="info22"
- alignement="Center"
- helpText="You have to configure the basic network parameters before launch this wizard."
- guiType="label"
- fontName="Default"
- fontStyle="plain"
- fontSize="11"
- >
- </Info>
-
- <Info
- name="info25"
- alignement="Center"
- helpText="Press next to configure these parameters now, or Cancel to exit this wizard."
- guiType="label"
- fontName="Default"
- fontStyle="plain"
- fontSize="11"
- >
- </Info>
-
- <Info
- name="info26"
- alignement="Center"
- guiType="label"
- fontName="Default"
- fontStyle="plain"
- fontSize="11"
- >
- </Info>
-
- <Info
- name="info24"
- alignement="Center"
- helpText="If you choose to configure now, you will automatically continue"
- guiType="label"
- fontName="Default"
- fontStyle="plain"
- fontSize="11"
- >
- </Info>
-
- <Info
- name="info27"
- alignement="Center"
- helpText="with the WEB configuration"
+ helpText="Warning\nYou are in dhcp, server may doesn't
+ work with your configuration."
guiType="label"
fontName="Default"
fontStyle="plain"
@@ -434,7 +372,7 @@
<Freetext
name="freetext1"
alignement="Fill"
- fillScript="[ \( ${wiz_web_internal} -eq 1 \) -o \( ${wiz_web_external} -eq 1 \) ] \a\a echo \qenabled\q || echo \qdisabled\q"
+ variableName="wiz_web_internal"
helpText="Intranet Web Server:"
guiType="textfield"
editable="false"
@@ -450,7 +388,7 @@
<Freetext
name="freetext2"
alignement="Fill"
- fillScript="[ ${wiz_web_external} -eq 0 ] \a\a echo \qdisabled\q || echo \qenabled\q"
+ variableName="wiz_web_external"
helpText="Internet Web Server:"
guiType="textfield"
editable="false"