From c8f368462035f7b06bea7c2decebc216f7f24d9a Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Fri, 24 May 2013 11:23:31 +0000 Subject: [PATCH] Remove notice --- application/controllers/UserController.php | 104 +++++++++++---------- 1 file changed, 53 insertions(+), 51 deletions(-) diff --git a/application/controllers/UserController.php b/application/controllers/UserController.php index 986156088..a7d20d15e 100644 --- a/application/controllers/UserController.php +++ b/application/controllers/UserController.php @@ -83,6 +83,10 @@ class UserController extends Zend_Controller_Action $login = $request->getParam('login', ''); $op = $request->getParam('op'); + //Récupération des informations de l'identité + $auth = Zend_Auth::getInstance(); + $identity = $auth->getIdentity(); + //Save data if ( $request->isPost() ) { $options = $request->getParam('frmOptions', ''); @@ -117,59 +121,36 @@ class UserController extends Zend_Controller_Action $message = 'Compte mis à jour.'; } } + + //Write change in session + if ($identity->idClient == $options['idClient'] && $identity->username == $login) { + //Modification lors du changement de mot de passe + if ($options['changepwd']==1 && $updateResult) { + + $identity->password = md5($login.'|'.$options['password']); + $auth->getStorage()->write($identity); + + } + //Mise à jour du profil + if ($isProfilUpdated && $updateResult) { + + $identity = $this->updateProfil($identity->username, $identity->password); + $auth->getStorage()->write($identity); + + } + //Gestion mode edition en SESSION + if ($action=='update') { + $modeEdition = $request->getParam('modeEdition', false); + if ( $modeEdition ) { + + $identity->modeEdition = true; + $auth->getStorage()->write($identity); + + } + } + } } - //Liste des catégories des accès - $reponse = $ws->getCategory(); - $wscategory = $reponse->item; - $this->view->assign('wscategory', $wscategory); - - //Liste de tous les droits - $listeDroits = $ws->getListeDroits(); - $droitsLib = array(); - foreach($listeDroits->item as $droit) { - $droitsLib[strtoupper($droit->code)] = $droit->desc; - } - $this->view->assign('droitsLib', $droitsLib); - - //Liste de toutes les préférences - $listePrefs = $ws->getListePrefs(); - $prefsLib = array(); - foreach($listePrefs->item as $pref) { - $prefsLib[strtoupper($pref->code)] = $pref->desc; - } - $this->view->assign('prefsLib', $prefsLib); - - //Récupération des informations de l'identité - $auth = Zend_Auth::getInstance(); - $identity = $auth->getIdentity(); - if (isset($options['idClient']) && $identity->idClient == $options['idClient'] && $identity->username == $login) { - //Modification lors du changement de mot de passe - if ($options['changepwd']==1 && $updateResult) { - - $identity->password = md5($login.'|'.$options['password']); - $auth->getStorage()->write($identity); - - } - //Mise à jour du profil - if ($isProfilUpdated && $updateResult) { - - $identity = $this->updateProfil($identity->username, $identity->password); - $auth->getStorage()->write($identity); - - } - //Gestion mode edition en SESSION - if ($action=='update') { - $modeEdition = $request->getParam('modeEdition', false); - if ( $modeEdition ) { - - $identity->modeEdition = true; - $auth->getStorage()->write($identity); - - } - } - } - if ( $isProfilUpdated || $isPasswordUpdated ) { $this->view->assign('message', $message); } @@ -224,6 +205,27 @@ class UserController extends Zend_Controller_Action $this->view->assign('action', 'update'); $this->view->assign('pref', explode(' ',$identity->pref)); } + + //Liste des catégories des accès + $reponse = $ws->getCategory(); + $wscategory = $reponse->item; + $this->view->assign('wscategory', $wscategory); + + //Liste de tous les droits + $listeDroits = $ws->getListeDroits(); + $droitsLib = array(); + foreach($listeDroits->item as $droit) { + $droitsLib[strtoupper($droit->code)] = $droit->desc; + } + $this->view->assign('droitsLib', $droitsLib); + + //Liste de toutes les préférences + $listePrefs = $ws->getListePrefs(); + $prefsLib = array(); + foreach($listePrefs->item as $pref) { + $prefsLib[strtoupper($pref->code)] = $pref->desc; + } + $this->view->assign('prefsLib', $prefsLib); } /**