squirrelmail-webmail  1.4.22
About: SquirrelMail is a standards-based webmail package with strong MIME support, address books, and folder manipulation (written in PHP4).
  Fossies Dox: squirrelmail-webmail-1.4.22.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

abook_database Class Reference
Inheritance diagram for abook_database:
[legend]
Collaboration diagram for abook_database:
[legend]

Public Member Functions

 abook_database ($param)
 
 open ($new=false)
 
 close ()
 
 get_field_name ($field)
 
 search ($expr)
 
 lookup ($value, $field=SM_ABOOK_FIELD_NICKNAME)
 
 list_addr ()
 
 add ($userdata)
 
 remove ($alias)
 
 modify ($alias, $userdata)
 
- Public Member Functions inherited from addressbook_backend
 set_error ($string)
 

Public Attributes

 $btype = 'local'
 
 $bname = 'database'
 
 $dsn = ''
 
 $table = ''
 
 $owner = ''
 
 $dbh = false
 
 $writeable = true
 
 $listing = true
 
- Public Attributes inherited from addressbook_backend
 $btype = 'dummy'
 
 $bname = 'dummy'
 
 $sname = 'Dummy backend'
 
 $bnum = -1
 
 $error = ''
 
 $writeable = false
 

Detailed Description

Definition at line 53 of file abook_database.php.

Member Function Documentation

◆ abook_database()

abook_database::abook_database (   $param)

Constructor

Parameters
array$paramaddress book backend options

Definition at line 104 of file abook_database.php.

References _(), open(), and addressbook_backend\set_error().

◆ add()

abook_database::add (   $userdata)

Add address

Parameters
array$userdataadded data
Returns
bool

Reimplemented from addressbook_backend.

Definition at line 366 of file abook_database.php.

References $r, $ret, _(), lookup(), open(), addressbook_backend\set_error(), and sprintf.

◆ close()

abook_database::close ( )

Close the file and forget the filehandle

Definition at line 177 of file abook_database.php.

Referenced by open().

◆ get_field_name()

abook_database::get_field_name (   $field)

Determine internal database field name given one of the SquirrelMail SM_ABOOK_FIELD_* constants

Parameters
integer$fieldThe SM_ABOOK_FIELD_* contant to look up
Returns
string The desired field name, or the string "ERROR" if the $field is not understood (the caller is responsible for handing errors)

Definition at line 193 of file abook_database.php.

References SM_ABOOK_FIELD_EMAIL, SM_ABOOK_FIELD_FIRSTNAME, SM_ABOOK_FIELD_LABEL, SM_ABOOK_FIELD_LASTNAME, and SM_ABOOK_FIELD_NICKNAME.

Referenced by lookup().

◆ list_addr()

abook_database::list_addr ( )

List all addresses

Returns
array search results

Reimplemented from addressbook_backend.

Definition at line 327 of file abook_database.php.

References $ret, _(), open(), addressbook_backend\set_error(), and sprintf.

◆ lookup()

abook_database::lookup (   $value,
  $field = SM_ABOOK_FIELD_NICKNAME 
)

Lookup by the indicated field

Parameters
string$valueValue to look up
integer$fieldThe field to look in, should be one of the SM_ABOOK_FIELD_* constants defined in functions/constants.php (OPTIONAL; defaults to nickname field) NOTE: uniqueness is only guaranteed when the nickname field is used here; otherwise, the first matching address is returned.
Returns
array search results

Reimplemented from addressbook_backend.

Definition at line 288 of file abook_database.php.

References _(), get_field_name(), open(), addressbook_backend\set_error(), and sprintf.

Referenced by add(), and modify().

◆ modify()

abook_database::modify (   $alias,
  $userdata 
)

Modify address

Parameters
string$aliasmodified alias
array$userdatanew data
Returns
bool

Reimplemented from addressbook_backend.

Definition at line 447 of file abook_database.php.

References addressbook_backend\$error, $owner, $r, $ret, _(), lookup(), open(), addressbook_backend\set_error(), and sprintf.

◆ open()

abook_database::open (   $new = false)

Open the database.

Parameters
bool$newnew connection if it is true
Returns
bool

field names are lowercased. We use unquoted identifiers and they use upper case in Oracle

Definition at line 143 of file abook_database.php.

References $dbh, _(), close(), addressbook_backend\set_error(), and sprintf.

Referenced by abook_database(), add(), list_addr(), lookup(), modify(), remove(), and search().

◆ remove()

abook_database::remove (   $alias)

Delete address

Parameters
string$aliasalias that has to be deleted
Returns
bool

Reimplemented from addressbook_backend.

Definition at line 409 of file abook_database.php.

References $r, _(), open(), addressbook_backend\set_error(), and sprintf.

◆ search()

abook_database::search (   $expr)

Search the database

Parameters
string$exprsearch expression
Returns
array search results

Reimplemented from addressbook_backend.

Definition at line 217 of file abook_database.php.

References $ret, _(), open(), addressbook_backend\set_error(), and sprintf.

Member Data Documentation

◆ $bname

abook_database::$bname = 'database'

Definition at line 63 of file abook_database.php.

◆ $btype

abook_database::$btype = 'local'

Definition at line 58 of file abook_database.php.

◆ $dbh

abook_database::$dbh = false

Definition at line 86 of file abook_database.php.

Referenced by open().

◆ $dsn

abook_database::$dsn = ''

Definition at line 69 of file abook_database.php.

◆ $listing

abook_database::$listing = true

Definition at line 96 of file abook_database.php.

◆ $owner

abook_database::$owner = ''

Definition at line 81 of file abook_database.php.

Referenced by modify().

◆ $table

abook_database::$table = ''

Definition at line 74 of file abook_database.php.

◆ $writeable

abook_database::$writeable = true

Definition at line 91 of file abook_database.php.


The documentation for this class was generated from the following file: