예제 #1
0
파일: Reset.php 프로젝트: fousheezy/auth
 protected function changePassword(UserInterface $user, $password)
 {
     $bcrypt = new Bcrypt();
     $bcrypt->setCost($this->getModuleConfig()->get('password_cost', 14));
     $pass = $bcrypt->create($password);
     $user->setPassword($pass);
     $user->setPasswordToken(null);
     // trigger event to allow password reset hooks
     $this->getEventManager()->trigger(__FUNCTION__, $this, array('user' => $user));
     $this->em()->flush();
     $this->getEventManager()->trigger(__FUNCTION__ . '.post', $this, array('user' => $user));
     return true;
 }
예제 #2
0
파일: Forgot.php 프로젝트: fousheezy/auth
 /**
  * Handle
  * @param  UserInterface $user
  * @return mixed
  */
 public function process(UserInterface $user)
 {
     $user->setPasswordToken($this->generatePasswordToken());
     return $this->sendEmail($user);
 }