本文整理汇总了PHP中UserPeer::loadUserByPasswordResetHash方法的典型用法代码示例。如果您正苦于以下问题:PHP UserPeer::loadUserByPasswordResetHash方法的具体用法?PHP UserPeer::loadUserByPasswordResetHash怎么用?PHP UserPeer::loadUserByPasswordResetHash使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserPeer
的用法示例。
在下文中一共展示了UserPeer::loadUserByPasswordResetHash方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: redirect
<?php
/* setup includes */
require_once 'includes/master.inc.php';
// check for pending hash
$userId = (int) $_REQUEST['u'];
$passwordHash = $_REQUEST['h'];
$user = UserPeer::loadUserByPasswordResetHash($passwordHash);
if (!$user) {
redirect(WEB_ROOT);
}
// check user id passed is valid
if ($user->id != $userId) {
redirect(WEB_ROOT);
}
/* setup page */
define("PAGE_NAME", t("forgot_password_page_name", "Forgot Password"));
define("PAGE_DESCRIPTION", t("forgot_password_meta_description", "Forgot account password"));
define("PAGE_KEYWORDS", t("forgot_password_meta_keywords", "forgot, password, account, short, url, user"));
$success = false;
/* register user */
if ((int) $_REQUEST['submitme']) {
// validation
$password = trim($_REQUEST['password']);
$confirmPassword = trim($_REQUEST['confirmPassword']);
if (!strlen($password)) {
setError(t("please_enter_your_password", "Please enter your new password"));
} elseif (strlen($password) < 6 || strlen($password) > 20) {
setError(t("password_length_incorrect", "Password should be between 6 - 20 characters in length"));
} elseif (containsInvalidCharacters(strtolower($password, 'abcdefghijklmnopqrstuvwxyz1234567890@~#!-_£$&*()^%}{()'))) {
setError(t("password_contains_illegal_characters", "Password contains invalid characters, please choose another."));