eZPublish  3.9
eZUser Class Reference

eZUser handles eZ publish user accounts More...

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

Public Member Functions

accessArray ()
 
 authenticationMatch ()
 
 checkUser (&$siteBasics, &$uri)
 
 cleanupCache ()
 
contentObject ()
 
 create ($contentObjectID)
 
 definition ()
 
 eZUser ($row)
 
 failedLoginAttempts ($userID=false)
 
 fetch ($id, $asObject=true)
 
fetchBuiltin ($id)
 
 fetchByEmail ($email, $asObject=true)
 
 fetchByName ($login, $asObject=true)
 
 fetchContentList ()
 
 fetchLoggedInCount ()
 
 fetchUserClassList ($asObject=false, $fields=false)
 
 fetchUserClassNames ()
 
 fetchUserGroupClassNames ()
 
 forceLogin ()
 
 generateAccessArray ()
 
groups ($asObject=false, $userID=false)
 
 hasAccessTo ($module, $function=false)
 
 hasAccessToView ($module, $viewName, &$params)
 
hasManageLocations ()
 
hasStoredLogin ()
 
 id ()
 
instance ($id=false)
 
 isAnonymous ()
 
isEnabled ()
 
 isEnabledAfterFailedLogin ($userID, $ignoreTrusted=false)
 
isLocked ()
 
isLoggedIn ()
 
 isUserObject ($contentObject)
 
lastVisit ()
 
 limitList ()
 
limitValueList ()
 
 loginCurrent ()
 
 loginURI ()
 
originalPassword ()
 
originalPasswordConfirm ()
 
 passwordHashTypeID ($identifier)
 
 passwordHashTypeName ($id)
 
 postCollectUserInfo ()
 
 preCollectUserInfo ()
 
 removeUser ($userID)
 
 requireUniqueEmail ()
 
roleIDList ()
 
roles ()
 
 sessionCleanup ()
 
 setFailedLoginAttempts ($userID, $value=false, $setByForce=false)
 
 setInformation ($id, $login, $email, $password, $passwordConfirm=false)
 
 setOriginalPassword ($password)
 
 setOriginalPasswordConfirm ($password)
 
 store ()
 
 updateLastVisit ($userID)
 
- Public Member Functions inherited from eZPersistentObject
attribute ($attr, $noFunction=false)
 
 attributes ()
 
 conditionText (&$conditions)
 
conditionTextByRow (&$conditions, &$row)
 
 definition ()
 
escapeArray (&$array)
 
 eZPersistentObject ($row)
 
 fetchObject (&$def, $field_filters, $conds, $asObject=true, $grouping=null, $custom_fields=null)
 
 fetchObjectList (&$def, $field_filters=null, $conds=null, $sorts=null, $limit=null, $asObject=true, $grouping=false, $custom_fields=null, $custom_tables=null, $custom_conds=null)
 
 fill (&$row)
 
 getShortAttributeName (&$db, &$def, $attrName)
 
 handleRows (&$rows, $class_name, $asObject)
 
 hasAttribute ($attr)
 
 hasDirtyData ()
 
 newObjectOrder (&$def, $orderField, $conditions)
 
 remove ($conditions=null, $extraConditions=null)
 
 removeObject (&$def, $conditions=null, $extraConditions=null)
 
 reorderObject (&$def, $orderField, $conditions, $down=true)
 
 setAttribute ($attr, $val)
 
 setHasDirtyData ($hasDirtyData)
 
 store ($fieldFilters=null)
 
 swapRow ($table, &$keys, &$order_id, &$rows, $id1, $id2)
 
 sync ($fieldFilters=null)
 
 updateObjectList ($parameters)
 

Static Public Member Functions

 authenticateHash ($user, $password, $site, $type, $hash)
 
 cleanup ()
 
 clearSessionCache ()
 
 createHash ($user, $password, $site, $type)
 
 createPassword ($passwordLength, $seed=false)
 
currentUser ()
 
 currentUserID ()
 
 fetchAnonymousCount ()
 
 fetchLoggedInList ($asObject=false, $offset=false, $limit=false, $sortBy=false)
 
 getCacheDir ($id=0)
 
 getCacheFilename ($id)
 
 hashType ()
 
 isTrusted ()
 
 isUserIPInList ($ipList)
 
 isUserLoggedIn ($userID)
 
loginUser ($login, $password, $authenticationMatch=false)
 
 logoutCurrent ()
 
 maxNumberOfFailedLogin ()
 
 passwordCharacterTable ()
 
 removeSessionData ($userID)
 
 site ()
 
 validatePassword ($password)
 

Protected Member Functions

 setCurrentlyLoggedInUser (&$user, $userID)
 

Private Member Functions

 userInfoExpiry ()
 

Private Attributes

 $Email
 
 $Groups
 
 $Login
 
 $OriginalPassword
 
 $OriginalPasswordConfirm
 
 $PasswordHash
 
 $PasswordHashType
 

Detailed Description

eZUser handles eZ publish user accounts

Member Function Documentation

& eZUser::accessArray ( )

Referenced by hasAccessTo().

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 eZLDAPUser\loginUser(), eZTextFileUser\loginUser(), and loginUser().

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

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

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

Cleans up any cache or session variables that are set. This at least called on login and logout but can be used other places where you must ensure that the cache user values are refetched.

Parameters
deprecated

Referenced by logoutCurrent().

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 ( )
eZUser::createHash (   $user,
  $password,
  $site,
  $type 
)
static

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

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

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

Returns the currently logged in user.

Referenced by eZDefaultShopAccountHandler\accountName(), eZCollaborationItemMessageLink\addMessage(), eZGeneralDigestHandler\attribute(), eZSubTreeHandler\attribute(), eZSimplePrice\attribute(), eZContentObject\cacheInfo(), eZContentObject\canCreateClassList(), eZContentObjectTreeNode\canCreateClassList(), eZContentObjectTreeNode\canEdit(), eZContentObject\canEdit(), eZContentClass\canInstantiateClasses(), eZContentClass\canInstantiateClassList(), eZOrder\canModifyStatus(), eZContentObject\canTranslate(), eZContentObjectVersion\checkAccess(), eZContentObject\checkAccess(), eZContentObjectTreeNode\checkAccess(), eZSubtreeNotificationRule\checkObjectAccess(), eZPackageCreationHandler\checkPackageMaintainer(), checkRelationActions(), checkTimeout(), checkUser(), eZUserType\classAttributeRemovableInformation(), eZContentObject\copy(), eZContentObject\copyVersion(), eZCollaborationSimpleMessage\create(), eZRSSImport\create(), eZInformationCollection\create(), eZContentObjectVersion\create(), eZContentObjectTreeNode\createObject(), eZBasket\createOrder(), eZContentObjectTreeNode\createPermissionCheckingSQL(), eZPackageCreationHandler\creatorList(), eZWishList\currentWishList(), eZWishList\discountPercent(), eZDefaultShopAccountHandler\email(), eZApproveType\execute(), eZMultiplexerType\execute(), eZSimplePrice\eZSimplePrice(), eZWebDAVContentServer\eZWebDAVContentServer(), eZContentFunctionCollection\fetchBookmarks(), eZUserFunctionCollection\fetchCurrentUser(), eZSubTreeHandler\fetchHttpInput(), 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(), isEnabled(), eZCollaborationGroup\itemCount(), eZLDAPUser\loginUser(), 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(), eZRSSExport\store(), eZPDFExport\store(), eZRSSImport\store(), eZContentClass\storeDefined(), eZGeneralDigestHandler\storeSettings(), eZSubTreeHandler\subscribedNodes(), eZCollaborationGroup\subTree(), eZContentObjectTreeNode\subTreeCount(), eZPreferences\value(), eZPreferences\values(), eZDefaultShopAccountHandler\verifyAccountInformation(), and eZAudit\writeAudit().

eZUser::definition ( )
eZUser::failedLoginAttempts (   $userID = false)

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

eZUser::fetchAnonymousCount ( )
static
Returns
the number of anonymous users in the system.
See Also
fetchLoggedInCount

Referenced by eZUserFunctionCollection\fetchAnonymousCount().

& eZUser::fetchBuiltin (   $id)

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

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

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().

eZUser::fetchUserClassList (   $asObject = false,
  $fields = false 
)
eZUser::fetchUserClassNames ( )
eZUser::fetchUserGroupClassNames ( )
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 ( )

Referenced by accessArray().

eZUser::getCacheDir (   $id = 0)
static

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

Returns
filename of the cachefile

Referenced by getCacheFilename().

eZUser::getCacheFilename (   $id)
static

Returns the filename for a cache file with user information

Returns
filename of the cachefile, or false when the user should not be cached

Referenced by accessArray().

& eZUser::groups (   $asObject = false,
  $userID = false 
)
Returns
an array of id's with all the groups the user belongs to.

Referenced by eZUserFunctionCollection\fetchUserRole(), generateAccessArray(), and 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 hasAccessToView(), and hasManageLocations().

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

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

& eZUser::hasManageLocations ( )

Check if current user has "content/manage_locations" access

& eZUser::hasStoredLogin ( )
eZUser::id ( )
Returns
the user id.
& eZUser::instance (   $id = false)

Finds the user with the id $id and returns the unique instance of it. If the user instance is not created yet it tries to either fetch it from the database with eZUser::fetch(). If $id is false or the user was not found, the default user is returned. This is a site.ini setting under UserSettings:AnonymousUserID. The instance is then returned. If $id is false then the current user is fetched.

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.
eZUser::isEnabledAfterFailedLogin (   $userID,
  $ignoreTrusted = false 
)
& 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.

eZUser::isTrusted ( )
static

Returns true if current user is trusted user.

Referenced by isEnabledAfterFailedLogin(), and setFailedLoginAttempts().

eZUser::isUserIPInList (   $ipList)
static

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

Referenced by isTrusted().

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().

eZUser::isUserObject (   $contentObject)

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 ( )
Returns
an array of limited assignments

Referenced by limitValueList().

& eZUser::limitValueList ( )
Returns
an array of values of limited assignments
eZUser::loginCurrent ( )
Returns
logs in the current user object
eZUser::loginURI ( )

Check if login handler require special login URI

Returns
Special login uri. If false, use system standard login uri.
& eZUser::loginUser (   $login,
  $password,
  $authenticationMatch = false 
)
static

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

Returns
The user object (eZContentObject) of the logged in user or false if it failed.

Referenced by eZScript\initialize().

eZUser::logoutCurrent ( )
static

Logs out the current user

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

eZUser::maxNumberOfFailedLogin ( )
static

Returns max number of failed login attempts.

Referenced by isEnabledAfterFailedLogin(), and setFailedLoginAttempts().

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

Referenced by createPassword().

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

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

eZUser::passwordHashTypeName (   $id)
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::removeSessionData (   $userID)
static

Remove session data for user $userID.

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

eZUser::removeUser (   $userID)

Removes the user from the ezuser table.

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

Referenced by eZUserType\deleteStoredObjectAttribute().

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

Referenced by eZUserType\validateObjectAttributeHTTPInput().

& 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

eZUser::setCurrentlyLoggedInUser ( $user,
  $userID 
)
protected

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 instance(), loginCurrent(), eZLDAPUser\loginUser(), eZTextFileUser\loginUser(), and loginUser().

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

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 eZLDAPUser\loginUser(), eZTextFileUser\loginUser(), 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::site ( )
static
Returns
the site name used in password hashing.

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

eZUser::store ( )
eZUser::updateLastVisit (   $userID)

Updates the user's last visit timestamp

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

eZUser::userInfoExpiry ( )
private

Returns expire timestamp for the user (but really returns global rolecache's expiry timestamp for now)

Referenced by accessArray().

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(), and setInformation().

Member Data Documentation

eZUser::$Email
private
eZUser::$Groups
private

Referenced by groups().

eZUser::$Login
private
eZUser::$OriginalPassword
private

Referenced by originalPassword().

eZUser::$OriginalPasswordConfirm
private

Referenced by originalPasswordConfirm().

eZUser::$PasswordHash
private
eZUser::$PasswordHashType
private

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