Piwik\Plugins\Login\PasswordResetter::removePasswordResetInfo PHP Method

removePasswordResetInfo() public method

Removes stored password reset info if it exists.
public removePasswordResetInfo ( string $login )
$login string The user login to check for.
    public function removePasswordResetInfo($login)
    {
        $optionName = self::getPasswordResetInfoOptionName($login);
        Option::delete($optionName);
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * Authenticate user and password.  Redirect if successful.
  *
  * @param string $login user name
  * @param string $password md5 password
  * @param bool $rememberMe Remember me?
  * @param string $urlToRedirect URL to redirect to, if successfully authenticated
  * @return string failure message if unable to authenticate
  */
 protected function authenticateAndRedirect($login, $password, $rememberMe, $urlToRedirect = false, $passwordHashed = false)
 {
     Nonce::discardNonce('Login.login');
     $this->auth->setLogin($login);
     if ($passwordHashed === false) {
         $this->auth->setPassword($password);
     } else {
         $this->auth->setPasswordHash($password);
     }
     $this->sessionInitializer->initSession($this->auth, $rememberMe);
     // remove password reset entry if it exists
     $this->passwordResetter->removePasswordResetInfo($login);
     if (empty($urlToRedirect)) {
         $urlToRedirect = Url::getCurrentUrlWithoutQueryString();
     }
     Url::redirectToUrl($urlToRedirect);
 }