Update plugin doc
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -119,21 +119,6 @@ class LdapAuth extends Base implements PasswordAuthenticationProviderInterface
|
||||
$this->password = $password;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
*
|
||||
|
||||
@@ -8,7 +8,7 @@ use Kanboard\Core\Security\SessionCheckProviderInterface;
|
||||
use Kanboard\User\ReverseProxyUserProvider;
|
||||
|
||||
/**
|
||||
* ReverseProxy Authentication Provider
|
||||
* Reverse-Proxy Authentication Provider
|
||||
*
|
||||
* @package auth
|
||||
* @author Frederic Guillot
|
||||
@@ -18,10 +18,10 @@ class ReverseProxyAuth extends Base implements PreAuthenticationProviderInterfac
|
||||
/**
|
||||
* User properties
|
||||
*
|
||||
* @access private
|
||||
* @access protected
|
||||
* @var \Kanboard\User\ReverseProxyUserProvider
|
||||
*/
|
||||
private $user = null;
|
||||
protected $userInfo = null;
|
||||
|
||||
/**
|
||||
* Get authentication provider name
|
||||
@@ -45,7 +45,7 @@ class ReverseProxyAuth extends Base implements PreAuthenticationProviderInterfac
|
||||
$username = $this->request->getRemoteUser();
|
||||
|
||||
if (! empty($username)) {
|
||||
$this->user = new ReverseProxyUserProvider($username);
|
||||
$this->userInfo = new ReverseProxyUserProvider($username);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -71,6 +71,6 @@ class ReverseProxyAuth extends Base implements PreAuthenticationProviderInterfac
|
||||
*/
|
||||
public function getUser()
|
||||
{
|
||||
return $this->user;
|
||||
return $this->userInfo;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user