2 # $Id: edit_keys.cgi,v 1.2 2005/04/16 14:30:21 jfranken Exp $
3 # File added 2005-04-15 by Johannes Franken <jfranken@jfranken.de>
4 # Distributed under the terms of the GNU General Public License, v2 or later
6 # * Display TSIG keys for updates to DNS servers
9 require './dhcpd-lib.pl';
10 require './params-lib.pl';
12 $conf = &get_config();
13 @keys = ( &find("key", $conf), { } );
16 # %access = &get_module_acl();
17 # &error_setup($text{'eacl_aviol'});
18 # &error("$text{'eacl_np'} $text{'eacl_pss'}") if !&can('r',\%access,$sub);
21 &ui_print_header($desc, $text{'keys_create'}, "");
24 &ui_print_header($desc, $text{'keys_edit'}, "");
25 $key = $sub->{'members'}->[$in{'idx'}];
28 print "<form action=save_keys.cgi>\n";
29 print "<table border>\n";
30 print "<tr $tb> <td><b>$text{'keys_id'}</b></td> ",
31 "<td><b>$text{'keys_alg'}</b></td> ",
32 "<td><b>$text{'keys_secret'}</b></td> </tr>\n";
33 for($i=0; $i<@keys; $i++) {
36 printf "<td><input name=id_$i size=15 value='%s'></td>\n",
39 @algs = ( "hmac-md5" );
40 $alg = &find_value("algorithm", $k->{'members'});
41 print "<td><select name=alg_$i>\n";
44 printf "<option %s>%s\n", $alg eq $a ? "selected" : "", $a;
45 $found++ if ($alg eq $a);
47 print "<option selected>$alg\n" if (!$found && $alg);
48 print "</select></td>\n";
50 printf "<td><input name=secret_$i size=64 value='%s'></td> </tr>\n",
51 &find_value("secret", $k->{'members'});
54 print "<input type=submit value=\"$text{'save'}\"></form>\n";
56 &ui_print_footer("", $text{'index_return'});