Commit 04d93bf5514f2e71359fcad75c8705c2ea920fee
1 parent
54a38102
Exists in
master
and in
3 other branches
Version: 2.4.3.9
Bugfixes getEmailFromLDAP & getLoginFromLDAP Version majeure en cours (2.5): https://projects.irap.omp.eu/versions/99 ROADMAP: https://projects.irap.omp.eu/projects/labinvent/roadmap
Showing
3 changed files
with
16 additions
and
9 deletions
Show diff stats
README-LABINVENT.md
... | ... | @@ -51,9 +51,9 @@ Logiciel testé et validé sur les configurations suivantes : |
51 | 51 | VERSION ACTUELLE |
52 | 52 | |
53 | 53 | Date: 13/06/2016 |
54 | -Version: 2.4.3.8 | |
54 | +Version: 2.4.3.9 | |
55 | 55 | |
56 | -Ajout informations debug - Utilisateur LDAP | |
56 | +Bugfixes getEmailFromLDAP & getLoginFromLDAP | |
57 | 57 | |
58 | 58 | Version majeure en cours (2.5): https://projects.irap.omp.eu/versions/99 |
59 | 59 | ... | ... |
src/Controller/UsersController.php
... | ... | @@ -187,11 +187,11 @@ class UsersController extends AppController |
187 | 187 | |
188 | 188 | for($i = 0; $i < $ldapConnection->getNbUsers(); $i++) { |
189 | 189 | |
190 | - if (!empty($u[$i][$this->request->session()->read('authType')][0])) { | |
190 | + //if (!empty($u[$i][$this->request->session()->read('authType')][0])) { | |
191 | 191 | if ($userName == $u[$i]['givenname'][0].' '.$u[$i]['sn'][0]) { |
192 | 192 | $this->set ( 'login', $u[$i][$this->request->session()->read('authType')][0] ); |
193 | 193 | } |
194 | - } | |
194 | + //} | |
195 | 195 | } |
196 | 196 | |
197 | 197 | $this->viewBuilder()->layout = 'ajax'; |
... | ... | @@ -201,19 +201,26 @@ class UsersController extends AppController |
201 | 201 | public function getLdapEmail($userName) { |
202 | 202 | $ldapConnection = TableRegistry::get('LdapConnections'); |
203 | 203 | $u = $ldapConnection->getAllLdapUsers(); |
204 | + | |
205 | + if (isset($u[0]['mailperso'])) { | |
206 | + $typeMail = 'mailperso'; | |
207 | + } | |
208 | + else { | |
209 | + $typeMail = 'mail'; | |
210 | + } | |
204 | 211 | |
205 | 212 | for($i = 0; $i < $ldapConnection->getNbUsers(); $i++) { |
206 | 213 | |
207 | - if (!empty($u[$i][$this->request->session()->read('authType')][0])) { | |
214 | + //if (!empty($u[$i][$this->request->session()->read('authType')][0])) { | |
208 | 215 | |
209 | 216 | if ($userName == $u[$i]['givenname'][0].' '.$u[$i]['sn'][0]) { |
210 | - if (isset($u[$i]['mail'][0]) && filter_var($u[$i]['mail'][0], FILTER_VALIDATE_EMAIL)) { | |
211 | - $this->set ('email', $u[$i]['mail'][0] ); | |
217 | + if (isset($u[$i][$typeMail][0]) && filter_var($u[$i][$typeMail][0], FILTER_VALIDATE_EMAIL)) { | |
218 | + $this->set ('email', $u[$i][$typeMail][0] ); | |
212 | 219 | } else { |
213 | 220 | $this->set ('email', ' '); |
214 | 221 | } |
215 | 222 | } |
216 | - } | |
223 | + //} | |
217 | 224 | |
218 | 225 | |
219 | 226 | } | ... | ... |
src/Template/Layout/default.ctp
... | ... | @@ -94,7 +94,7 @@ $cakeDescription = 'Labinvent 2.0'; |
94 | 94 | </i></td> |
95 | 95 | <td id="version"> |
96 | 96 | <!-- VERSION M.m.f.b (version (M)ajeure, version (m)ineure, numero de nouvelle (f)onctionnalite, numero de (b)ugfix) --> |
97 | - <font color="black">VERSION 2.4.3.8 (13/06/2016)</font> | |
97 | + <font color="black">VERSION 2.4.3.9 (13/06/2016)</font> | |
98 | 98 | </td> |
99 | 99 | </tr> |
100 | 100 | </table> | ... | ... |