TITAN Library for PHP5  5.1.0
Web Software Development Kit for PHP5
ldap Class Reference

Titan LDAP Class. More...

Public Member Functions

 __construct (array $options=array())
 
 __destruct ()
 
 read_options ($options_file= '')
 
 set_option ($option, $value=NULL)
 
 get_option ($option)
 
 connect ()
 
 close ()
 
 login ($username, $password, $prevent_rebind=false)
 
 attr_modify ($distinguishedname, array $attributes)
 
 attr_delete ($distinguishedname, array $attributes)
 
 findBaseDn ()
 
 get_root_dse ($attributes=array("*","+"))
 
 get_last_error ()
 
folders ()
 
users ()
 

Data Fields

 $error = ''
 Error message, if any.
 

Protected Member Functions

 ldap_supported ()
 
 ldap_sasl_supported ()
 

Detailed Description

Titan LDAP Class.

Class: \tl\io\ldap\ldap

Author
James E. Bush work@.nosp@m.bush.nosp@m..cc
Version
5.1.0

Constants:

    define('TL_LDAP_NORMAL_ACCOUNT'          , 805306368);
    define('TL_LDAP_WORKSTATION_TRUST'       , 805306369);
    define('TL_LDAP_INTERDOMAIN_TRUST'       , 805306370);
    define('TL_LDAP_SECURITY_GLOBAL_GROUP'   , 268435456);
    define('TL_LDAP_DISTRIBUTION_GROUP'      , 268435457);
    define('TL_LDAP_SECURITY_LOCAL_GROUP'    , 536870912);
    define('TL_LDAP_DISTRIBUTION_LOCAL_GROUP', 536870913);
    define('TL_LDAP_FOLDER'                  , 'OU');
    define('TL_LDAP_CONTAINER'               , 'CN');
    define('TL_LDAP_LDAP_PORT' , '389');
    define('TL_LDAP_LDAPS_PORT', '636');

Constructor & Destructor Documentation

__construct ( array  $options = array())

Constructor

Parameters
array$options(optional) Array of options (default) [] = no options are set

Valid Options:

    $options      = array(
        'account_suffix'      => '',                  //  string '@domain.local'
        'admin_username'      => '',                  //  string
        'admin_password'      => '',                  //  string
        'base_dn'             => '',                  //  string 'DC=domain,DC=local'
        'connect'             => false,               //  bool Should the constructor try to connect?
        'controllers'         => array(),             //  array of domain controller hostnames
        'domain'              => '',                  //  string 'domain.local' - if set, fills account_suffix and base_dn
        'port'                => TL_LDAP_LDAP_PORT,   //  int
        'useSSL'              => false,               //  bool
        'useTLS'              => false,               //  bool
    );
__destruct ( )

Destructor

Disconnects LDAP

Member Function Documentation

read_options (   $options_file = '')

Read an options file and apply the options

Parameters
string$options_filePath and filename of the options file in .pconf format
set_option (   $option,
  $value = NULL 
)

Set an option after connected

Parameters
string$optionThe option to set
mixed$valueThe value to set
get_option (   $option)

Get the value of an option

Parameters
mixed$optionThe option to get its value
Returns
mixed The value of the option or NULL if not set
connect ( )

Connect to LDAP server using preset settings

close ( )

Closes the LDAP connection

login (   $username,
  $password,
  $prevent_rebind = false 
)

Validate a user's login credentials

Parameters
string$usernameThe user's username
string$passwordThe user's password
bool$prevent_rebind(optional) Preven the class from rebinding as the administrator (default) false
Returns
bool Success?
attr_modify (   $distinguishedname,
array  $attributes 
)

Modify an AD object

Parameters
string$distinguishednameThe object to modify
array$attributesAn array of attributes to modify
attr_delete (   $distinguishedname,
array  $attributes 
)

Remove attribute values from an AD object

Parameters
string$distinguishednameThe object to modify
array$attributesAn array of attributes to remove
findBaseDn ( )

Find the Base DN of your domain controller

Returns
string
get_root_dse (   $attributes = array("*", "+"))

Get the RootDSE properties from a domain controller

Parameters
array$attributesThe attributes you wish to query e.g. defaultnamingcontext
Returns
array
get_last_error ( )

Get last message from Active Directory

This function gets the last message, success or failure, from Active Directory

return string

ldap_supported ( )
protected

Detect LDAP support in php

Returns
bool
ldap_sasl_supported ( )
protected

Detect ldap_sasl_bind support in PHP

Returns
bool
& folders ( )

Return the current instance of \tl\io\ldap\folders

& users ( )

Return the current instance of \tl\io\ldap\users


The documentation for this class was generated from the following file: