applications/dashboard/controllers/class.entrycontroller.php
public function PasswordReset($UserID = '', $PasswordResetKey = '') {
      if (!is_numeric($UserID)
          || $PasswordResetKey == ''
          || $this->UserModel->GetAttribute($UserID, 'PasswordResetKey', '') != $PasswordResetKey
         ) $this->Form->AddError('Failed to authenticate your password reset request. Try using the reset request form again.');

      if ($this->Form->ErrorCount() == 0) {
         $User = $this->UserModel->GetID($UserID, DATASET_TYPE_ARRAY);
         if ($User) {
            $User = ArrayTranslate($User, array('UserID', 'Name', 'Email'));
            $this->SetData('User', $User);
         }
      }
      
      if ($this->Form->ErrorCount() == 0
         && $this->Form->IsPostBack() === TRUE
      ) {
         $Password = $this->Form->GetFormValue('Password', '');
         $Confirm = $this->Form->GetFormValue('Confirm', '');
         if ($Password == '')
            $this->Form->AddError('Your new password is invalid');
         else if ($Password != $Confirm)
            $this->Form->AddError('Your passwords did not match.');

         if ($this->Form->ErrorCount() == 0) {
            $User = $this->UserModel->PasswordReset($UserID, $Password);
            Gdn::Session()->Start($User->UserID, TRUE);
//            $Authenticator = Gdn::Authenticator()->AuthenticateWith('password');
//            $Authenticator->FetchData($Authenticator, array('Email' => $User->Email, 'Password' => $Password, 'RememberMe' => FALSE));
//            $AuthUserID = $Authenticator->Authenticate();
				Redirect('/');
         }
      }
      $this->Render();
   }
public function PasswordReset($UserID = '', $PasswordResetKey = '') {
      if (!is_numeric($UserID)
          || $PasswordResetKey == ''
          || $this->UserModel->GetAttribute($UserID, 'PasswordResetKey', '') != $PasswordResetKey
         ) $this->Form->AddError('Failed to authenticate your password reset request. Try using the reset request form again.');

      if ($this->Form->ErrorCount() == 0) {
         $User = $this->UserModel->GetID($UserID, DATASET_TYPE_ARRAY);
         if ($User) {
            $User = ArrayTranslate($User, array('UserID', 'Name', 'Email'));
            $this->SetData('User', $User);
         }
      }
      
      if ($this->Form->ErrorCount() == 0
         && $this->Form->IsPostBack() === TRUE
      ) {
         $Password = $this->Form->GetFormValue('Password', '');
         $Confirm = $this->Form->GetFormValue('Confirm', '');
         if ($Password == '')
            $this->Form->AddError('Your new password is invalid');
         else if ($Password != $Confirm)
            $this->Form->AddError('Your passwords did not match.');

         if ($this->Form->ErrorCount() == 0) {
            $User = $this->UserModel->PasswordReset($UserID, $Password);
            Gdn::Session()->Start($User->UserID, TRUE);
//            $Authenticator = Gdn::Authenticator()->AuthenticateWith('password');
//            $Authenticator->FetchData($Authenticator, array('Email' => $User->Email, 'Password' => $Password, 'RememberMe' => FALSE));
//            $AuthUserID = $Authenticator->Authenticate();
				Redirect('/');
         }
      }
      $this->Render();
   }
public function PasswordReset ( $ UserID = '' , $ PasswordResetKey = '' ) { if ( ! is_numeric ( $ UserID ) || $ PasswordResetKey == '' || $ this -> UserModel -> GetAttribute ( $ UserID , 'PasswordResetKey' , '' ) != $ PasswordResetKey ) $ this -> Form -> AddError ( 'Failed to authenticate your password reset request. Try using the reset request form again.' ) ; if ( $ this -> Form -> ErrorCount ( ) == 0 ) { $ User = $ this -> UserModel -> GetID ( $ UserID , DATASET_TYPE_ARRAY ) ; if ( $ User ) { $ User = ArrayTranslate ( $ User , array ( 'UserID' , 'Name' , 'Email' ) ) ; $ this -> SetData ( 'User' , $ User ) ; } } if ( $ this -> Form -> ErrorCount ( ) == 0 && $ this -> Form -> IsPostBack ( ) === TRUE ) { $ Password = $ this -> Form -> GetFormValue ( 'Password' , '' ) ; $ Confirm = $ this -> Form -> GetFormValue ( 'Confirm' , '' ) ; if ( $ Password == '' ) $ this -> Form -> AddError ( 'Your new password is invalid' ) ; else if ( $ Password != $ Confirm ) $ this -> Form -> AddError ( 'Your passwords did not match.' ) ; if ( $ this -> Form -> ErrorCount ( ) == 0 ) { $ User = $ this -> UserModel -> PasswordReset ( $ UserID , $ Password ) ; Gdn :: Session ( ) -> Start ( $ User -> UserID , TRUE ) ; //            $Authenticator = Gdn::Authenticator()->AuthenticateWith('password'); //            $Authenticator->FetchData($Authenticator, array('Email' => $User->Email, 'Password' => $Password, 'RememberMe' => FALSE)); //            $AuthUserID = $Authenticator->Authenticate(); Redirect ( '/' ) ; } } $ this -> Render ( ) ; }
Do password reset.

@access public
@since 2.0.0

@param int $UserID Unique.
@param string $PasswordResetKey Authenticate with unique, 1-time code sent via email.
Do password reset .