eZPublish  4.5
eZUser Class Reference

eZUser handles eZ Publish user accounts More...

+ Inheritance diagram for eZUser:
+ Collaboration diagram for eZUser:

Public Member Functions

 accessArray ()
 Returns either cached or newly generated accessArray for the user depending on site.ini[RoleSettings] setting. More...
 
 canAssignSection ($checkSectionID)
 
 canAssignSectionList ()
 
 canAssignSectionToClassList ($checkSectionID)
 
 canAssignSectionToObject ($checkSectionID, $contentObject)
 
 canAssignToObjectSectionList ($contentObject)
 
 canLoginToSiteAccess ($access)
 
 checkUser (&$siteBasics, $uri)
 
 contentObject ()
 
 eZUser ($row=array())
 
 failedLoginAttempts ()
 
 forceLogin ()
 
 generateAccessArray ()
 Generates the accessArray for the user (for $this). More...
 
 getUserCache ()
 Get User cache from cache file. More...
 
 groups ($asObject=false)
 
 hasAccessTo ($module, $function=false)
 
 hasAccessToView ($module, $viewName, &$params)
 
 hasManageLocations ()
 
 hasStoredLogin ()
 
 id ()
 
 isAnonymous ()
 
 isEnabled ()
 
 isLocked ()
 
 isLoggedIn ()
 
 lastVisit ()
 
 limitList ($useGroupsCache=true)
 
 limitValueList ()
 
 loginCount ()
 Returns the login count for the current user. More...
 
 loginCurrent ()
 
 loginURI ()
 
 originalPassword ()
 
 originalPasswordConfirm ()
 
 postCollectUserInfo ()
 
 preCollectUserInfo ()
 
 purgeUserCache ()
 Delete User cache from locale var and cache file for current user. More...
 
 roleIDList ()
 
 roles ()
 
 sessionCleanup ()
 
 setInformation ($id, $login, $email, $password, $passwordConfirm=false)
 
 setOriginalPassword ($password)
 
 setOriginalPasswordConfirm ($password)
 
 setUserCache (array $userCache)
 Set User cache from cache file Needs to be in excact same format as eZUser::getUserCache()! More...
 
 store ($fieldFilters=null)
 
- Public Member Functions inherited from eZPersistentObject
 attribute ($attr, $noFunction=false)
 
 attributes ()
 
 eZPersistentObject ($row)
 
 fill ($row)
 
 hasAttribute ($attr)
 
 hasDirtyData ()
 
 remove ($conditions=null, $extraConditions=null)
 
 setAttribute ($attr, $val)
 
 setHasDirtyData ($hasDirtyData)
 
 store ($fieldFilters=null)
 
 sync ($fieldFilters=null)
 

Static Public Member Functions

static anonymousId ()
 Gets the id of the anonymous user. More...
 
static authenticateHash ($user, $password, $site, $type, $hash)
 
static authenticationMatch ()
 
static cleanup ()
 Cleanup user related session values, for use by login / logout code. More...
 
static cleanupCache ()
 Expire user access / info cache globally. More...
 
static clearSessionCache ()
 
static contentClassIDs ()
 
static create ($contentObjectID)
 
static createHash ($user, $password, $site, $type, $hash=false)
 
static createPassword ($passwordLength, $seed=false)
 
static currentUser ()
 
static currentUserID ()
 
static definition ()
 
static failedLoginAttemptsByUserID ($userID)
 
static fetch ($id, $asObject=true)
 
static fetchAnonymousCount ()
 Return the number of anonymous users in the system. More...
 
static fetchBuiltin ($id)
 
static fetchByEmail ($email, $asObject=true)
 
static fetchByName ($login, $asObject=true)
 
static fetchContentList ()
 
static fetchLoggedInCount ()
 
static fetchLoggedInList ($asObject=false, $offset=false, $limit=false, $sortBy=false)
 
static fetchUserClassList ($asObject=false, $fields=false)
 
static fetchUserClassNames ()
 
static fetchUserGroupClassNames ()
 
static generateUserCacheForFile ($filePath, $userId)
 Callback which generates user cache for user. More...
 
static getCacheDir ($userId=0)
 Creates the cache path if it doesn't exist, and returns the cache directory. More...
 
static getCacheFilename ($userId)
 Returns the filename for a cache file with user information. More...
 
static getUserCacheByAnonymousId ()
 Get User cache from cache file for Anonymous user(usefull for sessionless users) More...
 
static hashType ()
 
static instance ($id=false)
 Returns a shared instance of the eZUser class pr $id value. More...
 
static isEnabledAfterFailedLogin ($userID, $ignoreTrusted=false)
 
static isTrusted ()
 
static isUserIPInList ($ipList)
 
static isUserLoggedIn ($userID)
 
static isUserObject ($contentObject)
 
static loginUser ($login, $password, $authenticationMatch=false)
 Logs in the user if applied username and password is valid. More...
 
static logoutCurrent ()
 
static maxNumberOfFailedLogin ()
 
static passwordCharacterTable ()
 
static passwordHashTypeID ($identifier)
 
static passwordHashTypeName ($id)
 
static purgeUserCacheByAnonymousId ()
 Delete User cache from cache file for Anonymous user(usefull for sessionless users) More...
 
static purgeUserCacheByUserId ($userId)
 Delete User cache pr user. More...
 
static removeSessionData ($userID)
 Remove session data for user $userID. More...
 
static removeUser ($userID)
 
static requireUniqueEmail ()
 
static retrieveUserCacheFromFile ($filePath, $mtime, $userId)
 Callback which fetches user cache from local file. More...
 
static setFailedLoginAttempts ($userID, $value=false, $setByForce=false)
 
static site ()
 
static updateLastVisit ($userID, $updateLoginCount=false)
 
static validateLoginName ($loginName, &$errorText)
 Validates user login name using site.ini[UserSettings]UserNameValidationRegex[]. More...
 
static validatePassword ($password)
 
- Static Public Member Functions inherited from eZPersistentObject
static conditionText ($conditions)
 
static conditionTextByRow ($conditions, $row)
 
static count ($def, $conds=null, $field=null)
 
static definition ()
 
static escapeArray ($array)
 
static fetchObject ($def, $field_filters, $conds, $asObject=true, $grouping=null, $custom_fields=null)
 
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 getShortAttributeName ($db, $def, $attrName)
 
static handleRows ($rows, $class_name, $asObject)
 
static newObjectOrder ($def, $orderField, $conditions)
 
static removeObject ($def, $conditions=null, $extraConditions=null)
 
static reorderObject ($def, $orderField, $conditions, $down=true)
 
static swapRow ($table, $keys, $order_id, $rows, $id1, $id2)
 
static updateObjectList ($parameters)
 

Public Attributes

 $Email
 
 $Groups
 
 $Login
 
 $OriginalPassword
 
 $OriginalPasswordConfirm
 
 $PasswordHash
 
 $PasswordHashType
 
const AUTHENTICATE_ALL = 3
 
const AUTHENTICATE_EMAIL = 2
 Authenticate by matching the email field. More...
 
const AUTHENTICATE_LOGIN = 1
 Authenticate by matching the login field. More...
 
const PASSWORD_HASH_CRYPT = 6
 
const PASSWORD_HASH_MD5_PASSWORD = 1
 MD5 of password. More...
 
const PASSWORD_HASH_MD5_SITE = 3
 MD5 of site, user and password. More...
 
const PASSWORD_HASH_MD5_USER = 2
 MD5 of user and password. More...
 
const PASSWORD_HASH_MYSQL = 4
 Legacy support for mysql hashed passwords. More...
 
const PASSWORD_HASH_PLAINTEXT = 5
 Passwords in plaintext, should not be used for real sites. More...
 
- Public Attributes inherited from eZPersistentObject
 $PersistentDataDirty
 Whether the data is dirty, ie needs to be stored, or not. More...
 

Protected Member Functions

 generateGroupIdList ()
 Generate list of group id's. More...
 

Static Protected Member Functions

static _loginUser ($login, $password, $authenticationMatch=false)
 Logs in an user if applied login and password is valid. More...
 
static getUserCacheByUserId ($userId)
 Get User cache from cache file (usefull for sessionless users) More...
 
static loginFailed ($userID=false, $login)
 Does some house keeping work when a log in has failed. More...
 
static loginSucceeded ($user)
 Does some house keeping work once a log in has succeeded. More...
 
static setCurrentlyLoggedInUser ($user, $userID)
 
static userInfoExpiry ()
 

Protected Attributes

 $UserCache = null
 

Static Protected Attributes

static $anonymousId = null
 
static $userHasLoggedOut = false
 

Detailed Description

eZUser handles eZ Publish user accounts

Member Function Documentation

static eZUser::_loginUser (   $login,
  $password,
  $authenticationMatch = false 
)
staticprotected

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.
eZUser::accessArray ( )

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

private

Returns
array

Referenced by hasAccessTo().

static eZUser::anonymousId ( )
static

Gets the id of the anonymous user.

Returns
int User id of anonymous user.

Referenced by eZFetchActiveSessionCount(), eZFetchActiveSessions(), eZUserDiscountRule\fetchIDListByUserID(), and eZUserDiscountRule\store().

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.

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

static eZUser::authenticationMatch ( )
static
Returns
a bitfield which decides the authenticate methods.

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

eZUser::canAssignSection (   $checkSectionID)
eZUser::canAssignSectionList ( )
eZUser::canAssignSectionToClassList (   $checkSectionID)
eZUser::canAssignSectionToObject (   $checkSectionID,
  $contentObject 
)
eZUser::canAssignToObjectSectionList (   $contentObject)
eZUser::canLoginToSiteAccess (   $access)
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.
static eZUser::cleanup ( )
static

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

static eZUser::cleanupCache ( )
static

Expire user access / info cache globally.

Referenced by eZRole\expireCache().

static eZUser::clearSessionCache ( )
static

Removes any cached session information, this is:

  • logged in user count
  • anonymous user count
  • logged in user map

Referenced by removeSessionData().

eZUser::contentObject ( )
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.

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

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.
static eZUser::currentUser ( )
static

Returns the currently logged in user.

Referenced by eZDefaultShopAccountHandler\accountName(), eZCollaborationItemMessageLink\addMessage(), eZContentObject\allowedAssignSectionList(), eZContentObject\allowedAssignStateIDList(), eZSubTreeHandler\attribute(), eZGeneralDigestHandler\attribute(), eZSimplePrice\attribute(), eZWebDAVContentBackendAuth\authorize(), eZContentObject\cacheInfo(), eZContentObject\canCreateClassList(), eZContentObjectTreeNode\canCreateClassList(), eZContentObjectTreeNode\canEdit(), eZContentObject\canEdit(), eZContentClass\canInstantiateClasses(), eZContentClass\canInstantiateClassList(), eZOrder\canModifyStatus(), eZContentObject\canTranslate(), eZPackage\canUsePackagePolicyFunction(), eZPackage\canUsePolicyFunction(), eZContentObjectVersion\checkAccess(), eZContentObject\checkAccess(), eZContentObjectTreeNode\checkAccess(), eZSubtreeNotificationRule\checkObjectAccess(), eZPackageCreationHandler\checkPackageMaintainer(), checkTimeout(), checkUser(), eZUserType\classAttributeRemovableInformation(), eZContentObject\classListFromPolicy(), eZContentObjectTreeNode\classListFromPolicy(), eZContentObject\copy(), eZContentObject\copyVersion(), eZCollaborationSimpleMessage\create(), eZRSSImport\create(), eZInformationCollection\create(), eZContentObjectVersion\create(), eZBasket\createOrder(), eZContentObjectTreeNode\createPermissionCheckingSQL(), eZPackageCreationHandler\creatorList(), eZWishList\currentWishList(), eZWishList\discountPercent(), eZDefaultShopAccountHandler\email(), eZHTTPHeader\enabled(), eZApproveType\execute(), eZMultiplexerType\execute(), eZSimplePrice\eZSimplePrice(), eZWebDAVContentServer\eZWebDAVContentServer(), eZContentFunctionCollection\fetchBookmarks(), eZUserFunctionCollection\fetchCurrentUser(), eZSubTreeHandler\fetchHttpInput(), eZPackage\fetchMaintainerRoleIDList(), eZCollaborationFunctionCollection\fetchParticipant(), eZContentFunctionCollection\fetchRecent(), eZContentCacheManager\generateObjectViewCache(), eZInformationCollection\generateUserIdentifier(), eZContentObjectTreeNode\getLimitationList(), eZVATManager\getUserCountry(), eZApproveCollaborationHandler\handleCustomAction(), eZShopOperationCollection\handleUserCountry(), eZUserFunctionCollection\hasAccessTo(), eZContentClass\initializeCopy(), eZPackageCreationHandler\initializePackageChangelog(), eZPackageCreationHandler\initializePackageInformation(), eZPackageCreationHandler\initializePackageMaintainer(), eZCollaborationProfile\instance(), eZContentClass\instantiate(), ezpRestClient\isAuthorizedByUser(), isEnabled(), eZCollaborationGroup\itemCount(), eZLDAPUser\loginUser(), eZTopMenuOperator\modify(), eZAuthorType\objectAttributeContent(), eZSubtreeSubscriptionType\onPublish(), eZWebDAVContentServer\processClientRequest(), eZContentOperationCollection\publishNode(), eZContentObjectTreeNode\removeSubtrees(), eZCollaborationNotificationHandler\rules(), eZSubTreeHandler\rules(), eZSubTreeHandler\rulesCount(), eZTrigger\runTrigger(), sectionEditActionCheck(), eZGeneralDigestHandler\settings(), eZPreferences\setValue(), eZOrder\statusModificationList(), eZPDFExport\store(), eZRSSExport\store(), eZRSSImport\store(), eZGeneralDigestHandler\storeSettings(), eZContentClass\storeVersioned(), eZSubTreeHandler\subscribedNodes(), eZCollaborationGroup\subTree(), eZPreferences\value(), eZPreferences\values(), eZDefaultShopAccountHandler\verifyAccountInformation(), and eZAudit\writeAudit().

static eZUser::definition ( )
static
eZUser::eZUser (   $row = array())
eZUser::failedLoginAttempts ( )

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

static eZUser::failedLoginAttemptsByUserID (   $userID)
static

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

Referenced by failedLoginAttempts().

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

Referenced by ezpRestClient\_owner(), eZUserOperationCollection\activation(), ezpRestOauthAuthenticationStyle\authenticate(), ezpRestNoAuthStyle\authenticate(), eZOrder\canModifyStatus(), eZUserOperationCollection\checkActivation(), eZContentClassGroup\creator(), eZWorkflowGroup\creator(), eZCollaborationItem\creator(), eZWorkflow\creator(), eZContentClass\creator(), eZInformationCollection\creator(), eZOrder\discount(), ezpOauthUtility\doRefreshToken(), ezpOauthUtility\doRefreshTokenWithAuthorizationCode(), eZMultiplexerType\execute(), eZFetchActiveSessions(), fetchBuiltin(), eZUserFunctionCollection\fetchMemberOf(), eZUserFunctionCollection\fetchUserRole(), eZUserOperationCollection\forgotpassword(), eZContentCacheManager\generateObjectViewCache(), generateUserCacheForFile(), eZUserFunctionCollection\hasAccessTo(), eZStepCreateSites\initializePackage(), instance(), isEnabledAfterFailedLogin(), eZTextFileUser\loginUser(), eZContentClassGroup\modifier(), eZWorkflowGroup\modifier(), eZPDFExport\modifier(), eZRSSImport\modifier(), eZRSSExport\modifier(), eZWorkflow\modifier(), eZContentClass\modifier(), eZUserType\objectAttributeContent(), eZRSSImport\objectOwner(), eZCollaborationItemParticipantLink\participant(), eZUserOperationCollection\password(), ezpContentPublishingProcess\publish(), removeUser(), eZScriptTrashPurge\run(), eZUserOperationCollection\sendActivationEmail(), eZUserOperationCollection\sendUserNotification(), eZUserType\serializeContentObjectAttribute(), eZUserSetting\setAttribute(), setFailedLoginAttempts(), eZPreferences\setValue(), eZOrder\statusModificationList(), eZUserType\toString(), eZUserType\unserializeContentObjectAttribute(), eZCollaborationNotificationRule\user(), eZCollaborationItemGroupLink\user(), eZCollaborationGroup\user(), and eZOrder\user().

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

Referenced by eZUserFunctionCollection\fetchAnonymousCount().

static eZUser::fetchBuiltin (   $id)
static

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

static eZUser::fetchByEmail (   $email,
  $asObject = true 
)
static
static eZUser::fetchContentList ( )
static
Returns
a list of valid and enabled users, the data returned is an array with ezcontentobject database data.
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

Referenced by eZUserFunctionCollection\fetchLoggedInCount().

static eZUser::fetchLoggedInList (   $asObject = false,
  $offset = false,
  $limit = false,
  $sortBy = false 
)
static
Returns
a list of the logged in users.
Parameters
$asObjectIf 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

Referenced by eZUserFunctionCollection\fetchLoggedInList(), and eZUserFunctionCollection\fetchLoggedInUsers().

static eZUser::fetchUserClassList (   $asObject = false,
  $fields = false 
)
static
static eZUser::fetchUserClassNames ( )
static
static eZUser::fetchUserGroupClassNames ( )
static
eZUser::forceLogin ( )

Check if login handler require forced login at user check.

Returns
true if force login on user check, false if not.
eZUser::generateAccessArray ( )

Generates the accessArray for the user (for $this).

This function is uncached, and used as basis for user cache callback.

Returns
array

Referenced by accessArray().

eZUser::generateGroupIdList ( )
protected

Generate list of group id's.

Since
4.4
Returns
array

Referenced by generateAccessArray(), groups(), and limitList().

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

Callback which generates user cache for user.

Since
4.4
See Also
eZUser::getUserCacheByUserId()
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

int $userId

Returns
string Cache directory for the user

Referenced by getCacheFilename(), getUserCacheByUserId(), and purgeUserCacheByUserId().

static eZUser::getCacheFilename (   $userId)
static

Returns the filename for a cache file with user information.

Deprecated:
In 4.4.0 int $userId
Returns
string|false Filename of the cachefile, or false when the user should not be cached
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)

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

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
static eZUser::getUserCacheByUserId (   $userId)
staticprotected

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

Since
4.4
See Also
eZUser::getUserCache()
Parameters
int$userId
Returns
array
eZUser::groups (   $asObject = false)
Returns
an array of id's with all the groups the user belongs to.

Referenced by limitList().

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

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

Parameters
modulename
funtionname
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

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

eZUser::hasAccessToView (   $module,
  $viewName,
$params 
)
static eZUser::hashType ( )
static
Returns
the default hash type which is specified in UserSettings/HashType in site.ini

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

eZUser::hasManageLocations ( )

Check if current user has "content/manage_locations" access

eZUser::hasStoredLogin ( )
eZUser::id ( )
Returns
the user id.
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$idOn false: Gets current user id from session or from eZUser::anonymousId() if not set.
Returns
eZUser

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

eZUser::isAnonymous ( )
Returns
true if the user is the anonymous user.
eZUser::isEnabled ( )
Returns
true if the user is enabled and can be used on the site.
static eZUser::isEnabledAfterFailedLogin (   $userID,
  $ignoreTrusted = false 
)
static
eZUser::isLocked ( )
Returns
true if the user is locked (is enabled after failed login) and can be logged on the site.
eZUser::isLoggedIn ( )

Returns true if it's a real user which is logged in. False if the user is the default user or the fallback buildtin user.

static eZUser::isTrusted ( )
static

Returns true if current user is trusted user.

Referenced by isEnabledAfterFailedLogin(), and setFailedLoginAttempts().

static eZUser::isUserIPInList (   $ipList)
static

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

Referenced by isTrusted().

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

Referenced by eZUserFunctionCollection\fetchIsLoggedIn().

static eZUser::isUserObject (   $contentObject)
static

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

Parameters
ContentObject
Returns
true or false

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

eZUser::lastVisit ( )

Returns the last visit timestamp to the current user.

eZUser::limitList (   $useGroupsCache = true)
Returns
an array of limited assignments

Referenced by limitValueList().

eZUser::limitValueList ( )
Returns
an array of values of limited assignments
eZUser::loginCount ( )

Returns the login count for the current user.

Since
Version 4.1
Returns
int Login count for current user.
eZUser::loginCurrent ( )
Returns
logs in the current user object
static eZUser::loginFailed (   $userID = false,
  $login 
)
staticprotected

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

Parameters
mixed$userID
string$login
static eZUser::loginSucceeded (   $user)
staticprotected

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

Parameters
eZUser$user
eZUser::loginURI ( )

Check if login handler require special login URI

Returns
Special login uri. If false, use system standard login uri.
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

Referenced by eZScript\initialize().

static eZUser::logoutCurrent ( )
static

Logs out the current user

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

static eZUser::maxNumberOfFailedLogin ( )
static

Returns max number of failed login attempts.

Referenced by isEnabledAfterFailedLogin(), and setFailedLoginAttempts().

eZUser::originalPassword ( )
eZUser::originalPasswordConfirm ( )
static eZUser::passwordCharacterTable ( )
static
Returns
an array with characters which are allowed in password.

Referenced by createPassword().

static eZUser::passwordHashTypeID (   $identifier)
static
Returns
the hash type for the textual identifier $identifier

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

static eZUser::passwordHashTypeName (   $id)
static
Returns
a textual identifier for the hash type $id

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

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()
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()
eZUser::purgeUserCache ( )

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

Since
4.4
static eZUser::purgeUserCacheByAnonymousId ( )
static

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

Since
4.4
See Also
eZUser::purgeUserCacheByUserId()

Referenced by eZUserDiscountRule\store().

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.

int $userID

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

static eZUser::removeUser (   $userID)
static

Removes the user from the ezuser table.

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

Referenced by eZUserType\deleteStoredObjectAttribute().

static eZUser::requireUniqueEmail ( )
static
Returns
true if there can only be one instance of an email address on the site.

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

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

Callback which fetches user cache from local file.

Since
4.4
See Also
eZUser::getUserCacheByUserId()
eZUser::roleIDList ( )
Returns
an array of role ids which the user is assigned to
eZUser::roles ( )
Returns
an array of roles which the user is assigned to
eZUser::sessionCleanup ( )

Used by login handler to clean up session variables

static eZUser::setCurrentlyLoggedInUser (   $user,
  $userID 
)
staticprotected

Makes sure the user $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.

Referenced by ezpRestAuthConfiguration\filter(), eZContentCacheManager\generateObjectViewCache(), instance(), loginSucceeded(), eZLDAPUser\loginUser(), eZTextFileUser\loginUser(), ezpContentPublishingProcess\publish(), and eZScriptTrashPurge\run().

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.

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

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.

eZUser::setOriginalPassword (   $password)

Referenced by setInformation().

eZUser::setOriginalPasswordConfirm (   $password)

Referenced by setInformation().

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

Referenced by getUserCache().

static eZUser::site ( )
static
Returns
the site name used in password hashing.

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

eZUser::store (   $fieldFilters = null)
static eZUser::updateLastVisit (   $userID,
  $updateLoginCount = false 
)
static

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

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

static eZUser::userInfoExpiry ( )
staticprotected

Callback which figures out global expiry and returns it.

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

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

Since
Version 4.1
Parameters
string$loginNamethat we want to validate.
string$errorTextby reference for details if validation fails.
Returns
bool Indicates if validation failed (false) or not (true).

Referenced by eZUserType\validateObjectAttributeHTTPInput().

static eZUser::validatePassword (   $password)
static

Checks the password for validity

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

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

Member Data Documentation

eZUser::$anonymousId = null
staticprotected
eZUser::$Email
eZUser::$Groups

Referenced by groups().

eZUser::$Login
eZUser::$OriginalPassword

Referenced by originalPassword().

eZUser::$OriginalPasswordConfirm

Referenced by originalPasswordConfirm().

eZUser::$PasswordHash
eZUser::$PasswordHashType
eZUser::$UserCache = null
protected

Referenced by getUserCache().

eZUser::$userHasLoggedOut = false
staticprotected
const eZUser::AUTHENTICATE_ALL = 3
const eZUser::AUTHENTICATE_EMAIL = 2

Authenticate by matching the email field.

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

const eZUser::AUTHENTICATE_LOGIN = 1

Authenticate by matching the login field.

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

const eZUser::PASSWORD_HASH_CRYPT = 6
const eZUser::PASSWORD_HASH_MD5_PASSWORD = 1

MD5 of password.

const eZUser::PASSWORD_HASH_MD5_SITE = 3

MD5 of site, user and password.

const eZUser::PASSWORD_HASH_MD5_USER = 2

MD5 of user and password.

const eZUser::PASSWORD_HASH_MYSQL = 4

Legacy support for mysql hashed passwords.

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

const eZUser::PASSWORD_HASH_PLAINTEXT = 5

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


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