require 'postgresql-lib.pl'; # acl_security_form(&options) # Output HTML for editing security options for the postgresql module sub acl_security_form { my (@listdb)=&list_databases(); print " $text{'acl_dbs'}\n"; print "
$text{'acl_dbscannot'}" unless @listdb; print "\n"; print "\n"; if (@listdb) { printf " %s\n", $_[0]->{'dbs'} eq '*' ? 'checked' : '', $text{'acl_dall'}; printf " %s
\n", $_[0]->{'dbs'} eq '*' ? '' : 'checked', $text{'acl_dsel'}; print ""; print "\n"; } else { print "{'dbs'}."\">\n"; } print "\n"; print "$text{'acl_create'} \n"; printf " %s\n", $_[0]->{'create'} == 1 ? 'checked' : '', $text{'yes'}; printf " %s\n", $_[0]->{'create'} == 2 ? 'checked' : '', $text{'acl_max'}; printf "\n", $_[0]->{'max'}; printf " %s \n", $_[0]->{'create'} == 0 ? 'checked' : '', $text{'no'}; print " $text{'acl_delete'} \n"; printf " %s\n", $_[0]->{'delete'} ? 'checked' : '', $text{'yes'}; printf " %s \n", $_[0]->{'delete'} ? '' : 'checked', $text{'no'}; print " $text{'acl_stop'} \n"; printf " %s\n", $_[0]->{'stop'} ? 'checked' : '', $text{'yes'}; printf " %s \n", $_[0]->{'stop'} ? '' : 'checked', $text{'no'}; print " $text{'acl_users'} \n"; printf " %s\n", $_[0]->{'users'} ? 'checked' : '', $text{'yes'}; printf " %s \n", $_[0]->{'users'} ? '' : 'checked', $text{'no'}; print " $text{'acl_login'} \n"; printf " %s
\n", $_[0]->{'user'} ? '' : 'checked', $text{'acl_user_def'}; printf "\n", $_[0]->{'user'} ? 'checked' : ''; printf "%s \n", $text{'acl_user'}, $_[0]->{'user'}; printf "%s
\n", $text{'acl_pass'}, $_[0]->{'pass'}; print "   \n"; printf " %s \n", $_[0]->{'sameunix'} ? "checked" : "", $text{'acl_sameunix'}; print " $text{'acl_backup'} \n"; printf " %s\n", $_[0]->{'backup'} ? 'checked' : '', $text{'yes'}; printf " %s\n", $_[0]->{'backup'} ? '' : 'checked', $text{'no'}; print "$text{'acl_restore'} \n"; printf " %s\n", $_[0]->{'restore'} ? 'checked' : '', $text{'yes'}; printf " %s \n", $_[0]->{'restore'} ? '' : 'checked', $text{'no'}; print " $text{'acl_cmds'} \n"; printf " %s\n", $_[0]->{'cmds'} ? "checked" : "", $text{'yes'}; printf " %s\n", $_[0]->{'cmds'} ? "" : "checked", $text{'no'}; print "$text{'acl_views'} \n"; printf " %s\n", $_[0]->{'views'} ? 'checked' : '', $text{'yes'}; printf " %s \n", $_[0]->{'views'} ? '' : 'checked', $text{'no'}; print " $text{'acl_indexes'} \n"; printf " %s\n", $_[0]->{'indexes'} ? "checked" : "", $text{'yes'}; printf " %s\n", $_[0]->{'indexes'} ? "" : "checked", $text{'no'}; print "$text{'acl_seqs'} \n"; printf " %s\n", $_[0]->{'seqs'} ? 'checked' : '', $text{'yes'}; printf " %s \n", $_[0]->{'seqs'} ? '' : 'checked', $text{'no'}; print "\n"; } # acl_security_save(&options) # Parse the form for security options for the postgresql module sub acl_security_save { if ($in{'dblist'} eq '1') { if ($in{'dbs_def'}) { $_[0]->{'dbs'} = '*'; } else { $_[0]->{'dbs'} = join(" ", split(/\0/, $in{'dbs'})); } } else { $_[0]->{'dbs'} = $in{'dblist'}; $_[0]->{'dbs'} =~ s/^0 //; } $_[0]->{'create'} = $in{'create'}; $_[0]->{'max'} = $in{'max'}; $_[0]->{'delete'} = $in{'delete'}; $_[0]->{'stop'} = $in{'stop'}; $_[0]->{'users'} = $in{'users'}; $_[0]->{'backup'} = $in{'backup'}; $_[0]->{'restore'} = $in{'restore'}; $_[0]->{'cmds'} = $in{'cmds'}; $_[0]->{'views'} = $in{'views'}; $_[0]->{'indexes'} = $in{'indexes'}; $_[0]->{'seqs'} = $in{'seqs'}; if ($in{'user_def'}) { delete($_[0]->{'user'}); delete($_[0]->{'pass'}); } else { $_[0]->{'user'} = $in{'user'}; $_[0]->{'pass'} = $in{'pass'}; } $_[0]->{'sameunix'} = $in{'sameunix'}; }