#!/usr/local/bin/perl # edit_cpriv.cgi # Display a form for editing or creating new column permissions require './mysql-lib.pl'; &ReadParse(); $access{'perms'} || &error($text{'perms_ecannot'}); if ($in{'table'}) { &ui_print_header(undef, $text{'cpriv_title1'}, "", "create_cpriv"); ($d, $t) = split(/\./, $in{'table'}); } else { $d = &execute_sql_safe($master_db, "select * from columns_priv order by table_name,column_name"); $u = $d->{'data'}->[$in{'idx'}]; $access{'perms'} == 1 || &can_edit_db($u->[1]) || &error($text{'perms_edb'}); $d = $u->[1]; $t = $u->[3]; &ui_print_header(undef, $text{'cpriv_title2'}, "", "edit_cpriv"); } print "
\n"; if ($in{'table'}) { print "\n"; } else { print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; } print "\n"; print "\n"; print "
$text{'cpriv_header'}
\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n", $u->[0] eq '%' ? '' : $u->[0]; print "\n"; print "\n"; print "
$text{'cpriv_db'}$d
$text{'cpriv_table'}$t
$text{'cpriv_field'}
$text{'cpriv_user'} \n"; printf " %s\n", $u->[2] ? '' : 'checked', $text{'cpriv_anon'}; printf "\n", $u->[2] ? 'checked' : ''; print "
$text{'cpriv_host'} \n"; printf " %s\n", $u->[0] eq '%' || $u->[0] eq '' ? 'checked' : '', $text{'cpriv_any'}; printf "\n", $u->[0] eq '%' || $u->[0] eq '' ? '' : 'checked'; printf "
$text{'cpriv_perms'}
\n"; print "\n"; if (!$in{'new'}) { print "\n"; } print "
\n"; &ui_print_footer('list_cprivs.cgi', $text{'cprivs_return'}, "", $text{'index_return'});