"<li><a href=\"?action=create\">Create new user</a>\n".
"<li><a href=\"?action=change-auth\">Change user auth-ID</a>\n".
"<li><a href=\"?action=edit\">Edit user restrictions file</a>\n".
"<li><a href=\"?action=delete\">Delete existing user</a>\n".
"<li><a href=\"?action=quota\">Manage disk quota</a>\n";
"<li><a href=\"?action=create\">Create new user</a>\n".
"<li><a href=\"?action=change-auth\">Change user auth-ID</a>\n".
"<li><a href=\"?action=edit\">Edit user restrictions file</a>\n".
"<li><a href=\"?action=delete\">Delete existing user</a>\n".
"<li><a href=\"?action=quota\">Manage disk quota</a>\n";
"<li><a href=\"?action=fup.log\">Get fup.log</a>\n".
"<li><a href=\"?action=fop.log\">Get fop.log</a>\n".
"<li><a href=\"?action=error.log\">Get error.log</a>\n";
"<li><a href=\"?action=fup.log\">Get fup.log</a>\n".
"<li><a href=\"?action=fop.log\">Get fop.log</a>\n".
"<li><a href=\"?action=error.log\">Get error.log</a>\n";
"<li><a href=\"?action=backup\">Download backup<br>(config only)</a>\n".
"<li><a href=\"?action=restore\">Restore backup</a>\n";
"<li><a href=\"?action=backup\">Download backup<br>(config only)</a>\n".
"<li><a href=\"?action=restore\">Restore backup</a>\n";
"<li><a href=\"?action=showquota\">Show quotas (sender/recipient)</a>\n".
"<li><a href=\"?action=showconfig\">Show server config</a>\n".
"<li><a href=\"?action=userconfig\">Show user config</a>\n";
"<li><a href=\"?action=showquota\">Show quotas (sender/recipient)</a>\n".
"<li><a href=\"?action=showconfig\">Show server config</a>\n".
"<li><a href=\"?action=userconfig\">Show user config</a>\n";
"<li><a href=\"?action=editconfig\">Edit config</a>\n".
"<li><a href=\"?action=editindex\">Edit index.html</a>\n";
"<li><a href=\"?action=editconfig\">Edit config</a>\n".
"<li><a href=\"?action=editindex\">Edit index.html</a>\n";
-if ($action eq "create") { &createUserForm }
-elsif ($action eq "change-auth") { &changeAuthForm }
-elsif ($action eq "edit") { &editRestrictionsForm }
-elsif ($action eq "delete") { &deleteUserForm }
-elsif ($action eq "quota") { &changeQuotaForm }
+if ($action eq "create") { &createUserForm }
+elsif ($action eq "change-auth") { &changeAuthForm }
+elsif ($action eq "edit") { &editRestrictionsForm }
+elsif ($action eq "delete") { &deleteUserForm }
+elsif ($action eq "quota") { &changeQuotaForm }
-elsif ($action eq "showquota") { &showQuota }
-elsif ($action eq "showconfig") { &showConfig }
-elsif ($action eq "userconfig") { &userConfigForm }
-elsif ($action eq "watch") { &watchLog }
-elsif ($action eq "fexsrv.log") { &getlog("fexsrv.log") }
+elsif ($action eq "showquota") { &showQuota }
+elsif ($action eq "showconfig") { &showConfig }
+elsif ($action eq "userconfig") { &userConfigForm }
+elsif ($action eq "watch") { &watchLog }
+elsif ($action eq "fexsrv.log") { &getlog("fexsrv.log") }
-elsif ($action eq "fop.log") { &getlog("fop.log") }
-elsif ($action eq "error.log") { &getlog("error.log") }
-elsif ($action eq "editconfig") { &editFile("$FEXLIB/fex.ph") }
-elsif ($action eq "editindex") { &editFile("$docdir/index.html") }
-elsif ($action eq "backup") { &backup }
-elsif ($action eq "restore") { &restoreForm }
+elsif ($action eq "fop.log") { &getlog("fop.log") }
+elsif ($action eq "error.log") { &getlog("error.log") }
+elsif ($action eq "editconfig") { &editFile("$FEXLIB/fex.ph") }
+elsif ($action eq "editindex") { &editFile("$docdir/index.html") }
+elsif ($action eq "backup") { &backup }
+elsif ($action eq "restore") { &restoreForm }
if (defined $PARAM{"createUser"}) {
createUser($PARAM{"createUser"}, $PARAM{"authID"});
if (defined $PARAM{"createUser"}) {
createUser($PARAM{"createUser"}, $PARAM{"authID"});
$user = normalize_user($user);
unless (-d "$user") {
mkdir "$user",0755 or http_die("cannot mkdir $user - $!");
}
$user = normalize_user($user);
unless (-d "$user") {
mkdir "$user",0755 or http_die("cannot mkdir $user - $!");
}
open $idf,'>',$idf or http_die("cannot write $idf - $!");
print {$idf} $id,"\n";
close $idf or http_die("cannot write $idf - $!");
open $idf,'>',$idf or http_die("cannot write $idf - $!");
print {$idf} $id,"\n";
close $idf or http_die("cannot write $idf - $!");
open $idf,'>',$idf or http_die("cannot write $idf - $!");
print {$idf} $id,"\n";
close $idf or http_die("cannot write $idf - $!");
open $idf,'>',$idf or http_die("cannot write $idf - $!");
print {$idf} $id,"\n";
close $idf or http_die("cannot write $idf - $!");
chdir "$user" or http_die("could not change directory $user - $!");
print h2("Config files of <code>$user</code>");
chdir "$user" or http_die("could not change directory $user - $!");
print h2("Config files of <code>$user</code>");
http_die("not enough arguments in editUser") unless $user;
$user = normalize_user($user);
http_die("no user $user") unless -d $user;
http_die("not enough arguments in editUser") unless $user;
$user = normalize_user($user);
http_die("no user $user") unless -d $user;
# required arguments: list of Files
sub deleteFiles {
http_die("not enough arguments in deleteFiles") unless (my @files = @_);
# required arguments: list of Files
sub deleteFiles {
http_die("not enough arguments in deleteFiles") unless (my @files = @_);
if ($ar eq 'index.html') {
$ar = "$docdir/index.html"
} elsif ($ar eq 'fex.ph') {
if ($ar eq 'index.html') {
$ar = "$docdir/index.html"
} elsif ($ar eq 'fex.ph') {
open $ar,'>',$ar or http_die("cannot write $ar - $!");
print {$ar} $rf;
close $ar or http_die("cannot write $ar - $!");;
open $ar,'>',$ar or http_die("cannot write $ar - $!");
print {$ar} $rf;
close $ar or http_die("cannot write $ar - $!");;
$rquota = $1 if $rq and $rq =~ /(\d+)/;
$squota = $1 if $sq and $sq =~ /(\d+)/;
open $qf,'>',$qf or http_die("cannot write $qf - $!");
print {$qf} "recipient:$rquota\n" if $rquota;
print {$qf} "sender:$squota\n" if $squota;
close $qf or http_die("cannot write $qf - $!");
$rquota = $1 if $rq and $rq =~ /(\d+)/;
$squota = $1 if $sq and $sq =~ /(\d+)/;
open $qf,'>',$qf or http_die("cannot write $qf - $!");
print {$qf} "recipient:$rquota\n" if $rquota;
print {$qf} "sender:$squota\n" if $squota;
close $qf or http_die("cannot write $qf - $!");
$rquota = $recipient_quota unless $rquota;
$squota = $sender_quota unless $squota;
print h3("New quotas for $user");
$rquota = $recipient_quota unless $rquota;
$squota = $sender_quota unless $squota;
print h3("New quotas for $user");
sub watchLog {
if (-f "$logdir/fexsrv.log") {
print h2("polling fexsrv.log"),"\n";
sub watchLog {
if (-f "$logdir/fexsrv.log") {
print h2("polling fexsrv.log"),"\n";
# function for checking simple HTTP authentication
# (not used any more, replaced with require_akey)
sub require_auth {
# function for checking simple HTTP authentication
# (not used any more, replaced with require_akey)
sub require_auth {