AfterLogic API Documentation
  • Package
  • Class

Packages

  • Calendar
    • Classes
    • Storages
  • Capability
  • Channels
    • Classes
    • Storages
  • Collaboration
  • Contacts
    • Helpers
    • Storages
  • Dav
  • Db
    • Classes
    • Enum
    • Storages
  • Domains
    • Classes
    • Storages
  • Fetchers
    • Classes
    • Storages
  • Filecache
    • Storages
  • Filestorage
    • Classes
    • Storages
  • GContacts
    • Storages
  • Helpdesk
    • Classes
    • Enum
    • Storages
  • Integrator
  • IOS
  • Logger
  • Mail
    • Classes
    • Enum
    • Storages
  • Mailsuite
    • Classes
    • Storages
  • Min
    • Storages
  • Sieve
    • Classes
    • Enum
  • Social
    • Classes
    • Storages
  • Subscription
    • Classes
  • Subscriptions
    • Storages
  • Tenants
    • Classes
    • Storages
  • Twofactorauth
    • Classes
    • Storages
  • Users
    • Classes
    • Enum
    • Storages
  • Voice
  • WebMail
    • Storages

Classes

  • CApiMailStorage
  • CApiUsersCommandCreator
  • CApiUsersCommandCreatorMySQL
  • CApiUsersCommandCreatorPostgreSQL
  • CApiUsersDbStorage
  • CApiUsersNodbStorage
  • CApiUsersStorage

Class CApiUsersDbStorage

AApiManagerStorage
Extended by CApiUsersStorage
Extended by CApiUsersDbStorage
Package: Users\Storages
Internal
Located at users/storages/db/storage.php

Methods summary

public
# __construct( CApiGlobalManager & $oManager )

Creates a new instance of the object.

Creates a new instance of the object.

Parameters

$oManager
$oManager

Overrides

CApiUsersStorage::__construct
public CAccount
# getAccountByEmail( string $sEmail )

Retrieves information about account wich is specified as default. Email address is used for look up. The method is especially useful in case if your product configuration allows for adding multiple accounts per user.

Retrieves information about account wich is specified as default. Email address is used for look up. The method is especially useful in case if your product configuration allows for adding multiple accounts per user.

Parameters

$sEmail
Email address associated with the account.

Returns

CAccount

Overrides

CApiUsersStorage::getAccountByEmail
public CAccount
# getAccountById( integer $mAccountId, mixed $bIdIsMd5 = false, boolean $bIdIsMd5,… )

Retrieves information on WebMail Pro account. Account ID is used for look up.

Retrieves information on WebMail Pro account. Account ID is used for look up.

Parameters

$mAccountId
Account identifier.
$bIdIsMd5
$mAccountId
$bIdIsMd5,…
Default value is false.

Returns

CAccount

Overrides

CApiUsersStorage::getAccountById
public CUser
# getUserById( integer $iUserId, CDomain $oDomain = null )

Retrieves information on particular WebMail Pro user.

Retrieves information on particular WebMail Pro user.

Parameters

$iUserId
User identifier.
$oDomain

Returns

CUser
| false

Overrides

CApiUsersStorage::getUserById
public integer
# getDefaultAccountDomainId( integer $iUserId )

Returns domain identifier for primary user account. The method is especially useful in case if your product configuration allows for adding multiple accounts per user.

Returns domain identifier for primary user account. The method is especially useful in case if your product configuration allows for adding multiple accounts per user.

Parameters

$iUserId
WebMail Pro user identifier (not to be confused with account ID).

Returns

integer

Overrides

CApiUsersStorage::getDefaultAccountDomainId
public integer
# getDefaultAccountId( integer $iUserId )

Returns identifier of primary user account.

Returns identifier of primary user account.

Parameters

$iUserId
WebMail Pro user identifier.

Returns

integer

Overrides

CApiUsersStorage::getDefaultAccountId
public integer
# getAccountUsedSpace( string $sEmail )

Returns account used space in Kb.

Returns account used space in Kb.

Parameters

$sEmail
Email address associated with the account.

Returns

integer

Overrides

CApiUsersStorage::getAccountUsedSpace
public CIdentity
# getIdentity( integer $iIdentityId )

Returns identity.

Returns identity.

Parameters

$iIdentityId
Indentity identifier.

Returns

CIdentity
| bool

Overrides

CApiUsersStorage::getIdentity
public array|boolean
# getAccountIdentities( integer $IdAccount )

Returns list of identities belonging to account.

Returns list of identities belonging to account.

Parameters

$IdAccount
Identifier of account that contains identities to get.

Returns

array|boolean

Overrides

CApiUsersStorage::getAccountIdentities
public array|boolean
# getUserIdentities( integer $IdUser )

Returns list of identities belonging to user.

Returns list of identities belonging to user.

Parameters

$IdUser
Identifier of user that contains identities to get.

Returns

array|boolean
protected CAccount
# _getAccountBySql( string $sSql )

Obtains CAccount object by query-string.

Obtains CAccount object by query-string.

Parameters

$sSql
Query-string for obtaining CAccount object.

Returns

CAccount
protected CCalUser
# _getCalUserBySql( string $sSql )

Obtains CCalUser object by query-string.

Obtains CCalUser object by query-string.

Parameters

$sSql
Query-string for obtaining CCalUser object.

Returns

CCalUser
public boolean
# createIdentity( CIdentity & $oIdentity )

Creates identity in account.

Creates identity in account.

Parameters

$oIdentity
$oIdentity Identity to create.

Returns

boolean

Overrides

CApiUsersStorage::createIdentity
public boolean
# createAccount( CAccount & $oAccount )

Creates WebMail account.

Creates WebMail account.

Parameters

$oAccount
$oAccount Object instance with prepopulated account properties.

Returns

boolean

Overrides

CApiUsersStorage::createAccount
public boolean
# enableAccounts( array $aAccountsIds, boolean $bIsEnabled )

Enable/disable one or several WebMail Pro accounts.

Enable/disable one or several WebMail Pro accounts.

Parameters

$aAccountsIds
List of accounts to be enabled/disabled.
$bIsEnabled
true for enabling accounts, false for disabling them.

Returns

boolean

Overrides

CApiUsersStorage::enableAccounts
public boolean
# updateAccount( CAccount $oAccount )

Saves changes made to the account.

Saves changes made to the account.

Parameters

$oAccount
$oAccount Account object containing data to be saved.

Returns

boolean

Overrides

CApiUsersStorage::updateAccount
public boolean
# updateIdentity( CIdentity $oIdentity )

Saves changes made to the identity.

Saves changes made to the identity.

Parameters

$oIdentity
$oIdentity Identity object containing data to be saved.

Returns

boolean

Overrides

CApiUsersStorage::updateIdentity
public boolean
# updateIdentitiesDefaults( CIdentity $iIdentityId, integer $iIdAccount )

Updates value of default identity for account.

Updates value of default identity for account.

Parameters

$iIdentityId
$oIdentity New default identity.
$iIdAccount
Account identifier.

Returns

boolean
public boolean
# updateAccountLastLoginAndCount( integer $iUserId )

For the given user, updates login-related information including time of last login.

For the given user, updates login-related information including time of last login.

Parameters

$iUserId
User identifier.

Returns

boolean

Overrides

CApiUsersStorage::updateAccountLastLoginAndCount
public boolean
# accountExists( CAccount $oAccount )

Checks if particular account exists.

Checks if particular account exists.

Parameters

$oAccount
Object instance with prepopulated account properties.

Returns

boolean

Overrides

CApiUsersStorage::accountExists
public boolean
# deleteIdentity( integer $iIdentityId )

Deletes identity.

Deletes identity.

Parameters

$iIdentityId
Identity identifier.

Returns

boolean

Overrides

CApiUsersStorage::deleteIdentity
public boolean
# deleteAccount( CAccount $iAccountId )

Deletes account from WebMail Pro database.

Deletes account from WebMail Pro database.

Parameters

$iAccountId
$oAccount Object instance with prepopulated account properties.

Returns

boolean

Overrides

CApiUsersStorage::deleteAccount
protected boolean
# _deleteAccountRequests( integer $iAccountId )

Removes all account data from database.

Removes all account data from database.

Parameters

$iAccountId
Identifier of account to remove.

Returns

boolean
public array
# getAccountIdList( integer $iUserId )

Retrieves list of accounts for given WebMail Pro user.

Retrieves list of accounts for given WebMail Pro user.

Parameters

$iUserId
User identifier.

Returns

array
| false

Overrides

CApiUsersStorage::getAccountIdList
public array
# getUserAccounts( integer $iUserId )

Retrieves list of information about email accounts for specific user.

Retrieves list of information about email accounts for specific user.

Parameters

$iUserId
User identifier.

Returns

array
| false array(int IdAccount => array(bool isDefaultAccount, string email, string friendlyName, string signature, int isSignatureHtml, int isSignatureAdded))

Overrides

CApiUsersStorage::getUserAccounts
public integer
# getUserAccountId( integer $iUserId, string $sEmail )

Returns account identifier for specific user and account email.

Returns account identifier for specific user and account email.

Parameters

$iUserId
Identifier of user that contains account.
$sEmail
Email of account that is looked up.

Returns

integer
| false
public array
# getUserList( integer $iDomainId, integer $iPage, integer $iUsersPerPage, string $sOrderBy = 'email', boolean $bAscOrderType = true, string $sSearchDesc = '' )

Obtains list of information about users for specific domain. Domain identifier is used for look up. The answer contains information only about default account of founded user.

Obtains list of information about users for specific domain. Domain identifier is used for look up. The answer contains information only about default account of founded user.

Parameters

$iDomainId
Domain identifier.
$iPage
List page.
$iUsersPerPage
Number of users on a single page.
$sOrderBy
= 'email'. Field by which to sort.
$bAscOrderType
= true. If true the sort order type is ascending.
$sSearchDesc
= ''. If specified, the search goes on by substring in the name and email of default account.

Returns

array
| false [IdAccount => [IsMailingList, Email, FriendlyName, IsDisabled, IdUser, StorageQuota, LastLogin]]

Overrides

CApiUsersStorage::getUserList
public array
# getDefaultAccountIdList( integer $iDomainId, integer $iPage, integer $iUsersPerPage )

Obtains list of identifiers of accounts which are specified as default. Domain identifier is used for look up.

Obtains list of identifiers of accounts which are specified as default. Domain identifier is used for look up.

Parameters

$iDomainId
Domain identifier.
$iPage
List page.
$iUsersPerPage
Number of identifiers on a single page.

Returns

array
| false

Overrides

CApiUsersStorage::getDefaultAccountIdList
public array
# getDefaultAccountList( )

Obtains list of accounts which are specified as default.

Obtains list of accounts which are specified as default.

Returns

array
| false

Overrides

CApiUsersStorage::getDefaultAccountList
public array
# getTwilioNumbers( $iTenantId )

Obtains twilio numbers for default accounts with allowed twilio. Tenant identifier is used for look up.

Obtains twilio numbers for default accounts with allowed twilio. Tenant identifier is used for look up.

Parameters

$iTenantId
identifier.

Returns

array
| false
public integer
# getUsersCountForDomain( integer $iDomainId, string $sSearchDesc = '' )

Determines how many users are in particular domain, with optional filtering. Domain identifier is used for look up.

Determines how many users are in particular domain, with optional filtering. Domain identifier is used for look up.

Parameters

$iDomainId
Domain identifier.
$sSearchDesc
= '' If not empty, only users matching this pattern are counted.

Returns

integer
| false

Overrides

CApiUsersStorage::getUsersCountForDomain
public integer
# getUsersCountForTenant( integer $iTenantId )

Determines how many users are in particular tenant. Tenant identifier is used for look up.

Determines how many users are in particular tenant. Tenant identifier is used for look up.

Parameters

$iTenantId
Tenant identifier.

Returns

integer
| false

Overrides

CApiUsersStorage::getUsersCountForTenant
public integer
# getTotalUsersCount( )

Calculates total number of users registered in WebMail Pro.

Calculates total number of users registered in WebMail Pro.

Returns

integer

Overrides

CApiUsersStorage::getTotalUsersCount
public boolean
# createCalUser( CCalUser & $oCalUser )

Creates calendar user in storage.

Creates calendar user in storage.

Parameters

$oCalUser
$oCalUser CCalUser object.

Returns

boolean

Overrides

CApiUsersStorage::createCalUser
public CCalUser
# getCalUser( integer $iUserId )

Obtains CCalUser object that contains calendar settings for specified user. User identifier is used for look up.

Obtains CCalUser object that contains calendar settings for specified user. User identifier is used for look up.

Parameters

$iUserId
User identifier.

Returns

CCalUser

Overrides

CApiUsersStorage::getCalUser
public boolean
# deleteCalUser( integer $iUserId )

Deletes calendar user settings from the storage. User identifier is used for look up.

Deletes calendar user settings from the storage. User identifier is used for look up.

Parameters

$iUserId
User identifier.

Returns

boolean

Overrides

CApiUsersStorage::deleteCalUser
public boolean
# updateCalUser( CCalUser $oCalUser )

Updates calendar user settings.

Updates calendar user settings.

Parameters

$oCalUser
CCalUser object.

Returns

boolean

Overrides

CApiUsersStorage::updateCalUser
public boolean
# getSafetySender( string $iUserId, string $sEmail )

Checks whether specific address is in safelist for particular user.

Checks whether specific address is in safelist for particular user.

Parameters

$iUserId
User identifier.
$sEmail
Email of sender.

Returns

boolean
public boolean
# setSafetySender( string $iUserId, string $sEmail )

Updates a list of senders wich are considered safe to show external images coming from.

Updates a list of senders wich are considered safe to show external images coming from.

Parameters

$iUserId
User identifier.
$sEmail
Email of sender wich is considered safe.

Returns

boolean
public boolean
# clearSafetySenders( string $iUserId )

Purges all entries in safelist of particular user.

Purges all entries in safelist of particular user.

Parameters

$iUserId
User identifier.

Returns

boolean
protected string
# _getDbOrderBy( string $sOrderBy )

Returns the real name of the field to sort.

Returns the real name of the field to sort.

Parameters

$sOrderBy
Name of the field to sort.

Returns

string

Properties summary

protected CDbStorage $oConnection

$oConnection

$oConnection

#
protected CApiUsersCommandCreator $oCommandCreator
#
AfterLogic API Documentation API documentation generated by ApiGen