Class rcube_ldap_addressbook

Description

Model class to access an LDAP address directory

Located in /lib/Roundcube/rcube_ldap_addressbook.php (line 31)

rcube_addressbook
   |
   --rcube_ldap_addressbook
Variable Summary
 mixed $coltypes
 mixed $conn
 mixed $debug
 mixed $fieldmap
 mixed $filter
 mixed $groups
 mixed $group_id
 mixed $ldap
 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_addressbook __construct (array $p, [boolean $debug = false], [string $mail_domain = null])
 int add_to_group (string $group_id, array $contact_ids)
 void close ()
 object rcube_result_set count ()
 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 $id, [boolean $assoc = false])
 array get_record_groups (mixed $contact_id)
 object rcube_result_set get_result ()
 mixed get_search_set ()
 encoded insert (array $save_cols)
 array list_groups ([string $search = null])
 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 $contact_ids)
 boolean rename_group (string $group_id, string $new_name, string &$new_gid)
 void reset ()
 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_page (number $page)
 void set_pagesize (number $size)
 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 39)
  • access: public

Redefinition of:
rcube_addressbook::$coltypes
mixed $conn (line 44)
  • access: protected
mixed $debug = false (line 52)
  • access: protected
mixed $fieldmap = array() (line 46)
  • access: protected
mixed $filter = '' (line 48)
  • access: protected
mixed $groups = false (line 35)
  • access: public

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

Redefinition of:
rcube_addressbook::$group_id
mixed $ldap (line 42)

private properties

  • access: protected
mixed $ldap_result = null (line 50)
  • access: protected
mixed $mail_domain = '' (line 51)
  • access: protected
mixed $primary_key = 'ID' (line 34)

public properties

  • access: public

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

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

Redefinition of:
rcube_addressbook::$ready
mixed $result = null (line 49)
  • access: protected
mixed $sub_filter (line 47)
  • 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 1777)

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 1763)

HTML-safe DN string encoding

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

Object constructor

rcube_ldap_addressbook __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_to_group (line 1618)

Add the given contact records the a certain group

  • return: Number of contacts added
int add_to_group (string $group_id, array $contact_ids)
  • string $group_id: Group identifier
  • array $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
close (line 318)

Close connection to LDAP server

void close ()

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

Count number of available contacts in database

  • return: Resultset with values for 'count' and 'first'
object rcube_result_set count ()

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

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 1183)

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 1228)

Remove all contact records

void delete_all ()

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

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 1516)

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 332)

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 818)

Get a specific contact record

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

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

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 804)

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 391)

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 932)

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
list_groups (line 1412)

List all active contact groups of this source

  • return: Indexed list of contact groups, each a hash array
array list_groups ([string $search = null])
  • string $search: Optional search string to match group name

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

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 429)

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 1652)

Remove the given contact records from a certain group

  • return: Number of deleted group members
int remove_from_group (string $group_id, array $contact_ids)
  • string $group_id: Group identifier
  • array $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 1590)

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 413)

Reset all saved results and search parameters

void reset ()

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

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 403)

Activate/deactivate debug mode

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

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_page (line 343)

Set internal list page

void set_page (number $page)
  • number $page: Page number to list

Redefinition of:
rcube_addressbook::set_page()
Set internal list page
set_pagesize (line 354)

Set internal page size

void set_pagesize (number $size)
  • number $size: Number of records to display on one page

Redefinition of:
rcube_addressbook::set_pagesize()
Set internal page size
set_search_set (line 380)

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 367)

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 1000)

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 860)

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 626)

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