1#!/usr/local/bin/perl
2# edit_auth.cgi
3# Display authentication settings
4
5require './heartbeat-lib.pl';
6&ui_print_header(undef, $text{'auth_title'}, "");
7
8$conf = &get_auth_config();
9
10print "<form action=save_auth.cgi>\n";
11print "<table border>\n";
12print "<tr $tb> <td><b>$text{'auth_header'}</b></td> </tr>\n";
13print "<tr $cb> <td><table><tr>\n";
14print "<td valign=top><b>$text{'auth_mode'}</td> <td>\n";
15
16$i = 1;
17$n = $conf->{'auth'}->[0];
18foreach $k ('crc', 'sha1', 'md5') {
19	printf "<input type=radio name=auth value=%d %s> %s\n",
20		$i, $conf->{$n}->[0] eq $k ? "checked" : "",
21		$text{"auth_$k"};
22	if ($k ne 'crc') {
23		($thisnum) = grep { $conf->{$_}->[0] eq $k } (keys %$conf);
24		printf "<input name=%s size=20 value='%s'>\n",
25			$k, $conf->{$thisnum}->[1];
26		}
27	print "<br>\n";
28	$i++;
29	}
30
31print "</td></tr></table></td></tr></table>\n";
32print "<input type=submit value='$text{'save'}'></form>\n";
33
34&ui_print_footer("", $text{'index_return'});
35
36