#!/usr/local/bin/perl # edit_grant.cgi # Display a form for editing or creating a grant require './postgresql-lib.pl'; &ReadParse(); $access{'users'} || &error($text{'grant_ecannot'}); &ui_print_header(undef, $text{'grant_edit'}, ""); if (&supports_schemas($in{'db'})) { $s = &execute_sql_safe($in{'db'}, 'select relname, relacl, nspname from pg_class, pg_namespace where relnamespace = pg_namespace.oid and (relkind = \'r\' OR relkind = \'S\') and relname !~ \'^pg_\' order by relname'); } else { $s = &execute_sql_safe($in{'db'}, 'select relname, relacl, \'public\' from pg_class where (relkind = \'r\' OR relkind = \'S\') and relname !~ \'^pg_\' order by relname'); } foreach $g (@{$s->{'data'}}) { if ($g->[0] eq $in{'table'} && $g->[2] eq $in{'ns'}) { $g->[1] =~ s/^\{//; $g->[1] =~ s/\}$//; @grant = map { /^"(.*)=(.*)"$/ || /^(.*)=(.*)$/; [ $1, $2 ] } split(/,/, $g->[1]); } } print "
\n"; &ui_print_footer("list_grants.cgi?search=".&urlize($in{'search'}), $text{'grant_return'});