PHP 클래스 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.
저자: Marko Djukic ([email protected])
저자: Daniel Collins ([email protected])
파일 보기 프로젝트 열기: horde/horde 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_params array A hash containing any parameters for the current driver.

공개 메소드들

메소드 설명
__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.

보호된 메소드들

메소드 설명
_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.

메소드 상세

__construct() 공개 메소드

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

_deleteDomain() 추상적인 보호된 메소드

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

_getAddresses() 추상적인 보호된 메소드

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'.
리턴 array Account information for this domain.

_saveDomain() 추상적인 보호된 메소드

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

_saveUser() 추상적인 보호된 메소드

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

deleteAlias() 공개 메소드

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() 공개 메소드

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() 공개 메소드

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() 추상적인 공개 메소드

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

deleteVirtual() 공개 메소드

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

factory() 공개 정적인 메소드

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.
리턴 Vilma_Driver The newly created concrete Vilma_Driver instance.

getAddressInfo() 공개 메소드

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'.
리턴 array Array of user information on success or empty array if the user does not exist.

getAddresses() 공개 메소드

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.
리턴 array Account information for this domain.

getAllUsers() 공개 메소드

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

getDomain() 추상적인 공개 메소드

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.
리턴 array The domain's information in an array.

getDomainAdmin() 공개 메소드

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.
리턴 string The domain administrator.

getDomainByName() 추상적인 공개 메소드

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

getDomainMaxUsers() 공개 메소드

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.
리턴 integer The maximum number of allowed users.

getDomainNumUsers() 추상적인 공개 메소드

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.
리턴 integer The current number of users.

getDomainQuota() 공개 메소드

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.
리턴 integer The domain quota.

getDomains() 추상적인 공개 메소드

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

getUser() 추상적인 공개 메소드

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.
리턴 array The user information.

getUserFormAttributes() 공개 메소드

getUserStatus() 공개 메소드

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.
리턴 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() 추상적인 공개 메소드

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.
리턴 array The available users and their stored information.

getVirtual() 공개 메소드

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

getVirtuals() 공개 메소드

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.
리턴 array The available virtual emails.

isBelowMaxUsers() 공개 메소드

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

saveAlias() 공개 메소드

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() 공개 메소드

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

saveForward() 공개 메소드

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 saveUser ( $info )

saveVirtual() 공개 메소드

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.

프로퍼티 상세

$_params 보호되어 있는 프로퍼티

A hash containing any parameters for the current driver.
protected array $_params
리턴 array