Exemple #1
0
 /**
  * Allows users to change their passwords
  *
  * @access public
  * @return void
  */
 public function changePasswordAction()
 {
     $this->title = 'Change password';
     $user = Zend_Auth::getInstance()->getIdentity();
     if ($user->id == 1) {
         $this->_helper->FlashMessenger(array('msg-warn' => 'Please don\'t change the admin password in this release.'));
         $this->_redirect('/profile/');
     }
     $form = new ChangePasswordForm();
     $userModel = new BackofficeUser();
     if ($this->getRequest()->isPost()) {
         if ($form->isValid($this->getRequest()->getPost())) {
             $userModel->changePassword($form->getValue('password'));
             $this->_helper->FlashMessenger(array('msg-success' => 'Your password was successfully changed.'));
             $this->_redirect('/profile/');
         }
     }
     $this->view->form = $form;
 }