Beispiel #1
0
 public function changePasswordAction()
 {
     //Initialize variables
     $sm = $this->getServiceLocator();
     $users = new Users($sm);
     $user_session = new Container('user');
     //Get parameters
     $request = $this->getRequest($sm);
     $newPassword = $request->getPost('newPassword');
     //Redirecting if not logged
     if (!$user_session->logged) {
         return $this->redirect()->toRoute('application/default', array('controller' => 'index', 'action' => 'index'));
     }
     //Set new password
     $users->setPassword($user_session->user->user_id, $newPassword);
     //Return to config
     return $this->redirect()->toRoute('application/default', array('controller' => 'index', 'action' => 'index'));
 }