Add CGI args parser
authorJamie Cameron <jcameron@webmin.com>
Tue, 9 Jun 2009 00:26:18 +0000 (00:26 +0000)
committerJamie Cameron <jcameron@webmin.com>
Tue, 9 Jun 2009 00:26:18 +0000 (00:26 +0000)
pam/cgi_args.pl [new file with mode: 0644]

diff --git a/pam/cgi_args.pl b/pam/cgi_args.pl
new file mode 100644 (file)
index 0000000..2ca9a52
--- /dev/null
@@ -0,0 +1,15 @@
+
+do 'pam-lib.pl';
+
+sub cgi_args
+{
+my ($cgi) = @_;
+my @pams = &get_pam_config();
+if ($cgi eq 'edit_pam.cgi') {
+       return @pams ? 'idx='.$pams[0]->{'index'} : 'new=1';
+       }
+elsif ($cgi eq 'edit_mod.cgi') {
+       return @pams ? 'idx='.$pams[0]->{'index'}.'&midx=0' : 'new=1';
+       }
+return undef;
+}