#!/usr/local/bin/perl # edit_tpriv.cgi # Display a form for editing or creating new table permissions require './mysql-lib.pl'; &ReadParse(); $access{'perms'} || &error($text{'perms_ecannot'}); if ($in{'db'}) { &ui_print_header(undef, $text{'tpriv_title1'}, "", "create_tpriv"); } else { $d = &execute_sql_safe($master_db, "select * from tables_priv order by table_name"); $u = $d->{'data'}->[$in{'idx'}]; $access{'perms'} == 1 || &can_edit_db($u->[1]) || &error($text{'perms_edb'}); &ui_print_header(undef, $text{'tpriv_title2'}, "", "edit_tpriv"); } print "
\n"; if ($in{'db'}) { print "\n"; } else { print "\n"; print "\n"; print "\n"; print "\n"; } print "\n"; print "\n"; print "
$text{'tpriv_header'}
\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n", $u->[0] eq '%' ? '' : $u->[0]; print "\n"; print "\n"; print "\n"; print "\n"; print "
$text{'tpriv_db'}",$in{'db'} ? $in{'db'} : $u->[1],"
$text{'tpriv_table'}
$text{'tpriv_user'} \n"; printf " %s\n", $u->[2] ? '' : 'checked', $text{'tpriv_anon'}; printf "\n", $u->[2] ? 'checked' : ''; print "
$text{'tpriv_host'} \n"; printf " %s\n", $u->[0] eq '%' || $u->[0] eq '' ? 'checked' : '', $text{'tpriv_any'}; printf "\n", $u->[0] eq '%' || $u->[0] eq '' ? '' : 'checked'; printf "
$text{'tpriv_perms1'}
$text{'tpriv_perms2'}
\n"; print "\n"; if (!$in{'db'}) { print "\n"; } print "
\n"; &ui_print_footer('list_tprivs.cgi', $text{'tprivs_return'}, "", $text{'index_return'});