Added CGI args parser
authorJamie Cameron <jcameron@webmin.com>
Wed, 10 Jun 2009 23:05:59 +0000 (23:05 +0000)
committerJamie Cameron <jcameron@webmin.com>
Wed, 10 Jun 2009 23:05:59 +0000 (23:05 +0000)
dhcpd/cgi_args.pl [new file with mode: 0644]
dhcpd/edit_text.cgi

diff --git a/dhcpd/cgi_args.pl b/dhcpd/cgi_args.pl
new file mode 100644 (file)
index 0000000..0b465c6
--- /dev/null
@@ -0,0 +1,18 @@
+
+do 'dhcpd-lib.pl';
+
+sub cgi_args
+{
+my ($cgi) = @_;
+if ($cgi eq 'edit_group.cgi' || $cgi eq 'edit_host.cgi' ||
+    $cgi eq 'edit_subnet.cgi' || $cgi eq 'edit_shared.cgi' ||
+    $cgi eq 'edit_keys.cgi' || $cgi eq 'edit_zones.cgi') {
+       # Creating new one
+       return 'new=1';
+       }
+elsif ($cgi eq 'edit_options.cgi') {
+       # Global options
+       return '';
+       }
+return undef;
+}
index ec008a0..c94bef9 100755 (executable)
@@ -6,7 +6,6 @@
 # * Display form to manually edit dhcpd.conf file (pass to save_text.cgi)
 
 require './dhcpd-lib.pl';
-&ReadParse();
 $access{'noconfig'} && &error($text{'text_ecannot'});
 $conf = &get_config();
 &ui_print_header($text{'text_editor'}, $text{'text_title'}, "");