function change_password($newpass, $newpass_rep) { $pass_ok = check_new_pass($newpass, $newpass_rep); if ($pass_ok === true) { $pass_hash = gen_pass_hash($newpass); write_pass_hash_to_db($pass_hash, $this->uid); return true; } else { return false; } }
$mailbox_limit = $db->escape_string($_POST['mailbox_limit']); if ($mailbox_limit == "") { $mailbox_limit = $mailbox_limit_default; } $sql = "UPDATE `" . DBT_USERS . "` SET `" . DBC_USERS_MAILBOXLIMIT . "` = '{$mailbox_limit}' WHERE `" . DBC_USERS_ID . "` = '{$id}';"; if (!($result = $db->query($sql))) { dbError($db->error); } } // Is there a changed password? if ($_POST['password'] !== "") { $pass_ok = check_new_pass($_POST['password'], $_POST['password_repeat']); if ($pass_ok === true) { // Password is okay and can be set $pass_hash = gen_pass_hash($_POST['password']); write_pass_hash_to_db($pass_hash, $id); // Edit user password successfull, redirect to overview redirect("admin/listusers/?edited=1"); } else { // Password is not okay // $editsuccessful = 2; add_message("fail", $PASS_ERR_MSG); } } else { // Edit user successfull, redirect to overview redirect("admin/listusers/?edited=1"); } } else { if ($savemode === "create") { // Create mode entered if (defined('DBC_USERS_MAILBOXLIMIT')) {