PHP Class Vilma_Driver_Qmailldap, horde

See the enclosed file LICENSE for license information (BSD). If you did did not receive this file, see http://www.horde.org/licenses/bsd.
Author: Ben Klang ([email protected])
Author: David Cummings ([email protected])
Inheritance: extends Vilma_Driver_Sql
显示文件 Open project: horde/horde

Protected Properties

Property Type Description
$_fieldmap array Map of internal field names to LDAP attribute names.
$_ldap resource Reference to initialized LDAP driver.
$_users array Cache for retrieved getUsers() results.

Public Methods

Method Description
__construct ( array $params ) Constructor.
_connect ( )
deleteAlias ( array $info ) Deletes alias records for a given user.
deleteForward ( array $info ) Deletes forward records for a given user.
deleteUser ( integer $user_id ) Deletes a user.
getAddressInfo ( string $address, string $type = 'all' ) : array Returns an array of information related to the address passed in.
getDomainNumUsers ( string $domain_name ) : integer Returns the current number of users for a domain.
getUser ( integer $user_id ) : array Returns the user information for a given user id.
getUserFormAttributes ( )
getUsers ( string $domain = null ) : array Returns all available users, if a domain name is passed then limit the list of users only to those users.
saveAlias ( array $info ) Saves or creates alias records for a user.
saveForward ( array $info ) Saves or creates forward records for a given user.

Protected Methods

Method Description
_createUser ( array $info ) : array Creates a user in the backend.
_deleteDomain ( integer $domain_id ) Deletes a domain.
_getAddresses ( string $domain, string $type = 'all' ) : array Returns a list of all users, aliases, or groups and forwards for a domain.
_getAliases ( string $target = null ) : array Returns available email address aliases.
_getGroupsAndForwards ( string $acquire = null, string $domain = null ) : array Returns all available groups and forwards unless otherwise specified.
_saveUser ( array $info ) : array Saves a user to the backend.
_searchForUser ( string $email_id ) : array Searchs for a given email account.
_updateUser ( array $info ) : array Updates a user in the backend.

Method Details

__construct() public method

Constructor.
public __construct ( array $params )
$params array Any parameters needed for this driver.

_connect() public method

public _connect ( )

_createUser() protected method

Creates a user in the backend.
protected _createUser ( array $info ) : array
$info array The user information to save.
return array The user information.

_deleteDomain() protected method

Deletes a domain.
protected _deleteDomain ( integer $domain_id )
$domain_id integer The id of the domain to delete.

_getAddresses() protected method

Returns a list of all users, aliases, or groups and forwards for a domain.
protected _getAddresses ( string $domain, string $type = 'all' ) : array
$domain string Domain on which to search.
$type string Only return a specific type. One of 'all', 'user', 'alias','forward', or 'group'.
return array Account information for this domain

_getAliases() protected method

Returns available email address aliases.
protected _getAliases ( string $target = null ) : array
$target string If passed a domain then return all alias emails for the domain, otherwise if passed a user name return all virtual emails for that user.
return array The used email aliases.

_getGroupsAndForwards() protected method

If a domain name is passed then limit the results to groups or forwards in that domain.
protected _getGroupsAndForwards ( string $acquire = null, string $domain = null ) : array
$acquire string The default behavior is to acquire both groups and forwards; a value of 'group' will return only groups and a value of 'forward' will return only forwards.
$domain string The name of the domain from which to fetch.
return array The available groups and forwards with details.

_saveUser() protected method

Saves a user to the backend.
protected _saveUser ( array $info ) : array
$info array The user information to save.
return array The user information.

_searchForUser() protected method

Searchs for a given email account.
protected _searchForUser ( string $email_id ) : array
$email_id string The id of the account to be searched for.
return array Data for given email account on success or no information found.

_updateUser() protected method

Updates a user in the backend.
protected _updateUser ( array $info ) : array
$info array The user information to save.
return array The user information.

deleteAlias() public method

Deletes alias records for a given user.
public deleteAlias ( array $info )
$info array The info used to store the information. Required fields are: - 'address': The destination address (used for LDAP ID lookup). - 'alias': The alias we are deleting.

deleteForward() public method

Deletes forward records for a given user.
public deleteForward ( array $info )
$info array The info used to store the information. Required fields are: - 'address': The destination address (used for LDAP ID lookup). - 'forward': The forward we are deleting.

deleteUser() public method

Deletes a user.
public deleteUser ( integer $user_id )
$user_id integer The id of the user to delete.

getAddressInfo() public method

Returns an array of information related to the address passed in.
public getAddressInfo ( string $address, string $type = 'all' ) : array
$address string Address for which information will be pulled.
$type string Address type to request. One of 'all', 'user', 'alias', 'forward' or 'group'.
return array Array of user information on success or empty array if the user does not exist.

getDomainNumUsers() public method

Returns the current number of users for a domain.
public getDomainNumUsers ( string $domain_name ) : integer
$domain_name string The name of the domain for which to get the current number of users.
return integer The current number of users.

getUser() public method

Returns the user information for a given user id.
public getUser ( integer $user_id ) : array
$user_id integer The id of the user for which to fetch information.
return array The user information.

getUserFormAttributes() public method

getUsers() public method

Returns all available users, if a domain name is passed then limit the list of users only to those users.
public getUsers ( string $domain = null ) : array
$domain string The name of the domain for which to fetch the users.
return array The available users and their stored information.

saveAlias() public method

Saves or creates alias records for a user.
public saveAlias ( array $info )
$info array The info used to store the information. Required fields are: - 'address': The destination address (used for LDAP ID lookup). - 'alias_address': The alias to create or the new data for the modified entry. - 'alias': The alias we are modifying, if we are modifying an existing one.

saveForward() public method

Saves or creates forward records for a given user.
public saveForward ( array $info )
$info array The info used to store the information. Required fields are: - 'address': The destination address (used for LDAP ID lookup). - 'forward_address': The forward to create or the new data for the modified entry. - 'forward': The forward we are modifying, if we are modifying an existing one.

Property Details

$_fieldmap protected_oe property

Map of internal field names to LDAP attribute names.
protected array $_fieldmap
return array

$_ldap protected_oe property

Reference to initialized LDAP driver.
protected resource $_ldap
return resource

$_users protected_oe property

Cache for retrieved getUsers() results.
protected array $_users
return array