Methods summary
public
|
#
__construct( array $params )
Constructor.
Parameters
- $params
- Any parameters needed for this driver.
|
abstract public
array
|
#
getDomains( )
Returns the list of domains from the backend.
Returns the list of domains from the backend.
Returns
array All the domains and their data in an array.
|
abstract public
array
|
#
getDomain( integer $domain_id )
Returns the specified domain information from the backend.
Returns the specified domain information from the backend.
Parameters
- $domain_id
- The id of the domain to fetch.
Returns
array The domain's information in an array.
|
abstract public
array
|
#
getDomainByName( string $domain_name )
Given a domain name returns the information from the backend.
Given a domain name returns the information from the backend.
Parameters
- $domain_name
- $name The name of the domain to fetch.
Returns
array The domain's information in an array.
|
public
|
#
saveDomain( array $info )
Saves a domain with the provided information.
Saves a domain with the provided information.
Parameters
- $info
- Array of details to save the domain.
Throws
|
public
|
#
deleteDomain( integer $domain_id )
Deletes a domain and all the users and virtuals within it.
Deletes a domain and all the users and virtuals within it.
Parameters
- $domain_id
- The id of the domain to delete.
Throws
|
public
string
|
#
getDomainAdmin( string $domain_name )
Returns the user who is the domain administrator.
Returns the user who is the domain administrator.
Parameters
- $domain_name
- <p>The name of the domain for which to
return the administrator.</p>
Returns
string The domain adminstrator.
Throws
|
public
integer
|
#
getDomainQuota( string $domain_name )
Returns the configured quota for this domain.
Returns the configured quota for this domain.
Parameters
- $domain_name
- <p>The name of the domain for which to
return the quota.</p>
Returns
integer The domain quota.
Throws
|
public
integer
|
#
getDomainMaxUsers( string $domain_name )
Returns the maximum number of users allowed for a given domain.
Returns the maximum number of users allowed for a given domain.
Parameters
- $domain_name
- <p>The name of the domain for which to
return the maximum users.</p>
Returns
integer The maximum number of allowed users.
Throws
|
abstract public
integer
|
#
getDomainNumUsers( string $domain_name )
Returns the current number of users for a domain.
Returns the current number of users for a domain.
Parameters
- $domain_name
- <p>The name of the domain for which to
get the current number of users.</p>
Returns
integer The current number of users.
|
public
boolean
|
#
isBelowMaxUsers( string $domain )
Checks if the given domain is below the maximum allowed users.
Checks if the given domain is below the maximum allowed users.
Parameters
- $domain
- The domain name to check.
Returns
boolean True if the domain does not have a maximum limit (0) or
current number of users is below the maximum number
allowed.
|
abstract public
array
|
#
getUsers( string $domain = null )
Returns all available users, if a domain name is passed then limit the
list of users only to those users.
Returns all available users, if a domain name is passed then limit the
list of users only to those users.
Parameters
- $domain
- <p>The name of the domain for which to fetch the
users.</p>
Returns
array The available users and their stored information.
Throws
|
public
array
|
#
getAllUsers( )
Returns all the users sorted by domain and as arrays of each domain.
Returns all the users sorted by domain and as arrays of each domain.
Returns
array An array of domains then users for each domain.
|
abstract public
array
|
#
getUser( integer $user_id )
Returns the user information for a given user id.
Returns the user information for a given user id.
Parameters
- $user_id
- <p>The id of the user for which to fetch
information.</p>
Returns
array The user information.
|
public
array
|
#
getUserStatus( array $user )
Does a series of checks for a given user to determine the status.
Does a series of checks for a given user to determine the status.
Parameters
- $user
- <p>The user's details in an array as returned by the
getUser() function.</p>
Returns
array Either an array of error messages found during the checks
or an array with a single element stating that the user
is ready.
Throws
|
public
|
|
abstract public
|
#
deleteUser( integer $user_id )
Deletes a user.
Parameters
- $user_id
- The id of the user to delete.
Throws
|
public
|
|
public
array
|
#
getAddresses( string $domain, string $type = 'all', string $key = 'user_name', integer $direction = 0 )
Returns a list of all users, aliases, or groups and forwards for a
domain.
Returns a list of all users, aliases, or groups and forwards for a
domain.
Parameters
- $domain
- Domain on which to search.
- $type
- <p>Only return a specific type. One of 'all',
'user', 'alias', 'forward', or 'group'.</p>
- $key
- Sort list by this key.
- $direction
- Sort direction.
Returns
array Account information for this domain.
|
public
array
|
#
getAddressInfo( string $address, string $type = 'all' )
Returns an array of information related to the address passed in.
Returns an array of information related to the address passed in.
This method may be overridden by the backend driver if there is a more
efficient way to do this than a linear array search.
Parameters
- $address
- Address for which information will be pulled.
- $type
- <p>Address type to request.
One of 'all', 'user', 'alias', 'forward' or
'group'.</p>
Returns
array Array of user information on success or empty array
if the user does not exist.
Throws
|
public
array
|
#
getVirtuals( string $filter )
Returns available virtual emails.
Returns available virtual emails.
Parameters
- $filter
- <p>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.</p>
Returns
array The available virtual emails.
|
public
array
|
#
getVirtual( integer $virtual_id )
Returns information for a virtual id.
Returns information for a virtual id.
Parameters
- $virtual_id
- <p>The virtual id for which to return
information.</p>
Returns
array The virtual email information.
|
public
|
#
saveVirtual( array $info, string $domain )
Saves virtual email address to the backend.
Saves virtual email address to the backend.
Parameters
- $info
- The virtual email data.
- $domain
- The name of the domain for this virtual email.
Throws
|
public
|
#
deleteVirtual( integer $virtual_id )
Deletes a virtual email.
Parameters
- $virtual_id
- The id of the virtual email to delete.
|
public
|
#
saveAlias( array $info )
Saves or creates alias records for a user.
Saves or creates alias records for a user.
Parameters
- $info
- <p>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.</p>
Throws
|
public
|
#
deleteAlias( array $info )
Deletes alias records for a given user.
Deletes alias records for a given user.
Parameters
- $info
- <p>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.</p>
Throws
|
public
|
#
saveForward( array $info )
Saves or creates forward records for a given user.
Saves or creates forward records for a given user.
Parameters
- $info
- <p>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.</p>
Throws
|
public
|
#
deleteForward( array $info )
Deletes forward records for a given user.
Deletes forward records for a given user.
Parameters
- $info
- <p>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.</p>
Throws
|
public static
Vilma_Driver
|
#
factory( string $driver = null, array $params = null )
Attempts to return a concrete Vilma_Driver instance based on $driver.
Attempts to return a concrete Vilma_Driver instance based on $driver.
Parameters
- $driver
- <p>The type of concrete Vilma_Driver subclass to
return.</p>
- $params
- <p>A hash containing any additional configuration or
connection parameters a subclass might need.</p>
Returns
Vilma_Driver
The newly created concrete Vilma_Driver instance.
Throws
|