eZPublish  4.0
eZUser Class Reference

eZUser handles eZ Publish user accounts More...

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

Public Member Functions

 accessArray ()
 
 canAssignSection ($checkSectionID)
 
 canAssignSectionList ()
 
 canAssignSectionToClassList ($checkSectionID)
 
 canAssignSectionToObject ($checkSectionID, $contentObject)
 
 canAssignToObjectSectionList ($contentObject)
 
 checkUser (&$siteBasics, $uri)
 
 contentObject ()
 
 eZUser ($row)
 
 failedLoginAttempts ()
 
 forceLogin ()
 
 generateAccessArray ()
 
 groups ($asObject=false)
 
 hasAccessTo ($module, $function=false)
 
 hasAccessToView ($module, $viewName, &$params)
 
 hasManageLocations ()
 
 hasStoredLogin ()
 
 id ()
 
 isAnonymous ()
 
 isEnabled ()
 
 isLocked ()
 
 isLoggedIn ()
 
 lastVisit ()
 
 limitList ()
 
 limitValueList ()
 
 loginCurrent ()
 
 loginURI ()
 
 originalPassword ()
 
 originalPasswordConfirm ()
 
 postCollectUserInfo ()
 
 preCollectUserInfo ()
 
 roleIDList ()
 
 roles ()
 
 sessionCleanup ()
 
 setInformation ($id, $login, $email, $password, $passwordConfirm=false)
 
 setOriginalPassword ($password)
 
 setOriginalPasswordConfirm ($password)
 
 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 ()
 
static authenticateHash ($user, $password, $site, $type, $hash)
 
static authenticationMatch ()
 
static cleanup ()
 
static cleanupCache ()
 
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 ()
 
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 getCacheDir ($id=0)
 
static getCacheFilename ($id)
 
static hashType ()
 
static instance ($id=false)
 
static isEnabledAfterFailedLogin ($userID, $ignoreTrusted=false)
 
static isTrusted ()
 
static isUserIPInList ($ipList)
 
static isUserLoggedIn ($userID)
 
static isUserObject ($contentObject)
 
static loginUser ($login, $password, $authenticationMatch=false)
 
static logoutCurrent ()
 
static maxNumberOfFailedLogin ()
 
static passwordCharacterTable ()
 
static passwordHashTypeID ($identifier)
 
static passwordHashTypeName ($id)
 
static removeSessionData ($userID)
 
static removeUser ($userID)
 
static requireUniqueEmail ()
 
static setFailedLoginAttempts ($userID, $value=false, $setByForce=false)
 
static site ()
 
static updateLastVisit ($userID)
 
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...
 

Static Protected Member Functions

static setCurrentlyLoggedInUser ($user, $userID)
 

Private Member Functions

 generateAccessArrayForCache ($filePath, $userID)
 

Static Private Member Functions

 retrieveAccessArrayFromCache ($filePath, $mtime, $userID)
 
 userInfoExpiry ()
 

Static Private Attributes

static $anonymousId = null
 

Detailed Description

eZUser handles eZ Publish user accounts

Member Function Documentation

eZUser::accessArray ( )

Referenced by hasAccessTo().

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

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

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

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

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

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

static eZUser::contentClassIDs ( )
static
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 authenticateHash(), eZLDAPUser\loginUser(), eZTextFileUser\loginUser(), 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(), eZGeneralDigestHandler\attribute(), eZSubTreeHandler\attribute(), eZSimplePrice\attribute(), 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(), 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(), 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(), 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\subTreeCountByNodeID(), eZPreferences\value(), eZPreferences\values(), eZDefaultShopAccountHandler\verifyAccountInformation(), and eZAudit\writeAudit().

static eZUser::definition ( )
static
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::fetchAnonymousCount ( )
static
Returns
the number of anonymous users in the system.
See Also
fetchLoggedInCount

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::fetchByName (   $login,
  $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 ( )
eZUser::generateAccessArrayForCache (   $filePath,
  $userID 
)
private

Callback which generates the accessarray for the current user.

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

static 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)
Returns
an array of id's with all the groups the user belongs to.

Referenced by 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 canAssignSection(), canAssignSectionList(), canAssignSectionToClassList(), canAssignSectionToObject(), canAssignToObjectSectionList(), 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 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.
static eZUser::instance (   $id = false)
static

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

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

Remove session data for user $userID.

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

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

eZUser::retrieveAccessArrayFromCache (   $filePath,
  $mtime,
  $userID 
)
staticprivate

Callback which fetches access array from local file.

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

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

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

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

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

Updates the user's last visit timestamp

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

eZUser::userInfoExpiry ( )
staticprivate

Callback which figures out global expiry and returns it.

Referenced by accessArray().

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

Member Data Documentation

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

Referenced by groups().

eZUser::$Login
eZUser::$OriginalPassword

Referenced by originalPassword().

eZUser::$OriginalPasswordConfirm

Referenced by originalPasswordConfirm().

eZUser::$PasswordHash
eZUser::$PasswordHashType
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: