Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Static Private Member Functions | Private Attributes | List of all members
eZUser Class Reference

eZUser handles eZ Publish user accounts More...

Inheritance diagram for eZUser:

## Public Member Functions
| __construct ( $row=array())
| eZUser ( $row=array())
| hasManageLocations ()
| store ( $fieldFilters=null)
| originalPassword ()
| setOriginalPassword ( $password)
| originalPasswordConfirm ()
| setOriginalPasswordConfirm ( $password)
| hasStoredLogin ()
| setInformation ( $id, $login, $email, $password, $passwordConfirm=false)
| id ()
| sessionCleanup ()
| loginCurrent ()
| getUserCache ()
| purgeUserCache ()
| setUserCache (array $userCache)
| lastVisit ()
| loginCount ()
| failedLoginAttempts ()
| isLocked ()
| isEnabled ( $useCache=true)
| isAnonymous ()
| hasAccessTo ( $module, $function=false)
| accessArray ()
| generateAccessArray ()
| canAssignToObjectSectionList ( $contentObject)
| canAssignSectionToObject ( $checkSectionID, $contentObject)
| canAssignSection ( $checkSectionID)
| canAssignSectionList ()
| canAssignSectionToClassList ( $checkSectionID)
| hasAccessToView ( $module, $viewName, &$params)
| roles ()
| roleIDList ()
| limitList ( $useGroupsCache=true)
| limitValueList ()
| contentObject ()
| accountKey ()
| isLoggedIn ()
| isRegistered ()
| groups ( $asObject=false)
| checkUser (&$siteBasics, $uri)
| preCollectUserInfo ()
| postCollectUserInfo ()
| loginURI ()
| forceLogin ()
| canLoginToSiteAccess ( $access)
Public Member Functions inherited from eZPersistentObject
| eZPersistentObject ( $row=null)
| fill ( $row)
| remove ( $conditions=null, $extraConditions=null)
| sync ( $fieldFilters=null)
| attributes ()
| hasAttribute ( $attr)
| attribute ( $attr, $noFunction=false)
| setAttribute ( $attr, $val)
| hasDirtyData ()
| setHasDirtyData ( $hasDirtyData)

## Static Public Member Functions
static | definition ()
static | passwordHashTypeName ( $id)
static | passwordHashTypeID ( $identifier)
static | create ( $contentObjectID)
static | fetch ( $id, $asObject=true)
static | fetchByName ( $login, $asObject=true)
static | fetchByEmail ( $email, $asObject=true)
static | fetchUnactivated ( $sort=false, $limit=10, $offset=0)
static | fetchLoggedInList ( $asObject=false, $offset=false, $limit=false, $sortBy=false)
static | fetchLoggedInCount ()
static | fetchAnonymousCount ()
static | isUserLoggedIn ( $userID)
static | clearSessionCache ()
static | removeSessionData ( $userID)
static | removeUser ( $userID)
static | fetchContentList ()
static | hashType ()
static | site ()
static | fetchBuiltin ( $id)
static | authenticationMatch ()
static | requireUniqueEmail ()
static | loginUser ( $login, $password, $authenticationMatch=false)
static | isUserIPInList ( $ipList)
static | isTrusted ()
static | maxNumberOfFailedLogin ()
static | isEnabledAfterFailedLogin ( $userID, $ignoreTrusted=false)
static | setCurrentlyLoggedInUser ( $user, $userID, $flags=0)
static | cleanup ()
static | logoutCurrent ()
static | updateLastVisitByLogout ( $userID)
static | instance ( $id=false)
static | purgeUserCacheByAnonymousId ()
static | purgeUserCacheByUserId ( $userId)
static | getUserCacheByAnonymousId ()
static | retrieveUserCacheFromFile ( $filePath, $mtime, $userId)
static | generateUserCacheForFile ( $filePath, $userId)
static | updateLastVisit ( $userID, $updateLoginCount=false)
static | setFailedLoginAttempts ( $userID, $value=false, $setByForce=false)
static | failedLoginAttemptsByUserID ( $userID)
static | currentUser ()
static | currentUserID ()
static | authenticateHash ( $user, $password, $site, $type, $hash)
static | passwordCharacterTable ()
static | isUserObject ( $contentObject)
static | createPassword ( $passwordLength, $seed=false)
static | createHash ( $user, $password, $site, $type, $hash=false)
static | isCurrentUserRegistered ()
static | getCacheDir ( $userId=0)
static | cleanupCache ()
static | fetchUserClassList ( $asObject=false, $fields=false)
static | fetchUserClassNames ()
static | fetchUserGroupClassNames ()
static | validatePassword ( $password)
static | validateLoginName ( $loginName, &$errorText)
static | anonymousId ()
static | contentClassIDs ()
Static Public Member Functions inherited from eZPersistentObject
static | replaceFieldsWithShortNames (eZDBInterface $db, array $fieldDefs, &$fields)
static | count ( $def, $conds=null, $field=null)
static | fetchObject ( $def, $field_filters, $conds, $asObject=true, $grouping=null, $custom_fields=null)
static | removeObject ( $def, $conditions=null, $extraConditions=null)
static | storeObject ( $obj, $fieldFilters=null)
static | conditionText ( $conditions)
static | conditionTextByRow ( $conditions, $row)
static | fetchObjectList ( $def, $field_filters=null, $conds=null, $sorts=null, $limit=null, $asObject=true, $grouping=false, $custom_fields=null, $custom_tables=null, $custom_conds=null)
static | handleRows ( $rows, $class_name, $asObject)
static | swapRow ( $table, $keys, $order_id, $rows, $id1, $id2)
static | newObjectOrder ( $def, $orderField, $conditions)
static | reorderObject ( $def, $orderField, $conditions, $down=true)
static | escapeArray ( $array)
static | updateObjectList ( $parameters)
static | getShortAttributeName ( $db, $def, $attrName)

## Public Attributes
| $GroupsAsObjects
const | PASSWORD_HASH_EMPTY = 0
| No hash, used by external handlers such as LDAP and TextFile. More...
const | PASSWORD_HASH_MD5_PASSWORD = 1
| MD5 of password. More...
const | PASSWORD_HASH_MD5_USER = 2
| MD5 of user and password. More...
const | PASSWORD_HASH_MD5_SITE = 3
| MD5 of site, user and password. More...
const | PASSWORD_HASH_MYSQL = 4
const | PASSWORD_HASH_PLAINTEXT = 5
| Passwords in plaintext, should not be used for real sites. More...
const | PASSWORD_HASH_BCRYPT = 6
| Passwords in bcrypt format. More...
const | PASSWORD_HASH_PHP_DEFAULT = 7
| Passwords in PHP default format. More...
const | DEFAULT_PASSWORD_HASH = self::PASSWORD_HASH_PHP_DEFAULT
const | AUTH_STRING_MAX_LENGTH = 4096
const | AUTHENTICATE_LOGIN = 1
| Authenticate by matching the login field. More...
const | AUTHENTICATE_EMAIL = 2
| Authenticate by matching the email field. More...
const | AUTHENTICATE_ALL = 3
const | NO_SESSION_REGENERATE = 1
| $Login
| $Email
| $PasswordHash
| $PasswordHashType
| $Groups
| $OriginalPassword
| $OriginalPasswordConfirm
| $AccessArray
| $ContentObjectID
Public Attributes inherited from eZPersistentObject
| $PersistentDataDirty
| $ID
| $ContentObjectID
| $SectionID
| $OwnerID
| $ClassID
| $Published
| $Modified
| $CurrentVersion
| $Status
| $RemoteID
| $LanguageMask
| $InitialLanguageID
| $NodeID
| $ParentNodeID
| $MainNodeID
| $ContentObjectVersion
| $ContentObjectIsPublished
| $Depth
| $SortField
| $SortOrder
| $Priority
| $ModifiedSubNode
| $PathString
| $PathIdentificationString
| $IsHidden
| $IsInvisible
| $UserID
| $Name
| $Locale
| $Identifier
| $NavigationPartIdentifier
| $SerializedDescriptionList
| $URLAliasName
| $AlwaysAvailable
| $CanTranslate
| $DataInt1
| $DataInt2
| $DataInt3
| $DataInt4
| $DataFloat1
| $DataFloat2
| $DataFloat3
| $DataFloat4
| $DataText1
| $DataText2
| $DataText3
| $DataText4
| $DataText5
| $SerializedDataText
| $Category
| $PolicyID
| $Values
| $Created
| $CurrencyCode
| $ProductCollectionID
| $ItemCount
| $Price
| $IsVATIncluded
| $VATValue
| $DiscountValue
| $Email
| $IsTemporary
| $IsArchived
| $IsActive
| $OrderID
| $ModifierID
| $Code
| $Symbol
| $AutoRateValue
| $CustomRateValue
| $RateFactor
| $Main
| $MementoKey
| $MainKey
| $WorkflowEventPos
| $LanguageID
| $ContentObjectStateGroupID
| $contentobject_attribute_id
| $contentobject_id
| $rating
| $rating_count
| $rating_average

## Protected Member Functions
| generateGroupIdList ()
| fetchUserCacheIfNeeded ()
| setCachingEnabled ( $cachingEnabled)

## Static Protected Member Functions
static | loginSucceeded ( $user)
static | loginFailed ( $userID, $login)
static | _loginUser ( $login, $password, $authenticationMatch=false)
static | getUserCacheByUserId ( $userId)
static | userInfoExpiry ()
Static Protected Member Functions inherited from eZPersistentObject
static | replaceFieldsWithLongNames (eZDBInterface $db, array $fieldDefs, &$fields)

## Protected Attributes
| $UserCache = null

## Static Protected Attributes
static | $anonymousId = null
static | $userHasLoggedOut = false

## Static Private Member Functions
static | generateUserCacheContent ( $userId)
static | generateUserCacheData ( $userId)
static | trimAuthString ( $string)

## Private Attributes
| $CachingEnabled = true

## Detailed Description

eZUser handles eZ Publish user accounts

Definition at line 18 of file ezuser.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZUser::__construct | ( |  | $row = `array()` | ) |

Initializes the object with the $row.

It will try to set each field taken from the database row. Calls fill to do the job. If $row is an integer, it will try to fetch it from the database using it as the unique ID.

Parameters

  int | array | $row |

Reimplemented from eZPersistentObject.

Definition at line 67 of file ezuser.php.

Referenced by eZUser().

## Member Function Documentation

## ◆ _loginUser()

static eZUser::_loginUser | ( |  | $login,
|  |  | $password,
|  |  | $authenticationMatch = `false`
| ) |  |
| static protected

Logs in an user if applied login and password is valid.

This method does not do any house keeping work anymore (writing audits, etc). When you call this method make sure to call loginSucceeded() or loginFailed() depending on the success of the login.

Parameters

  string | $login |
  string | $password |
  bool | $authenticationMatch |

Returns
  mixed eZUser object on log in success, int userID if the username exists but log in failed, or false if the username doesn't exists.

Definition at line 825 of file ezuser.php.

References authenticateHash(), authenticationMatch(), createHash(), eZUser(), eZUserSetting\fetch(), hashType(), eZDB\instance(), eZHTTPTool\instance(), isEnabledAfterFailedLogin(), site(), eZContentObject\STATUS_PUBLISHED, trimAuthString(), eZMail\validate(), and eZDebugSetting\writeDebug().

Referenced by loginUser().

## ◆ accessArray()

eZUser::accessArray | ( |  | ) |

Returns either cached or newly generated accessArray for the user depending on site.ini[RoleSettings]\EnableCaching setting

@access private

Returns
  array

Definition at line 1995 of file ezuser.php.

References $AccessArray, generateAccessArray(), and getUserCache().

Referenced by hasAccessTo().

## ◆ accountKey()

eZUser::accountKey | ( |  | ) |

Returns the eZUserAccountKey associated with this user

Returns
  eZUserAccountKey

Definition at line 2529 of file ezuser.php.

References eZUserAccountKey\fetchByUserID().

## ◆ anonymousId()

static eZUser::anonymousId | ( |  | ) |
| static

Gets the id of the anonymous user.

Returns
  int User id of anonymous user.

Definition at line 2898 of file ezuser.php.

References $anonymousId.

Referenced by fetchAnonymousCount(), fetchBuiltin(), eZUserDiscountRule\fetchIDListByUserID(), fetchLoggedInCount(), fetchLoggedInList(), instance(), isRegistered(), logoutCurrent(), and eZUserDiscountRule\store().

## ◆ authenticateHash()

static eZUser::authenticateHash | ( |  | $user,
|  |  | $password,
|  |  | $site,
|  |  | $type,
|  |  | $hash
| ) |  |
| static

Creates a hash out of $user, $password and $site according to the type $type.

Returns
  true if the generated hash is equal to the supplied hash $hash.

Definition at line 1741 of file ezuser.php.

References createHash().

Referenced by _loginUser(), eZLDAPUser\loginUser(), and eZTextFileUser\loginUser().

## ◆ authenticationMatch()

static eZUser::authenticationMatch | ( |  | ) |
| static

Returns
  a bitfield which decides the authenticate methods.

Definition at line 719 of file ezuser.php.

References AUTHENTICATE_EMAIL, and AUTHENTICATE_LOGIN.

Referenced by _loginUser(), eZLDAPUser\loginUser(), eZTextFileUser\loginUser(), and eZUserType\validateObjectAttributeHTTPInput().

## ◆ canAssignSection()

eZUser::canAssignSection | ( |  | $checkSectionID | ) |

Definition at line 2154 of file ezuser.php.

References hasAccessTo().

## ◆ canAssignSectionList()

eZUser::canAssignSectionList | ( |  | ) |

Definition at line 2185 of file ezuser.php.

References hasAccessTo().

## ◆ canAssignSectionToClassList()

eZUser::canAssignSectionToClassList | ( |  | $checkSectionID | ) |

Definition at line 2219 of file ezuser.php.

References eZContentClass\fetchList(), hasAccessTo(), and eZContentClass\VERSION_STATUS_DEFINED.

## ◆ canAssignSectionToObject()

eZUser::canAssignSectionToObject | ( |  | $checkSectionID,
|  |  | $contentObject
| ) |  |

Definition at line 2095 of file ezuser.php.

References eZPersistentObject\attribute(), and hasAccessTo().

## ◆ canAssignToObjectSectionList()

eZUser::canAssignToObjectSectionList | ( |  | $contentObject | ) |

Definition at line 2053 of file ezuser.php.

References eZPersistentObject\attribute(), and hasAccessTo().

## ◆ canLoginToSiteAccess()

eZUser::canLoginToSiteAccess | ( |  | $access | ) |

Definition at line 2928 of file ezuser.php.

References eZSys\ezcrc32(), and hasAccessTo().

## ◆ checkUser()

eZUser::checkUser | ( | & | $siteBasics,
|  |  | $uri
| ) |  |

Checks if user is logged in, if not and the site requires user login for access a module redirect is returned.

Returns
  null, user login not required.

Definition at line 2653 of file ezuser.php.

References currentUser(), eZHTTPTool\instance(), and logoutCurrent().

## ◆ cleanup()

static eZUser::cleanup | ( |  | ) |
| static

Cleanup user related session values, for use by login / logout code

Definition at line 1082 of file ezuser.php.

References eZHTTPTool\instance(), and eZPreferences\sessionCleanup().

Referenced by logoutCurrent(), and setCurrentlyLoggedInUser().

## ◆ cleanupCache()

static eZUser::cleanupCache | ( |  | ) |
| static

Expire user access / info cache globally

Definition at line 2767 of file ezuser.php.

Referenced by eZRole\expireCache().

## ◆ clearSessionCache()

static eZUser::clearSessionCache | ( |  | ) |
| static

Removes any cached session information, this is:

- logged in user count
- anonymous user count
- logged in user map

Definition at line 605 of file ezuser.php.

Referenced by removeSessionData().

## ◆ contentClassIDs()

static eZUser::contentClassIDs | ( |  | ) |
| static

Returns the IDs of content classes that contain user accounts

Definition at line 2912 of file ezuser.php.

References eZContentClass\fetchIDListContainingDatatype().

Referenced by eZApproveType\execute(), eZContentObjectTreeNode\isNodeTrashAllowed(), eZContentObjectTreeNodeOperations\move(), and eZContentObjectTreeNode\removeThis().

## ◆ contentObject()

eZUser::contentObject | ( |  | ) |

Definition at line 2515 of file ezuser.php.

References eZContentObject\fetch().

## ◆ create()

static eZUser::create | ( |  | $contentObjectID | ) |
| static

Definition at line 237 of file ezuser.php.

References eZUser().

Referenced by eZUserType\fetchObjectAttributeHTTPInput(), eZUserType\fromString(), eZTextFileUser\loginUser(), eZLDAPUser\publishUpdateUser(), eZUserType\unserializeContentObjectAttribute(), and eZSiteInstaller\updateContentObjectAttributes().

## ◆ createHash()

static eZUser::createHash | ( |  | $user,
|  |  | $password,
|  |  | $site,
|  |  | $type,
|  |  | $hash = `false`
| ) |  |
| static

Will create a hash of the given string. This is used to store the passwords in the database.

Definition at line 1846 of file ezuser.php.

References eZDB\instance(), trimAuthString(), eZDebugSetting\writeDebug(), and eZDebug\writeError().

Referenced by _loginUser(), authenticateHash(), eZLDAPUser\loginUser(), eZTextFileUser\loginUser(), and setInformation().

## ◆ createPassword()

static eZUser::createPassword | ( |  | $passwordLength,
|  |  | $seed = `false`
| ) |  |
| static

Creates a password with number of characters equal to $passwordLength and returns it. If you want pass a value in $seed it will be used as basis for the password, if not it will use the current time value as seed.

Note
  If $passwordLength exceeds 16 it will need to generate new seed for the remaining characters.

Definition at line 1816 of file ezuser.php.

References eZPersistentObject\count(), and passwordCharacterTable().

## ◆ currentUser()

static eZUser::currentUser | ( |  | ) |
| static

Returns the currently logged in user.

Definition at line 1716 of file ezuser.php.

References instance(), and logoutCurrent().

Referenced by eZDefaultShopAccountHandler\accountName(), eZCollaborationItemMessageLink\addMessage(), eZContentObject\allowedAssignSectionList(), eZContentObject\allowedAssignStateIDList(), eZSection\applyTo(), eZGeneralDigestHandler\attribute(), eZSubTreeHandler\attribute(), eZContentObject\cacheInfo(), eZContentObject\canCreateClassList(), eZContentObjectTreeNode\canCreateClassList(), eZContentObject\canEdit(), eZContentObjectTreeNode\canEdit(), eZContentClass\canInstantiateClasses(), eZContentClass\canInstantiateClassList(), eZOrder\canModifyStatus(), eZContentObject\canTranslate(), eZPackage\canUsePackagePolicyFunction(), eZPackage\canUsePolicyFunction(), eZContentObject\checkAccess(), eZContentObjectTreeNode\checkAccess(), eZContentObjectVersion\checkAccess(), eZSubtreeNotificationRule\checkObjectAccess(), eZPackageCreationHandler\checkPackageMaintainer(), checkUser(), eZUserType\classAttributeRemovableInformation(), eZContentObject\classListFromPolicy(), eZContentObjectTreeNode\classListFromPolicy(), eZContentObject\copy(), eZContentObject\copyVersion(), eZContentObjectVersion\create(), eZInformationCollection\create(), eZCollaborationSimpleMessage\create(), eZRSSImport\create(), eZBasket\createOrder(), eZContentObjectTreeNode\createPermissionCheckingSQL(), eZPackageCreationHandler\creatorList(), currentUserID(), eZWishList\currentWishList(), eZWishList\discountPercent(), eZDefaultShopAccountHandler\email(), eZApproveType\execute(), eZMultiplexerType\execute(), eZSubTreeHandler\fetchHttpInput(), eZPackage\fetchMaintainerRoleIDList(), eZContentCacheManager\generateObjectViewCache(), eZInformationCollection\generateUserIdentifier(), eZContentObjectTreeNode\getLimitationList(), eZVATManager\getUserCountry(), eZApproveCollaborationHandler\handleCustomAction(), eZContentClass\initializeCopy(), eZPackageCreationHandler\initializePackageChangelog(), eZPackageCreationHandler\initializePackageInformation(), eZPackageCreationHandler\initializePackageMaintainer(), eZCollaborationProfile\instance(), eZContentClass\instantiate(), isCurrentUserRegistered(), eZCollaborationGroup\itemCount(), eZLDAPUser\loginUser(), eZTopMenuOperator\modify(), eZAuthorType\objectAttributeContent(), eZSubtreeSubscriptionType\onPublish(), eZContentObjectTreeNode\removeSubtrees(), eZCollaborationNotificationHandler\rules(), eZSubTreeHandler\rules(), eZSubTreeHandler\rulesCount(), eZTrigger\runTrigger(), eZGeneralDigestHandler\settings(), eZPreferences\setValue(), eZContentObjectTreeNodeOperations\showNotificationAfterCopying(), eZOrder\statusModificationList(), eZRSSImport\store(), eZPDFExport\store(), eZRSSExport\store(), eZGeneralDigestHandler\storeSettings(), eZContentClass\storeVersioned(), eZSubTreeHandler\subscribedNodes(), eZCollaborationGroup\subTree(), eZPreferences\value(), eZPreferences\values(), and eZAudit\writeAudit().

## ◆ currentUserID()

static eZUser::currentUserID | ( |  | ) |
| static

Returns the ID of the currently logged in user.

Definition at line 1731 of file ezuser.php.

References currentUser().

Referenced by eZDebug\checkDebugByUser(), eZContentObject\cleanupAllInternalDrafts(), eZContentObject\cleanupInternalDrafts(), eZCollaborationItemStatus\create(), eZCollaborationNotificationRule\create(), eZOrderStatusHistory\create(), eZContentClassGroup\create(), eZContentClass\create(), eZContentObjectTreeNode\dataMap(), eZCollaborationItemGroupLink\fetch(), eZCollaborationItemStatus\fetch(), eZCollaborationItemGroupLink\fetchList(), eZCollaborationNotificationRule\fetchList(), eZCollaborationItem\fetchListTool(), eZContentObjectPackageHandler\installContentObjects(), eZCollaborationItem\isCreator(), eZTemplateRoleOperator\modify(), eZOrder\modifyStatus(), eZCollaborationNotificationRule\removeByIdentifier(), eZCollaborationItemParticipantLink\setLastRead(), eZCollaborationItem\setLastRead(), eZPreferences\setValue(), eZPackage\temporaryExportPath(), eZCollaborationItemStatus\updateFields(), and eZCollaborationItem\userStatus().

## ◆ definition()

static eZUser::definition | ( |  | ) |
| static

Returns the definition for the object, the default implementation is to return an empty array. It's upto each inheriting class to return a proper definition array.

The definition array is an associative array consists of these keys:

- fields: an associative array of fields which defines which database field (the key) is to fetched and how they map to object member variables (the value).
- keys: an array of fields which is used for uniquely identifying the object in the table.
- function_attributes: an associative array of attributes which maps to member functions, used for fetching data with functions.
- set_functions: an associative array of attributes which maps to member functions, used for setting data with functions.
- increment_key: the field which is incremented on table inserts.
- class_name: the classname which is used for instantiating new objecs when fetching from the database.
- sort: an associative array which defines the default sorting of lists, the key is the table field while the value is the sorting method which is either 'asc' or 'desc'.
- name: the name of the database table

Example: `public static function definition() { return array( "fields" => array( "id" => "ID", "version" => "Version", "name" => "Name" ), "keys" => array( "id", "version" ), "function_attributes" => array( "current" => "currentVersion", "class_name" => "className" ), "increment_key" => "id", "class_name" => "eZContentClass", "sort" => array( "id" => "asc" ), "name" => "ezcontentclass" ); }`

Returns
  array

Reimplemented from eZPersistentObject.

Definition at line 83 of file ezuser.php.

Referenced by fetch(), fetchByEmail(), fetchByName(), fetchUnactivated(), and removeUser().

## ◆ eZUser()

eZUser::eZUser | ( |  | $row = `array()` | ) |

Deprecated:
  Use eZUser::__construct() instead

Parameters

  array | $row |

Definition at line 78 of file ezuser.php.

References __construct().

Referenced by _loginUser(), create(), fetchLoggedInList(), instance(), eZLDAPUser\loginUser(), and eZTextFileUser\loginUser().

## ◆ failedLoginAttempts()

eZUser::failedLoginAttempts | ( |  | ) |

Returns the current user's number of failed login attempts.

Definition at line 1653 of file ezuser.php.

References eZPersistentObject\attribute(), and failedLoginAttemptsByUserID().

## ◆ failedLoginAttemptsByUserID()

static eZUser::failedLoginAttemptsByUserID | ( |  | $userID | ) |
| static

Returns the current user's number of failed login attempts.

Definition at line 1661 of file ezuser.php.

References eZDB\instance().

Referenced by failedLoginAttempts().

## ◆ fetch()

static eZUser::fetch | ( |  | $id,
|  |  | $asObject = `true`
| ) |  |
| static

Parameters

  integer | $id |
  bool | $asObject |

Returns
  eZUser|null

Definition at line 351 of file ezuser.php.

References definition(), and eZPersistentObject\fetchObject().

Referenced by eZGeneralDigestUserSettings\address(), eZOrder\canModifyStatus(), eZCollaborationItem\creator(), eZContentClass\creator(), eZContentClassGroup\creator(), eZInformationCollection\creator(), eZWorkflow\creator(), eZWorkflowGroup\creator(), eZUserType\deleteStoredObjectAttribute(), eZOrder\discount(), eZMultiplexerType\execute(), fetchBuiltin(), eZContentCacheManager\generateObjectViewCache(), generateUserCacheData(), instance(), isEnabledAfterFailedLogin(), eZTemplateRoleOperator\isMemberOfAnyRole(), eZTemplateRoleOperator\isMemberOfRole(), eZTemplateRoleOperator\isMemberOfRoleId(), eZTextFileUser\loginUser(), eZTemplateRoleOperator\memberOfRoleByUserId(), eZContentClass\modifier(), eZContentClassGroup\modifier(), eZPDFExport\modifier(), eZRSSExport\modifier(), eZRSSImport\modifier(), eZWorkflow\modifier(), eZWorkflowGroup\modifier(), eZUserType\objectAttributeContent(), eZRSSImport\objectOwner(), eZCollaborationItemParticipantLink\participant(), removeUser(), eZUserType\serializeContentObjectAttribute(), eZUserSetting\setAttribute(), setFailedLoginAttempts(), eZPreferences\setValue(), eZOrder\statusModificationList(), eZUserType\toString(), eZUserType\unserializeContentObjectAttribute(), eZCollaborationGroup\user(), eZCollaborationItemGroupLink\user(), eZOrder\user(), eZCollaborationNotificationRule\user(), and eZTemplateRoleOperator\userHasPolicy().

## ◆ fetchAnonymousCount()

static eZUser::fetchAnonymousCount | ( |  | ) |
| static

Return the number of anonymous users in the system.

Deprecated:
  As of 4.4 since default session handler does not support this.

Returns
  int

Definition at line 549 of file ezuser.php.

References anonymousId(), and eZDB\instance().

## ◆ fetchBuiltin()

static eZUser::fetchBuiltin | ( |  | $id | ) |
| static

Fetches a builtin user and returns it, this helps avoid special cases where user is not logged in.

Definition at line 697 of file ezuser.php.

References anonymousId(), and fetch().

## ◆ fetchByEmail()

static eZUser::fetchByEmail | ( |  | $email,
|  |  | $asObject = `true`
| ) |  |
| static

Definition at line 369 of file ezuser.php.

References definition(), and eZPersistentObject\fetchObject().

Referenced by eZGeneralDigestUserSettings\fetchForUser(), eZUserType\fromString(), eZGeneralDigestUserSettings\removeByAddress(), and eZUserType\validateObjectAttributeHTTPInput().

## ◆ fetchByName()

static eZUser::fetchByName | ( |  | $login,
|  |  | $asObject = `true`
| ) |  |
| static

Definition at line 361 of file ezuser.php.

References definition(), and eZPersistentObject\fetchObject().

Referenced by eZUserType\fromString(), eZTextFileUser\loginUser(), eZLDAPUser\publishUpdateUser(), and eZUserType\validateObjectAttributeHTTPInput().

## ◆ fetchContentList()

static eZUser::fetchContentList | ( |  | ) |
| static

Returns
  a list of valid and enabled users, the data returned is an array with ezcontentobject database data.

Definition at line 657 of file ezuser.php.

References eZDB\instance(), and eZContentObject\STATUS_PUBLISHED.

## ◆ fetchLoggedInCount()

static eZUser::fetchLoggedInCount | ( |  | ) |
| static

Returns
  the number of logged in users in the system.

Note
  The count will be cached for the current page if caching is allowed.

See also
  fetchAnonymousCount

Definition at line 523 of file ezuser.php.

References anonymousId(), and eZDB\instance().

## ◆ fetchLoggedInList()

static eZUser::fetchLoggedInList | ( |  | $asObject = `false`,
|  |  | $offset = `false`,
|  |  | $limit = `false`,
|  |  | $sortBy = `false`
| ) |  |
| static

Returns
  a list of the logged in users.

Parameters

  $asObject | If false it will return a list with only the names of the users as elements and user ID as key, otherwise each entry is a eZUser object.

See also
  fetchLoggedInCount

Definition at line 413 of file ezuser.php.

References anonymousId(), eZUser(), eZDB\instance(), and eZDebug\writeError().

## ◆ fetchUnactivated()

static eZUser::fetchUnactivated | ( |  | $sort = `false`,
|  |  | $limit = `10`,
|  |  | $offset = `0`
| ) |  |
| static

Return an array of unactivated eZUser object

Parameters

  | array|false|null | An associative array of sorting conditions, if set to false ignores settings in $def, if set to null uses settingss in $def.
  int | $limit |
  int | $offset |

Returns
  array( eZUser )

Definition at line 387 of file ezuser.php.

References definition(), eZUserAccountKey\definition(), eZUserSetting\definition(), and eZPersistentObject\fetchObjectList().

## ◆ fetchUserCacheIfNeeded()

eZUser::fetchUserCacheIfNeeded | ( |  | ) |
| protected

Fetches user cache when given preconditions are met

Definition at line 2966 of file ezuser.php.

References getUserCache().

Referenced by groups().

## ◆ fetchUserClassList()

static eZUser::fetchUserClassList | ( |  | $asObject = `false`,
|  |  | $fields = `false`
| ) |  |
| static

Definition at line 2774 of file ezuser.php.

References eZPersistentObject\handleRows(), eZDB\instance(), and eZContentClass\VERSION_STATUS_DEFINED.

Referenced by fetchUserClassNames(), and fetchUserGroupClassNames().

## ◆ fetchUserClassNames()

static eZUser::fetchUserClassNames | ( |  | ) |
| static

Definition at line 2806 of file ezuser.php.

References fetchUserClassList().

Referenced by eZApproveType\customWorkflowEventHTTPAction().

## ◆ fetchUserGroupClassNames()

static eZUser::fetchUserGroupClassNames | ( |  | ) |
| static

Definition at line 2817 of file ezuser.php.

References eZPersistentObject\count(), eZContentClassClassGroup\fetchClassList(), fetchUserClassList(), and eZContentClass\VERSION_STATUS_DEFINED.

Referenced by eZApproveType\customWorkflowEventHTTPAction(), and eZApproveType\validateGroupIDList().

## ◆ forceLogin()

eZUser::forceLogin | ( |  | ) |

Check if login handler require forced login at user check.

Returns
  true if force login on user check, false if not.

Definition at line 2741 of file ezuser.php.

## ◆ generateAccessArray()

eZUser::generateAccessArray | ( |  | ) |

Generates the accessArray for the user (for $this). This function is uncached, and used as basis for user cache callback.

Returns
  array

Definition at line 2020 of file ezuser.php.

References eZRole\accessArrayByUserID(), eZPersistentObject\attribute(), and groups().

Referenced by accessArray().

## ◆ generateGroupIdList()

eZUser::generateGroupIdList | ( |  | ) |
| protected

Generate list of group id's

Since
  4.4

Returns
  array

Definition at line 2605 of file ezuser.php.

References $ContentObjectID, and eZDB\instance().

Referenced by groups(), and limitList().

## ◆ generateUserCacheContent()

static eZUser::generateUserCacheContent | ( |  | $userId | ) |
| static private

Generate cache content or fallback to an empty array (for BC)

Since
  5.3

Parameters

  int | $userId |

Returns
  array

Definition at line 1433 of file ezuser.php.

References generateUserCacheData().

Referenced by getUserCacheByUserId().

## ◆ generateUserCacheData()

static eZUser::generateUserCacheData | ( |  | $userId | ) |
| static private

Generate cache content

Since
  5.3

Parameters

  int | $userId |

Returns
  array|null

Definition at line 1457 of file ezuser.php.

References fetch(), eZRole\fetchIDListByUser(), and eZUserDiscountRule\generateIDListByUserID().

Referenced by generateUserCacheContent(), and generateUserCacheForFile().

## ◆ generateUserCacheForFile()

static eZUser::generateUserCacheForFile | ( |  | $filePath,
|  |  | $userId
| ) |  |
| static

Callback which generates user cache for user, returns null on invalid user

Since
  4.4

See also
  eZUser::getUserCacheByUserId()

Definition at line 1510 of file ezuser.php.

References generateUserCacheData().

## ◆ getCacheDir()

static eZUser::getCacheDir | ( |  | $userId = `0` | ) |
| static

Creates the cache path if it doesn't exist, and returns the cache directory. The $userId parameter is used to create multi-level directory names

@params int $userId

Returns
  string Cache directory for the user

Definition at line 2753 of file ezuser.php.

References eZSys\cacheDirectory(), and eZDir\mkdir().

Referenced by getUserCacheByUserId(), and purgeUserCacheByUserId().

## ◆ getUserCache()

eZUser::getUserCache | ( |  | ) |

Get User cache from cache file

Since
  4.4

Returns
  array( 'info' => array, 'groups' => array, 'roles' => array, 'role_limitations' => array, 'access_array' => array)

Definition at line 1296 of file ezuser.php.

References $UserCache, and setUserCache().

Referenced by accessArray(), fetchUserCacheIfNeeded(), limitValueList(), and roleIDList().

## ◆ getUserCacheByAnonymousId()

static eZUser::getUserCacheByAnonymousId | ( |  | ) |
| static

Get User cache from cache file for Anonymous user(usefull for sessionless users)

Since
  4.4

See also
  eZUser::getUserCacheByUserId()

Returns
  array

Definition at line 1361 of file ezuser.php.

References getUserCacheByUserId().

## ◆ getUserCacheByUserId()

static eZUser::getUserCacheByUserId | ( |  | $userId | ) |
| static protected

Get User cache from cache file (usefull for sessionless users)

Since
  4.4

See also
  eZUser::getUserCache()

Parameters

  int | $userId |

Returns
  array

Definition at line 1374 of file ezuser.php.

References generateUserCacheContent(), getCacheDir(), and eZClusterFileHandler\instance().

Referenced by getUserCacheByAnonymousId(), and instance().

## ◆ groups()

eZUser::groups | ( |  | $asObject = `false` | ) |

Returns
  an array of id's with all the groups the user belongs to.

Definition at line 2566 of file ezuser.php.

References $Groups, $GroupsAsObjects, fetchUserCacheIfNeeded(), and generateGroupIdList().

Referenced by generateAccessArray(), and limitList().

## ◆ hasAccessTo()

eZUser::hasAccessTo | ( |  | $module,
|  |  | $function = `false`
| ) |  |

Check if user has got access to the specified module and function

Parameters

  module | name
  funtion | name

Returns
  Array containg result. Array elements : 'accessWord', yes - access allowed no - access denied limited - access array describing access included 'policies', array containing the policy limitations 'accessList', array describing missing access rights

Definition at line 1947 of file ezuser.php.

References accessArray().

Referenced by canAssignSection(), canAssignSectionList(), canAssignSectionToClassList(), canAssignSectionToObject(), canAssignToObjectSectionList(), canLoginToSiteAccess(), hasAccessToView(), and hasManageLocations().

## ◆ hasAccessToView()

eZUser::hasAccessToView | ( |  | $module,
|  |  | $viewName,
|  | & | $params
| ) |  |

Definition at line 2270 of file ezuser.php.

References $ContentObjectID, hasAccessTo(), and eZDebug\writeError().

## ◆ hashType()

static eZUser::hashType | ( |  | ) |
| static

Returns
  the default hash type which is specified in UserSettings/HashType in site.ini

Definition at line 675 of file ezuser.php.

References passwordHashTypeID().

Referenced by _loginUser(), eZLDAPUser\loginUser(), eZTextFileUser\loginUser(), and setInformation().

## ◆ hasManageLocations()

eZUser::hasManageLocations | ( |  | ) |

Check if current user has "content/manage_locations" access

Definition at line 226 of file ezuser.php.

References hasAccessTo().

## ◆ hasStoredLogin()

eZUser::hasStoredLogin | ( |  | ) |

Definition at line 289 of file ezuser.php.

References eZPersistentObject\attribute(), eZContentObject\fetch(), and eZDB\instance().

## ◆ id()

eZUser::id | ( |  | ) |

Returns
  the user id.

Definition at line 711 of file ezuser.php.

References $ContentObjectID.

## ◆ instance()

static eZUser::instance | ( |  | $id = `false` | ) |
| static

Returns a shared instance of the eZUser class pr $id value. If user can not be fetched, then anonymous user is returned and a warning trown, if anonymous user can not be fetched, then NoUser is returned and another warning is thrown.

Parameters

  int | false | $id | On false: Gets current user id from session or from eZUser::anonymousId() if not set.

Returns
  eZUser

Definition at line 1163 of file ezuser.php.

References anonymousId(), eZExecution\cleanExit(), eZUser(), fetch(), getUserCacheByUserId(), eZSys\indexFile(), eZHTTPTool\instance(), eZSys\queryString(), eZHTTPTool\redirect(), eZSys\requestURI(), setCurrentlyLoggedInUser(), updateLastVisit(), eZDebug\writeError(), eZDebug\writeWarning(), and eZSys\wwwDir().

Referenced by currentUser(), eZApproveType\execute(), and eZWorkflowProcess\user().

## ◆ isAnonymous()

eZUser::isAnonymous | ( |  | ) |

Returns
  `true` if the user is the anonymous user.

Definition at line 1703 of file ezuser.php.

References eZPersistentObject\attribute().

Referenced by eZContentClass\instantiate().

## ◆ isCurrentUserRegistered()

static eZUser::isCurrentUserRegistered | ( |  | ) |
| static

Returns whether the current user is a registered user.

Since
  5.1

Definition at line 2558 of file ezuser.php.

References currentUser().

Referenced by eZHTTPHeader\enabled(), and eZDefaultShopAccountHandler\verifyAccountInformation().

## ◆ isEnabled()

eZUser::isEnabled | ( |  | $useCache = `true` | ) |

Returns
  `true` if the user is enabled and can be used on the site.

Definition at line 1685 of file ezuser.php.

References $ContentObjectID, eZPersistentObject\attribute(), and eZUserSetting\fetch().

## ◆ isEnabledAfterFailedLogin()

static eZUser::isEnabledAfterFailedLogin | ( |  | $userID,
|  |  | $ignoreTrusted = `false`
| ) |  |
| static

Definition at line 1014 of file ezuser.php.

References fetch(), isTrusted(), and maxNumberOfFailedLogin().

Referenced by _loginUser(), isLocked(), eZLDAPUser\loginUser(), and eZTextFileUser\loginUser().

## ◆ isLocked()

eZUser::isLocked | ( |  | ) |

Returns
  `true` if the user is locked (is enabled after failed login) and can be logged on the site.

Definition at line 1675 of file ezuser.php.

References eZPersistentObject\attribute(), and isEnabledAfterFailedLogin().

## ◆ isLoggedIn()

eZUser::isLoggedIn | ( |  | ) |

Returns true if the user is a registered and not anonymous user.

Deprecated:
  since 5.1 Use isRegistered() / isUserLoggedIn() instead.

Definition at line 2539 of file ezuser.php.

References isRegistered(), and eZDebug\writeStrict().

## ◆ isRegistered()

eZUser::isRegistered | ( |  | ) |

Returns true if the user is a registered and not anonymous user.

Definition at line 2548 of file ezuser.php.

References anonymousId().

Referenced by isLoggedIn().

## ◆ isTrusted()

static eZUser::isTrusted | ( |  | ) |
| static

Returns true if current user is trusted user.

Definition at line 980 of file ezuser.php.

References isUserIPInList().

Referenced by isEnabledAfterFailedLogin(), and setFailedLoginAttempts().

## ◆ isUserIPInList()

static eZUser::isUserIPInList | ( |  | $ipList | ) |
| static

Checks if IP address of current user is in $ipList.

Definition at line 937 of file ezuser.php.

References eZSys\clientIP(), and eZDebug\isIPInNet().

Referenced by isTrusted().

## ◆ isUserLoggedIn()

static eZUser::isUserLoggedIn | ( |  | $userID | ) |
| static

Returns
  true if the user with ID $userID is currently logged into the system.

Note
  The information will be cached for the current page if caching is allowed.

See also
  fetchLoggedInList

Definition at line 578 of file ezuser.php.

References eZDB\instance().

## ◆ isUserObject()

static eZUser::isUserObject | ( |  | $contentObject | ) |
| static

Checks if the supplied content object is a user object ( contains ezuser datatype )

Parameters

  ContentObject |

Returns
  true or false

Definition at line 1788 of file ezuser.php.

References eZUserType\DATA_TYPE_STRING, and eZDataType\loadAndRegisterType().

Referenced by eZApproveType\fetchHTTPInput(), and eZApproveType\validateUserIDList().

## ◆ lastVisit()

eZUser::lastVisit | ( |  | ) |

Returns the last visit timestamp to the current user.

Definition at line 1554 of file ezuser.php.

References eZDB\instance().

## ◆ limitList()

eZUser::limitList | ( |  | $useGroupsCache = `true` | ) |

Returns
  an array of limited assignments

Definition at line 2476 of file ezuser.php.

References eZPersistentObject\attribute(), generateGroupIdList(), groups(), and eZDB\instance().

Referenced by limitValueList().

## ◆ limitValueList()

eZUser::limitValueList | ( |  | ) |

Returns
  an array of values of limited assignments

Definition at line 2497 of file ezuser.php.

References getUserCache(), and limitList().

## ◆ loginCount()

eZUser::loginCount | ( |  | ) |

Returns the login count for the current user.

Since
  Version 4.1

Returns
  int Login count for current user.

Definition at line 1575 of file ezuser.php.

References eZDB\instance().

## ◆ loginCurrent()

eZUser::loginCurrent | ( |  | ) |

Returns
  logs in the current user object

Definition at line 1097 of file ezuser.php.

References setCurrentlyLoggedInUser().

## ◆ loginFailed()

static eZUser::loginFailed | ( |  | $userID,
|  |  | $login
| ) |  |
| static protected

Does some house keeping work when a log in has failed.

Parameters

  mixed | $userID |
  string | $login |

Definition at line 799 of file ezuser.php.

References eZDB\instance(), setFailedLoginAttempts(), and eZAudit\writeAudit().

Referenced by loginUser().

## ◆ loginSucceeded()

static eZUser::loginSucceeded | ( |  | $user | ) |
| static protected

Does some house keeping work once a log in has succeeded.

Parameters

  eZUser | $user |

Definition at line 779 of file ezuser.php.

References setCurrentlyLoggedInUser(), setFailedLoginAttempts(), updateLastVisit(), and eZAudit\writeAudit().

Referenced by loginUser().

## ◆ loginURI()

eZUser::loginURI | ( |  | ) |

Check if login handler require special login URI

Returns
  Special login uri. If false, use system standard login uri.

Definition at line 2731 of file ezuser.php.

## ◆ loginUser()

static eZUser::loginUser | ( |  | $login,
|  |  | $password,
|  |  | $authenticationMatch = `false`
| ) |  |
| static

Logs in the user if applied username and password is valid.

Parameters

  string | $login |
  string | $password |
  bool | $authenticationMatch |

Returns
  mixed eZUser on success, bool false on failure

Reimplemented in eZTextFileUser, and eZLDAPUser.

Definition at line 758 of file ezuser.php.

References _loginUser(), loginFailed(), and loginSucceeded().

Referenced by eZScript\initialize().

## ◆ logoutCurrent()

static eZUser::logoutCurrent | ( |  | ) |
| static

Logs out the current user

Definition at line 1106 of file ezuser.php.

References anonymousId(), cleanup(), eZBasket\cleanupCurrentBasket(), eZDB\instance(), eZHTTPTool\instance(), and updateLastVisitByLogout().

Referenced by checkUser(), currentUser(), and eZScript\shutdown().

## ◆ maxNumberOfFailedLogin()

static eZUser::maxNumberOfFailedLogin | ( |  | ) |
| static

Returns max number of failed login attempts.

Definition at line 999 of file ezuser.php.

Referenced by isEnabledAfterFailedLogin(), and setFailedLoginAttempts().

## ◆ originalPassword()

eZUser::originalPassword | ( |  | ) |

Definition at line 269 of file ezuser.php.

References $OriginalPassword.

## ◆ originalPasswordConfirm()

eZUser::originalPasswordConfirm | ( |  | ) |

Definition at line 279 of file ezuser.php.

References $OriginalPasswordConfirm.

## ◆ passwordCharacterTable()

static eZUser::passwordCharacterTable | ( |  | ) |
| static

Returns
  an array with characters which are allowed in password.

Definition at line 1755 of file ezuser.php.

Referenced by createPassword().

## ◆ passwordHashTypeID()

static eZUser::passwordHashTypeID | ( |  | $identifier | ) |
| static

Returns
  the hash type for the textual identifier $identifier

Definition at line 177 of file ezuser.php.

References DEFAULT_PASSWORD_HASH, PASSWORD_HASH_BCRYPT, PASSWORD_HASH_EMPTY, PASSWORD_HASH_MD5_PASSWORD, PASSWORD_HASH_MD5_SITE, PASSWORD_HASH_MD5_USER, PASSWORD_HASH_MYSQL, PASSWORD_HASH_PHP_DEFAULT, PASSWORD_HASH_PLAINTEXT, and eZDebug\writeError().

Referenced by eZUserType\fromString(), hashType(), and eZUserType\unserializeContentObjectAttribute().

## ◆ passwordHashTypeName()

static eZUser::passwordHashTypeName | ( |  | $id | ) |
| static

Returns
  a textual identifier for the hash type $id

Definition at line 135 of file ezuser.php.

References PASSWORD_HASH_BCRYPT, PASSWORD_HASH_EMPTY, PASSWORD_HASH_MD5_PASSWORD, PASSWORD_HASH_MD5_SITE, PASSWORD_HASH_MD5_USER, PASSWORD_HASH_MYSQL, PASSWORD_HASH_PHP_DEFAULT, and PASSWORD_HASH_PLAINTEXT.

Referenced by eZUserType\serializeContentObjectAttribute(), and eZUserType\toString().

## ◆ postCollectUserInfo()

eZUser::postCollectUserInfo | ( |  | ) |

Function performed after user login info has been collected. Store login data as array: array( 'login' => <username>, 'password' = <password> ) to session variable EZ_LOGIN_HANDLER_USER_INFO for automatic processing of login data.

Returns

See also
  eZUserLoginHandler::checkUser()

Definition at line 2721 of file ezuser.php.

## ◆ preCollectUserInfo()

eZUser::preCollectUserInfo | ( |  | ) |

Funtion performed before user login info is collected. It's optional to implement this function in new login handler.

Returns

See also
  eZUserLoginHandler::checkUser()

Definition at line 2707 of file ezuser.php.

## ◆ purgeUserCache()

eZUser::purgeUserCache | ( |  | ) |

Delete User cache from locale var and cache file for current user.

Since
  4.4

Definition at line 1310 of file ezuser.php.

References purgeUserCacheByUserId().

## ◆ purgeUserCacheByAnonymousId()

static eZUser::purgeUserCacheByAnonymousId | ( |  | ) |
| static

Delete User cache from cache file for Anonymous user(usefull for sessionless users)

Since
  4.4

See also
  eZUser::purgeUserCacheByUserId()

Definition at line 1334 of file ezuser.php.

References purgeUserCacheByUserId().

Referenced by eZUserDiscountRule\store().

## ◆ purgeUserCacheByUserId()

static eZUser::purgeUserCacheByUserId | ( |  | $userId | ) |
| static

Delete User cache pr user

Since
  4.4

Parameters

  int | $userId |

Definition at line 1345 of file ezuser.php.

References getCacheDir(), and eZClusterFileHandler\instance().

Referenced by eZContentObjectTreeNodeOperations\move(), purgeUserCache(), purgeUserCacheByAnonymousId(), eZContentObjectTreeNode\removeThis(), eZUserSetting\setAttribute(), and store().

## ◆ removeSessionData()

static eZUser::removeSessionData | ( |  | $userID | ) |
| static

Remove session data for user $userID.

Todo:
  should use eZSession api (needs to be created) so callbacks (like preference / basket..) is cleared as well.

@params int $userID

Definition at line 619 of file ezuser.php.

References clearSessionCache().

Referenced by eZContentObjectTreeNode\removeThis(), removeUser(), and eZUserSetting\setAttribute().

## ◆ removeUser()

static eZUser::removeUser | ( |  | $userID | ) |
| static

Removes the user from the ezuser table.

Note
  Will also remove any notifications and session related to the user.

Definition at line 629 of file ezuser.php.

References definition(), fetch(), eZGeneralDigestUserSettings\removeByUserId(), eZForgotPassword\removeByUserID(), eZUserAccountKey\removeByUserID(), eZUserSetting\removeByUserID(), eZWishList\removeByUserID(), eZCollaborationNotificationRule\removeByUserID(), eZSubtreeNotificationRule\removeByUserID(), eZPersistentObject\removeObject(), removeSessionData(), and eZDebug\writeError().

Referenced by eZUserType\deleteStoredObjectAttribute().

## ◆ requireUniqueEmail()

static eZUser::requireUniqueEmail | ( |  | ) |
| static

Returns
  `true` if there can only be one instance of an email address on the site.

Definition at line 744 of file ezuser.php.

Referenced by eZUserType\fromString(), and eZUserType\validateObjectAttributeHTTPInput().

## ◆ retrieveUserCacheFromFile()

static eZUser::retrieveUserCacheFromFile | ( |  | $filePath,
|  |  | $mtime,
|  |  | $userId
| ) |  |
| static

Callback which fetches user cache from local file.

Since
  4.4

See also
  eZUser::getUserCacheByUserId()

Definition at line 1404 of file ezuser.php.

References eZDebug\writeError().

## ◆ roleIDList()

eZUser::roleIDList | ( |  | ) |

Returns
  an array of role ids which the user is assigned to

Definition at line 2460 of file ezuser.php.

References eZPersistentObject\attribute(), eZRole\fetchIDListByUser(), and getUserCache().

## ◆ roles()

eZUser::roles | ( |  | ) |

Returns
  an array of roles which the user is assigned to

Definition at line 2450 of file ezuser.php.

References eZPersistentObject\attribute(), and eZRole\fetchByUser().

## ◆ sessionCleanup()

eZUser::sessionCleanup | ( |  | ) |

\virtual Used by login handler to clean up session variables

Definition at line 1073 of file ezuser.php.

## ◆ setCachingEnabled()

eZUser::setCachingEnabled | ( |  | $cachingEnabled | ) |
| protected

Sets cachingEnabled flag to given value. Returns previous value of cachingEnabled flag

Parameters

  bool | $cachingEnabled |

Returns
  bool

Definition at line 2981 of file ezuser.php.

References $CachingEnabled.

## ◆ setCurrentlyLoggedInUser()

static eZUser::setCurrentlyLoggedInUser | ( |  | $user,
|  |  | $userID,
|  |  | $flags = `0`
| ) |  |
| static

Makes sure the $user is set as the currently logged in user by updating the session and setting the necessary global variables.

All login handlers should use this function to ensure that the process is executed properly.

@access private

Parameters

  eZUser | $user | User
  int | $userID | User ID
  int | $flags | Optional flag that can be set to: eZUser::NO_SESSION_REGENERATE to avoid session to be regenerated

Definition at line 1054 of file ezuser.php.

References cleanup().

Referenced by eZContentCacheManager\generateObjectViewCache(), instance(), loginCurrent(), loginSucceeded(), eZLDAPUser\loginUser(), and eZTextFileUser\loginUser().

## ◆ setFailedLoginAttempts()

static eZUser::setFailedLoginAttempts | ( |  | $userID,
|  |  | $value = `false`,
|  |  | $setByForce = `false`
| ) |  |
| static

If $value is false will increase the user's number of failed login attempts otherwise failed_login_attempts will be updated by $value. $setByForce if true checking for trusting or max number of failed login attempts will be ignored.

Definition at line 1594 of file ezuser.php.

References eZContentCacheManager\clearContentCacheIfNeeded(), fetch(), eZContentCacheManager\generateObjectViewCache(), eZDB\instance(), isTrusted(), and maxNumberOfFailedLogin().

Referenced by loginFailed(), loginSucceeded(), eZLDAPUser\loginUser(), eZTextFileUser\loginUser(), and eZLDAPUser\publishUpdateUser().

## ◆ setInformation()

eZUser::setInformation | ( |  | $id,
|  |  | $login,
|  |  | $email,
|  |  | $password,
|  |  | $passwordConfirm = `false`
| ) |  |

Fills in the $id, $login, $email and $password for the user and creates the proper password hash.

Definition at line 321 of file ezuser.php.

References createHash(), hashType(), eZPersistentObject\setAttribute(), setOriginalPassword(), setOriginalPasswordConfirm(), site(), and validatePassword().

## ◆ setOriginalPassword()

eZUser::setOriginalPassword | ( |  | $password | ) |

Definition at line 274 of file ezuser.php.

Referenced by setInformation().

## ◆ setOriginalPasswordConfirm()

eZUser::setOriginalPasswordConfirm | ( |  | $password | ) |

Definition at line 284 of file ezuser.php.

Referenced by setInformation().

## ◆ setUserCache()

eZUser::setUserCache | ( | array | $userCache | ) |

Set User cache from cache file Needs to be in excact same format as eZUser::getUserCache()!

Since
  4.4

Parameters

  array | $userCache |

Definition at line 1323 of file ezuser.php.

Referenced by getUserCache().

## ◆ site()

static eZUser::site | ( |  | ) |
| static

Returns
  the site name used in password hashing.

Definition at line 687 of file ezuser.php.

Referenced by _loginUser(), eZLDAPUser\loginUser(), eZTextFileUser\loginUser(), and setInformation().

## ◆ store()

eZUser::store | ( |  | $fieldFilters = `null` | ) |

Only stores the entry if it has a Login value

Parameters

  mixed | null | $fieldFilters |

Reimplemented from eZPersistentObject.

Definition at line 254 of file ezuser.php.

References eZPersistentObject\attribute(), and purgeUserCacheByUserId().

## ◆ trimAuthString()

static eZUser::trimAuthString | ( |  | $string | ) |
| static private

If needed, trims $string using AUTH_STRING_MAX_LENGTH to avoid DDOS attack when the password is hashed.

Parameters

  $string |

Returns
  string valid password

Definition at line 1922 of file ezuser.php.

Referenced by _loginUser(), and createHash().

## ◆ updateLastVisit()

static eZUser::updateLastVisit | ( |  | $userID,
|  |  | $updateLoginCount = `false`
| ) |  |
| static

Updates the user's last visit timestamp Optionally updates user login count by setting $updateLoginCount to true

Definition at line 1529 of file ezuser.php.

References eZDB\instance().

Referenced by instance(), loginSucceeded(), eZLDAPUser\loginUser(), eZTextFileUser\loginUser(), and eZLDAPUser\publishUpdateUser().

## ◆ updateLastVisitByLogout()

static eZUser::updateLastVisitByLogout | ( |  | $userID | ) |
| static

Update LastVisit When a user logout. Logout will set current_visit_timestamp to -current_visit_timestamp. If the user relogin, the last_visit_timestamp will get ABS(current_visit_timestamp).

Parameters

  $userID |

Since
  5.1

See also
  eZUser::updateLastVisit

Definition at line 1147 of file ezuser.php.

References eZDB\instance().

Referenced by logoutCurrent().

## ◆ userInfoExpiry()

static eZUser::userInfoExpiry | ( |  | ) |
| static protected

Callback which figures out global expiry and returns it.

Definition at line 2033 of file ezuser.php.

## ◆ validateLoginName()

static eZUser::validateLoginName | ( |  | $loginName,
|  | & | $errorText
| ) |  |
| static

Validates user login name using site.ini[UserSettings]UserNameValidationRegex[]

Since
  Version 4.1

Parameters

  string | $loginName | that we want to validate.
  string | $errorText | by reference for details if validation fails.

Returns
  bool Indicates if validation failed (false) or not (true).

Definition at line 2873 of file ezuser.php.

Referenced by eZUserType\validateObjectAttributeHTTPInput().

## ◆ validatePassword()

static eZUser::validatePassword | ( |  | $password | ) |
| static

Checks the password for validity

Returns
  true when password is valid by length and not empty, false if not

Definition at line 2850 of file ezuser.php.

Referenced by setInformation(), and eZUserType\validateObjectAttributeHTTPInput().

## Member Data Documentation

## ◆ $AccessArray

eZUser::$AccessArray

Definition at line 2997 of file ezuser.php.

Referenced by accessArray().

## ◆ $anonymousId

eZUser::$anonymousId = null
| static protected

Definition at line 65 of file ezuser.php.

Referenced by anonymousId().

## ◆ $CachingEnabled

eZUser::$CachingEnabled = true
| private

Definition at line 3018 of file ezuser.php.

Referenced by setCachingEnabled().

## ◆ $ContentObjectID

eZUser::$ContentObjectID

Definition at line 2998 of file ezuser.php.

Referenced by generateGroupIdList(), hasAccessToView(), id(), and isEnabled().

## ◆ $Email

eZUser::$Email

Definition at line 2991 of file ezuser.php.

## ◆ $Groups

eZUser::$Groups

Definition at line 2994 of file ezuser.php.

Referenced by groups().

## ◆ $GroupsAsObjects

eZUser::$GroupsAsObjects

Definition at line 20 of file ezuser.php.

Referenced by groups().

## ◆ $Login

eZUser::$Login

Definition at line 2990 of file ezuser.php.

## ◆ $OriginalPassword

eZUser::$OriginalPassword

Definition at line 2995 of file ezuser.php.

Referenced by originalPassword().

## ◆ $OriginalPasswordConfirm

eZUser::$OriginalPasswordConfirm

Definition at line 2996 of file ezuser.php.

Referenced by originalPasswordConfirm().

## ◆ $PasswordHash

eZUser::$PasswordHash

Definition at line 2992 of file ezuser.php.

## ◆ $PasswordHashType

eZUser::$PasswordHashType

Definition at line 2993 of file ezuser.php.

## ◆ $UserCache

eZUser::$UserCache = null
| protected

Definition at line 3008 of file ezuser.php.

Referenced by getUserCache().

## ◆ $userHasLoggedOut

eZUser::$userHasLoggedOut = false
| static protected

Definition at line 3016 of file ezuser.php.

## ◆ AUTH_STRING_MAX_LENGTH

const eZUser::AUTH_STRING_MAX_LENGTH = 4096

Definition at line 48 of file ezuser.php.

## ◆ AUTHENTICATE_ALL

const eZUser::AUTHENTICATE_ALL = 3

Definition at line 55 of file ezuser.php.

## ◆ AUTHENTICATE_EMAIL

const eZUser::AUTHENTICATE_EMAIL = 2

Authenticate by matching the email field.

Definition at line 53 of file ezuser.php.

Referenced by authenticationMatch(), eZLDAPUser\loginUser(), eZTextFileUser\loginUser(), and eZUserType\validateObjectAttributeHTTPInput().

## ◆ AUTHENTICATE_LOGIN

const eZUser::AUTHENTICATE_LOGIN = 1

Authenticate by matching the login field.

Definition at line 51 of file ezuser.php.

Referenced by authenticationMatch(), eZLDAPUser\loginUser(), and eZTextFileUser\loginUser().

## ◆ DEFAULT_PASSWORD_HASH

const eZUser::DEFAULT_PASSWORD_HASH = self::PASSWORD_HASH_PHP_DEFAULT

Default password hashing algorithm, used in case of invalid configuration or usage. Update this if support for better algorithms is added.

Definition at line 41 of file ezuser.php.

Referenced by passwordHashTypeID().

## ◆ NO_SESSION_REGENERATE

const eZUser::NO_SESSION_REGENERATE = 1

Definition at line 63 of file ezuser.php.

Referenced by eZContentCacheManager\generateObjectViewCache().

## ◆ PASSWORD_HASH_BCRYPT

const eZUser::PASSWORD_HASH_BCRYPT = 6

Passwords in bcrypt format.

Definition at line 35 of file ezuser.php.

Referenced by passwordHashTypeID(), and passwordHashTypeName().

## ◆ PASSWORD_HASH_EMPTY

const eZUser::PASSWORD_HASH_EMPTY = 0

No hash, used by external handlers such as LDAP and TextFile.

Definition at line 22 of file ezuser.php.

Referenced by passwordHashTypeID(), and passwordHashTypeName().

## ◆ PASSWORD_HASH_MD5_PASSWORD

const eZUser::PASSWORD_HASH_MD5_PASSWORD = 1

MD5 of password.

Definition at line 24 of file ezuser.php.

Referenced by passwordHashTypeID(), and passwordHashTypeName().

## ◆ PASSWORD_HASH_MD5_SITE

const eZUser::PASSWORD_HASH_MD5_SITE = 3

MD5 of site, user and password.

Definition at line 28 of file ezuser.php.

Referenced by passwordHashTypeID(), and passwordHashTypeName().

## ◆ PASSWORD_HASH_MD5_USER

const eZUser::PASSWORD_HASH_MD5_USER = 2

MD5 of user and password.

Definition at line 26 of file ezuser.php.

Referenced by passwordHashTypeID(), and passwordHashTypeName().

## ◆ PASSWORD_HASH_MYSQL

const eZUser::PASSWORD_HASH_MYSQL = 4

Legacy support for mysql hashed passwords NB! Does not work as of MySQL 8.0 where this has been removed from MySQL.

Definition at line 31 of file ezuser.php.

Referenced by eZLDAPUser\loginUser(), eZTextFileUser\loginUser(), passwordHashTypeID(), and passwordHashTypeName().

## ◆ PASSWORD_HASH_PHP_DEFAULT

const eZUser::PASSWORD_HASH_PHP_DEFAULT = 7

Passwords in PHP default format.

Definition at line 37 of file ezuser.php.

Referenced by passwordHashTypeID(), and passwordHashTypeName().

## ◆ PASSWORD_HASH_PLAINTEXT

const eZUser::PASSWORD_HASH_PLAINTEXT = 5

Passwords in plaintext, should not be used for real sites.

Definition at line 33 of file ezuser.php.

Referenced by passwordHashTypeID(), and passwordHashTypeName().

The documentation for this class was generated from the following file:

- ezuser.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.