本文整理汇总了PHP中check_password_reset_key函数的典型用法代码示例。如果您正苦于以下问题:PHP check_password_reset_key函数的具体用法?PHP check_password_reset_key怎么用?PHP check_password_reset_key使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了check_password_reset_key函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Register_FluxBB_PasswReset
/**
* Update FluxBB password if user uses "lost password"
*/
function Register_FluxBB_PasswReset()
{
global $page, $user, $conf;
if (isset($_POST['submit'])) {
if ('reset' == $_GET['action']) {
$user_id = check_password_reset_key($_GET['key']);
$query = '
SELECT ' . $conf['user_fields']['username'] . ' AS username, mail_address
FROM ' . USERS_TABLE . '
WHERE ' . $conf['user_fields']['id'] . ' = \'' . $user_id . '\'
AND ' . $conf['user_fields']['username'] . ' NOT IN ("18","16")
;';
list($username, $mail_address) = pwg_db_fetch_row(pwg_query($query));
FluxBB_Updateuser($user_id, stripslashes($username), sha1($_POST['use_new_pwd']), $mail_address);
}
}
}
示例2: get_password_reset_handler_structure
/**
* Return password reset handler form or redirect to password reset page when key is invalid.
*
* @param int $id
*
* @return null|string
*/
public function get_password_reset_handler_structure($id)
{
// Verify key / login combo
$user = check_password_reset_key($_REQUEST['key'], $_REQUEST['login']);
if (!$user || is_wp_error($user)) {
if ($user && $user->get_error_code() === 'expired_key') {
wp_redirect(pp_password_reset_url() . '?error=expiredkey');
} else {
wp_redirect(pp_password_reset_url() . '?error=invalidkey');
}
exit;
} else {
$handler_structure = PROFILEPRESS_sql::get_password_reset_handler_structure($id);
$handler_structure .= '<input type="hidden" name="reset_key" value="' . esc_attr($_REQUEST['key']) . '">';
$handler_structure .= '<input type="hidden" name="reset_login" value="' . esc_attr($_REQUEST['login']) . '">';
}
return $handler_structure;
}
示例3: reset_form
/**
* Returns HTML partial that contains password-reset form.
* Based on WordPress core code from wp-login.php
*
* @since 1.0.0
*
* @return string
*/
private function reset_form()
{
static $Reset_Result = null;
if (null === $Reset_Result) {
lib3()->array->equip_get('login', 'key');
lib3()->array->equip_post('pass1', 'pass2');
$rp_login = wp_unslash($_GET['login']);
$rp_key = wp_unslash($_GET['key']);
$err_msg = new WP_Error();
$fatal_error = false;
lib3()->array->strip_slashes($_POST, 'pass1', 'pass2');
$pass1 = $_POST['pass1'];
$pass2 = $_POST['pass2'];
// Get the user object and validate the key.
if ($rp_login && $rp_key) {
$user = check_password_reset_key($rp_key, $rp_login);
} else {
$user = false;
}
if (!$user || is_wp_error($user)) {
// If the user was not found then show an error message.
if ($user && 'expired_key' == $user->get_error_code()) {
$fatal_error = true;
$err_msg->add('password_expired_key', __('Sorry, this reset-key is not valid anymore. Please request a new reset email and try again.', 'membership2'));
} else {
$fatal_error = true;
$err_msg->add('password_invalid_key', __('Sorry, we did not find a valid reset-key. Please request a new reset email and try again.', 'membership2'));
}
} else {
// If the user provided a new password, then check it now.
if ($pass1 && $pass1 != $pass2) {
$pass1 = false;
$err_msg->add('password_reset_mismatch', __('The passwords do not match, try again.', 'membership2'));
}
}
if ($fatal_error && count($err_msg->errors)) {
$url = esc_url_raw(add_query_arg(array('show' => 'lostpass'), remove_query_arg(array('action', 'key', 'login'))));
$Reset_Result = sprintf('[ms-note type="warning"]%s[/ms-note]<a href="%s">%s</a>', $err_msg->get_error_message(), $url, __('Request a new password-reset key', 'membership2'));
} elseif ($pass1) {
// This action is documented in wp-login.php
do_action('validate_password_reset', $err_msg, $user);
reset_password($user, $_POST['pass1']);
// All done! Show success message and link to login form
$url = esc_url_raw(remove_query_arg(array('action', 'key', 'login')));
$Reset_Result = sprintf('[ms-note type="info"]%s[/ms-note]<a href="%s">%s</a>', __('Your Password has been reset.', 'membership2'), $url, __('Login with your new password', 'membership2'));
} else {
// This action is documented in wp-login.php
do_action('validate_password_reset', $err_msg, $user);
wp_enqueue_script('utils');
wp_enqueue_script('user-profile');
ob_start();
if (count($err_msg->errors)) {
printf('[ms-note type="warning"]%s[/ms-note]', implode('<br>', $err_msg->get_error_messages()));
}
?>
<form name="resetpassform" id="resetpassform"
action="" method="post" autocomplete="off" class="ms-form">
<input type="hidden" id="user_login"
value="<?php
echo esc_attr($rp_login);
?>
" autocomplete="off"/>
<p class="user-pass1-wrap">
<label for="pass1"><?php
_e('New password');
?>
</label><br />
<div class="wp-pwd">
<span class="password-input-wrapper">
<input type="password" data-reveal="1" data-pw="<?php
echo esc_attr(wp_generate_password(16));
?>
" name="pass1" id="pass1" class="input" size="20" value="" autocomplete="off" aria-describedby="pass-strength-result" />
</span>
<div id="pass-strength-result" class="hide-if-no-js" aria-live="polite"><?php
_e('Strength indicator');
?>
</div>
</div>
</p>
<p class="user-pass2-wrap">
<label for="pass2"><?php
_e('Confirm new password');
?>
</label><br />
<input type="password" name="pass2" id="pass2" class="input" size="20" value="" autocomplete="off" />
</p>
<p class="description indicator-hint"><?php
echo wp_get_password_hint();
?>
//.........这里部分代码省略.........
示例4: do_password_reset
/**
* Смена пароля пользователя если пароль был отправлен через форму
*/
public function do_password_reset()
{
if ('POST' == $_SERVER['REQUEST_METHOD']) {
$rp_key = $_REQUEST['rp_key'];
$rp_login = $_REQUEST['rp_login'];
$user = check_password_reset_key($rp_key, $rp_login);
if (!$user || is_wp_error($user)) {
if ($user && $user->get_error_code() === 'expired_key') {
wp_redirect(home_url('member-login?login=expiredkey'));
} else {
wp_redirect(home_url('member-login?login=invalidkey'));
}
exit;
}
if (isset($_POST['pass1'])) {
if ($_POST['pass1'] != $_POST['pass2']) {
// Пароли не совпадают
$redirect_url = home_url('member-password-reset');
$redirect_url = add_query_arg('key', $rp_key, $redirect_url);
$redirect_url = add_query_arg('login', $rp_login, $redirect_url);
$redirect_url = add_query_arg('error', 'password_reset_mismatch', $redirect_url);
wp_redirect($redirect_url);
exit;
}
if (empty($_POST['pass1'])) {
// Пароль пустой
$redirect_url = home_url('member-password-reset');
$redirect_url = add_query_arg('key', $rp_key, $redirect_url);
$redirect_url = add_query_arg('login', $rp_login, $redirect_url);
$redirect_url = add_query_arg('error', 'password_reset_empty', $redirect_url);
wp_redirect($redirect_url);
exit;
}
// Проверка параметров ОК, сброс пароля
reset_password($user, $_POST['pass1']);
wp_redirect(home_url('member-login?password=changed'));
} else {
echo "Недопустимый запрос.";
}
exit;
}
}
示例5: wp_doin_verify_user_key
function wp_doin_verify_user_key()
{
global $gf_reset_user;
// analyze wp-login.php for a better understanding of these values
list($rp_path) = explode('?', wp_unslash($_SERVER['REQUEST_URI']));
$rp_cookie = 'wp-resetpass-' . COOKIEHASH;
// lets redirect the user on pass change, so that nobody could spoof his key
if (isset($_GET['key']) and isset($_GET['method'])) {
if ($_GET['method'] == 'gf') {
$value = sprintf('%s:%s', wp_unslash($_GET['login']), wp_unslash($_GET['key']));
setcookie($rp_cookie, $value, 0, $rp_path, COOKIE_DOMAIN, is_ssl(), true);
wp_safe_redirect(remove_query_arg(array('key', 'login', 'method')));
exit;
}
}
// lets compare the validation cookie with the hash key stored with the database data
// if they match user data will be returned
if (isset($_COOKIE[$rp_cookie]) && 0 < strpos($_COOKIE[$rp_cookie], ':')) {
list($rp_login, $rp_key) = explode(':', wp_unslash($_COOKIE[$rp_cookie]), 2);
$user = check_password_reset_key($rp_key, $rp_login);
if (isset($_POST['pass1']) && !hash_equals($rp_key, $_POST['rp_key'])) {
$user = false;
}
} else {
$user = false;
}
// if any error occured make sure to remove the validation cookie
if (!$user || is_wp_error($user)) {
setcookie($rp_cookie, ' ', time() - YEAR_IN_SECONDS, $rp_path, COOKIE_DOMAIN, is_ssl(), true);
}
// make sure our user is available for later reference
$gf_reset_user = $user;
}
示例6: reales_reset_pass_form
function reales_reset_pass_form()
{
$allowed_html = array();
$pass_1 = isset($_POST['pass_1']) ? wp_kses($_POST['pass_1'], $allowed_html) : '';
$pass_2 = isset($_POST['pass_2']) ? wp_kses($_POST['pass_2'], $allowed_html) : '';
$key = isset($_POST['key']) ? wp_kses($_POST['key'], $allowed_html) : '';
$login = isset($_POST['login']) ? wp_kses($_POST['login'], $allowed_html) : '';
if ($pass_1 == '' || $pass_2 == '') {
echo json_encode(array('reset' => false, 'message' => __('Password field empty!', 'reales')));
exit;
}
$user = check_password_reset_key($key, $login);
if (is_wp_error($user)) {
if ($user->get_error_code() === 'expired_key') {
echo json_encode(array('reset' => false, 'message' => __('Sorry, the link does not appear to be valid or is expired!', 'reales')));
exit;
} else {
echo json_encode(array('reset' => false, 'message' => __('Sorry, the link does not appear to be valid or is expired!', 'reales')));
exit;
}
}
if (isset($pass_1) && $pass_1 != $pass_2) {
echo json_encode(array('reset' => false, 'message' => __('The passwords do not match!', 'reales')));
exit;
} else {
reset_password($user, $pass_1);
echo json_encode(array('reset' => true, 'message' => __('Your password has been reset.', 'reales')));
}
die;
}
示例7: template_redirect
/**
* Proccesses the request
*
* Callback for "template_redirect" hook in template-loader.php
*
* @since 6.3
* @access public
*/
public function template_redirect()
{
$this->request_action = isset($_REQUEST['action']) ? sanitize_key($_REQUEST['action']) : '';
if (!$this->request_action && self::is_tml_page()) {
$this->request_action = self::get_page_action(get_the_id());
}
$this->request_instance = isset($_REQUEST['instance']) ? sanitize_key($_REQUEST['instance']) : 0;
do_action_ref_array('tml_request', array(&$this));
// allow plugins to override the default actions, and to add extra actions if they want
do_action('login_form_' . $this->request_action);
if (has_action('tml_request_' . $this->request_action)) {
do_action_ref_array('tml_request_' . $this->request_action, array(&$this));
} else {
$http_post = 'POST' == $_SERVER['REQUEST_METHOD'];
switch ($this->request_action) {
case 'postpass':
if (!array_key_exists('post_password', $_POST)) {
wp_safe_redirect(wp_get_referer());
exit;
}
require_once ABSPATH . 'wp-includes/class-phpass.php';
$hasher = new PasswordHash(8, true);
$expire = apply_filters('post_password_expires', time() + 10 * DAY_IN_SECONDS);
if ($referer) {
$secure = 'https' === parse_url($referer, PHP_URL_SCHEME);
} else {
$secure = false;
}
setcookie('wp-postpass_' . COOKIEHASH, $hasher->HashPassword(wp_unslash($_POST['post_password'])), $expire, COOKIEPATH, COOKIE_DOMAIN, $secure);
wp_safe_redirect(wp_get_referer());
exit;
break;
case 'logout':
check_admin_referer('log-out');
$user = wp_get_current_user();
wp_logout();
if (!empty($_REQUEST['redirect_to'])) {
$redirect_to = $requested_redirect_to = $_REQUEST['redirect_to'];
} else {
$redirect_to = site_url('wp-login.php?loggedout=true');
$requested_redirect_to = '';
}
$redirect_to = apply_filters('logout_redirect', $redirect_to, $requested_redirect_to, $user);
wp_safe_redirect($redirect_to);
exit;
break;
case 'lostpassword':
case 'retrievepassword':
if ($http_post) {
$this->errors = self::retrieve_password();
if (!is_wp_error($this->errors)) {
$redirect_to = !empty($_REQUEST['redirect_to']) ? $_REQUEST['redirect_to'] : site_url('wp-login.php?checkemail=confirm');
wp_safe_redirect($redirect_to);
exit;
}
}
if (isset($_REQUEST['error'])) {
if ('invalidkey' == $_REQUEST['error']) {
$this->errors->add('invalidkey', __('Your password reset link appears to be invalid. Please request a new link below.', 'theme-my-login'));
} elseif ('expiredkey' == $_REQUEST['error']) {
$this->errors->add('expiredkey', __('Your password reset link has expired. Please request a new link below.', 'theme-my-login'));
}
}
do_action('lost_password');
break;
case 'resetpass':
case 'rp':
// Dirty hack for now
global $rp_login, $rp_key;
list($rp_path) = explode('?', wp_unslash($_SERVER['REQUEST_URI']));
$rp_cookie = 'wp-resetpass-' . COOKIEHASH;
if (isset($_GET['key'])) {
$value = sprintf('%s:%s', wp_unslash($_GET['login']), wp_unslash($_GET['key']));
setcookie($rp_cookie, $value, 0, $rp_path, COOKIE_DOMAIN, is_ssl(), true);
wp_safe_redirect(remove_query_arg(array('key', 'login')));
exit;
}
if (isset($_COOKIE[$rp_cookie]) && 0 < strpos($_COOKIE[$rp_cookie], ':')) {
list($rp_login, $rp_key) = explode(':', wp_unslash($_COOKIE[$rp_cookie]), 2);
$user = check_password_reset_key($rp_key, $rp_login);
if (isset($_POST['pass1']) && !hash_equals($rp_key, $_POST['rp_key'])) {
$user = false;
}
} else {
$user = false;
}
if (!$user || is_wp_error($user)) {
setcookie($rp_cookie, ' ', time() - YEAR_IN_SECONDS, $rp_path, COOKIE_DOMAIN, is_ssl(), true);
if ($user && $user->get_error_code() === 'expired_key') {
wp_redirect(site_url('wp-login.php?action=lostpassword&error=expiredkey'));
} else {
wp_redirect(site_url('wp-login.php?action=lostpassword&error=invalidkey'));
//.........这里部分代码省略.........
示例8: _e
?>
"><?php
_e('Register');
?>
</a>
<?php
}
?>
</p>
<?php
login_footer('user_login');
break;
case 'resetpass':
case 'rp':
$user = check_password_reset_key($_GET['key'], $_GET['login']);
if (is_wp_error($user)) {
wp_redirect(site_url('wp-login.php?action=lostpassword&error=invalidkey'));
exit;
}
$errors = new WP_Error();
if (isset($_POST['pass1']) && $_POST['pass1'] != $_POST['pass2']) {
$errors->add('password_reset_mismatch', __('The passwords do not match.'));
}
do_action('validate_password_reset', $errors, $user);
if (!$errors->get_error_code() && isset($_POST['pass1']) && !empty($_POST['pass1'])) {
reset_password($user, $_POST['pass1']);
login_header(__('Password Reset'), '<p class="message reset-pass">' . __('Your password has been reset.') . ' <a href="' . esc_url(wp_login_url()) . '">' . __('Log in') . '</a></p>');
login_footer();
exit;
}
示例9: the_title
> <?php
// контэйнер с классами и id
?>
<h1><?php
the_title();
// заголовок
?>
</h1>
<?php
the_content();
// контент
?>
</article>
<?php
if (!isset($_GET['key']) || !isset($_GET['login']) || is_wp_error(check_password_reset_key($_GET['key'], $_GET['login']))) {
// если параметры не передали или ф-я проверки вернула ошибку
echo '<p>Ключ и (или) логин ни были переданы, либо не верны.</p>';
//resetpass
} else {
// если все ок показываем форму
?>
<form name="resetpassform" id="resetpassform" action="" method="post" class="userform">
<input type="password" name="pass1" id="pass1" placeholder="Новый пароль">
<input type="password" name="pass2" id="pass2" placeholder="Повторите новый пароль">
<input type="hidden" name="key" value="<?php
echo esc_attr($_GET['key']);
?>
"><!-- переданные параметры сунем в скрытые поля -->
<input type="hidden" name="login" value="<?php
示例10: sas_do_password_reset
/**
* Resets the user's password if the password reset form was submitted.
*/
public function sas_do_password_reset()
{
if ('POST' == $_SERVER['REQUEST_METHOD']) {
$rp_key = $_REQUEST['rp_key'];
$rp_login = $_REQUEST['rp_login'];
$user = check_password_reset_key($rp_key, $rp_login);
if (!$user || is_wp_error($user)) {
if ($user && $user->get_error_code() === 'expired_key') {
wp_redirect(home_url('sas-login?login=expiredkey'));
} else {
wp_redirect(home_url('sas-login?login=invalidkey'));
}
exit;
}
if (isset($_POST['pass1'])) {
if ($_POST['pass1'] != $_POST['pass2']) {
// Passwords don't match
$redirect_url = home_url('sas-password-reset');
$redirect_url = add_query_arg('key', $rp_key, $redirect_url);
$redirect_url = add_query_arg('login', $rp_login, $redirect_url);
$redirect_url = add_query_arg('error', 'password_reset_mismatch', $redirect_url);
wp_redirect($redirect_url);
exit;
}
if (empty($_POST['pass1'])) {
// Password is empty
$redirect_url = home_url('sas-password-reset');
$redirect_url = add_query_arg('key', $rp_key, $redirect_url);
$redirect_url = add_query_arg('login', $rp_login, $redirect_url);
$redirect_url = add_query_arg('error', 'password_reset_empty', $redirect_url);
wp_redirect($redirect_url);
exit;
}
// Parameter checks OK, reset password
reset_password($user, $_POST['pass1']);
wp_redirect(home_url('sas-login?password=changed'));
} else {
echo "Invalid request.";
}
exit;
}
}
示例11: simplr_login_switch
function simplr_login_switch()
{
$options = get_option('simplr_reg_options');
if (!isset($_GET['action'])) {
$_GET['action'] = 'login';
}
$action = $_GET['action'];
global $errors;
switch ($action) {
case 'logout':
check_admin_referer('log-out');
wp_logout();
$redirect_to = !empty($_REQUEST['redirect_to']) ? $_REQUEST['redirect_to'] : 'wp-login.php?loggedout=true';
wp_safe_redirect($redirect_to);
exit;
break;
case 'lostpassword':
case 'retrievepassword':
?>
<form name="lostpasswordform" id="lostpasswordform" action="<?php
echo get_permalink($options->login_redirect);
?>
?action=lostpassword" method="post">
<p>
<label><?php
_e('Username or E-mail:', 'simplr-registration-form');
?>
<br />
<input type="text" name="user_login" id="user_login" class="input" value="" size="20" tabindex="10" /></label>
</p>
<?php
do_action('lostpassword_form');
?>
<input type="hidden" name="redirect_to" value="<?php
echo esc_attr(@$redirect_to);
?>
" />
<p class="submit"><input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="<?php
esc_attr_e('Get New Password', 'simplr-registration-form');
?>
" tabindex="100" /></p>
</form>
<p id="nav">
<a href="<?php
echo site_url('wp-login.php', 'login');
?>
"><?php
_e('Log in', 'simplr-registration-form');
?>
</a>
<?php
if (get_option('users_can_register')) {
?>
| <a href="<?php
echo site_url('wp-login.php?action=register', 'login');
?>
"><?php
_e('Register', 'simplr-registration-form');
?>
</a>
<?php
}
?>
</p>
<?php
login_footer('user_login');
break;
case 'resetpass':
case 'rp':
$user = check_password_reset_key($_GET['key'], $_GET['login']);
if (is_wp_error($user)) {
wp_redirect(site_url('wp-login.php?action=lostpassword&error=invalidkey'));
exit;
}
$errors = '';
if (isset($_POST['pass1']) && $_POST['pass1'] != $_POST['pass2']) {
$errors = new WP_Error('password_reset_mismatch', __('The passwords do not match.', 'simplr-registration-form'));
} elseif (isset($_POST['pass1']) && !empty($_POST['pass1'])) {
reset_password($user, $_POST['pass1']);
login_header(__('Password Reset', 'simplr-registration-form'), '<p class="message reset-pass">' . __('Your password has been reset.', 'simplr-registration-form') . ' <a href="' . site_url('wp-login.php', 'login') . '">' . __('Log in', 'simplr-registration-form') . '</a></p>');
login_footer();
exit;
}
wp_enqueue_script('utils');
wp_enqueue_script('user-profile');
login_header(__('Reset Password', 'simplr-registration-form'), '<p class="message reset-pass">' . __('Enter your new password below.', 'simplr-registration-form') . '</p>', $errors);
?>
<form name="resetpassform" id="resetpassform" action="<?php
echo get_permalink($options->login_redirect) . '?action=resetpass&key=' . urlencode($_GET['key']) . '&login=' . urlencode($_GET['login']);
?>
" method="post">
<input type="hidden" id="user_login" value="<?php
echo esc_attr($_GET['login']);
?>
" autocomplete="off" />
<p>
//.........这里部分代码省略.........
示例12: check_password_reset_key
/**
* Retrieves a user row based on password reset key and login.
*
* @uses $wpdb WordPress Database object
*
* @param string $key Hash to validate sending user's password
* @param string $login The user login
* @return WP_User|bool User's database row on success, false for invalid keys
*/
public static function check_password_reset_key($key, $login)
{
// Check for the password reset key.
// Get user data or an error message in case of invalid or expired key.
$user = check_password_reset_key($key, $login);
if (is_wp_error($user)) {
wc_add_notice($user->get_error_message(), 'error');
return false;
}
return $user;
}
示例13: action_reset_pass
/**
* Reset Password hooks
*/
function action_reset_pass()
{
list($rp_path) = explode('?', wp_unslash($_SERVER['REQUEST_URI']));
$rp_cookie = 'wp-resetpass-' . COOKIEHASH;
if (isset($_GET['key'])) {
$value = sprintf('%s:%s', wp_unslash($_GET['login']), wp_unslash($_GET['key']));
setcookie($rp_cookie, $value, 0, $rp_path, COOKIE_DOMAIN, is_ssl(), true);
wp_safe_redirect(remove_query_arg(array('key', 'login')));
exit;
}
if (isset($_COOKIE[$rp_cookie]) && 0 < strpos($_COOKIE[$rp_cookie], ':')) {
list($rp_login, $rp_key) = explode(':', wp_unslash($_COOKIE[$rp_cookie]), 2);
$user = check_password_reset_key($rp_key, $rp_login);
} else {
$user = false;
}
if (!$user || is_wp_error($user)) {
setcookie($rp_cookie, ' ', time() - YEAR_IN_SECONDS, $rp_path, COOKIE_DOMAIN, is_ssl(), true);
if ($user && $user->get_error_code() === 'expired_key') {
wp_redirect(site_url('wp-login.php?action=lostpassword&error=expiredkey'));
} else {
wp_redirect(site_url('wp-login.php?action=lostpassword&error=invalidkey'));
}
exit;
}
$errors = new WP_Error();
if (isset($_POST['pass1']) && $_POST['pass1'] != $_POST['pass2']) {
$errors->add('password_reset_mismatch', __('The passwords do not match.', 'colabsthemes'));
}
/**
* Fires before the password reset procedure is validated.
*
* @since 3.5.0
*
* @param object $errors WP Error object.
* @param WP_User|WP_Error $user WP_User object if the login and reset key match. WP_Error object otherwise.
*/
do_action('validate_password_reset', $errors, $user);
if (!$errors->get_error_code() && isset($_POST['pass1']) && !empty($_POST['pass1'])) {
reset_password($user, $_POST['pass1']);
setcookie($rp_cookie, ' ', time() - YEAR_IN_SECONDS, $rp_path, COOKIE_DOMAIN, is_ssl(), true);
$message = __('Your password has been reset.', 'colabsthemes') . ' <a href="' . esc_url(wp_login_url()) . '">' . __('Log in', 'colabsthemes') . '</a>';
}
wp_enqueue_script('password-strength-meter');
wp_enqueue_script('zxcvbn-async');
wp_enqueue_script('custom-strengthmeter', trailingslashit(get_template_directory_uri()) . 'includes/js/custom-strengthmeter.js');
if (isset($message) && !empty($message)) {
$this->render_messages($message);
}
if (isset($errors) && sizeof($errors) > 0 && $errors->get_error_code()) {
$this->render_messages($errors);
}
$this->reset_pass_form($rp_key);
}
示例14: parse_reset_key
/**
* Get the reset key and login from the cookie.
*
* @return void
* @access protected
* @since 1.4.0
*/
protected function parse_reset_key()
{
$this->key = null;
$this->login = null;
if (!isset($_COOKIE['wp-resetpass-' . COOKIEHASH])) {
return;
}
$cookie = $_COOKIE['wp-resetpass-' . COOKIEHASH];
if (!strpos($cookie, ':')) {
return;
}
$cookie_parts = explode(':', wp_unslash($cookie), 2);
list($login, $key) = array_map('sanitize_text_field', $cookie_parts);
$user = check_password_reset_key($key, $login);
if (is_wp_error($user)) {
charitable_get_notices()->add_errors_from_wp_error($user);
Charitable_User_Management::get_instance()->set_reset_cookie();
return;
}
/* Reset key / login is correct, display reset password form with hidden key / login values */
$this->key = $key;
$this->login = $login;
}
示例15: Copyright
<?php
# TemaTres : aplicación para la gestión de lenguajes documentales # #
# #
# Copyright (C) 2004-2015 Diego Ferreyra tematres@r020.com.ar
# Distribuido bajo Licencia GNU Public License, versión 2 (de junio de 1.991) Free Software Foundation
#
###############################################################################################################
#
include "config.tematres.php";
$metadata = do_meta_tag();
if ($_GET["action"] == 'rp' && $_GET["key"]) {
$chek_key = check_password_reset_key($_GET["key"], urldecode($_GET["login"]));
if ($chek_key["user_id"] > 0) {
$task_result = reset_password($chek_key);
}
}
?>
<!DOCTYPE html>
<html lang="<?php
echo LANG;
?>
">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="<?php
echo T3_WEBPATH;
?>
bootstrap/css/bootstrap.min.css" rel="stylesheet">