#!/usr/local/bin/perl # edit_restrict.cgi # Edit a user or group module restriction require './usermin-lib.pl'; $access{'restrict'} || &error($text{'acl_ecannot'}); &ReadParse(); if ($in{'new'}) { &ui_print_header(undef, $text{'restrict_create'}, ""); } else { &ui_print_header(undef, $text{'restrict_edit'}, ""); @usermods = &list_usermin_usermods(); $um = $usermods[$in{'idx'}]; } print "
\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
$text{'restrict_header'}
\n"; print "\n"; $umode = $um->[0] eq "*" ? 2 : $um->[0] =~ /^\@/ ? 1 : $um->[0] =~ /^\// ? 3 : 0; printf "\n", $umode == 3 ? $um->[0] : "", &file_chooser_button("file"); } &read_usermin_acl(\%acl); print "\n"; print "
$text{'restrict_who2'} %s
\n", $umode == 2 ? "checked" : "", $text{'restrict_umode2'}; printf " %s\n", $umode == 0 ? "checked" : "", $text{'restrict_umode0'}; printf " %s
\n", $umode == 0 ? $um->[0] : "", &user_chooser_button("user"); printf " %s\n", $umode == 1 ? "checked" : "", $text{'restrict_umode1'}; printf " %s
\n", $umode == 1 ? substr($um->[0], 1) : "", &group_chooser_button("group"); if (&get_usermin_version() >= 1.031) { printf " %s\n", $umode == 3 ? "checked" : "", $text{'restrict_umode3'}; printf " %s
$text{'restrict_mods'}
", &text('restrict_modsdesc', "edit_acl.cgi"),"
\n"; printf " %s\n", $um->[1] eq "" ? "checked" : "", $text{'restrict_mmode0'}; printf " %s\n", $um->[1] eq "+" ? "checked" : "", $text{'restrict_mmode1'}; printf " %s
\n", $um->[1] eq "-" ? "checked" : "", $text{'restrict_mmode2'}; @mods = &list_modules(); print "\n"; foreach $m (@mods) { print "\n" if ($i % 3 == 0); printf "\n", $m->{'dir'}, &indexof($m->{'dir'}, @{$um->[2]}) >= 0 ? 'checked' : '', $acl{"user",$m->{'dir'}} ? $m->{'desc'} : "$m->{'desc'}"; print "\n" if ($i % 3 == 2); $i++; } print "
%s
\n"; print &select_all_link("mod", 0),"\n"; print &select_invert_link("mod", 0),"\n"; print "
\n"; print "\n"; if ($in{'new'}) { print "\n"; } else { print "\n"; print "\n"; } print "
\n"; &ui_print_footer("list_restrict.cgi", $text{'restrict_return'});