#!/usr/local/bin/perl # edit_auth.cgi # Display commands and allowed users require './mon-lib.pl'; &ui_print_header(undef, $text{'auth_title'}, ""); $file = &mon_auth_file(); open(FILE, $file); while() { s/\r|\n//g; s/#.*$//; if (/^(\S+):\s*(.*)$/) { $auth{$1} = [ split(/,/, $2) ]; } } close(FILE); print "$text{'auth_desc'}

\n"; print "

\n"; print "\n"; print " ", "\n"; printf "\n", join(" ", keys %auth); foreach $a (&list_auth_types()) { local @au = @{$auth{$a}}; print "\n", $au[0] eq "all" ? "" : join(" ", @{$auth{$a}}), &user_chooser_button($a, 0); delete($auth{$a}); } print "
$text{'auth_cmd'}$text{'auth_users'}
$a \n"; printf " %s\n", @au ? "" : "checked", $text{'auth_none'}; printf " %s\n", $au[0] eq "all" ? "checked" : "", $text{'auth_all'}; printf " %s\n", @au && $au[0] ne "all" ? "checked" : "", $text{'auth_sel'}; printf " %s
\n"; foreach $a (keys %auth) { print "\n"; } print "
\n"; &ui_print_footer("", $text{'index_return'});