Commit 5138a4a8c610da24b2b654be4aae980dea3cabcf
1 parent
047a237f
Exists in
master
and in
3 other branches
ajout du filtre dans ldap_search
Showing
3 changed files
with
13 additions
and
12 deletions
Show diff stats
README.md
... | ... | @@ -51,6 +51,7 @@ VERSION ACTUELLE |
51 | 51 | Date: 21/12/2018 |
52 | 52 | Version: 2.9.1.4 |
53 | 53 | Author: EP |
54 | + Version et date affichés automatiquement sur page d'accueil (par extraction texte de ce fichier README) | |
54 | 55 | Les vues "Voir les autres listes" et "Outils/Gérer le contenu variable..." sont maintenant les mêmes |
55 | 56 | |
56 | 57 | Version majeure en cours : 2.9 (https://projects.irap.omp.eu/versions/207) | ... | ... |
src/Model/Table/LdapConnectionsTable.php
... | ... | @@ -176,7 +176,8 @@ class LdapConnectionsTable extends AppTable |
176 | 176 | $results = ldap_search($ldapConnection, $this->baseDn, $this->filter); |
177 | 177 | |
178 | 178 | $res = ldap_get_entries($ldapConnection, $results); |
179 | - } // FAKE LDAP | |
179 | + } | |
180 | + // FAKE LDAP | |
180 | 181 | else { |
181 | 182 | $res = $this->fakeLDAPUsers; |
182 | 183 | } |
... | ... | @@ -191,14 +192,6 @@ class LdapConnectionsTable extends AppTable |
191 | 192 | { |
192 | 193 | try { |
193 | 194 | |
194 | - /* | |
195 | - if ($this->checkConfiguration()) { | |
196 | - if ($this->USE_LDAP) { | |
197 | - $ldapConnection = ldap_connect($this->host, $this->port); | |
198 | - ldap_set_option($ldapConnection, LDAP_OPT_PROTOCOL_VERSION, 3); | |
199 | - $results = ldap_search($ldapConnection, $this->baseDn, '(' . $this->authenticationType . '=' . $userName . ')'); | |
200 | - return ldap_get_entries($ldapConnection, $results); | |
201 | - */ | |
202 | 195 | if ($this->checkConfiguration()) { |
203 | 196 | if ($this->USE_LDAP) { |
204 | 197 | /* Code inutile car redondant: |
... | ... | @@ -365,7 +358,8 @@ class LdapConnectionsTable extends AppTable |
365 | 358 | $auth_dn = ''; //= $this->authDn; |
366 | 359 | $binddn = $this->authenticationType . '=' . $user_login; |
367 | 360 | $ldappass = $user_password; |
368 | - $filter = '('.$binddn.')'; // ex: "(uid=epallier)" | |
361 | + //$filter = '('.$binddn.')'; // ex: "(uid=epallier)" | |
362 | + $filter = $this->filter . '('.$binddn.')'; // ex: "(uid=epallier)" | |
369 | 363 | } |
370 | 364 | // - Authentified connection (CRAL) |
371 | 365 | else { |
... | ... | @@ -377,6 +371,12 @@ class LdapConnectionsTable extends AppTable |
377 | 371 | $ldappass = "lemotdepasse"; |
378 | 372 | $filter = "(&(objectClass=person)(memberOf:1.2.840.113556.1.4.1941:=cn=ucbl.osu.cral,ou=groups,ou=27,ou=sim,ou=univ-lyon1,dc=univ-lyon1,dc=fr))"; |
379 | 373 | //$just_these = array("cn"); |
374 | + /* | |
375 | + NEW version | |
376 | + $filter = "(&(objectClass=person)(memberOf:1.2.840.113556.1.4.1941:=cn=ucbl.osu.cral,ou=groups,ou=27,ou=sim,ou=univ-lyon1,dc=univ-lyon1,dc=fr)(sAMAccountName=$user_login))"; | |
377 | + $dn = "dc=univ-lyon1,dc=fr"; | |
378 | + $binddn="CN=svc_ldap_cral,OU=users,OU=27,OU=sim,OU=univ-lyon1,DC=univ-lyon1,DC=fr"; | |
379 | + */ | |
380 | 380 | } |
381 | 381 | $binddn .= ','.$this->baseDn; |
382 | 382 | ... | ... |
src/Template/Layout/default.ctp
... | ... | @@ -118,6 +118,8 @@ $cakeDescription = 'Labinvent 2'; |
118 | 118 | |
119 | 119 | // Set $version and $version_date |
120 | 120 | // (cf https://book.cakephp.org/3.0/fr/core-libraries/file-folder.html#Cake\Filesystem) |
121 | + //$version = '2.9.1.4'; | |
122 | + //$version_date = '21/12/2018'; | |
121 | 123 | $wwwroot_dir = new Cake\Filesystem\Folder(WWW_ROOT); |
122 | 124 | $readme_file = new Cake\Filesystem\File($wwwroot_dir->pwd() . DS . '..' . DS . 'README.md'); |
123 | 125 | //dump($file); |
... | ... | @@ -135,8 +137,6 @@ $cakeDescription = 'Labinvent 2'; |
135 | 137 | // $readme_file->append('J'ajoute à la fin de ce fichier.'); |
136 | 138 | // $readme_file->delete(); // Je supprime ce fichier |
137 | 139 | $readme_file->close(); // Assurez-vous de fermer le fichier quand c'est fini |
138 | - //$version = '2.9.1.4'; | |
139 | - //$version_date = '21/12/2018'; | |
140 | 140 | ?> |
141 | 141 | </i></td> |
142 | 142 | <td id="version"> | ... | ... |