本文整理匯總了PHP中CB\User::setNewPasswordByRecoveryHash方法的典型用法代碼示例。如果您正苦於以下問題:PHP User::setNewPasswordByRecoveryHash方法的具體用法?PHP User::setNewPasswordByRecoveryHash怎麽用?PHP User::setNewPasswordByRecoveryHash使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CB\User
的用法示例。
在下文中一共展示了User::setNewPasswordByRecoveryHash方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: trim
if (!empty($hash)) {
//process hash from get and check it
$user_id = DM\Users::getIdByRecoveryHash($hash);
if (empty($user_id)) {
$_SESSION['msg'] = '<div class="alert alert-error">' . L\get('RecoverHashNotFound') . (IS_DEBUG_HOST ? $hash : '') . '</div>';
break;
}
//if recovery hash check passed - check and set new password if specified
if (isset($_POST['p']) && isset($_POST['p2'])) {
$p = $_POST['p'];
$p2 = $_POST['p2'];
if (empty($p) || $p != $p2) {
$_SESSION['p_msg'] = L\get('PasswordMissmatch');
break;
}
User::setNewPasswordByRecoveryHash($hash, $p);
$_SESSION['msg'] = '<div class="alert alert-success">' . L\get('PasswordChangedMsg') . '<br /> <br /><a href="' . $coreUrl . '">' . L\get('Login') . '</a></div>';
break;
}
$prompt_for_new_password = true;
break;
}
$e = @$_POST['e'];
$u = @$_POST['u'];
$e = trim($e);
$u = trim($u);
$e = mb_strtolower($e);
$u = mb_strtolower($u);
//redirect to recovery form if not submited or empty user and email
if (!isset($_POST['s']) || empty($e) && empty($u)) {
header('location: ' . $coreUrl . 'recover/forgot-password/');