PHP Класс Scalr_Account_User

См. также: Scalr\Model\Entity\Account\User
Устаревший: This class has been deprecated since version 5.4.0. Please use new Scalr\Model\Entity\Account\User entity.
Наследование: extends Scalr_Model
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$accountId
$comments
$dtCreated
$dtLastLogin
$email
$fullname
$loginattempts
$status
$type

Защищенные свойства (Protected)

Свойство Тип Описание
$account
$dbMessageKeyNotFound
$dbPrimaryKey
$dbPropertyMap
$dbTableName
$password
$permissions
$settingsCache
$varCache

Открытые методы

Метод Описание
addDashboardWidget ( integer $envId, array $widgetConfig, integer $columnNumber, integer $position ) Adds widget to dashboard
applyLdapGroups ( $groups ) Special method for LDAP auth sync LDAP groups to Scalr groups
canEditUser ( Scalr_Account_User $user ) : boolean Checks whether the user is allowed to edit specified user
canManageAcl ( ) : boolean Checks whether the user is allowed to manage ACL
canRemoveUser ( Scalr_Account_User $user ) : boolean Checks whether the user is allowed to remove specified user
checkPassword ( string $pwd, boolean $updateLoginAttempt = true ) : boolean Checks password
create ( $email, $accountId )
delete ( $id = null )
getAccount ( ) : Scalr_Account
getAccountId ( )
getAclRoles ( boolean $ignoreCache = false ) : Scalr\Acl\Role\AccountRoleSuperposition Gets account level roles for the user
getAclRolesByEnvironment ( integer $envId, boolean $ignoreCache = false ) : Scalr\Acl\Role\AccountRoleSuperposition Gets roles by specified ID of environment
getAclRolesByTeam ( integer $teamId ) : Scalr\Acl\Role\AccountRoleSuperposition Gets roles by specified ID of team
getDashboard ( integer $envId ) : array Get user dashboard
getDefaultEnvironment ( integer $envId ) : Scalr_Environment Gets environment object for the specified identifier.
getEmail ( ) : string Gets email address of the User
getEnvironments ( string $filter = null, boolean $orderByPriority = false ) : array Gets environments of the current user filtered by name
getGravatarHash ( )
getId ( ) : integer Gets effective user identifier
getLdapUsername ( ) : string Gets LDAP username of the User
getList ( $accountId )
getPermissions ( ) : Scalr_Permissions Gets scalr permission object
getSetting ( string $name, boolean $ignoreCache = false ) : mixed Returns user setting value by name
getSshConsoleSettings ( $ignoreCache = false, $gvi = false, $serverId = null )
getTeams ( ) : array
getType ( )
getUserInfo ( )
getVar ( string $name, boolean $ignoreCache = false ) : mixed Returns user var value by name
init ( $className = null ) : Scalr_Account_User
isAccountAdmin ( ) : boolean Checks if the user is account admin
isAccountOwner ( ) : boolean Checks if the user is account owher
isAccountSuperAdmin ( ) : boolean Checks if the user is account admin
isAdmin ( ) : boolean Checks if the user is admin user (scalr, financial). It means user doesn't have current environment
isEmailExists ( $email )
isFinAdmin ( ) : boolean Checks if the user is Financial admin
isInTeam ( integer $teamId ) : boolean Check if user is included in team
isLeadVerified ( ) : boolean
isScalrAdmin ( ) : boolean Checks if the user is Scalr admin
isSubjectLead ( string $projectId = null, string $ccId = null ) : boolean Checks if user has access to project or cost center
isTeamOwner ( integer $teamId = null ) : boolean Checks wheter this user is considered to be the team owner for the specified team.
isTeamOwnerInEnvironment ( integer $envId ) : boolean Checks if the user is both AccountAdmin and member of the specified environment
isTeamUser ( ) : boolean Checks if the user is team user
isUser ( ) : boolean Checks if the user is account user (owner, admin, team user)
loadByApiAccessKey ( string $accessKey ) : Scalr_Account_User Loads user by the specified access key
loadByEmail ( string $email, $accountId = null ) : Scalr_Account_User Loads user by an email
loadBySetting ( string $name, string $value ) : Scalr_Account_User Loads user by the specified unique setting
save ( $forceInsert = false )
setAclRoles ( array $data = [] ) Sets ACL roles to this user
setDashboard ( integer $envId, array $value ) Set user dashboard
setSetting ( string $name, mixed $value ) : void Set user setting
setSshConsoleSettings ( $settings )
setVar ( string $name, mixed $value ) : void Set user var
updateEmail ( $email )
updateLastLogin ( )
updateLoginAttempt ( integer | null $loginattempt = null ) Increases or resets the number of attempts to sign in
updatePassword ( $pwd )

Описание методов

addDashboardWidget() публичный Метод

Adds widget to dashboard
public addDashboardWidget ( integer $envId, array $widgetConfig, integer $columnNumber, integer $position )
$envId integer The identifier of the environment
$widgetConfig array Widget config
$columnNumber integer optional the number of the column
$position integer optional the position

applyLdapGroups() публичный Метод

Special method for LDAP auth sync LDAP groups to Scalr groups
public applyLdapGroups ( $groups )
$groups

canEditUser() публичный Метод

Checks whether the user is allowed to edit specified user
public canEditUser ( Scalr_Account_User $user ) : boolean
$user Scalr_Account_User The user to edit
Результат boolean Returns true if the user is allowed to edit specified user

canManageAcl() публичный Метод

Checks whether the user is allowed to manage ACL
public canManageAcl ( ) : boolean
Результат boolean Returns true if user is allowed to manage ACL

canRemoveUser() публичный Метод

Checks whether the user is allowed to remove specified user
public canRemoveUser ( Scalr_Account_User $user ) : boolean
$user Scalr_Account_User The user to remove
Результат boolean Returns true if the user is allowed to remove specified user

checkPassword() публичный Метод

Checks password
public checkPassword ( string $pwd, boolean $updateLoginAttempt = true ) : boolean
$pwd string A password
$updateLoginAttempt boolean optional Whether it should update the number of attempts
Результат boolean Returns true if password is valid

create() публичный Метод

public create ( $email, $accountId )

delete() публичный Метод

См. также: Scalr_Model::delete()
public delete ( $id = null )

getAccount() публичный Метод

public getAccount ( ) : Scalr_Account
Результат Scalr_Account

getAccountId() публичный Метод

public getAccountId ( )

getAclRoles() публичный Метод

Gets account level roles for the user
public getAclRoles ( boolean $ignoreCache = false ) : Scalr\Acl\Role\AccountRoleSuperposition
$ignoreCache boolean
Результат Scalr\Acl\Role\AccountRoleSuperposition Returns the list of the roles of account level

getAclRolesByEnvironment() публичный Метод

Gets roles by specified ID of environment
public getAclRolesByEnvironment ( integer $envId, boolean $ignoreCache = false ) : Scalr\Acl\Role\AccountRoleSuperposition
$envId integer The ID of the client's environment
$ignoreCache boolean optional Ignore cache.
Результат Scalr\Acl\Role\AccountRoleSuperposition Returns the list of the roles of account level by specified environment

getAclRolesByTeam() публичный Метод

Gets roles by specified ID of team
public getAclRolesByTeam ( integer $teamId ) : Scalr\Acl\Role\AccountRoleSuperposition
$teamId integer The ID of the team
Результат Scalr\Acl\Role\AccountRoleSuperposition Returns the list of the roles of account level by specified team

getDashboard() публичный Метод

Get user dashboard
public getDashboard ( integer $envId ) : array
$envId integer
Результат array

getDefaultEnvironment() публичный Метод

In case the identifier is not specified it takes default Environment from the list of the available for current User.
public getDefaultEnvironment ( integer $envId ) : Scalr_Environment
$envId integer optional The identifier of the Environment
Результат Scalr_Environment Returns Environment object

getEmail() публичный Метод

Gets email address of the User
public getEmail ( ) : string
Результат string Returns user email address

getEnvironments() публичный Метод

Gets environments of the current user filtered by name
public getEnvironments ( string $filter = null, boolean $orderByPriority = false ) : array
$filter string optional Filter string
$orderByPriority boolean optional Order by default_priority
Результат array

getGravatarHash() публичный Метод

public getGravatarHash ( )

getId() публичный Метод

Gets effective user identifier
public getId ( ) : integer
Результат integer Returns identifier of the user

getLdapUsername() публичный Метод

Gets LDAP username of the User
public getLdapUsername ( ) : string
Результат string Returns user LDAP username

getList() публичный статический Метод

public static getList ( $accountId )

getPermissions() публичный Метод

Gets scalr permission object
public getPermissions ( ) : Scalr_Permissions
Результат Scalr_Permissions

getSetting() публичный Метод

Returns user setting value by name
public getSetting ( string $name, boolean $ignoreCache = false ) : mixed
$name string
$ignoreCache boolean
Результат mixed $value

getSshConsoleSettings() публичный Метод

public getSshConsoleSettings ( $ignoreCache = false, $gvi = false, $serverId = null )

getTeams() публичный Метод

public getTeams ( ) : array
Результат array

getType() публичный Метод

public getType ( )

getUserInfo() публичный Метод

public getUserInfo ( )

getVar() публичный Метод

Returns user var value by name
public getVar ( string $name, boolean $ignoreCache = false ) : mixed
$name string
$ignoreCache boolean
Результат mixed $value

init() публичный статический Метод

public static init ( $className = null ) : Scalr_Account_User
Результат Scalr_Account_User

isAccountAdmin() публичный Метод

Checks if the user is account admin
public isAccountAdmin ( ) : boolean
Результат boolean Returns true if user is account admin

isAccountOwner() публичный Метод

Checks if the user is account owher
public isAccountOwner ( ) : boolean
Результат boolean Returns true if user is account owner.

isAccountSuperAdmin() публичный Метод

Checks if the user is account admin
public isAccountSuperAdmin ( ) : boolean
Результат boolean Returns true if user is account super admin

isAdmin() публичный Метод

Checks if the user is admin user (scalr, financial). It means user doesn't have current environment
public isAdmin ( ) : boolean
Результат boolean

isEmailExists() публичный Метод

public isEmailExists ( $email )

isFinAdmin() публичный Метод

Checks if the user is Financial admin
public isFinAdmin ( ) : boolean
Результат boolean Returns true if user is Financial Admin

isInTeam() публичный Метод

Check if user is included in team
public isInTeam ( integer $teamId ) : boolean
$teamId integer
Результат boolean

isLeadVerified() публичный Метод

public isLeadVerified ( ) : boolean
Результат boolean Returns true if lead is verified

isScalrAdmin() публичный Метод

Checks if the user is Scalr admin
public isScalrAdmin ( ) : boolean
Результат boolean Returns true if user is Scalr Admin

isSubjectLead() публичный Метод

Checks if user has access to project or cost center
public isSubjectLead ( string $projectId = null, string $ccId = null ) : boolean
$projectId string optional Id of the project
$ccId string optional Id of the cost center
Результат boolean Returns false if user is not lead of the subject

isTeamOwner() публичный Метод

Checks wheter this user is considered to be the team owner for the specified team.
Устаревший: This function has been deprecated since new ACL
public isTeamOwner ( integer $teamId = null ) : boolean
$teamId integer The identifier of the team.
Результат boolean Returns true if the user is considered to be the team owner for the specified team.

isTeamOwnerInEnvironment() публичный Метод

Checks if the user is both AccountAdmin and member of the specified environment
Устаревший: This function has been deprecated since new ACL
public isTeamOwnerInEnvironment ( integer $envId ) : boolean
$envId integer The identifier of the environment
Результат boolean

isTeamUser() публичный Метод

Checks if the user is team user
public isTeamUser ( ) : boolean
Результат boolean Returns true if user is team user

isUser() публичный Метод

Checks if the user is account user (owner, admin, team user)
public isUser ( ) : boolean
Результат boolean

loadByApiAccessKey() публичный Метод

Loads user by the specified access key
public loadByApiAccessKey ( string $accessKey ) : Scalr_Account_User
$accessKey string An access key
Результат Scalr_Account_User

loadByEmail() публичный Метод

Loads user by an email
public loadByEmail ( string $email, $accountId = null ) : Scalr_Account_User
$email string The email of the user
Результат Scalr_Account_User

loadBySetting() публичный Метод

Loads user by the specified unique setting
public loadBySetting ( string $name, string $value ) : Scalr_Account_User
$name string The setting name
$value string The value
Результат Scalr_Account_User

save() публичный Метод

См. также: Scalr_Model::save()
public save ( $forceInsert = false )

setAclRoles() публичный Метод

This method modifies resords of two tables account_team_users and account_team_user_acls. Attention! It expects full list of the ACL roles relations for user. All missing relations will be removed.
public setAclRoles ( array $data = [] )
$data array ACL roles array which looks like array(teamId => array(accountRoleId1, accountRoleId2, ...))

setDashboard() публичный Метод

Set user dashboard
public setDashboard ( integer $envId, array $value )
$envId integer
$value array

setSetting() публичный Метод

Set user setting
public setSetting ( string $name, mixed $value ) : void
$name string
$value mixed
Результат void

setSshConsoleSettings() публичный Метод

public setSshConsoleSettings ( $settings )

setVar() публичный Метод

Set user var
public setVar ( string $name, mixed $value ) : void
$name string
$value mixed
Результат void

updateEmail() публичный Метод

public updateEmail ( $email )

updateLastLogin() публичный Метод

public updateLastLogin ( )

updateLoginAttempt() публичный Метод

Increases or resets the number of attempts to sign in
public updateLoginAttempt ( integer | null $loginattempt = null )
$loginattempt integer | null optional The number to increase

updatePassword() публичный Метод

public updatePassword ( $pwd )

Описание свойств

$account защищенное свойство

protected $account

$accountId публичное свойство

public $accountId

$comments публичное свойство

public $comments

$dbMessageKeyNotFound защищенное свойство

protected $dbMessageKeyNotFound

$dbPrimaryKey защищенное свойство

protected $dbPrimaryKey

$dbPropertyMap защищенное свойство

protected $dbPropertyMap

$dbTableName защищенное свойство

protected $dbTableName

$dtCreated публичное свойство

public $dtCreated

$dtLastLogin публичное свойство

public $dtLastLogin

$email публичное свойство

public $email

$fullname публичное свойство

public $fullname

$loginattempts публичное свойство

public $loginattempts

$password защищенное свойство

protected $password

$permissions защищенное свойство

protected $permissions

$settingsCache защищенное свойство

protected $settingsCache

$status публичное свойство

public $status

$type публичное свойство

public $type

$varCache защищенное свойство

protected $varCache