PHP Class BookStack\Services\LdapService

Mostra file Open project: ssddanbrown/bookstack Class Usage Examples

Protected Properties

Property Type Description
$config
$ldap
$ldapConnection

Public Methods

Method Description
__construct ( Ldap $ldap ) LdapService constructor.
getUserDetails ( $userName ) : array | null Get the details of a user from LDAP using the given username.
validateUserCredentials ( Illuminate\Contracts\Auth\Authenticatable $user, string $username, string $password ) : boolean

Protected Methods

Method Description
bindSystemUser ( $connection ) Bind the system user to the LDAP connection using the given credentials otherwise anonymous access is attempted.
buildFilter ( string $filterString, array $attrs ) : string Build a filter string by injecting common variables.
getConnection ( ) : resource Get the connection to the LDAP server.

Method Details

__construct() public method

LdapService constructor.
public __construct ( Ldap $ldap )
$ldap Ldap

bindSystemUser() protected method

Bind the system user to the LDAP connection using the given credentials otherwise anonymous access is attempted.
protected bindSystemUser ( $connection )
$connection

buildFilter() protected method

Build a filter string by injecting common variables.
protected buildFilter ( string $filterString, array $attrs ) : string
$filterString string
$attrs array
return string

getConnection() protected method

Creates a new connection if one does not exist.
protected getConnection ( ) : resource
return resource

getUserDetails() public method

User found via configurable user filter.
public getUserDetails ( $userName ) : array | null
$userName
return array | null

validateUserCredentials() public method

public validateUserCredentials ( Illuminate\Contracts\Auth\Authenticatable $user, string $username, string $password ) : boolean
$user Illuminate\Contracts\Auth\Authenticatable
$username string
$password string
return boolean

Property Details

$config protected_oe property

protected $config

$ldap protected_oe property

protected $ldap

$ldapConnection protected_oe property

protected $ldapConnection