Class addressbook_backend

Description

Generic backend that all other backends extend

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


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

Internal backend name


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

Backend number

string $btype = 'dummy' (line 891)

Backend type

Can be 'local' or 'remote'

  • var: backend type

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

Error messages

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

Displayed backend name


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

Writeable flag


Redefined in descendants as:
Methods
add (line 989)

Add entry to backend

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

Redefined in descendants as:
fullname (line 1025)

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

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

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

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

Remove entry from backend

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

Redefined in descendants as:
search (line 945)

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

Set error message

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

Documentation generated on Mon, 13 Jan 2020 04:21:59 +0100 by phpDocumentor 1.4.3