Added cgi args parser
authorJamie Cameron <jcameron@webmin.com>
Fri, 5 Jun 2009 20:00:36 +0000 (20:00 +0000)
committerJamie Cameron <jcameron@webmin.com>
Fri, 5 Jun 2009 20:00:36 +0000 (20:00 +0000)
ppp-client/cgi_args.pl [new file with mode: 0644]
ppp-client/index.cgi

diff --git a/ppp-client/cgi_args.pl b/ppp-client/cgi_args.pl
new file mode 100644 (file)
index 0000000..4eea268
--- /dev/null
@@ -0,0 +1,12 @@
+
+do 'ppp-client-lib.pl';
+
+sub cgi_args
+{
+my ($cgi) = @_;
+if ($cgi eq 'edit.cgi') {
+       my $conf = &get_config();
+       return @$conf ? 'idx='.$conf->[0]->{'index'} : 'new=1';
+       }
+return undef;
+}
index 95b0a8a..ba17ca5 100755 (executable)
@@ -8,7 +8,7 @@ require './ppp-client-lib.pl';
 # Check if wvdial is installed
 if (!&has_command($config{'wvdial'}) ||
     ($out = &proc::pty_backquote("$config{'wvdial'} --version")) !~
-     /WvDial\s+([^: ]+)/i) {
+     /WvDial\s+([^: \n\r]+)/i) {
        &ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1);
        print "<p>",&text('index_ewvdial', "<tt>$config{'wvdial'}</tt>",
                  "$gconfig{'webprefix'}/config.cgi?$module_name"),"<p>\n";