issue #0000638 : Lors du changement de mot de pass, il n'est plus utile de se déconnecter
This commit is contained in:
parent
9d9716e0c7
commit
28ffa9848a
@ -5,20 +5,20 @@ $message = '';
|
||||
if (isset($_REQUEST['login']) && $_REQUEST['login']!='' &&
|
||||
$_REQUEST['login']!=$_SESSION['tabInfo']['login'] &&
|
||||
($_SESSION['tabInfo']['profil']=='Administrateur' ||
|
||||
$_SESSION['tabInfo']['profil']=='SuperAdministrateur') ){
|
||||
$loginVu=$_REQUEST['login'];
|
||||
}elseif (isset($tabOptions) && $tabOptions['action']=='new'){
|
||||
$loginVu=$tabOptions['login'];
|
||||
}else{
|
||||
$loginVu=$_SESSION['tabInfo']['login'];
|
||||
$_SESSION['tabInfo']['profil']=='SuperAdministrateur') ) {
|
||||
$loginVu = $_REQUEST['login'];
|
||||
} elseif (isset($tabOptions) && $tabOptions['action']=='new') {
|
||||
$loginVu = $tabOptions['login'];
|
||||
} else {
|
||||
$loginVu = $_SESSION['tabInfo']['login'];
|
||||
//On affecte la valeur en session de mode edition d'après le résultat du formulaire
|
||||
if (isset($tabOptions) && !isset($tabOptions['mode_edition']) &&
|
||||
$tabOptions['action']=='save'){
|
||||
$_SESSION['tabInfo']['mode_edition']=0;
|
||||
$_SESSION['tabInfo']['mode_edition'] = 0;
|
||||
}
|
||||
}
|
||||
if (isset($tabOptions) &&
|
||||
($tabOptions['action']=='save' || $tabOptions['action']=='new')){
|
||||
($tabOptions['action']=='save' || $tabOptions['action']=='new')) {
|
||||
$message = 'Erreur lors de la mise à jour du compte !';
|
||||
|
||||
$tabOptions['nom'] = preg_replace('/[^0-9A-Z\'-]/i', ' ', strtoupper(strtr(stripslashes($tabOptions['nom']), 'àáâãäåæçèéêëìíîïðñòóôõöùúûüýÿÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖÙÚÛÜÝ', 'aaaaaaaceeeeiiiionooooouuuuyyAAAAAAACEEEEIIIIONOOOOOUUUUYY')));
|
||||
@ -29,7 +29,25 @@ if (isset($tabOptions) &&
|
||||
$firephp->log($tabOptions, 'tabOptions');
|
||||
try {
|
||||
$O = $client->setInfosLogin($loginVu, $tabOptions);
|
||||
if ($O['result']==1) $message='Compte mis à jour !';
|
||||
if ($O['result']==1) {
|
||||
$message = 'Compte mis à jour !';
|
||||
//Pour un changement de mot de pass
|
||||
if ($_REQUEST['frmOptions']['changepwd']==1 &&
|
||||
$loginVu==$_SESSION['tabInfo']['login'] &&
|
||||
$tabOptions['action']=='save' ) {
|
||||
$login = $_SESSION['tabInfo']['login'];
|
||||
$hach = md5($_SESSION['tabInfo']['login'].'|'.$_REQUEST['frmOptions']['password']);
|
||||
$_SESSION['tabInfo']['password'] = $hach;
|
||||
$client = new SoapClient( null, array(
|
||||
'trace' => 1,
|
||||
'soap_version' => SOAP_1_1,
|
||||
'location' => WEBSERVICE_URL,
|
||||
'uri' => WEBSERVICE_URI,
|
||||
'login' => $login,
|
||||
'password' => $hach
|
||||
));
|
||||
}
|
||||
}
|
||||
} catch (SoapFault $fault) {
|
||||
require_once 'soaperror.php';
|
||||
processSoapFault($client,$fault,$tabInfo);
|
||||
@ -46,19 +64,6 @@ if (isset($tabOptions) &&
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
|
||||
if ($_REQUEST['frmOptions']['changepwd']==1 &&
|
||||
$loginVu==$_SESSION['tabInfo']['login'] &&
|
||||
$tabOptions['action']=='save' ){
|
||||
?>
|
||||
<script language="javascript">
|
||||
$(document).ready(function(){
|
||||
alert("La modification de votre mot de passe nécessite votre déconnexion !");
|
||||
window.location.href = '/?page=main&action=logout';
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
/** Utilisation du WS **/
|
||||
|
Loading…
Reference in New Issue
Block a user