LDAP Account Manager

Ldap
in package

Ldap manages connection to LDAP and includes several helper functions.

Table of Contents

$conf  : mixed
Object of Config to access preferences
$is_connected  : mixed
LDAP connection established
$isActiveDirectory  : mixed
is Active Directory
$password  : mixed
LDAP password used for bind
$server  : mixed
Server handle
$username  : mixed
LDAP username used for bind
__construct()  : mixed
Creates a new LDAP object.
__sleep()  : mixed
Closes connection to LDAP server before serialization
__wakeup()  : mixed
Reconnects to LDAP server when deserialized
close()  : mixed
Closes connection to server
connect()  : mixed
Connects to the server using the given username and password
destroy()  : mixed
Closes connection to LDAP server and deletes encrypted username/password
encrypt_login()  : mixed
Encrypts username and password
getPassword()  : string
Returns the LDAP password.
getUserName()  : string
Returns the LDAP user name.
isActiveDirectory()  : bool
Returns if the LDAP server is an Active Directory.
server()  : object
Returns the LDAP connection handle
tryAndApplyNewPassword()  : void
Checks if the given password is the new password to use for the current user.

Properties

$conf

Object of Config to access preferences

private mixed $conf

$is_connected

LDAP connection established

private mixed $is_connected = \false

$isActiveDirectory

is Active Directory

private mixed $isActiveDirectory

$password

LDAP password used for bind

private mixed $password

$server

Server handle

private mixed $server

$username

LDAP username used for bind

private mixed $username

Methods

__construct()

Creates a new LDAP object.

public __construct(object $config) : mixed
Parameters
$config : object

an object of class Config

Return values
mixed

__sleep()

Closes connection to LDAP server before serialization

public __sleep() : mixed
Return values
mixed

__wakeup()

Reconnects to LDAP server when deserialized

public __wakeup() : mixed
Return values
mixed

close()

Closes connection to server

public close() : mixed
Return values
mixed

connect()

Connects to the server using the given username and password

public connect(string $user, string $passwd[, bool $allowAnonymous = false ]) : mixed
Parameters
$user : string

user name

$passwd : string

password

$allowAnonymous : bool = false

specifies if anonymous binds are allowed

Tags
throws
LAMException

unable to connect

Return values
mixed

destroy()

Closes connection to LDAP server and deletes encrypted username/password

public destroy() : mixed
Return values
mixed

encrypt_login()

Encrypts username and password

public encrypt_login(string $username, string $password) : mixed
Parameters
$username : string

LDAP user name

$password : string

LDAP password

Return values
mixed

getPassword()

Returns the LDAP password.

public getPassword() : string
Return values
string

password

getUserName()

Returns the LDAP user name.

public getUserName() : string
Return values
string

user name

isActiveDirectory()

Returns if the LDAP server is an Active Directory.

public isActiveDirectory() : bool
Return values
bool

is Active Directory

server()

Returns the LDAP connection handle

public server() : object
Return values
object

connection handle

tryAndApplyNewPassword()

Checks if the given password is the new password to use for the current user.

public tryAndApplyNewPassword(string $newPassword) : void
Parameters
$newPassword : string

new password

Return values
void

Search results