Exemplo n.º 1
0
 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;
 }