#!/usr/local/bin/perl # edit_db.cgi # Edit or create a db table record require './mysql-lib.pl'; &ReadParse(); $access{'perms'} || &error($text{'perms_ecannot'}); if ($in{'new'}) { &ui_print_header(undef, $text{'db_title1'}, "", "create_db"); } else { $d = &execute_sql_safe($master_db, "select * from db order by db"); $u = $d->{'data'}->[$in{'idx'}]; $access{'perms'} == 1 || &can_edit_db($u->[1]) || &error($text{'perms_edb'}); &ui_print_header(undef, $text{'db_title2'}, "", "edit_db"); } print "
\n"; if ($in{'new'}) { print "\n"; } else { print "\n"; print "\n"; print "\n"; } print "\n"; print "\n"; print "
$text{'db_header'}
\n"; print "\n"; print "\n"; print "\n"; print "\n", $u->[0] eq '%' ? '' : $u->[0]; print "\n"; print "\n"; print "
$text{'db_db'}",&select_db($u->[1]),"
$text{'db_user'} \n"; printf " %s\n", $u->[2] ? '' : 'checked', $text{'db_anon'}; printf "\n", $u->[2] ? 'checked' : ''; print "
$text{'db_host'} \n"; printf " %s\n", $u->[0] eq '' ? 'checked' : '', $text{'db_hosts'}; printf " %s\n", $u->[0] eq '%' ? 'checked' : '', $text{'db_any'}; printf "\n", $u->[0] eq '%' || $u->[0] eq '' ? '' : 'checked'; printf "
$text{'db_perms'}
\n"; print "\n"; if (!$in{'new'}) { print "\n"; } print "
\n"; &ui_print_footer('list_dbs.cgi', $text{'dbs_return'}, "", $text{'index_return'});