User Class Reference

Inheritance diagram for User:
Permitable Item CustomFieldsModel RedBeanModel BeanModel ObservableComponent

Public Member Functions

 __toString ()
 getFullName ()
 save ($runValidation=true, array $attributeNames=null)
 setPassword ($password)
 serializeAndSetAvatarData (Array $avatar)
 getAvatarImage ($size=250)
 getActualRight ($moduleName, $rightName)
 getPropagatedActualAllowRight ($moduleName, $rightName)
 getInheritedActualRight ($moduleName, $rightName)
 beforeValidate ()
 isUserEmailUnique ($email)
 getEmailSignature ()
 isDeletable ()
 setIsRootUser ()
 setIsSystemUser ()
 isAllowedToSetReadOnlyAttribute ($attributeName)
 setIsNotRootUser ()
 setIsNotSystemUser ()
 isSuperAdministrator ()

Static Public Member Functions

static getByUsername ($username)
static authenticate ($username, $password)
static resolveAuthenticatedUserCanLogin (User $user)
static getMixedInModelClassNames ()
static getModuleClassName ()
static getMetadata ()
static setMetadata (array $metadata)
static encryptPassword ($password)
static mangleTableName ()
static canSaveMetadata ()
static getDefaultMetadata ()
static getActiveUserCount ()
static getRootUserCount ()
static isTypeDeletable ()
static getSortAttributesByAttribute ($attribute)

Data Fields

const AVATAR_TYPE_DEFAULT = 1
const AVATAR_TYPE_PRIMARY_EMAIL = 2
const AVATAR_TYPE_CUSTOM_EMAIL = 3

Protected Member Functions

 constructDerived ($bean, $setDefaults)
 unrestrictedDelete ()
 linkBeans ()
 afterSave ()
 beforeSave ()
 beforeDelete ()
 logAuditEventsListForCreatedAndModifed ($newModel)
 recursiveGetPropagatedActualAllowRight (Role $role, $moduleName, $rightName)
 getInheritedActualRightIgnoringEveryone ($moduleName, $rightName)
 getInheritedActualPolicyIgnoringEveryone ($moduleName, $policyName)
 setIsActive ()
 login ()

Static Protected Member Functions

static translatedAttributeLabels ($language)

Detailed Description

Definition at line 37 of file User.php.


Member Function Documentation

static getByUsername ( username  )  [static]
Parameters:
string $username
Exceptions:
NotFoundException 

Definition at line 49 of file User.php.

static authenticate ( username,
password 
) [static]

Added fallback for system users to never be able to login

Parameters:
$username 
$password 
Returns:
An
Exceptions:
NoRightWebLoginException 
BadPasswordException 
ApiNoRightWebApiLoginException 

Definition at line 72 of file User.php.

static resolveAuthenticatedUserCanLogin ( User user  )  [static]

Check if authenticated user can login

Parameters:
User $user
Returns:
bool
Exceptions:
NoRightWebLoginException 
ApiNoRightWebApiLoginException 

Definition at line 94 of file User.php.

constructDerived ( bean,
setDefaults 
) [protected]
Parameters:
RedBean_OODBBean $bean
bool $setDefaults

Reimplemented from CustomFieldsModel.

Definition at line 121 of file User.php.

static getMixedInModelClassNames (  )  [static]
Returns:
array

Reimplemented from BeanModel.

Definition at line 164 of file User.php.

__toString (  ) 

Returns the displayable string for the class. Should be overridden in any model that can provide a meaningful string representation of itself.

Returns:
A string.

Reimplemented from RedBeanModel.

Definition at line 196 of file User.php.

save ( runValidation = true,
array $  attributeNames = null 
)

Saves the model to the database. Models are only saved if they have been modified and related models are saved before this model. If a related model is modified and needs saving the deems the model to be modified and need saving, which ensures that keys are updated. Cyclic relationships are prevented from causing problems by the save only proceeding to non-saved models.

Reimplemented from Item.

Definition at line 225 of file User.php.

afterSave (  )  [protected]

If a user is being added to a role, raise two events signaling a potential change in Rights/Policies for this user.

See also:
Permitable::afterSave()

Reimplemented from Permitable.

Definition at line 249 of file User.php.

beforeSave (  )  [protected]

If a user is removed from a role, raise two events signaling a potential change in Rights/Policies for this user.

See also:
Item::beforeSave()

Reimplemented from Item.

Definition at line 271 of file User.php.

beforeDelete (  )  [protected]

This method is invoked before deleting a record. The default implementation raises the onBeforeDelete event. You may override this method to do any preparation work for record deletion. Make sure you call the parent implementation so that the event is raised properly.

Returns:
boolean whether the record should be deleted. Defaults to true.

Reimplemented from RedBeanModel.

Definition at line 289 of file User.php.

static getMetadata (  )  [static]

Returns metadata for the model. Attempts to cache metadata, if it is not already cached.

See also:
getDefaultMetadata()
Returns:
An array of metadata.

Reimplemented from RedBeanModel.

Definition at line 317 of file User.php.

static setMetadata ( array $  metadata  )  [static]

Sets metadata for the model.

See also:
getDefaultMetadata()
Returns:
An array of metadata.

Reimplemented from RedBeanModel.

Definition at line 351 of file User.php.

static mangleTableName (  )  [static]

By default the table name is the lowercased class name. If this conflicts with a database keyword override to return true. RedBean does not quote table names in most cases.

Reimplemented from RedBeanModel.

Definition at line 450 of file User.php.

getActualRight ( moduleName,
rightName 
)
Parameters:
string $moduleName
string $rightName
Returns:
int
Exceptions:
NotSupportedException 

Reimplemented from Permitable.

Definition at line 485 of file User.php.

getInheritedActualRight ( moduleName,
rightName 
)
Parameters:
string $moduleName
string $rightName
Returns:
int

Reimplemented from Permitable.

Definition at line 586 of file User.php.

getInheritedActualRightIgnoringEveryone ( moduleName,
rightName 
) [protected]
Parameters:
string $moduleName
string $rightName
Returns:
int|void
Exceptions:
NotSupportedException 

Reimplemented from Permitable.

Definition at line 612 of file User.php.

getInheritedActualPolicyIgnoringEveryone ( moduleName,
policyName 
) [protected]
Parameters:
string $moduleName
string $policyName
Returns:
null

Definition at line 649 of file User.php.

static canSaveMetadata (  )  [static]

By default models cannot save their metadata, allowing them to be loaded quickly because the loading of of metadata can be avoided as much as possible. To make a model able to save its metadata override this method to return true. PUT it before the getDefaultMetadata in the derived class.

Reimplemented from RedBeanModel.

Definition at line 679 of file User.php.

static getDefaultMetadata (  )  [static]

Returns the default meta data for the class. It must be appended to the meta data from the parent model, if any.

Reimplemented from Permitable.

Definition at line 684 of file User.php.

beforeValidate (  ) 

Check if user's email is unique.

Returns:
boolean

Reimplemented from RedBeanModel.

Definition at line 788 of file User.php.

isUserEmailUnique ( email  ) 

Check if user email is unique in system. Two users can't share same email address.

Parameters:
string $email
Returns:
bool

Definition at line 809 of file User.php.

static isTypeDeletable (  )  [static]

To be overriden on intermediate derived classes to return false so that deletes are not done on intermediate classes because the object relational mapping will not clean up properly. For example if User is a Person, and Person is a RedBeanModel delete should be called only on User, not on Person. So User must override isDeletable to return false.

Reimplemented from Permitable.

Definition at line 902 of file User.php.

getEmailSignature (  ) 

Currently user only supports a single email signature even though the architecture is setup to handle more than one.

Returns:
EmailSignature object

Definition at line 912 of file User.php.

isDeletable (  ) 

To be overridden by derived classes to prevent deletion.

Reimplemented from RedBeanModel.

Definition at line 928 of file User.php.

setIsRootUser (  ) 

Sets the user as the root user only if there is not an existing root user. There is only one root user allowed

Exceptions:
NotSupportedException 

Definition at line 942 of file User.php.

setIsActive (  )  [protected]

to change isActive attribute properly during save

Definition at line 959 of file User.php.

static getSortAttributesByAttribute ( attribute  )  [static]

Overriding so when sorting by lastName it sorts bye firstName lastName

Reimplemented from RedBeanModel.

Definition at line 981 of file User.php.

isAllowedToSetReadOnlyAttribute ( attributeName  ) 

Handle the search scenario for isActive, isRootUser and isSystemUser attributes.

Reimplemented from Item.

Definition at line 1002 of file User.php.

isSuperAdministrator (  ) 
Returns:
bool

Definition at line 1032 of file User.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Tue May 23 07:10:30 2017