Class rcube_ldap

Description

Model class to access an LDAP address directory

Located in /lib/Roundcube/rcube_ldap.php (line 28)

rcube_addressbook
   |
   --rcube_ldap
Variable Summary
 mixed $coltypes
 mixed $conn
 mixed $debug
 mixed $fieldmap
 mixed $filter
 mixed $groups
 mixed $group_id
 mixed $ldap_result
 mixed $mail_domain
 mixed $primary_key
 mixed $prop
 mixed $readonly
 mixed $ready
 mixed $result
 mixed $sub_filter
Method Summary
 static string dn_decode (string $str)
 static string dn_encode (string $str)
 rcube_ldap __construct (array $p, [boolean $debug = false], [string $mail_domain = null])
 void add_autovalues (array &$attrs)
 int add_to_group (string $group_id, array|string $contact_ids)
 boolean bind (string $dn, string $pass)
 void close ()
 mixed create_group (string $group_name)
 boolean delete (array $ids, [boolean $force = true])
 void delete_all ()
 boolean delete_group (string $group_id)
 array get_group (string $group_id)
 string get_name ()
 mixed get_record (mixed $dn, [boolean $assoc = false])
 array get_record_groups (mixed $contact_id)
 mixed get_search_set ()
 encoded insert (array $save_cols)
 void ldap_add ( $dn,  $entry)
 void ldap_delete ( $dn)
 void ldap_list ( $dn,  $filter, [ $attrs = array('')])
 void ldap_mod_add ( $dn,  $entry)
 void ldap_mod_del ( $dn,  $entry)
 void ldap_mod_replace ( $dn,  $entry)
 void ldap_rename ( $dn,  $newrdn, [ $newparent = null], [ $deleteoldrdn = true])
 array list_groups ([string $search = null], [int $mode = 0])
 array list_group_members (string $dn, [array $count = false], [ $entries = null])
 array list_records ([array $cols = null], [int $subset = 0])
 int remove_from_group (string $group_id, array|string $contact_ids)
 boolean rename_group (string $group_id, string $new_name, string &$new_gid)
 void reset ()
 boolean sasl_bind (string $authc, string $pass, [string $authz = null])
 array search (mixed $fields, mixed $value, [int $mode = 0], [boolean $select = true], [boolean $nocount = false], [array $required = array()])
 void set_debug ([boolean $dbg = true])
 void set_group ( $group_id)
 void set_search_set (string $filter)
 void set_sort_order (string $sort_col, [string $sort_order = null])
 boolean update (mixed $id, array $save_cols)
 boolean validate (array &$save_data, [boolean $autofix = false])
 void _entry_sort_cmp ( $a,  $b)
Variables
mixed $coltypes = array() (line 36)
  • access: public

Redefinition of:
rcube_addressbook::$coltypes
mixed $conn (line 39)

private properties

  • access: protected
mixed $debug = false (line 47)
  • access: protected
mixed $fieldmap = array() (line 41)
  • access: protected
mixed $filter = '' (line 43)
  • access: protected
mixed $groups = false (line 32)
  • access: public

Redefinition of:
rcube_addressbook::$groups
mixed $group_id = 0 (line 35)
  • access: public

Redefinition of:
rcube_addressbook::$group_id
mixed $ldap_result = null (line 45)
  • access: protected
mixed $mail_domain = '' (line 46)
  • access: protected
mixed $primary_key = 'ID' (line 31)

public properties

  • access: public

Redefinition of:
rcube_addressbook::$primary_key
public properties (mandatory)
mixed $prop = array() (line 40)
  • access: protected
mixed $readonly = true (line 33)
  • access: public

Redefinition of:
rcube_addressbook::$readonly
mixed $ready = false (line 34)
  • access: public

Redefinition of:
rcube_addressbook::$ready
mixed $result = null (line 44)
  • access: protected
mixed $sub_filter (line 42)
  • access: protected

Inherited Variables

Inherited from rcube_addressbook

rcube_addressbook::$date_cols
rcube_addressbook::$error
rcube_addressbook::$list_page
rcube_addressbook::$page_size
rcube_addressbook::$searchonly
rcube_addressbook::$sort_col
rcube_addressbook::$sort_order
rcube_addressbook::$undelete
Methods
static dn_decode (line 2241)

Decodes DN string encoded with _dn_encode()

  • return: DN string
string dn_decode (string $str)
  • string $str: Encoded HTML identifier string
static dn_encode (line 2227)

HTML-safe DN string encoding

  • return: Encoded HTML identifier string
string dn_encode (string $str)
  • string $str: DN string
Constructor __construct (line 65)

Object constructor

rcube_ldap __construct (array $p, [boolean $debug = false], [string $mail_domain = null])
  • array $p: LDAP connection properties
  • boolean $debug: Enables debug mode
  • string $mail_domain: Current user mail domain name
add_autovalues (line 1397)

Generate missing attributes as configured

  • access: protected
void add_autovalues (array &$attrs)
  • array &$attrs: LDAP record attributes
add_to_group (line 1949)

Add the given contact records the a certain group

  • return: Number of contacts added
int add_to_group (string $group_id, array|string $contact_ids)
  • string $group_id: Group identifier
  • array|string $contact_ids: List of contact identifiers to be added

Redefinition of:
rcube_addressbook::add_to_group()
Add the given contact records the a certain group
bind (line 421)

Bind connection with DN and password

  • return: True on success, False on error
  • access: public
boolean bind (string $dn, string $pass)
  • string $dn: Bind DN
  • string $pass: Bind password
close (line 449)

Close connection to LDAP server

void close ()

Redefinition of:
rcube_addressbook::close()
Close connection to source
count (line 912)

Count number of available contacts in database

  • return: Resultset with values for 'count' and 'first'

Redefinition of:
rcube_addressbook::count()
Count number of available contacts in database
create_group (line 1863)

Create a contact group with the given name

  • return: False on error, array with record props in success
mixed create_group (string $group_name)
  • string $group_name: The group name

Redefinition of:
rcube_addressbook::create_group()
Create a contact group with the given name
delete (line 1334)

Mark one or more contact records as deleted

  • return: True on success, False on error
boolean delete (array $ids, [boolean $force = true])
  • array $ids: Record identifiers
  • boolean $force: Remove record(s) irreversible (unsupported)

Redefinition of:
rcube_addressbook::delete()
Mark one or more contact records as deleted
delete_all (line 1379)

Remove all contact records

void delete_all ()

Redefinition of:
rcube_addressbook::delete_all()
Mark all records in database as deleted
delete_group (line 1893)

Delete the given group and all linked group members

  • return: True on success, false if no data was changed
boolean delete_group (string $group_id)
  • string $group_id: Group identifier

Redefinition of:
rcube_addressbook::delete_group()
Delete the given group and all linked group members
get_group (line 1846)

Get group properties such as name and email address(es)

  • return: Group properties as hash array
array get_group (string $group_id)
  • string $group_id: Group identifier

Redefinition of:
rcube_addressbook::get_group()
Get group properties such as name and email address(es)
get_name (line 465)

Returns address book name

  • return: Address book name
string get_name ()

Redefinition of:
rcube_addressbook::get_name()
Returns addressbook name (e.g. for addressbooks listing)
get_record (line 954)

Get a specific contact record

  • return: Hash array or rcube_result_set with all record fields
mixed get_record (mixed $dn, [boolean $assoc = false])
  • mixed $dn: Record identifier
  • boolean $assoc: Return as associative array

Redefinition of:
rcube_addressbook::get_record()
Get a specific contact record
get_record_groups (line 2019)

Get group assignments of a specific contact record

  • return: List of assigned groups as ID=>Name pairs
  • since: 0.5-beta
array get_record_groups (mixed $contact_id)
  • mixed $contact_id: Record identifier

Redefinition of:
rcube_addressbook::get_record_groups()
Get group assignments of a specific contact record
get_result (line 940)

Return the last result set

  • return: Current resultset or NULL if nothing selected yet
object rcube_result_set get_result ()

Redefinition of:
rcube_addressbook::get_result()
Return the last result set
get_search_set (line 500)

Getter for saved search properties

  • return: Search properties used by this class
mixed get_search_set ()

Redefinition of:
rcube_addressbook::get_search_set()
Getter for saved search properties
insert (line 1080)

Create a new contact record

  • return: record ID on success, False on error
encoded insert (array $save_cols)
  • array $save_cols: Hash array with save data

Redefinition of:
rcube_addressbook::insert()
Create a new contact record
ldap_add (line 2250)

Wrapper for ldap_add()

  • access: protected
void ldap_add ( $dn,  $entry)
  • $dn
  • $entry
ldap_delete (line 2267)

Wrapper for ldap_delete()

  • access: protected
void ldap_delete ( $dn)
  • $dn
ldap_list (line 2348)

Wrapper for ldap_list()

  • access: protected
void ldap_list ( $dn,  $filter, [ $attrs = array('')])
  • $dn
  • $filter
  • $attrs
ldap_mod_add (line 2300)

Wrapper for ldap_mod_add()

  • access: protected
void ldap_mod_add ( $dn,  $entry)
  • $dn
  • $entry
ldap_mod_del (line 2316)

Wrapper for ldap_mod_del()

  • access: protected
void ldap_mod_del ( $dn,  $entry)
  • $dn
  • $entry
ldap_mod_replace (line 2284)

Wrapper for ldap_mod_replace()

  • access: protected
void ldap_mod_replace ( $dn,  $entry)
  • $dn
  • $entry
ldap_rename (line 2332)

Wrapper for ldap_rename()

  • access: protected
void ldap_rename ( $dn,  $newrdn, [ $newparent = null], [ $deleteoldrdn = true])
  • $dn
  • $newrdn
  • $newparent
  • $deleteoldrdn
list_groups (line 1740)

List all active contact groups of this source

  • return: Indexed list of contact groups, each a hash array
array list_groups ([string $search = null], [int $mode = 0])
  • string $search: Optional search string to match group name
  • int $mode: Matching mode:
    1. - partial (*abc*),
    2. - strict (=),
    3. - prefix (abc*)

Redefinition of:
rcube_addressbook::list_groups()
List all active contact groups of this source
list_group_members (line 596)

Get all members of the given group

  • return: Accumulated group members
array list_group_members (string $dn, [array $count = false], [ $entries = null])
  • string $dn: Group DN
  • array $count: Group entries (if called recursively)
  • $entries
list_records (line 525)

List the current set of contact records

  • return: Indexed list of contact records, each a hash array
array list_records ([array $cols = null], [int $subset = 0])
  • array $cols: List of cols to show
  • int $subset: Only return this number of records

Redefinition of:
rcube_addressbook::list_records()
List the current set of contact records
remove_from_group (line 1984)

Remove the given contact records from a certain group

  • return: Number of deleted group members
int remove_from_group (string $group_id, array|string $contact_ids)
  • string $group_id: Group identifier
  • array|string $contact_ids: List of contact identifiers to be removed

Redefinition of:
rcube_addressbook::remove_from_group()
Remove the given contact records from a certain group
rename_group (line 1920)

Rename a specific contact group

  • return: New name on success, false if no data was changed
boolean rename_group (string $group_id, string $new_name, string &$new_gid)
  • string $group_id: Group identifier
  • string $new_name: New name to set for this group
  • string &$new_gid: New group identifier (if changed, otherwise don't set)

Redefinition of:
rcube_addressbook::rename_group()
Rename a specific contact group
reset (line 509)

Reset all saved results and search parameters

void reset ()

Redefinition of:
rcube_addressbook::reset()
Reset saved results and search parameters
sasl_bind (line 370)

Bind connection with (SASL-) user and password

  • return: True on success, False on error
  • access: public
boolean sasl_bind (string $authc, string $pass, [string $authz = null])
  • string $authc: Authentication user
  • string $pass: Bind password
  • string $authz: Autorization user
search (line 762)

Search contacts

  • return: Indexed list of contact records and 'count' value
array search (mixed $fields, mixed $value, [int $mode = 0], [boolean $select = true], [boolean $nocount = false], [array $required = array()])
  • mixed $fields: The field name of array of field names to search in
  • mixed $value: Search value (or array of values when $fields is array)
  • int $mode: Matching mode:
    1. - partial (*abc*),
    2. - strict (=),
    3. - prefix (abc*)
  • boolean $select: True if results are requested, False if count only
  • boolean $nocount: (Not used)
  • array $required: List of fields that cannot be empty

Redefinition of:
rcube_addressbook::search()
Search records
set_debug (line 1677)

Activate/deactivate debug mode

  • access: public
void set_debug ([boolean $dbg = true])
  • boolean $dbg: True if LDAP commands should be logged
set_group (line 1712)

Setter for the current group

(empty, has to be re-implemented by extending class)

void set_group ( $group_id)
  • $group_id

Redefinition of:
rcube_addressbook::set_group()
Setter for the current group
set_search_set (line 489)

Save a search string for future listings

void set_search_set (string $filter)
  • string $filter: Filter string

Redefinition of:
rcube_addressbook::set_search_set()
Save a search string for future listings
set_sort_order (line 477)

Set internal sort settings

void set_sort_order (string $sort_col, [string $sort_order = null])
  • string $sort_col: Sort column
  • string $sort_order: Sort order

Redefinition of:
rcube_addressbook::set_sort_order()
Set internal sort settings
update (line 1151)

Update a specific contact record

  • return: True on success, False on error
boolean update (mixed $id, array $save_cols)
  • mixed $id: Record identifier
  • array $save_cols: Hash array with save data

Redefinition of:
rcube_addressbook::update()
Update a specific contact record
validate (line 1008)

Check the given data before saving.

If input not valid, the message to display can be fetched using get_error()

  • return: True if input is valid, False if not.
  • access: public
boolean validate (array &$save_data, [boolean $autofix = false])
  • array &$save_data: Assoziative array with data to save
  • boolean $autofix: Try to fix/complete record automatically

Redefinition of:
rcube_addressbook::validate()
Check the given data before saving.
_entry_sort_cmp (line 741)

Callback for sorting entries

void _entry_sort_cmp ( $a,  $b)
  • $a
  • $b

Inherited Methods

Inherited From rcube_addressbook

 rcube_addressbook::add_to_group()
 rcube_addressbook::close()
 rcube_addressbook::compare_search_value()
 rcube_addressbook::compose_contact_key()
 rcube_addressbook::compose_display_name()
 rcube_addressbook::compose_list_name()
 rcube_addressbook::count()
 rcube_addressbook::create_group()
 rcube_addressbook::delete()
 rcube_addressbook::delete_all()
 rcube_addressbook::delete_group()
 rcube_addressbook::get_col_values()
 rcube_addressbook::get_error()
 rcube_addressbook::get_group()
 rcube_addressbook::get_name()
 rcube_addressbook::get_record()
 rcube_addressbook::get_record_groups()
 rcube_addressbook::get_result()
 rcube_addressbook::get_search_set()
 rcube_addressbook::insert()
 rcube_addressbook::insertMultiple()
 rcube_addressbook::list_groups()
 rcube_addressbook::list_records()
 rcube_addressbook::normalize_string()
 rcube_addressbook::refresh_search()
 rcube_addressbook::remove_from_group()
 rcube_addressbook::rename_group()
 rcube_addressbook::reset()
 rcube_addressbook::search()
 rcube_addressbook::set_error()
 rcube_addressbook::set_group()
 rcube_addressbook::set_page()
 rcube_addressbook::set_pagesize()
 rcube_addressbook::set_search_set()
 rcube_addressbook::set_sort_order()
 rcube_addressbook::undelete()
 rcube_addressbook::update()
 rcube_addressbook::validate()
Class Constants

Documentation generated on Fri, 03 May 2013 12:45:03 +0200 by phpDocumentor 1.4.4