From 04d93bf5514f2e71359fcad75c8705c2ea920fee Mon Sep 17 00:00:00 2001 From: Alexandre Cases Date: Mon, 13 Jun 2016 14:03:26 +0200 Subject: [PATCH] Version: 2.4.3.9 --- README-LABINVENT.md | 4 ++-- src/Controller/UsersController.php | 19 +++++++++++++------ src/Template/Layout/default.ctp | 2 +- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/README-LABINVENT.md b/README-LABINVENT.md index b52e09a..c1cc7c2 100755 --- a/README-LABINVENT.md +++ b/README-LABINVENT.md @@ -51,9 +51,9 @@ Logiciel testé et validé sur les configurations suivantes : VERSION ACTUELLE Date: 13/06/2016 -Version: 2.4.3.8 +Version: 2.4.3.9 -Ajout informations debug - Utilisateur LDAP +Bugfixes getEmailFromLDAP & getLoginFromLDAP Version majeure en cours (2.5): https://projects.irap.omp.eu/versions/99 diff --git a/src/Controller/UsersController.php b/src/Controller/UsersController.php index c2f8ae4..276c5c1 100755 --- a/src/Controller/UsersController.php +++ b/src/Controller/UsersController.php @@ -187,11 +187,11 @@ class UsersController extends AppController for($i = 0; $i < $ldapConnection->getNbUsers(); $i++) { - if (!empty($u[$i][$this->request->session()->read('authType')][0])) { + //if (!empty($u[$i][$this->request->session()->read('authType')][0])) { if ($userName == $u[$i]['givenname'][0].' '.$u[$i]['sn'][0]) { $this->set ( 'login', $u[$i][$this->request->session()->read('authType')][0] ); } - } + //} } $this->viewBuilder()->layout = 'ajax'; @@ -201,19 +201,26 @@ class UsersController extends AppController public function getLdapEmail($userName) { $ldapConnection = TableRegistry::get('LdapConnections'); $u = $ldapConnection->getAllLdapUsers(); + + if (isset($u[0]['mailperso'])) { + $typeMail = 'mailperso'; + } + else { + $typeMail = 'mail'; + } for($i = 0; $i < $ldapConnection->getNbUsers(); $i++) { - if (!empty($u[$i][$this->request->session()->read('authType')][0])) { + //if (!empty($u[$i][$this->request->session()->read('authType')][0])) { if ($userName == $u[$i]['givenname'][0].' '.$u[$i]['sn'][0]) { - if (isset($u[$i]['mail'][0]) && filter_var($u[$i]['mail'][0], FILTER_VALIDATE_EMAIL)) { - $this->set ('email', $u[$i]['mail'][0] ); + if (isset($u[$i][$typeMail][0]) && filter_var($u[$i][$typeMail][0], FILTER_VALIDATE_EMAIL)) { + $this->set ('email', $u[$i][$typeMail][0] ); } else { $this->set ('email', ' '); } } - } + //} } diff --git a/src/Template/Layout/default.ctp b/src/Template/Layout/default.ctp index e4a3069..6f6caf5 100755 --- a/src/Template/Layout/default.ctp +++ b/src/Template/Layout/default.ctp @@ -94,7 +94,7 @@ $cakeDescription = 'Labinvent 2.0'; - VERSION 2.4.3.8 (13/06/2016) + VERSION 2.4.3.9 (13/06/2016) -- libgit2 0.21.2