PHP Class Scalr_Account_User

See also: Scalr\Model\Entity\Account\User
Deprecation: This class has been deprecated since version 5.4.0. Please use new Scalr\Model\Entity\Account\User entity.
Inheritance: extends Scalr_Model
Afficher le fichier Open project: scalr/scalr Class Usage Examples

Méthodes publiques

Свойство Type Description
$accountId
$comments
$dtCreated
$dtLastLogin
$email
$fullname
$loginattempts
$status
$type

Protected Properties

Свойство Type Description
$account
$dbMessageKeyNotFound
$dbPrimaryKey
$dbPropertyMap
$dbTableName
$password
$permissions
$settingsCache
$varCache

Méthodes publiques

Méthode Description
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 )

Method Details

addDashboardWidget() public méthode

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() public méthode

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

canEditUser() public méthode

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
Résultat boolean Returns true if the user is allowed to edit specified user

canManageAcl() public méthode

Checks whether the user is allowed to manage ACL
public canManageAcl ( ) : boolean
Résultat boolean Returns true if user is allowed to manage ACL

canRemoveUser() public méthode

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
Résultat boolean Returns true if the user is allowed to remove specified user

checkPassword() public méthode

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
Résultat boolean Returns true if password is valid

create() public méthode

public create ( $email, $accountId )

delete() public méthode

See also: Scalr_Model::delete()
public delete ( $id = null )

getAccount() public méthode

public getAccount ( ) : Scalr_Account
Résultat Scalr_Account

getAccountId() public méthode

public getAccountId ( )

getAclRoles() public méthode

Gets account level roles for the user
public getAclRoles ( boolean $ignoreCache = false ) : Scalr\Acl\Role\AccountRoleSuperposition
$ignoreCache boolean
Résultat Scalr\Acl\Role\AccountRoleSuperposition Returns the list of the roles of account level

getAclRolesByEnvironment() public méthode

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.
Résultat Scalr\Acl\Role\AccountRoleSuperposition Returns the list of the roles of account level by specified environment

getAclRolesByTeam() public méthode

Gets roles by specified ID of team
public getAclRolesByTeam ( integer $teamId ) : Scalr\Acl\Role\AccountRoleSuperposition
$teamId integer The ID of the team
Résultat Scalr\Acl\Role\AccountRoleSuperposition Returns the list of the roles of account level by specified team

getDashboard() public méthode

Get user dashboard
public getDashboard ( integer $envId ) : array
$envId integer
Résultat array

getDefaultEnvironment() public méthode

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
Résultat Scalr_Environment Returns Environment object

getEmail() public méthode

Gets email address of the User
public getEmail ( ) : string
Résultat string Returns user email address

getEnvironments() public méthode

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
Résultat array

getGravatarHash() public méthode

public getGravatarHash ( )

getId() public méthode

Gets effective user identifier
public getId ( ) : integer
Résultat integer Returns identifier of the user

getLdapUsername() public méthode

Gets LDAP username of the User
public getLdapUsername ( ) : string
Résultat string Returns user LDAP username

getList() public static méthode

public static getList ( $accountId )

getPermissions() public méthode

Gets scalr permission object
public getPermissions ( ) : Scalr_Permissions
Résultat Scalr_Permissions

getSetting() public méthode

Returns user setting value by name
public getSetting ( string $name, boolean $ignoreCache = false ) : mixed
$name string
$ignoreCache boolean
Résultat mixed $value

getSshConsoleSettings() public méthode

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

getTeams() public méthode

public getTeams ( ) : array
Résultat array

getType() public méthode

public getType ( )

getUserInfo() public méthode

public getUserInfo ( )

getVar() public méthode

Returns user var value by name
public getVar ( string $name, boolean $ignoreCache = false ) : mixed
$name string
$ignoreCache boolean
Résultat mixed $value

init() public static méthode

public static init ( $className = null ) : Scalr_Account_User
Résultat Scalr_Account_User

isAccountAdmin() public méthode

Checks if the user is account admin
public isAccountAdmin ( ) : boolean
Résultat boolean Returns true if user is account admin

isAccountOwner() public méthode

Checks if the user is account owher
public isAccountOwner ( ) : boolean
Résultat boolean Returns true if user is account owner.

isAccountSuperAdmin() public méthode

Checks if the user is account admin
public isAccountSuperAdmin ( ) : boolean
Résultat boolean Returns true if user is account super admin

isAdmin() public méthode

Checks if the user is admin user (scalr, financial). It means user doesn't have current environment
public isAdmin ( ) : boolean
Résultat boolean

isEmailExists() public méthode

public isEmailExists ( $email )

isFinAdmin() public méthode

Checks if the user is Financial admin
public isFinAdmin ( ) : boolean
Résultat boolean Returns true if user is Financial Admin

isInTeam() public méthode

Check if user is included in team
public isInTeam ( integer $teamId ) : boolean
$teamId integer
Résultat boolean

isLeadVerified() public méthode

public isLeadVerified ( ) : boolean
Résultat boolean Returns true if lead is verified

isScalrAdmin() public méthode

Checks if the user is Scalr admin
public isScalrAdmin ( ) : boolean
Résultat boolean Returns true if user is Scalr Admin

isSubjectLead() public méthode

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
Résultat boolean Returns false if user is not lead of the subject

isTeamOwner() public méthode

Checks wheter this user is considered to be the team owner for the specified team.
Deprecation: This function has been deprecated since new ACL
public isTeamOwner ( integer $teamId = null ) : boolean
$teamId integer The identifier of the team.
Résultat boolean Returns true if the user is considered to be the team owner for the specified team.

isTeamOwnerInEnvironment() public méthode

Checks if the user is both AccountAdmin and member of the specified environment
Deprecation: This function has been deprecated since new ACL
public isTeamOwnerInEnvironment ( integer $envId ) : boolean
$envId integer The identifier of the environment
Résultat boolean

isTeamUser() public méthode

Checks if the user is team user
public isTeamUser ( ) : boolean
Résultat boolean Returns true if user is team user

isUser() public méthode

Checks if the user is account user (owner, admin, team user)
public isUser ( ) : boolean
Résultat boolean

loadByApiAccessKey() public méthode

Loads user by the specified access key
public loadByApiAccessKey ( string $accessKey ) : Scalr_Account_User
$accessKey string An access key
Résultat Scalr_Account_User

loadByEmail() public méthode

Loads user by an email
public loadByEmail ( string $email, $accountId = null ) : Scalr_Account_User
$email string The email of the user
Résultat Scalr_Account_User

loadBySetting() public méthode

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
Résultat Scalr_Account_User

save() public méthode

See also: Scalr_Model::save()
public save ( $forceInsert = false )

setAclRoles() public méthode

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() public méthode

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

setSetting() public méthode

Set user setting
public setSetting ( string $name, mixed $value ) : void
$name string
$value mixed
Résultat void

setSshConsoleSettings() public méthode

public setSshConsoleSettings ( $settings )

setVar() public méthode

Set user var
public setVar ( string $name, mixed $value ) : void
$name string
$value mixed
Résultat void

updateEmail() public méthode

public updateEmail ( $email )

updateLastLogin() public méthode

public updateLastLogin ( )

updateLoginAttempt() public méthode

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 méthode

public updatePassword ( $pwd )

Property Details

$account protected_oe property

protected $account

$accountId public_oe property

public $accountId

$comments public_oe property

public $comments

$dbMessageKeyNotFound protected_oe property

protected $dbMessageKeyNotFound

$dbPrimaryKey protected_oe property

protected $dbPrimaryKey

$dbPropertyMap protected_oe property

protected $dbPropertyMap

$dbTableName protected_oe property

protected $dbTableName

$dtCreated public_oe property

public $dtCreated

$dtLastLogin public_oe property

public $dtLastLogin

$email public_oe property

public $email

$fullname public_oe property

public $fullname

$loginattempts public_oe property

public $loginattempts

$password protected_oe property

protected $password

$permissions protected_oe property

protected $permissions

$settingsCache protected_oe property

protected $settingsCache

$status public_oe property

public $status

$type public_oe property

public $type

$varCache protected_oe property

protected $varCache