#!/usr/local/bin/perl
# edit_auth.cgi
# Display authentication settings

require './heartbeat-lib.pl';
&header($text{'auth_title'}, "");
print "<hr>\n";

$conf = &get_auth_config();

print "<form action=save_auth.cgi>\n";
print "<table border>\n";
print "<tr $tb> <td><b>$text{'auth_header'}</b></td> </tr>\n";
print "<tr $cb> <td><table><tr>\n";
print "<td valign=top><b>$text{'auth_mode'}</td> <td>\n";

$i = 1;
foreach $k ('crc', 'sha1', 'md5') {
	printf "<input type=radio name=auth value=%d %s> %s\n",
		$i, $conf->{'auth'}->[0] == $i ? "checked" : "",
		$text{"auth_$k"};
	if ($k ne 'crc') {
		printf "<input name=%s size=20 value='%s'>\n",
			$k, $conf->{$i}->[1];
		}
	print "<br>\n";
	$i++;
	}

print "</td></tr></table></td></tr></table>\n";
print "<input type=submit value='$text{'save'}'></form>\n";

print "<hr>\n";
&footer("", $text{'index_return'});

