• LifterLMS
  • Knowledge Base
  • Academy
  • Blog
  • Podcast
  • Contributors
  • My Account

LifterLMS LifterLMS

  • Code Reference
  • REST API
  • LLMS-CLI

Code Reference

Skip to content
Filter by type:
Search
Browse: Home / Code Reference / Classes / LLMS_Controller_Account / LLMS_Controller_Account::reset_password_link_redirect()

LLMS_Controller_Account::reset_password_link_redirect()

Automatically redirect password reset links to the password reset form page.

Contents

  • Description
  • Return
  • Source
  • Related
    • Uses
  • Changelog
  • User Contributed Notes

Description #Description

Strips the key and login query string parameters and sets them in a cookie (which is accessed later to populate the hidden fields on the reset form) and then redirect to the password reset form.


Top ↑

Return #Return

(void)


Top ↑

Source #Source

File: includes/forms/controllers/class.llms.controller.account.php

	public function reset_password_link_redirect() {

		if ( is_llms_account_page() && isset( $_GET['key'] ) && isset( $_GET['login'] ) ) {

			$user = get_user_by( 'login', wp_unslash( llms_filter_input_sanitize_string( INPUT_GET, 'login' ) ) );
			$uid  = $user ? $user->ID : 0;
			$val  = sprintf( '%1$d:%2$s', $uid, wp_unslash( llms_filter_input_sanitize_string( INPUT_GET, 'key' ) ) );

			( new LLMS_Cache_Helper() )->maybe_no_cache();
			llms_set_password_reset_cookie( $val );
			llms_redirect_and_exit( add_query_arg( 'reset-pass', 1, llms_lostpassword_url() ) );
		}

	}

Expand full source code Collapse full source code View on GitHub


Top ↑

Related #Related

Uses #Uses

Uses
Uses Description
includes/llms.functions.core.php: llms_filter_input_sanitize_string()

Function used to sanitize user input in a manner similar to the (deprecated) FILTER_SANITIZE_STRING.

includes/functions/llms.functions.person.php: llms_set_password_reset_cookie()

Set or unset a user’s password reset cookie.

includes/functions/llms-functions-conditional-tags.php: is_llms_account_page()

Determine if the LifterLMS Student Dashboard (account page) is being displayed.

includes/functions/llms-functions-wrappers.php: llms_redirect_and_exit()

Redirect and exit

includes/functions/llms.functions.page.php: llms_lostpassword_url()

Returns the url to the lost password endpoint url.

includes/class.llms.cache.helper.php: LLMS_Cache_Helper::__construct()

Constructor

Show 1 more use Hide more uses

Top ↑

Changelog #Changelog

Changelog
Version Description
6.6.0 Prevented client and server caching of the password reset form page.
5.9.0 Stop using deprecated FILTER_SANITIZE_STRING.
5.0.0 Introduced.

Top ↑

User Contributed Notes #User Contributed Notes

You must log in before being able to contribute a note or feedback.

© 2014 - 2023 LifterLMS · Privacy Policy · Terms and Conditions

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.