&error_message("Permissions Error", "Only the superuser may access the data recovery utility") if $FORM{'username'} ne $superuser;
&ex("data_recovery_top", $FORM{'rectype'});
exit(0);
}
if ($FORM{'action'} eq "archive_options") {
&check_passwd;
&error_message("Permissions Error", "Only the superuser may save options that affect archiving") if $FORM{'username'} ne $superuser;
&ex('save_archive_options', 1);
&ex('archive_mgr', 1);
}
if ($FORM{'action'} eq "options_save") {
&check_passwd;
&error_message("Permissions Error", "Only the superuser may save options that affect the entire board") if $FORM{'username'} ne $superuser;
&ex('options_save', 1);
&ex('options_mgr', 1);
} else {
if ($GLOBAL_OPTIONS{'admin'} == 0 && $GLOBAL_OPTIONS{'options_used'} == 1) {
&error_message("Administration Disabled", "Administration has been disabled on this board for all moderators except the superuser.") if $FORM{'username'} ne $superuser;
}
}
if ($FORM{'action'} eq "email_save") {
&check_passwd;
&error_message("Permissions Error", "Only the superuser may save options that affect the entire board", 0, 1) if $FORM{'username'} ne $superuser;
&error_message("Permissions Error", "The e-mail notification settings are <U>read-only</U>. To remove this restriction, move the <U>email.txt</U> file from the <U>$admin_dir/source</U> directory into your <U>$admin_dir</U> directory.", 0, 1) if -e "$admin_dir/source/email.txt";
&ex('email_configuration', 1);
&ex('email_configurator', 1);
}
if ($FORM{'action'} eq "prune_board") {
&check_passwd;
&error_message("Permissions Error", "Only the superuser may access this option") if $FORM{'username'} ne $superuser;
$FORM{'prune_days'} =~ s/\D//g;
&error_message("Archive/Prune Error", "The number of days you specified is invalid") if $FORM{'prune_days'} <= 0;
&error_message("Permissions Error", "You must be the superuser to access this function!") if $FORM{'username'} ne $superuser;
&lock("$admin_dir/passwd.txt");
open (PASS, "$admin_dir/passwd.txt") || &error_message("File Read Error", "Cannot read your <B>passwd.txt</B> file.");
@pass = <PASS>; close (PASS);
open (PASS, ">$admin_dir/passwd.txt") || &error_message("File Write Error", "Cannot write to your <B>passwd.txt</B> file. Check that you have set permissions properly on that file.");
print PASS @pass;
close (PASS);
&unlock("$admin_dir/passwd.txt");
($result) = grep(/^$superuser:/, @pass);
$result = "PASSWD:$result";
@result = ($result);
$p1 = $FORM{'pass1'}; $p2 = $FORM{'pass2'};
$p1 =~ tr/A-Z/a-z/; $p2 =~ tr/A-Z/a-z/;
&error_message($L{PROFILE_CHPASS_ERROR}, $L{PROFILE_CHPASS_ERROR_ALPHA}) if $p1 =~ /\W/;
&error_message($L{PROFILE_CHPASS_ERROR}, $L{PROFILE_CHPASS_ERROR_MATCH}) if $p1 ne $p2;
&error_message($L{PROFILE_CHPASS_ERROR}, $L{PROFILE_CHPASS_ERROR_LENGTH}) if length($p1) < 2;