lib/ldap.inc

Properties

Description

ldap.inc provides basic functions to connect to the OpenLDAP server.

Functions

convertHex2bin( string   $value, ) : \binary

Description

Converts a HEX string to a binary value

Arguments

Name Type Description Default
$value string

HEX string

Return value

Type Description
\binary result binary

Classes

Ldap

Properties

 
 
LDAP  
No 
No 

Description

Ldap manages connection to LDAP and includes several helper functions.

Methods

__construct, __sleep, __wakeup, close, connect, decrypt, decrypt_login, destroy, encrypt, encrypt_login, server,

__construct( object   $config, ) : n/a

Description

Creates a new LDAP object.

Arguments

Name Type Description Default
$config object

an object of class Config

Return value

Type Description
n/a n/a

__sleep( ) : n/a

Description

Closes connection to LDAP server before serialization

Return value

Type Description
n/a n/a

__wakeup( ) : n/a

Description

Reconnects to LDAP server when deserialized

Return value

Type Description
n/a n/a

close( ) : n/a

Description

Closes connection to server

Return value

Type Description
n/a n/a

connect( string   $user, string   $passwd, boolean   $allowAnonymous = false, ) : mixed

Description

Connects to the server using the given username and password

Arguments

Name Type Description Default
$user string

user name

$passwd string

password

$allowAnonymous boolean

specifies if anonymous binds are allowed

false

Return value

Type Description
mixed if connect succeeds the server handle is returned, else false

decrypt( object   $data, string   $prefix = '', ) : string

Description

Decrypts a string

Arguments

Name Type Description Default
$data object

string to decrypt

$prefix string

prefix for cookie names

''

Return value

Type Description
string decrypted string

decrypt_login( ) : array

Description

Decrypts username and password

Return value

Type Description
array array(user name, password)

destroy( ) : n/a

Description

Closes connection to LDAP server and deletes encrypted username/password

Return value

Type Description
n/a n/a

encrypt( string   $data, string   $prefix = '', ) : object

Description

Encrypts a string

Arguments

Name Type Description Default
$data string

string to encrypt

$prefix string

prefix for cookie names

''

Return value

Type Description
object encrypted string

encrypt_login( string   $username, string   $password, ) : n/a

Description

Encrypts username and password

Arguments

Name Type Description Default
$username string

LDAP user name

$password string

LDAP password

Return value

Type Description
n/a n/a

server( ) : object

Description

Returns the LDAP connection handle

Return value

Type Description
object connection handle

Properties

$conf, $is_connected, $password, $server, $username,

  private  $conf =

Object of Config to access preferences


  private  $is_connected = false

LDAP connection established


  private  $password =

LDAP password used for bind


  private  $server =

Server handle


  private  $username =

LDAP username used for bind


Documentation was generated by phpDocumentor 2.0.1 .

Namespaces

  • global

    Packages