#!/usr/local/bin/perl # edit_host.cgi # Edit or create a host table record require './mysql-lib.pl'; &ReadParse(); $access{'perms'} || &error($text{'perms_ecannot'}); if ($in{'new'}) { &ui_print_header(undef, $text{'host_title1'}, ""); } else { $d = &execute_sql_safe($master_db, "select * from host order by host"); $u = $d->{'data'}->[$in{'idx'}]; $access{'perms'} == 1 || &can_edit_db($u->[1]) || &error($text{'perms_edb'}); &ui_print_header(undef, $text{'host_title2'}, ""); } print "
\n"; if ($in{'new'}) { print "\n"; } else { print "\n"; print "\n"; } print "\n"; print "\n"; print "
$text{'host_header'}
\n"; print "\n"; print "\n"; print "\n", $u->[0] eq '%' ? '' : $u->[0]; print "\n"; print "\n"; print "
$text{'host_db'}",&select_db($u->[1]),"
$text{'host_host'} \n"; printf " %s\n", $u->[0] eq '%' || $u->[0] eq '' ? 'checked' : '', $text{'host_any'}; printf "\n", $u->[0] eq '%' || $u->[0] eq '' ? '' : 'checked'; printf "
$text{'host_perms'}
\n"; print "\n"; if (!$in{'new'}) { print "\n"; } print "
\n"; &ui_print_footer('list_hosts.cgi', $text{'hosts_return'}, "", $text{'index_return'});