Example #1
0
    if (!$password) {
        $validated = false;
        notice(_BLANK_PASSWORD);
    } elseif (strlen($password) < 6) {
        $validated = false;
        notice(_JOIN_PASSWORD_TOO_SHORT);
    } elseif (!$password2) {
        $validated = false;
        notice('Password confirmation required.');
    } elseif ($password != $password2) {
        $validated = false;
        notice('Password mismatch.');
    }
    if ($validated) {
        sql_query("UPDATE `users` SET `usePassword` = '" . sha1($password) . "' WHERE `useid` = '" . $useData["useid"] . "' LIMIT 1");
        terminateSession($_auth["useid"]);
        // force the user to log in with their new password
        redirect(url("passwordchanged"));
    }
}
?>

<form action="<?php 
echo url(".");
?>
" method="post">
<div class="caption"><?php 
echo _USE_ENTER_NEW_PASSWORD;
?>
:</div>
<div><input class="narrow" name="joinpassword" type="password" /></div>
Example #2
0
     $susLeft = $suspendUntil - time();
     $susLeft = round(($susLeft < 0 ? 0 : $susLeft) / (60 * 60 * 24));
     addModeratorLog($useData["useid"], "[b]Suspended until[/b]: " . date("Y-m-d H:i:s", $suspendUntil) . " (" . $susLeft . " days)");
     redirect(url("."));
 }
 // only smod can ban
 if (atLeastSModerator()) {
     if (isset($_POST["submitBan"])) {
         $suspendReason = $_POST["suspendReason"];
         terminateSession($useData["useid"]);
         sql_query("UPDATE `users`,`useExtData` SET `useIsBanned` = '1', " . "`useSuspendedReason` = '" . addslashes($suspendReason) . "' " . "WHERE `useid` = `useEid` AND `useid` = '" . $useData["useid"] . "'");
         addModeratorLog($useData["useid"], "[b]BANNED![/b]");
         redirect(url("."));
     }
     if (isset($_POST["submitUnban"])) {
         terminateSession($useData["useid"]);
         sql_query("UPDATE `users` SET `useIsBanned` = '0' " . "WHERE `useid` = '" . $useData["useid"] . "' LIMIT 1");
         addModeratorLog($useData["useid"], "[b]Unbanned![/b]");
         redirect(url("."));
     }
 }
 if (isset($_POST["submitLog"])) {
     addModeratorLog($useData["useid"], $_POST["modMessage"]);
     redirect(url(".") . "#modlog");
 }
 if (isset($_POST["submitUserData"])) {
     $changes = array();
     $changesExt = array();
     if ($useData["useCustomTitle"] != $_POST["useCustomTitle"]) {
         $changesExt["useCustomTitle"] = $_POST["useCustomTitle"];
         addModeratorLog($useData["useid"], "[b]Changed user custom title[/b]");