3 # Display a list of table priviliges
5 require './mysql-lib.pl';
6 $access{'perms'} || &error($text{'perms_ecannot'});
7 &ui_print_header(undef, $text{'tprivs_title'}, "", "tprivs");
9 $d = &execute_sql_safe($master_db, "select * from tables_priv order by table_name");
10 if (@{$d->{'data'}}) {
11 print &ui_form_start("delete_tprivs.cgi", "post");
12 @rowlinks = ( &select_all_link("d", 0),
13 &select_invert_link("d", 0) );
14 print &ui_links_row(\@rowlinks);
16 print &ui_columns_start([ "",
17 $text{'tprivs_table'},
21 $text{'tprivs_privs1'},
22 $text{'tprivs_privs2'} ], 100, 0, \@tds);
24 foreach $u (@{$d->{'data'}}) {
26 next if ($access{'perms'} == 2 && !&can_edit_db($u->[1]));
28 push(@cols, "<a href='edit_tpriv.cgi?idx=$i'>".
29 &html_escape($u->[3])."</a>");
30 push(@cols, &html_escape($u->[1]));
31 push(@cols, $u->[0] eq '' || $u->[0] eq '%' ?
32 $text{'tprivs_all'} : &html_escape($u->[0]));
33 push(@cols, $u->[2] ? &html_escape($u->[2])
34 : $text{'tprivs_anon'});
35 push(@cols, !$u->[6] ? $text{'tprivs_none'} :
36 join(" | ",split(/[, ]+/, $u->[6])));
37 push(@cols, !$u->[7] ? $text{'tprivs_none'} :
38 join(" | ",split(/[, ]+/, $u->[7])));
39 print &ui_checked_columns_row(\@cols, \@tds,
40 "d", join(" ", @$u[0..3]));
42 print &ui_columns_end();
43 print &ui_links_row(\@rowlinks);
44 print &ui_form_end([ [ "delete", $text{'users_delete'} ] ]);
47 print "<b>$text{'tprivs_norows'}</b><p>\n";
51 &ui_print_footer("", $text{'index_return'});
55 print &ui_form_start("edit_tpriv.cgi");
56 print &ui_submit($text{'tprivs_add'});
57 local @dbs = sort { $a cmp $b } &list_databases();
58 if (@dbs > $max_dbs) {
60 print &ui_textbox("db", undef, 20);
64 print &ui_select("db", undef,
65 [ grep { $access{'perms'} == 1 || &can_edit_db($_) }