/**
  * Save user's new password.
  */
 function savePassword($args, &$request)
 {
     $this->validate();
     $this->setupTemplate($request);
     $site = $request->getSite();
     $oneStepReset = $site->getSetting('oneStepReset') ? true : false;
     $confirmHash = null;
     if ($oneStepReset) {
         $confirmHash = $request->getUserVar('confirmHash');
     }
     import('classes.user.form.LoginChangePasswordForm');
     $passwordForm = new LoginChangePasswordForm($confirmHash);
     $passwordForm->readInputData();
     if ($passwordForm->validate()) {
         if ($passwordForm->execute()) {
             $user = Validation::login($passwordForm->getData('username'), $passwordForm->getData('password'), $reason);
         }
         $request->redirect(null, 'user');
     } else {
         $passwordForm->display();
     }
 }
 /**
  * Save user's new password.
  */
 function savePassword()
 {
     $this->validate();
     $this->setupTemplate();
     import('classes.user.form.LoginChangePasswordForm');
     $passwordForm = new LoginChangePasswordForm();
     $passwordForm->readInputData();
     if ($passwordForm->validate()) {
         if ($passwordForm->execute()) {
             $user = Validation::login($passwordForm->getData('username'), $passwordForm->getData('password'), $reason);
         }
         PKPRequest::redirect(null, 'user');
     } else {
         $passwordForm->display();
     }
 }
Esempio n. 3
0
 /**
  * Save user's new password.
  */
 function savePassword($args, $request)
 {
     $this->setupTemplate($request);
     import('lib.pkp.classes.user.form.LoginChangePasswordForm');
     $passwordForm = new LoginChangePasswordForm($request->getSite());
     $passwordForm->readInputData();
     if ($passwordForm->validate()) {
         if ($passwordForm->execute()) {
             $user = Validation::login($passwordForm->getData('username'), $passwordForm->getData('password'), $reason);
         }
         $this->sendHome($request);
     } else {
         $passwordForm->display($request);
     }
 }