Handle hostnames with upper-case letters
[webmin.git] / postgresql / down.cgi
1 #!/usr/local/bin/perl
2 # down.cgi
3 # Move a hosts list entry down
4
5 require './postgresql-lib.pl';
6 &ReadParse();
7 $access{'users'} || &error($text{'host_ecannot'});
8
9 &lock_file($hba_conf_file);
10 @hosts = &get_hba_config();
11 $host = $hosts[$in{'idx'}];
12 &swap_hba($host, $hosts[$in{'idx'}+1]);
13 &unlock_file($hba_conf_file);
14 &restart_postgresql();
15 &webmin_log('move', 'hba',
16                    $host->{'type'} eq 'local' ? 'local' :
17                    $host->{'netmask'} eq '0.0.0.0' ? 'all' :
18                    $host->{'netmask'} eq '255.255.255.255' ? $host->{'address'}:
19                    "$host->{'address'}/$host->{'netmask'}", $host);
20 &redirect("list_hosts.cgi");
21