diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-12-06 14:48:59 -0500 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-12-06 14:48:59 -0500 |
commit | 70c65268fe017014b97dbc18e02588b8ed1d9a19 (patch) | |
tree | d843b97b1458e696f7e9e993295e5961cc06903d /app/Auth/LdapAuth.php | |
parent | 6d4286ec664f1df8b0e97b759075afbf34d9620a (diff) |
Update plugin doc
Diffstat (limited to 'app/Auth/LdapAuth.php')
-rw-r--r-- | app/Auth/LdapAuth.php | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/app/Auth/LdapAuth.php b/app/Auth/LdapAuth.php index eb66e54d..85234ed3 100644 --- a/app/Auth/LdapAuth.php +++ b/app/Auth/LdapAuth.php @@ -23,7 +23,7 @@ class LdapAuth extends Base implements PasswordAuthenticationProviderInterface * @access private * @var \Kanboard\User\LdapUserProvider */ - private $user = null; + private $userInfo = null; /** * Username @@ -62,8 +62,8 @@ class LdapAuth extends Base implements PasswordAuthenticationProviderInterface { try { - $ldap = LdapClient::connect($this->getLdapUsername(), $this->getLdapPassword()); - $user = LdapUser::getUser($ldap, $this->getLdapUserPattern()); + $client = LdapClient::connect($this->getLdapUsername(), $this->getLdapPassword()); + $user = LdapUser::getUser($client, $this->username); if ($user === null) { $this->logger->info('User not found in LDAP server'); @@ -74,8 +74,8 @@ class LdapAuth extends Base implements PasswordAuthenticationProviderInterface throw new LogicException('Username not found in LDAP profile, check the parameter LDAP_USER_ATTRIBUTE_USERNAME'); } - if ($ldap->authenticate($user->getDn(), $this->password)) { - $this->user = $user; + if ($client->authenticate($user->getDn(), $this->password)) { + $this->userInfo = $user; return true; } @@ -94,7 +94,7 @@ class LdapAuth extends Base implements PasswordAuthenticationProviderInterface */ public function getUser() { - return $this->user; + return $this->userInfo; } /** @@ -120,21 +120,6 @@ class LdapAuth extends Base implements PasswordAuthenticationProviderInterface } /** - * Get LDAP user pattern - * - * @access public - * @return string - */ - public function getLdapUserPattern() - { - if (! LDAP_USER_FILTER) { - throw new LogicException('LDAP user filter empty, check the parameter LDAP_USER_FILTER'); - } - - return sprintf(LDAP_USER_FILTER, $this->username); - } - - /** * Get LDAP username (proxy auth) * * @access public |