diff options
Diffstat (limited to 'ftp_wizard')
-rw-r--r-- | ftp_wizard/ftp.wiz | 6 | ||||
-rw-r--r-- | ftp_wizard/scripts/ProFtpconf.pm | 32 |
2 files changed, 29 insertions, 9 deletions
diff --git a/ftp_wizard/ftp.wiz b/ftp_wizard/ftp.wiz index 63ad0024..df020c4f 100644 --- a/ftp_wizard/ftp.wiz +++ b/ftp_wizard/ftp.wiz @@ -35,7 +35,7 @@ > </Variable> <Variable - name="shared_dir" + name="wiz_dir" shellVariable="wiz_dir" > </Variable> @@ -198,7 +198,7 @@ <Freetext name="freetext_dir" - variableName="shared_dir" + variableName="wiz_dir" helpText="Shared dir:" editable="true" fillfunc="get_dir" @@ -264,7 +264,7 @@ needed to configure your FTP Server" </Freetext> <Freetext - variableName="shared_dir" + variableName="wiz_dir" helpText="Public directory:" editable="false" > diff --git a/ftp_wizard/scripts/ProFtpconf.pm b/ftp_wizard/scripts/ProFtpconf.pm index 77877742..5db3c385 100644 --- a/ftp_wizard/scripts/ProFtpconf.pm +++ b/ftp_wizard/scripts/ProFtpconf.pm @@ -1,7 +1,25 @@ #!/usr/bin/perl +# Drakwizard + +# Copyright (C) 2002 MandrakeSoft Arnaud Desmons (adesmons@mandrakesoft.com) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + package ProFtpconf; -require "__WIZ_HOME__/common/scripts/DrakconnectConf.pm"; +require "__WIZ_HOME__/common/scripts/IFCFG.pm"; use MDK::Common; use strict; require "__WIZ_HOME__/common/scripts/Vareqval.pm"; @@ -16,6 +34,9 @@ sub true { } sub check_dir { + foreach (keys %ENV) { + print "$_ $ENV{$_}\n"; + } -d ($ENV{wiz_dir}) and return 10; 1; } @@ -28,10 +49,10 @@ sub get_dir { } } } - ""; + return ""; } -my $o = DrakconnectConf->new(); +my $o = IFCFG->new(); sub check { $> and return 1; @@ -39,7 +60,7 @@ sub check { 0; } -sub print_anonymous() { +sub print_anonymous() { print ' #<drakwizard> <Anonymous '.$_[0].'> @@ -64,7 +85,7 @@ sub do_it { open(NEW, "< $file") or die "error while opening $file: $!"; my $allow = "all"; if ($wiz_ftp_internal && !$wiz_ftp_external) { - ($allow) = $o->get_from_known_dev("IP") =~ qr/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.)\d{1,3}$/; + ($allow) = $o->itf_get("IPADDR") =~ qr/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.)\d{1,3}$/; $allow .= " 127.0.0.1"; } elsif (!$wiz_ftp_external) { @@ -139,4 +160,3 @@ sub do_it { 10; } 1; - |