diff --git a/src/Model/Table/LdapConnectionsTable.php b/src/Model/Table/LdapConnectionsTable.php index 04a18fa..9fd77cb 100755 --- a/src/Model/Table/LdapConnectionsTable.php +++ b/src/Model/Table/LdapConnectionsTable.php @@ -523,7 +523,229 @@ class LdapConnectionsTable extends AppTable //$binddn .= ','.$this->baseDn; $user_fetched = $this->searchLdap($filter, $just_these, $user_login, $user_password); $this->mydebugmsg("(1) user found in LDAP is:"); - $this->mydebugmsg($user_fetched); + //$this->mydebugmsg($user_fetched); + $this->mydebugmsg($user_fetched[0]); + /* Voici un exemple de ce qui est dans $user_fetched (structure LDAP IRAP) : + + 'sn' => [ + 'count' => (int) 1, + (int) 0 => 'Pallier' + ], + (int) 14 => 'sn', + 'givenname' => [ + 'count' => (int) 1, + (int) 0 => 'Etienne' + ], + + + [ + 'sn' => [ + (int) 0 => 'Pallier' + ], + 'mail' => [ + (int) 0 => 'Etienne.Pallier@irap.omp.eu' + ], + 'givenname' => [ + (int) 0 => 'Etienne' + ], + 'uid' => [ + (int) 0 => 'epallier' + ], + 'userpassword' => [ + (int) 0 => '' + ] + ] + + [ + 'count' => (int) 1, + (int) 0 => [ + 'cn' => [ + 'count' => (int) 1, + (int) 0 => 'Etienne Pallier' + ], + (int) 0 => 'cn', + 'homedirectory' => [ + 'count' => (int) 1, + (int) 0 => '/home/epallier' + ], + (int) 1 => 'homedirectory', + 'uidnumber' => [ + 'count' => (int) 1, + (int) 0 => '20172' + ], + (int) 2 => 'uidnumber', + 'objectclass' => [ + 'count' => (int) 9, + (int) 0 => 'top', + (int) 1 => 'person', + (int) 2 => 'organizationalPerson', + (int) 3 => 'inetOrgPerson', + (int) 4 => 'posixAccount', + (int) 5 => 'shadowAccount', + (int) 6 => 'irap', + (int) 7 => 'hostObject', + (int) 8 => 'sambaSamAccount' + ], + (int) 3 => 'objectclass', + 'sambasid' => [ + 'count' => (int) 1, + (int) 0 => 'S-1-5-21-3149873848-2002230563-1027543705-41344' + ], + (int) 4 => 'sambasid', + 'mail' => [ + 'count' => (int) 1, + (int) 0 => 'Etienne.Pallier@irap.omp.eu' + ], + (int) 5 => 'mail', + 'olddn' => [ + 'count' => (int) 1, + (int) 0 => 'uid=pallier,ou=users,ou=laboratoire,dc=cesr,dc=fr' + ], + (int) 6 => 'olddn', + 'userpassword' => [ + 'count' => (int) 1, + (int) 0 => '{SASL}epallier@IRAP.OMP.EU' + ], + (int) 7 => 'userpassword', + 'sambantpassword' => [ + 'count' => (int) 1, + (int) 0 => 'ED9A0ECE0C6C7560A8DDF6A23B2C7C36' + ], + (int) 8 => 'sambantpassword', + 'sambapwdlastset' => [ + 'count' => (int) 1, + (int) 0 => '1317291687' + ], + (int) 9 => 'sambapwdlastset', + 'loginshell' => [ + 'count' => (int) 1, + (int) 0 => '/bin/bash' + ], + (int) 10 => 'loginshell', + 'shadowexpire' => [ + 'count' => (int) 1, + (int) 0 => '-1' + ], + (int) 11 => 'shadowexpire', + 'host' => [ + 'count' => (int) 3, + (int) 0 => 'gitlab1.irap.omp.eu', + (int) 1 => 'gw.irap.omp.eu', + (int) 2 => 'version2.irap.omp.eu' + ], + (int) 12 => 'host', + 'uid' => [ + 'count' => (int) 1, + (int) 0 => 'epallier' + ], + (int) 13 => 'uid', + 'sn' => [ + 'count' => (int) 1, + (int) 0 => 'Pallier' + ], + (int) 14 => 'sn', + 'givenname' => [ + 'count' => (int) 1, + (int) 0 => 'Etienne' + ], + (int) 15 => 'givenname', + 'gecos' => [ + 'count' => (int) 1, + (int) 0 => 'Etienne.Pallier' + ], + (int) 16 => 'gecos', + 'gidnumber' => [ + 'count' => (int) 1, + (int) 0 => '2001' + ], + (int) 17 => 'gidnumber', + 'tagmail' => [ + 'count' => (int) 1, + (int) 0 => 'Oui' + ], + (int) 18 => 'tagmail', + 'compteinfo' => [ + 'count' => (int) 1, + (int) 0 => 'Oui' + ], + (int) 19 => 'compteinfo', + 'arrivaldate' => [ + 'count' => (int) 1, + (int) 0 => '01/01/1933' + ], + (int) 20 => 'arrivaldate', + 'birthday' => [ + 'count' => (int) 1, + (int) 0 => '07/08/1968' + ], + (int) 21 => 'birthday', + 'telephonenumber' => [ + 'count' => (int) 1, + (int) 0 => '0561556648' + ], + (int) 22 => 'telephonenumber', + 'roomnumber' => [ + 'count' => (int) 1, + (int) 0 => 'J039' + ], + (int) 23 => 'roomnumber', + 'mailperso' => [ + 'count' => (int) 1, + (int) 0 => 'N/A' + ], + (int) 24 => 'mailperso', + 'title' => [ + 'count' => (int) 1, + (int) 0 => 'M' + ], + (int) 25 => 'title', + 'site' => [ + 'count' => (int) 1, + (int) 0 => 'Roche' + ], + (int) 26 => 'site', + 'manager' => [ + 'count' => (int) 1, + (int) 0 => 'uid=mgiard,ou=users,dc=irap,dc=omp,dc=eu' + ], + (int) 27 => 'manager', + 'statut1' => [ + 'count' => (int) 1, + (int) 0 => 'ITA' + ], + (int) 28 => 'statut1', + 'o' => [ + 'count' => (int) 1, + (int) 0 => 'UPS' + ], + (int) 29 => 'o', + 'gt1' => [ + 'count' => (int) 1, + (int) 0 => 'PEPS' + ], + (int) 30 => 'gt1', + 'gt2' => [ + 'count' => (int) 1, + (int) 0 => 'GAHEC' + ], + (int) 31 => 'gt2', + 'statut2' => [ + 'count' => (int) 1, + (int) 0 => 'GT2I' + ], + (int) 32 => 'statut2', + 'affichageannuaire' => [ + 'count' => (int) 1, + (int) 0 => 'Oui' + ], + (int) 33 => 'affichageannuaire', + 'count' => (int) 34, + 'dn' => 'uid=epallier,ou=users,dc=irap,dc=omp,dc=eu' + ] + ] + + + */ // CACHE the new user in DB for next time if ($user_fetched !== FALSE) { $this->saveNewUserInDB($user_fetched[0]); @@ -544,7 +766,7 @@ class LdapConnectionsTable extends AppTable $user_fetched = $this->getFakeLdapUser($user_login); $this->mydebugmsg("(1) user found in FAKE LDAP is:"); $this->mydebugmsg($user_fetched); - /* Voici un exemple de ce qui est dans $user_fetched + /* Voici un exemple de ce qui est dans $user_fetched (fake ldap) : [ 'sn' => [ (int) 0 => 'Pallier' -- libgit2 0.21.2