本文整理汇总了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/');