public function password()
    {
        $this->setData('formTitle', __("Change password"));
        if ($this->getServiceLocator()->get(ApplicationService::SERVICE_ID)->isDemo()) {
            $this->setData('myForm', __('Unable to change passwords in demo mode'));
        } else {
            $myFormContainer = new tao_actions_form_UserPassword();
            $myForm = $myFormContainer->getForm();
            if($myForm->isSubmited()){
                if($myForm->isValid()){
                    $user = $this->getUserService()->getCurrentUser();
                    $this->getServiceLocator()->get(tao_models_classes_UserService::SERVICE_ID)
                        ->setPassword($user, $myForm->getValue('newpassword'));
                    $this->setData('message', __('Password changed'));
                }
            }
            $this->setData('myForm', $myForm->render());
        }

        $this->setView('form/settings_user.tpl');
    }
public function password()
    {
        $this->setData('formTitle', __("Change password"));
        if ($this->getServiceLocator()->get(ApplicationService::SERVICE_ID)->isDemo()) {
            $this->setData('myForm', __('Unable to change passwords in demo mode'));
        } else {
            $myFormContainer = new tao_actions_form_UserPassword();
            $myForm = $myFormContainer->getForm();
            if($myForm->isSubmited()){
                if($myForm->isValid()){
                    $user = $this->getUserService()->getCurrentUser();
                    $this->getServiceLocator()->get(tao_models_classes_UserService::SERVICE_ID)
                        ->setPassword($user, $myForm->getValue('newpassword'));
                    $this->setData('message', __('Password changed'));
                }
            }
            $this->setData('myForm', $myForm->render());
        }

        $this->setView('form/settings_user.tpl');
    }
public function password ( ) { $ this -> setData ( 'formTitle' , __ ( "Change password" ) ) ; if ( $ this -> getServiceLocator ( ) -> get ( ApplicationService :: SERVICE_ID ) -> isDemo ( ) ) { $ this -> setData ( 'myForm' , __ ( 'Unable to change passwords in demo mode' ) ) ; } else { $ myFormContainer = new tao_actions_form_UserPassword ( ) ; $ myForm = $ myFormContainer -> getForm ( ) ; if ( $ myForm -> isSubmited ( ) ) { if ( $ myForm -> isValid ( ) ) { $ user = $ this -> getUserService ( ) -> getCurrentUser ( ) ; $ this -> getServiceLocator ( ) -> get ( tao_models_classes_UserService :: SERVICE_ID ) -> setPassword ( $ user , $ myForm -> getValue ( 'newpassword' ) ) ; $ this -> setData ( 'message' , __ ( 'Password changed' ) ) ; } } $ this -> setData ( 'myForm' , $ myForm -> render ( ) ) ; } $ this -> setView ( 'form/settings_user.tpl' ) ; }
Action dedicated to change the password of the user currently connected.
Action dedicated to change the password of the user currently connected .