diff --git a/src/Model/Table/LdapConnectionsTable.php b/src/Model/Table/LdapConnectionsTable.php index 35f2f2d..8a1b25c 100755 --- a/src/Model/Table/LdapConnectionsTable.php +++ b/src/Model/Table/LdapConnectionsTable.php @@ -321,7 +321,7 @@ class LdapConnectionsTable extends AppTable ]; } - public function ldapAuthentication($login, $user_password) + public function ldapAuthentication($user_login, $user_password) { try { if ($this->checkConfiguration()) { @@ -338,7 +338,7 @@ class LdapConnectionsTable extends AppTable if ($LDAP_ANONYMOUS) { //$dn = "ou=users,dc=irap,dc=omp,dc=eu"; //$dn = $this->baseDn; - $binddn = $this->authenticationType . '=' . $login; + $binddn = $this->authenticationType . '=' . $user_login; $ldappass = $user_password; $filter = '('.$binddn.')'; $just_these = array("cn"); @@ -365,7 +365,7 @@ class LdapConnectionsTable extends AppTable $ldapbind = ldap_bind($ldapConnection, $binddn, $ldappass) or die( "Could not bind to LDAP server.". ldap_error($ldapConnection) ); if ($ldapbind) { //return $this->getUserAttributes($login, $LDAP_ANONYMOUS, $filter, $just_these)[0]; - $search = $this->getUserAttributes($login, $LDAP_ANONYMOUS, $filter, $just_these) or die("Could not search in LDAP server, response was: " . ldap_error($ldapConnection) ); + $search = $this->getUserAttributes($user_login, $LDAP_ANONYMOUS, $filter, $just_these) or die("Could not search in LDAP server, response was: " . ldap_error($ldapConnection) ); return $search[0]; /* * } else { @@ -376,7 +376,7 @@ class LdapConnectionsTable extends AppTable // We are not using LDAP (use FAKE LDAP instead) } else { - $user = $this->getFakeLdapUser($login); + $user = $this->getFakeLdapUser($user_login); // debug($user); if ($user === false) return FALSE; -- libgit2 0.21.2