PHP Class Vilma_Driver, horde

See the enclosed file LICENSE for license information (BSD). If you did not did not receive this file, see http://www.horde.org/licenses/bsd.
Author: Marko Djukic ([email protected])
Author: Daniel Collins ([email protected])
Afficher le fichier Open project: horde/horde Class Usage Examples

Protected Properties

Свойство Type Description
$_params array A hash containing any parameters for the current driver.

Méthodes publiques

Méthode Description
__construct ( array $params ) Constructor.
deleteAlias ( array $info ) Deletes alias records for a given user.
deleteDomain ( integer $domain_id ) Deletes a domain and all the users and virtuals within it.
deleteForward ( array $info ) Deletes forward records for a given user.
deleteUser ( integer $user_id ) Deletes a user.
deleteVirtual ( integer $virtual_id ) Deletes a virtual email.
factory ( string $driver = null, array $params = null ) : Vilma_Driver Attempts to return a concrete Vilma_Driver instance based on $driver.
getAddressInfo ( string $address, string $type = 'all' ) : array Returns an array of information related to the address passed in.
getAddresses ( string $domain, string $type = 'all', string $key = 'user_name', integer $direction ) : array Returns a list of all users, aliases, or groups and forwards for a domain.
getAllUsers ( ) : array Returns all the users sorted by domain and as arrays of each domain.
getDomain ( integer $domain_id ) : array Returns the specified domain information from the backend.
getDomainAdmin ( string $domain_name ) : string Returns the user who is the domain administrator.
getDomainByName ( $domain_name ) : array Given a domain name returns the information from the backend.
getDomainMaxUsers ( string $domain_name ) : integer Returns the maximum number of users allowed for a given domain.
getDomainNumUsers ( string $domain_name ) : integer Returns the current number of users for a domain.
getDomainQuota ( string $domain_name ) : integer Returns the configured quota for this domain.
getDomains ( ) : array Returns the list of domains from the backend.
getUser ( integer $user_id ) : array Returns the user information for a given user id.
getUserFormAttributes ( )
getUserStatus ( array $user ) : array Does a series of checks for a given user to determine the status.
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.
getVirtual ( integer $virtual_id ) : array Returns information for a virtual id.
getVirtuals ( string $filter ) : array Returns available virtual emails.
isBelowMaxUsers ( string $domain ) : boolean Checks if the given domain is below the maximum allowed users.
saveAlias ( array $info ) Saves or creates alias records for a user.
saveDomain ( array $info ) Saves a domain with the provided information.
saveForward ( array $info ) Saves or creates forward records for a given user.
saveUser ( $info )
saveVirtual ( array $info, string $domain ) Saves virtual email address to the backend.

Méthodes protégées

Méthode Description
_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.
_saveDomain ( array $info ) Saves a domain with the provided information.
_saveUser ( array $info ) : string Saves a user to the backend.

Method Details

__construct() public méthode

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

_deleteDomain() abstract protected méthode

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

_getAddresses() abstract protected méthode

Returns a list of all users, aliases, or groups and forwards for a domain.
abstract 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'.
Résultat array Account information for this domain.

_saveDomain() abstract protected méthode

Saves a domain with the provided information.
abstract protected _saveDomain ( array $info )
$info array Array of details to save the domain.

_saveUser() abstract protected méthode

Saves a user to the backend.
abstract protected _saveUser ( array $info ) : string
$info array The user information to save.
Résultat string The user ID.

deleteAlias() public méthode

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.

deleteDomain() public méthode

Deletes a domain and all the users and virtuals within it.
public deleteDomain ( integer $domain_id )
$domain_id integer The id of the domain to delete.

deleteForward() public méthode

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() abstract public méthode

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

deleteVirtual() public méthode

Deletes a virtual email.
public deleteVirtual ( integer $virtual_id )
$virtual_id integer The id of the virtual email to delete.

factory() public static méthode

Attempts to return a concrete Vilma_Driver instance based on $driver.
public static factory ( string $driver = null, array $params = null ) : Vilma_Driver
$driver string The type of concrete Vilma_Driver subclass to return.
$params array A hash containing any additional configuration or connection parameters a subclass might need.
Résultat Vilma_Driver The newly created concrete Vilma_Driver instance.

getAddressInfo() public méthode

This method may be overridden by the backend driver if there is a more efficient way to do this than a linear array search.
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'.
Résultat array Array of user information on success or empty array if the user does not exist.

getAddresses() public méthode

Returns a list of all users, aliases, or groups and forwards for a domain.
public getAddresses ( string $domain, string $type = 'all', string $key = 'user_name', integer $direction ) : array
$domain string Domain on which to search.
$type string Only return a specific type. One of 'all', 'user', 'alias', 'forward', or 'group'.
$key string Sort list by this key.
$direction integer Sort direction.
Résultat array Account information for this domain.

getAllUsers() public méthode

Returns all the users sorted by domain and as arrays of each domain.
public getAllUsers ( ) : array
Résultat array An array of domains then users for each domain.

getDomain() abstract public méthode

Returns the specified domain information from the backend.
abstract public getDomain ( integer $domain_id ) : array
$domain_id integer The id of the domain to fetch.
Résultat array The domain's information in an array.

getDomainAdmin() public méthode

Returns the user who is the domain administrator.
public getDomainAdmin ( string $domain_name ) : string
$domain_name string The name of the domain for which to return the administrator.
Résultat string The domain administrator.

getDomainByName() abstract public méthode

Given a domain name returns the information from the backend.
abstract public getDomainByName ( $domain_name ) : array
Résultat array The domain's information in an array.

getDomainMaxUsers() public méthode

Returns the maximum number of users allowed for a given domain.
public getDomainMaxUsers ( string $domain_name ) : integer
$domain_name string The name of the domain for which to return the maximum users.
Résultat integer The maximum number of allowed users.

getDomainNumUsers() abstract public méthode

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

getDomainQuota() public méthode

Returns the configured quota for this domain.
public getDomainQuota ( string $domain_name ) : integer
$domain_name string The name of the domain for which to return the quota.
Résultat integer The domain quota.

getDomains() abstract public méthode

Returns the list of domains from the backend.
abstract public getDomains ( ) : array
Résultat array All the domains and their data in an array.

getUser() abstract public méthode

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

getUserFormAttributes() public méthode

getUserStatus() public méthode

Does a series of checks for a given user to determine the status.
public getUserStatus ( array $user ) : array
$user array The user's details in an array as returned by the getUser() function.
Résultat array Either an array of error messages found during the checks or an array with a single element stating that the user is ready.

getUsers() abstract public méthode

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

getVirtual() public méthode

Returns information for a virtual id.
public getVirtual ( integer $virtual_id ) : array
$virtual_id integer The virtual id for which to return information.
Résultat array The virtual email information.

getVirtuals() public méthode

Returns available virtual emails.
public getVirtuals ( string $filter ) : array
$filter string If passed a domain then return all virtual emails for the domain, otherwise if passed a user name return all virtual emails for that user.
Résultat array The available virtual emails.

isBelowMaxUsers() public méthode

Checks if the given domain is below the maximum allowed users.
public isBelowMaxUsers ( string $domain ) : boolean
$domain string The domain name to check.
Résultat boolean True if the domain does not have a maximum limit (0) or current number of users is below the maximum number allowed.

saveAlias() public méthode

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.

saveDomain() public méthode

Saves a domain with the provided information.
public saveDomain ( array $info )
$info array Array of details to save the domain.

saveForward() public méthode

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.

saveUser() public méthode

public saveUser ( $info )

saveVirtual() public méthode

Saves virtual email address to the backend.
public saveVirtual ( array $info, string $domain )
$info array The virtual email data.
$domain string The name of the domain for this virtual email.

Property Details

$_params protected_oe property

A hash containing any parameters for the current driver.
protected array $_params
Résultat array