#!/usr/local/bin/perl # edit_authuser.cgi # Display a form for editing a user from a text file require './apache-lib.pl'; require './auth-lib.pl'; &ReadParse(); &allowed_auth_file($in{'file'}) || &error(&text('authu_ecannot', $in{'file'})); $desc = &text('authu_header', "$in{'file'}"); if (defined($in{'user'})) { # editing an existing user &ui_print_header($desc, $text{'authu_edit'}, ""); $u = &get_authuser($in{'file'}, $in{'user'}); $user = $u->{'user'}; $pass = $u->{'pass'}; $new = 0; } else { # creating a new user &ui_print_header($desc, $text{'authu_create'}, ""); $new = 1; } print "
\n"; print "\n"; print "\n"; if (!$new) { print "\n"; } print "\n"; printf "\n", $new ? $text{'authu_create'} : $text{'authu_edit'}; print "
%s
\n"; print "\n"; print "\n"; print "\n"; printf "\n"; print "
$text{'authu_user'}
$text{'authu_pass'} $text{'authu_enc'}\n", $new ? '' : 'checked'; print "\n"; printf " $text{'authu_plain'}\n", $new ? 'checked' : ''; print "
\n"; print "\n"; print "\n" if (!$new); print "
\n"; print "
\n"; &ui_print_footer($in{'url'}, $text{'authu_return'});