Handle hostnames with upper-case letters
[webmin.git] / net / cgi_args.pl
1
2 do 'net-lib.pl';
3
4 sub cgi_args
5 {
6 my ($cgi) = @_;
7 if ($cgi eq 'edit_host.cgi') {
8         # Link to first host
9         my @hosts = &list_hosts();
10         return @hosts ? 'idx='.$hosts[0]->{'index'} : 'new=1';
11         }
12 elsif ($cgi eq 'edit_ipnode.cgi' && $config{'ipnodes_file'}) {
13         # Link to first ipnode
14         my @ipnodes = &list_ipnodes();
15         return @ipnodes ? 'idx='.$ipnodes[0]->{'index'} : 'new=1';
16         }
17 elsif ($cgi eq 'list_routes.cgi' || $cgi eq 'list_ifcs.cgi') {
18         # Works, even though it calls ReadParse
19         return '';
20         }
21 elsif ($cgi eq 'edit_aifc.cgi') {
22         my @act = &active_interfaces();
23         return @act ? 'idx='.$act[0]->{'index'} : 'new=1';
24         }
25 elsif ($cgi eq 'edit_bifc.cgi') {
26         my @boot = &boot_interfaces();
27         return @boot ? 'idx='.$boot[0]->{'index'} : 'new=1';
28         }
29 return undef;
30 }