Handle hostnames with upper-case letters
[webmin.git] / heartbeat / save_auth.cgi
1 #!/usr/local/bin/perl
2 # save_auth.cgi
3 # Save authentication settings
4
5 require './heartbeat-lib.pl';
6 &ReadParse();
7 &error_setup($text{'auth_err'});
8
9 $conf = &get_auth_config();
10 $conf->{'auth'} = [ $in{'auth'} ];
11 $i = 1;
12 foreach $k ('crc', 'sha1', 'md5') {
13         if ($k eq 'crc') {
14                 $conf->{$i} = [ $k ];
15                 }
16         else {
17                 $in{'auth'} != $i || $in{$k} =~ /^\S+$/ ||
18                         &error($text{"auth_e$k"});
19                 $conf->{$i} = [ $k, $in{$k} ];
20                 }
21         $i++;
22         }
23 &save_auth_config($conf);
24 &redirect("");
25