Model class to access an LDAP address directory
| package |
Framework |
|---|---|
| subpackage |
Addressbook |
__construct(array $p, boolean $debug = false, string $mail_domain = null)
arrayLDAP connection properties
booleanEnables debug mode
stringCurrent user mail domain name
_attr_name( $namev)
_connect()
_entry_sort_cmp( $a, $b)
_fetch_groups( $search = null, $mode, $vlv_page = null)
_ldap2result( $rec)
_list_group_members( $dn, $entry, $attr, $count) : array
arrayAccumulated group members
_list_group_memberurl( $dn, $entry, $count) : array
arrayAccumulated group members
_map_data( $save_cols)
_map_field( $field)
add_autovalues( &$attrs)
add_to_group(string $group_id, array|string $ids) : integer
stringGroup identifier
array|stringList of contact identifiers to be added
integerNumber of contacts added
close()
compare_search_value(string $colname, string|array $value, string $search, integer $mode) : boolean
stringData name
string|arrayData value
stringSearch value
integerSearch mode
booleanComparison result
compose_contact_key(array $contact, string $sort_col) : string
arrayContact record
stringSorting column name
stringUnique key
compose_display_name(array $contact, boolean $full_email = false) : string
arrayHash array with contact data as key-value pairs
booleanDon't attempt to extract components from the email address
stringDisplay name
compose_list_name(array $contact) : string
This respects the settings parameter how to list conacts.
arrayHash array with contact data as key-value pairs
stringList name
compose_search_name(array $contact, string $email = null, string $name = null, string $templ = null) : string
arrayHash array with contact data as key-value pairs
stringOptional email address
stringOptional name (self::compose_list_name() result)
stringOptional template to use (defaults to the 'contact_search_name' config option)
stringDisplay name
count() : \rcube_result_set
create_group(string $name) : mixed
stringThe group name
mixedFalse on error, array with record props in success
delete(array $ids, boolean $force = true)
arrayRecord identifiers
booleanRemove records irreversible (see self::undelete)
delete_all(boolean $with_groups = false)
booleanRemove also groups
delete_group(string $group_id) : boolean
stringGroup identifier
booleanTrue on success, false if no data was changed
dn_decode(string $str) : string
stringEncoded HTML identifier string
stringDN string
dn_encode(string $str) : string
stringDN string
stringEncoded HTML identifier string
extended_search(boolean $count = false) : integer|array
booleanReturn count instead of the records
integer|arrayCount of records or the result array (with 'count' item)
get_col_values(string $col, array $data, boolean $flat = false) : array
stringCol name
arrayRecord data array as used for saving
booleanTrue to return one array with all values, False for hash array with values grouped by type
arrayList of column values
get_error() : array
arrayHash array with the following fields: type, message
get_group(string $group_id) : array
stringGroup identifier
arrayGroup properties as hash array
get_group_entry( $group_id)
get_group_member_attr( $object_classes = array(), $default = 'member')
get_name()
get_record(mixed $id, boolean $assoc = false) : \rcube_result_set|array
mixedRecord identifier(s)
booleanTrue to return record as associative array, otherwise a result set is returned
\rcube_result_set|arrayResult object with all record fields
get_record_groups( $id) : array
| since | 0.5-beta |
|---|
array$id List of assigned groups as ID=>Name pairs
get_result() : \rcube_result_set
get_search_set() : mixed
mixedSearch properties used by this class
insert(array $save_data, boolean $check = false) : mixed
arrayAssociative array with save data Keys: Field name with optional section in the form FIELD:SECTION Values: Field value. Can be either a string or an array of strings for multiple values
booleanTrue to check for duplicates first
mixedThe created record ID on success, False on error
insertMultiple(\rcube_result_set $recset, boolean $check = false) : array
booleanTrue to check for duplicates first
arrayList of created record IDs
is_group_entry( $entry)
list_group_members( $dn, $count = false, $entries = null) : array
arrayAccumulated group members
list_groups(string $search = null, integer $mode) : array
stringOptional search string to match group name
integerSearch mode. Sum of self::SEARCH_*
arrayIndexed list of contact groups, each a hash array
list_records(array $cols = null, integer $subset) : array
arrayList of cols to show
integerOnly return this number of records, use negative values for tail
arrayIndexed list of contact records, each a hash array
normalize_string(string $str) : string
Currently only optimized for Latin-1 characters; to be extended
| deprecated |
since 0.9-beta |
|---|
stringInput string (UTF-8)
stringNormalized string
refresh_search() : mixed
mixedNew search set
remove_from_group(string $group_id, array|string $ids) : integer
stringGroup identifier
array|stringList of contact identifiers to be removed
integerNumber of deleted group members
rename_group(string $group_id, string $newname, &$newid) : boolean
stringGroup identifier
stringNew name to set for this group
booleanNew name on success, false if no data was changed
reset()
search(array $fields, string $value, integer $mode, boolean $select = true, boolean $nocount = false, array $required = array()) : object
arrayList of fields to search in
stringSearch value
integerSearch mode. Sum of self::SEARCH_*.
booleanTrue if results are requested, False if count only
booleanTrue to skip the count query (select only)
arrayList of fields that cannot be empty
objectrcube_result_set List of contact records and 'count' value
set_debug(boolean $dbg = true)
booleanTrue if LDAP commands should be logged
set_error(integer $type, string $message)
integerError type (one of this class' error constants)
stringError message (name of a text label)
set_group( $group_id)
set_page(\number $page)
\numberPage number to list
set_pagesize(\number $size)
\numberNumber of messages to display on one page
set_search_set(mixed $filter)
mixedSearch params to use in listing method, obtained by get_search_set()
set_sort_order(string $sort_col, string $sort_order = null)
stringSort column
stringSort order
undelete(array $ids)
arrayRecord identifiers
update(mixed $id, array $save_cols) : mixed
mixedRecord identifier
arrayAssociative array with save data Keys: Field name with optional section in the form FIELD:SECTION Values: Field value. Can be either a string or an array of strings for multiple values
mixedOn success if ID has been changed returns ID, otherwise True, False on error
validate( &$save_data, boolean $autofix = false) : boolean
If input isn't valid, the message to display can be fetched using get_error()
booleanAttempt to fix/complete record automatically
booleanTrue if input is valid, False if not.
ERROR_READ_ONLY
ERROR_NO_CONNECTION
ERROR_VALIDATE
ERROR_SAVING
ERROR_SEARCH
SEARCH_ALL
SEARCH_STRICT
SEARCH_PREFIX
SEARCH_GROUPS
primary_key :
groups :
readonly :
ready :
group_id :
coltypes :
export_groups :
ldap :
formats :
prop :
fieldmap :
filter :
sub_filter :
result :
ldap_result :
mail_domain :
debug :
group_types : array
| var |
|---|
array
base_dn :
groups_base_dn :
group_data :
group_search_cache :
cache :
searchonly :
undelete :
list_page :
page_size :
sort_col :
sort_order :
date_cols :
error :