Commit 85cfcfce525c7a629be589f17e4e853012e53248

Authored by Etienne Pallier
1 parent 383a91b2
Exists in master and in 2 other branches dev, dev-IRAP

bugfix pour CRAL (samaccountname)

Showing 1 changed file with 8 additions and 2 deletions   Show diff stats
src/Model/Table/LdapConnectionsTable.php
... ... @@ -77,18 +77,23 @@ class LdapConnectionsTable extends AppTable
77 77 $names = explode(" ", $user['nom']);
78 78 $givenName = isset($names[1]) ? $names[1] : " ";
79 79 $ldapUsers[] = [
  80 + // Nom
80 81 'sn' => [
81 82 $names[0]
82 83 ],
  84 + // Email
83 85 'mail' => [
84 86 $user['email']
85 87 ],
  88 + // Pnom
86 89 'givenname' => [
87 90 $givenName
88 91 ],
  92 + // Login ("uid" for IRAP, "samaccountname" for CRAL)
89 93 $this->authenticationType => [
90 94 $user['username']
91 95 ],
  96 + // Pass
92 97 'userpassword' => [
93 98 $user['password']
94 99 ]
... ... @@ -138,7 +143,6 @@ class LdapConnectionsTable extends AppTable
138 143 $this->DEBUG_MODE = $config->mode_debug;
139 144 $this->LDAP_USED = $config->ldap_used;
140 145 if (! $this->LDAP_USED) {
141   - //$this->authenticationType = $config->authentificationType_ldap;
142 146 $this->authenticationType = $config->ldap_authenticationType;
143 147 if (empty($this->fakeLDAPUsers))
144 148 $this->fakeLDAPUsers = $this->buildFakeLdapUsers();
... ... @@ -279,7 +283,9 @@ class LdapConnectionsTable extends AppTable
279 283 // $utilisateurs["Pallier Etienne"] = ["email"]
280 284 ////$usersWithNameAndEmail[ $u[$i]['sn'][0].' '.$u[$i]['givenname'][0] ] = $u[$i]['mail'][0];
281 285 $usersWithNameAndEmail[ $u[$i]['sn'][0].' '.$u[$i]['givenname'][0] ] = array(
282   - "login" => $u[$i]['uid'][0],
  286 + //"login" => $u[$i]['uid'][0] // (IRAP)
  287 + //"login" => $u[$i]['samaccountname'][0] // CRAL
  288 + "login" => $u[$i][$this->authenticationType][0],
283 289 "email" => $u[$i]['mail'][0]
284 290 );
285 291 // Sort users (without modifying the keys, don't use sort() but asort() !!!!!!!!!!!!!)
... ...