Class addressbook_backend

Description

Generic backend that all other backends extend

Located in /functions/addressbook.php (line 875)


	
			
Direct descendents
Class Description
abook_local_file Backend for address book as a pipe separated file
abook_database Address book in a database backend
abook_ldap_server Address book backend for LDAP server
Variable Summary
string $bname
integer $bnum
string $btype
string $error
string $sname
bool $writeable
Method Summary
bool add (array $userdata)
string fullname (string $firstname, string $lastname)
bool list_addr ()
mixed lookup (string $value, [integer $field = SM_ABOOK_FIELD_NICKNAME])
bool modify (string $alias, array $newuserdata)
bool remove (string $alias)
bool search (string $expression)
bool set_error (string $string)
Variables
string $bname = 'dummy' (line 889)

Internal backend name


Redefined in descendants as:
integer $bnum = -1 (line 904)

Backend number

string $btype = 'dummy' (line 884)

Backend type

Can be 'local' or 'remote'

  • var: backend type

Redefined in descendants as:
string $error = '' (line 909)

Error messages

string $sname = 'Dummy backend' (line 894)

Displayed backend name


Redefined in descendants as:
bool $writeable = false (line 914)

Writeable flag


Redefined in descendants as:
Methods
add (line 982)

Add entry to backend

bool add (array $userdata)
  • array $userdata: userdata

Redefined in descendants as:
fullname (line 1018)

Creates full name from given name and surname

Handles name order differences. Function always runs in SquirrelMail gettext domain. Plugins don't have to switch domains before calling this function.

  • return: full name
  • since: 1.5.2
string fullname (string $firstname, string $lastname)
  • string $firstname: given name
  • string $lastname: surname
list_addr (line 972)

List all entries in backend

Working backend should provide this function or at least dummy function that returns empty array.

bool list_addr ()

Redefined in descendants as:
lookup (line 960)

Find entry in backend by the indicated field

  • return: Array with lookup results when the value was found, an empty array if the value was not found, or false if an error occured.
mixed lookup (string $value, [integer $field = SM_ABOOK_FIELD_NICKNAME])
  • string $value: The value to look up
  • integer $field: The field to look in, should be one of the SM_ABOOK_FIELD_* constants defined in include/constants.php NOTE: uniqueness is only guaranteed when the nickname field is used here; otherwise, the first matching address is returned.

Redefined in descendants as:
modify (line 1003)

Modify entry in backend

bool modify (string $alias, array $newuserdata)
  • string $alias: name used for id
  • array $newuserdata: new data

Redefined in descendants as:
remove (line 992)

Remove entry from backend

bool remove (string $alias)
  • string $alias: name used for id

Redefined in descendants as:
search (line 938)

Search for entries in backend

Working backend should support use of wildcards. * symbol should match one or more symbols. ? symbol should match any single symbol.

bool search (string $expression)
  • string $expression

Redefined in descendants as:
set_error (line 921)

Set error message

bool set_error (string $string)
  • string $string: error message

Documentation generated on Thu, 24 Apr 2014 04:17:05 +0200 by phpDocumentor 1.4.3