3 # Edit or create a host address
5 require './net-lib.pl';
6 $access{'hosts'} == 2 || &error($text{'hosts_ecannot'});
9 &ui_print_header(undef, $text{'hosts_create'}, "");
12 &ui_print_header(undef, $text{'hosts_edit'}, "");
13 @hosts = &list_hosts();
14 $h = $hosts[$in{'idx'}];
18 print &ui_form_start("save_host.cgi");
19 print &ui_hidden("new", $in{'new'});
20 print &ui_hidden("idx", $in{'idx'});
21 print &ui_table_start($text{'hosts_detail'}, undef, 2);
24 print &ui_table_row($text{'hosts_ip'},
25 &ui_textbox("address", $h->{'address'}, 30));
28 print &ui_table_row($text{'hosts_host'},
29 &ui_textarea("hosts", join("\n", @{$h->{'hosts'}}), 5, 50));
32 print &ui_table_end();
34 print &ui_form_end([ [ undef, $text{'create'} ] ]);
37 print &ui_form_end([ [ undef, $text{'save'} ],
38 [ "delete", $text{'delete'} ] ]);
41 &ui_print_footer("list_hosts.cgi", $text{'hosts_return'});