Methods |
public
static
|
getInstance(): Module
|
#
|
public
|
getTenantsManager()
|
#
|
public
|
getChannelsManager()
|
#
|
public
|
getUsersManager()
|
#
|
public
|
getIntegratorManager()
|
#
|
public
|
init()
Initializes Core Module.
|
#
|
public
|
onCreateAccount(array &$Args, &$Result)
Is called by CreateAccount event. Finds or creates and returns User for new account.
Is called by CreateAccount event. Finds or creates and returns User for new account.
Parameters
$Args |
{
int UserId Identifier of existing user.
int TenantId Identifier of tenant for creating new user in it.
int $PublicId New user name.
}
|
|
#
|
public
|
onAfterGetCompatibilities(type $aArgs, array &$mResult)
|
#
|
public
|
onBeforeRunEntry($aArgs, &$mResult)
|
#
|
public
|
EntryApi(): string
|
#
|
public
|
EntryMobile()
|
#
|
public
|
EntrySso()
|
#
|
public
|
EntryPostlogin()
|
#
|
public
|
EntryFileCache()
|
#
|
public
|
IsModuleExists($Module)
|
#
|
public
|
GetVersion(): string
|
#
|
public
|
UpdateUserObject(User $oUser)
!Not public
This method is restricted to be called by web API (see denyMethodsCallByWebApi method).
!Not public
This method is restricted to be called by web API (see denyMethodsCallByWebApi method).
Updates user by object.
|
#
|
public
|
GetUserUnchecked(int|string $UserId = ''): User
!Not public
This method is restricted to be called by web API (see denyMethodsCallByWebApi method).
!Not public
This method is restricted to be called by web API (see denyMethodsCallByWebApi method).
Returns user object.
Parameters
$UserId |
User identifier or UUID.
|
|
#
|
public
|
GetUserByUUID(int $UUID): User
!Not public
This method is restricted to be called by web API (see denyMethodsCallByWebApi method).
!Not public
This method is restricted to be called by web API (see denyMethodsCallByWebApi method).
Returns user object.
Parameters
$UUID |
User uuid identifier.
|
|
#
|
public
|
GetUserByPublicId(string $PublicId): User
!Not public
This method is restricted to be called by web API (see denyMethodsCallByWebApi method).
!Not public
This method is restricted to be called by web API (see denyMethodsCallByWebApi method).
Returns user object.
Parameters
$PublicId |
User public identifier.
|
|
#
|
public
|
GetAdminUser(): User
!Not public
This method is restricted to be called by web API (see denyMethodsCallByWebApi method).
!Not public
This method is restricted to be called by web API (see denyMethodsCallByWebApi method).
Creates and returns user with super administrator role.
|
#
|
public
|
GetTenantUnchecked(int $Id): Tenant|null
!Not public
This method is restricted to be called by web API (see denyMethodsCallByWebApi method).
!Not public
This method is restricted to be called by web API (see denyMethodsCallByWebApi method).
Returns tenant object by identifier.
Parameters
|
#
|
public
|
GetTenantIdByName(string $TenantName = ''): int|null
!Not public
This method is restricted to be called by web API (see denyMethodsCallByWebApi method).
!Not public
This method is restricted to be called by web API (see denyMethodsCallByWebApi method).
Returns tenant identifier by tenant name.
Parameters
|
#
|
public
|
GetTenantName(): string
!Not public
This method is restricted to be called by web API (see denyMethodsCallByWebApi method).
!Not public
This method is restricted to be called by web API (see denyMethodsCallByWebApi method).
Returns current tenant name.
|
#
|
public
|
GetTenantById($Id)
|
#
|
public
|
GetDefaultGlobalTenant(): Tenant
!Not public
This method is restricted to be called by web API (see denyMethodsCallByWebApi method).
!Not public
This method is restricted to be called by web API (see denyMethodsCallByWebApi method).
Returns default global tenant.
|
#
|
public
|
UpdateTenantObject(Tenant $oTenant): void
!Not public
This method is restricted to be called by web API (see denyMethodsCallByWebApi method).
!Not public
This method is restricted to be called by web API (see denyMethodsCallByWebApi method).
Updates tenant.
|
#
|
public
|
UpdateTokensValidFromTimestamp(User $oUser): int
!Not public
This method is restricted to be called by web API (see denyMethodsCallByWebApi method).
!Not public
This method is restricted to be called by web API (see denyMethodsCallByWebApi method).
|
#
|
public
|
DoServerInitializations($Timezone = ''): bool
Does some pending actions to be executed when you log in.
Does some pending actions to be executed when you log in.
|
#
|
public
|
Ping(): 'Pong'
Method is used for checking Internet connection.
Method is used for checking Internet connection.
|
#
|
public
|
GetAppData(): array
Obtains a list of settings for each module for the current user.
Obtains a list of settings for each module for the current user.
|
#
|
public
|
GetSettings(): array
Obtains list of module settings for authenticated user.
Obtains list of module settings for authenticated user.
Overrides
|
#
|
public
|
UpdateSettings(
string $DbLogin = null,
string $DbPassword = null,
string $DbName = null,
string $DbHost = null,
string $AdminLogin = null,
string $Password = null,
string $NewPassword = null,
string $AdminLanguage = null,
string $SiteName = null,
string $Language = null,
bool $AutodetectLanguage = null,
int $TimeFormat = null,
$DateFormat = null,
bool $EnableLogging = null,
bool $EnableEventLogging = null,
int $LoggingLevel = null,
): bool
Updates specified settings if super administrator is authenticated.
Updates specified settings if super administrator is authenticated.
Parameters
$DbLogin |
Database login.
|
$DbPassword |
Database password.
|
$DbName |
Database name.
|
$DbHost |
Database host.
|
$AdminLogin |
Login for super administrator.
|
$Password |
Current password for super administrator.
|
$NewPassword |
New password for super administrator.
|
$AdminLanguage |
Language for super administrator.
|
$SiteName |
Site name.
|
$Language |
Language that is used on login and for new users.
|
$AutodetectLanguage |
Indicates if browser language should be used on login and for new users.
|
$TimeFormat |
Time format that is used for new users.
|
$EnableLogging |
Indicates if logs are enabled.
|
$EnableEventLogging |
Indicates if events logs are enabled.
|
$LoggingLevel |
Specify logging level.
|
Throws
|
#
|
public
|
UpdateLoggingSettings($EnableLogging = null, $EnableEventLogging = null, $LoggingLevel = null)
|
#
|
public
|
SetMobile(bool $Mobile): bool
Parameters
$Mobile |
Indicates if mobile version should be turned on or turned off.
|
|
#
|
public
|
CreateTables(): bool
Creates tables required for module work. Creates first channel and tenant if it is necessary.
Creates tables required for module work. Creates first channel and tenant if it is necessary.
|
#
|
public
|
GetOrphans()
|
#
|
public
|
UpdateConfig(): boolean
Updates config files.
|
#
|
public
|
TestDbConnection(string $DbLogin, string $DbName, string $DbHost, string $DbPassword = null): bool
Tests connection to database with specified credentials.
Tests connection to database with specified credentials.
Parameters
$DbLogin |
Database login.
|
$DbName |
Database name.
|
$DbHost |
Database host.
|
$DbPassword |
Database password.
|
|
#
|
public
|
GetAuthenticatedAccount(string $AuthToken)
Obtains authenticated account.
Obtains authenticated account.
|
#
|
public
|
GetAccounts(string $AuthToken, string $Type = ''): array
Obtains all accounts from all modules for authenticated user.
Obtains all accounts from all modules for authenticated user.
|
#
|
public
|
IsBlockedUser($sEmail, $sIp)
|
#
|
public
|
GetBlockedUser($sEmail, $sIp)
|
#
|
public
|
BlockUser($sEmail, $sIp)
|
#
|
public
|
Authenticate($Login, $Password, $SignMe = false)
|
#
|
public
|
SetAuthDataAndGetAuthToken($aAuthData, $Language = '', $SignMe = false)
|
#
|
public
|
Login(string $Login, string $Password, string $Language = '', bool $SignMe = false): array
Broadcasts event Login to other modules, gets responses from them and returns AuthToken.
Broadcasts event Login to other modules, gets responses from them and returns AuthToken.
Parameters
$Login |
Account login.
|
$Password |
Account password.
|
$Language |
New value of language for user.
|
$SignMe |
Indicates if it is necessary to remember user between sessions.
|
Throws
|
#
|
public
|
GetDigestHash($Login, $Realm, $Type): void
|
#
|
public
|
GetAccountUsedToAuthorize($Login)
|
#
|
public
|
VerifyPassword(string $Password): bool
Parameters
$Password |
Account password.
|
Throws
|
#
|
public
|
ResetPassword($email, $resetOption): bool
|
#
|
public
|
ResetPasswordBySecurityQuestion($securityAnswer, $securityToken)
|
#
|
public
|
UpdatePassword($Password, $ConfirmPassword, $Hash)
|
#
|
public
|
Logout(): bool
Logs out authenticated user. Clears session.
Logs out authenticated user. Clears session.
Throws
|
#
|
public
|
GetEntityList($Type, $Offset = 0, $Limit = 0, $Search = '', $TenantId = 0, $Filters = [])
|
#
|
public
|
GetEntity($Type, $Id)
|
#
|
public
|
CreateChannel(string $Login, string $Description = ''): int
Creates channel with specified login and description.
Creates channel with specified login and description.
Parameters
$Login |
New channel login.
|
$Description |
New channel description.
|
Returns
Throws
|
#
|
public
|
UpdateChannel(int $ChannelId, string $Login = '', string $Description = ''): bool
Updates channel.
Parameters
$ChannelId |
Channel identifier.
|
$Login |
New login for channel.
|
$Description |
New description for channel.
|
Throws
|
#
|
public
|
DeleteChannel(int $ChannelId): bool
Deletes channel.
Parameters
$ChannelId |
Identifier of channel to delete.
|
Throws
|
#
|
public
|
GetTenants(int $Offset = 0, int $Limit = 0, string $Search = ''): array
Obtains tenant list if super administrator is authenticated.
Obtains tenant list if super administrator is authenticated.
Parameters
$Offset |
Offset of the list.
|
$Limit |
Limit of the list.
|
$Search |
Search string.
|
Returns
{
array Items Tenant list
int Count Tenant count
}
Throws
|
#
|
public
|
GetTenantList($Offset = 0, $Limit = 0, $Search = '')
|
#
|
public
|
GetTenant(int $Id): Tenant|null
Returns tenant object by identifier.
Returns tenant object by identifier.
Parameters
|
#
|
public
|
CreateTenant(
int $ChannelId = 0,
string $Name = '',
string $Description = '',
string $WebDomain = '',
string $SiteName = null,
): bool
Creates tenant.
Parameters
$ChannelId |
Identifier of channel new tenant belongs to.
|
$Name |
New tenant name.
|
$Description |
New tenant description.
|
$WebDomain |
New tenant web domain.
|
$SiteName |
Tenant site name.
|
Throws
|
#
|
public
|
UpdateTenant(
int $TenantId,
string $Description = null,
string $WebDomain = null,
string $SiteName = null,
int $ChannelId = 0,
): bool
Updates tenant.
Parameters
$TenantId |
Identifier of tenant to update.
|
$Description |
Tenant description.
|
$WebDomain |
Tenant web domain.
|
$SiteName |
Tenant site name.
|
$ChannelId |
Identifier of the tenant channel.
|
Throws
|
#
|
public
|
DeleteTenants(array $IdList): bool
Deletes tenants specified by a list of identifiers.
Deletes tenants specified by a list of identifiers.
Parameters
$IdList |
List of tenants identifiers.
|
|
#
|
public
|
DeleteTenant(int $TenantId): bool
Deletes tenant.
Parameters
$TenantId |
Identifier of tenant to delete.
|
Throws
|
#
|
public
|
GetUsers(
int $TenantId = 0,
int $Offset = 0,
int $Limit = 0,
string $OrderBy = 'PublicId',
int $OrderType = SortOrder::ASC,
string $Search = '',
array $Filters = null,
$GroupId = -1,
): array
Returns user list.
Parameters
$TenantId |
Tenant identifier.
|
$Offset |
Offset of user list.
|
$Limit |
Limit of result user list.
|
$OrderBy |
Name of field order by.
|
$OrderType |
Order type.
|
$Search |
Search string.
|
$Filters |
Filters.
|
Returns
{
array Items User list.
int Count Users count.
}
|
#
|
public
|
GetUserList(
$TenantId = 0,
$Offset = 0,
$Limit = 0,
$OrderBy = 'PublicId',
$OrderType = SortOrder::ASC,
$Search = '',
$Filters = [],
)
|
#
|
public
|
GetTotalUsersCount()
|
#
|
public
|
GetUser(int|string $Id = ''): User
Returns user object.
Parameters
$Id |
User identifier or UUID.
|
|
#
|
public
|
TurnOffSeparateLogs()
|
#
|
public
|
ClearSeparateLogs()
|
#
|
public
|
GetUsersWithSeparateLog()
|
#
|
public
|
CreateUser(
int $TenantId = 0,
string $PublicId = '',
int $Role = UserRole::NormalUser,
bool $WriteSeparateLog = false,
): int|false
Creates user.
Parameters
$TenantId |
Identifier of tenant that will contain new user.
|
$PublicId |
New user name.
|
$Role |
New user role.
|
$WriteSeparateLog |
Indicates if log file should be written separate for this user.
|
Throws
|
#
|
public
|
UpdateUser(
int $UserId,
string $PublicId = '',
int $TenantId = 0,
int $Role = -1,
bool $WriteSeparateLog = null,
$GroupIds = null,
): bool
Updates user.
Parameters
$UserId |
Identifier of user to update.
|
$PublicId |
New user name.
|
$TenantId |
Identifier of tenant that will contain the user.
|
$Role |
New user role.
|
$WriteSeparateLog |
New value of indicator if user's logs should be in a separate file.
|
Throws
|
#
|
public
|
DeleteUsers(array $IdList): bool
Deletes users specified by a list of identifiers.
Deletes users specified by a list of identifiers.
Parameters
$IdList |
List of users identifiers.
|
|
#
|
public
|
DeleteUser(int $UserId = 0): bool
Deletes user.
|
#
|
public
|
GetLogFilesData()
|
#
|
public
|
GetLogFile($EventsLog = false, $PublicId = '')
|
#
|
public
|
GetLog($EventsLog, $PartSize = 10240)
|
#
|
public
|
ClearLog(bool $EventsLog): bool
|
#
|
public
|
SaveContentAsTempFile(int $UserId, string $Content, string $FileName): array|bool
|
#
|
public
|
UpdateUserTimezone(string $Timezone)
Updates user Timezone.
|
#
|
public
|
GetCompatibilities()
|
#
|
public
|
IsModuleDisabledForObject($oObject, $sModuleName)
|
#
|
public
|
GetUserSessions()
|
#
|
public
|
CreateGroup($TenantId, $Name)
|
#
|
public
|
GetGroup($TenantId, $GroupId)
|
#
|
public
|
GetAllGroup($TenantId)
|
#
|
public
|
GetGroups($TenantId, $Search = '')
|
#
|
public
|
UpdateGroup($GroupId, $Name)
|
#
|
public
|
DeleteGroups(array $IdList): bool
Deletes groups specified by a list of identifiers.
Deletes groups specified by a list of identifiers.
Parameters
$IdList |
List of groups identifiers.
|
|
#
|
public
|
DeleteGroup($GroupId)
|
#
|
public
|
GetGroupUsers($TenantId, $GroupId)
|
#
|
public
|
AddUsersToGroup($GroupId, $UserIds)
|
#
|
public
|
RemoveUsersFromGroup($GroupId, $UserIds)
|
#
|
public
|
UpdateUserGroups($UserId, $GroupIds)
|
#
|