Add cgi args parser
authorJamie Cameron <jcameron@webmin.com>
Sun, 7 Jun 2009 20:54:52 +0000 (20:54 +0000)
committerJamie Cameron <jcameron@webmin.com>
Sun, 7 Jun 2009 20:54:52 +0000 (20:54 +0000)
mount/cgi_args.pl [new file with mode: 0644]

diff --git a/mount/cgi_args.pl b/mount/cgi_args.pl
new file mode 100644 (file)
index 0000000..c4bab7b
--- /dev/null
@@ -0,0 +1,21 @@
+
+do 'mount-lib.pl';
+
+sub cgi_args
+{
+my ($cgi) = @_;
+if ($cgi eq 'edit_mount.cgi') {
+       # Find root filesystem, or first mount
+       my @mounts = &list_mounts();
+       return 'none' if (!@mounts);
+       my $i = 0;
+       foreach my $m (@mounts) {
+               if ($m->[0] eq '/') {
+                       return 'index='.$i;
+                       }
+               $i++;
+               }
+       return 'index=0';
+       }
+return undef;
+}