Warning: mysql_connect(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/zurmoorg/public_html/z-header.php on line 8

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/zurmoorg/public_html/z-header.php on line 8

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, $addScheme=false)
 getAvatarImageUrl ($size, $addScheme=false)
 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 hashPassword ($password)
static resolvePhpassHashObject ()
static mangleTableName ()
static canSaveMetadata ()
static getDefaultMetadata ()
static getActiveUserCount ($includeRootUser=false)
static getByCriteria ($active=true, $groupId=null)
static getRootUserCount ()
static isTypeDeletable ()
static getSortAttributesByAttribute ($attribute)
static makeActiveUsersQuerySearchAttributeData ($includeRootUser=false)
static getActiveUsers ($includeRootUser=false)

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 ()
 afterDelete ()
 logAuditEventsListForModified ($newModel)
 recursiveGetPropagatedActualAllowRight (Role $role, $moduleName, $rightName)
 getInheritedActualRightIgnoringEveryone ($moduleName, $rightName)
 getInheritedActualPolicyIgnoringEveryone ($moduleName, $policyName)
 setIsActive ()
 login ()

Static Protected Member Functions

static compareWithCurrentPasswordHash ($password, User $user)
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 compareWithCurrentPasswordHash ( password,
User user 
) [static, protected]

Compare provided password with the hash stored in database.

Parameters:
$password 
User $user
Returns:
bool

Definition at line 93 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 108 of file User.php.

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

Reimplemented from CustomFieldsModel.

Definition at line 135 of file User.php.

static getMixedInModelClassNames (  )  [static]
Returns:
array

Reimplemented from BeanModel.

Definition at line 178 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 210 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 239 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 263 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 294 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 312 of file User.php.

afterDelete (  )  [protected]

This method is invoked after deleting a record. The default implementation raises the onAfterDelete event. You may override this method to do postprocessing after the record is deleted. Make sure you call the parent implementation so that the event is raised properly.

Reimplemented from RedBeanModel.

Definition at line 322 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 345 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 379 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 507 of file User.php.

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

Reimplemented from Permitable.

Definition at line 544 of file User.php.

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

Reimplemented from Permitable.

Definition at line 645 of file User.php.

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

Reimplemented from Permitable.

Definition at line 671 of file User.php.

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

Definition at line 708 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 738 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 743 of file User.php.

beforeValidate (  ) 

Check if user's email is unique.

Returns:
boolean

Reimplemented from RedBeanModel.

Definition at line 855 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 897 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 993 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 1003 of file User.php.

isDeletable (  ) 

To be overridden by derived classes to prevent deletion.

Reimplemented from RedBeanModel.

Definition at line 1019 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 1033 of file User.php.

setIsActive (  )  [protected]

to change isActive attribute properly during save

Definition at line 1050 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 1077 of file User.php.

isAllowedToSetReadOnlyAttribute ( attributeName  ) 

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

Reimplemented from Item.

Definition at line 1098 of file User.php.

isSuperAdministrator (  ) 
Returns:
bool
Exceptions:
NotSupportedException 

Definition at line 1129 of file User.php.

static makeActiveUsersQuerySearchAttributeData ( includeRootUser = false  )  [static]

Make active users query search attributes data.

Parameters:
bool $includeRootUser
Returns:
array

Definition at line 1143 of file User.php.

static getActiveUsers ( includeRootUser = false  )  [static]

Get active users.

Returns:
array

Definition at line 1185 of file User.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Wed Mar 20 07:11:06 2019

Warning: mysql_connect(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/zurmoorg/public_html/z-footer.php on line 8

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/zurmoorg/public_html/z-footer.php on line 8