eZ Publish [4.5]
eZUser Class Reference

eZUser handles eZ Publish user accounts More...

Inheritance diagram for eZUser:
Collaboration diagram for eZUser:

List of all members.

Public Member Functions

 accessArray ()
 Returns either cached or newly generated accessArray for the user depending on site.ini\[RoleSettings] setting.
 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).
 getUserCache ()
 Get User cache from cache file.
 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.
 loginCurrent ()
 loginURI ()
 originalPassword ()
 originalPasswordConfirm ()
 postCollectUserInfo ()
 preCollectUserInfo ()
 purgeUserCache ()
 Delete User cache from locale var and cache file for current user.
 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()!
 store ($fieldFilters=null)

Static Public Member Functions

static anonymousId ()
 Gets the id of the anonymous user.
static authenticateHash ($user, $password, $site, $type, $hash)
static authenticationMatch ()
static cleanup ()
 Cleanup user related session values, for use by login / logout code.
static cleanupCache ()
 Expire user access / info cache globally.
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.
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.
static getCacheDir ($userId=0)
 Creates the cache path if it doesn't exist, and returns the cache directory.
static getCacheFilename ($userId)
 Returns the filename for a cache file with user information.
static getUserCacheByAnonymousId ()
 Get User cache from cache file for Anonymous user(usefull for sessionless users)
static hashType ()
static instance ($id=false)
 Returns a shared instance of the eZUser class pr $id value.
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.
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)
static purgeUserCacheByUserId ($userId)
 Delete User cache pr user.
static removeSessionData ($userID)
 Remove session data for user $userID.
static removeUser ($userID)
static requireUniqueEmail ()
static retrieveUserCacheFromFile ($filePath, $mtime, $userId)
 Callback which fetches user cache from local file.
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[].
static validatePassword ($password)

Public Attributes

 $Email
 $Groups
 $Login
 $OriginalPassword
 $OriginalPasswordConfirm
 $PasswordHash
 $PasswordHashType
const AUTHENTICATE_ALL = 3
const AUTHENTICATE_EMAIL = 2
 Authenticate by matching the email field.
const AUTHENTICATE_LOGIN = 1
 Authenticate by matching the login field.
const PASSWORD_HASH_CRYPT = 6
const PASSWORD_HASH_MD5_PASSWORD = 1
 MD5 of password.
const PASSWORD_HASH_MD5_SITE = 3
 MD5 of site, user and password.
const PASSWORD_HASH_MD5_USER = 2
 MD5 of user and password.
const PASSWORD_HASH_MYSQL = 4
 Legacy support for mysql hashed passwords.
const PASSWORD_HASH_PLAINTEXT = 5
 Passwords in plaintext, should not be used for real sites.

Protected Member Functions

 generateGroupIdList ()
 Generate list of group id's.

Static Protected Member Functions

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

Definition at line 35 of file ezuser.php.


Member Function Documentation

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 732 of file ezuser.php.

Referenced by loginUser().

eZUser::accessArray ( )

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

private

Returns:
array

Definition at line 1764 of file ezuser.php.

Referenced by hasAccessTo().

static eZUser::anonymousId ( ) [static]

Gets the id of the anonymous user.

Returns:
int User id of anonymous user.

Definition at line 2719 of file ezuser.php.

Referenced by checkUser(), fetchAnonymousCount(), fetchBuiltin(), eZUserDiscountRule::fetchIDListByUserID(), fetchLoggedInCount(), fetchLoggedInList(), instance(), logoutCurrent(), 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.

Definition at line 1560 of file ezuser.php.

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

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

Definition at line 626 of file ezuser.php.

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

eZUser::canAssignSection ( checkSectionID)

Definition at line 1938 of file ezuser.php.

eZUser::canAssignSectionList ( )

Definition at line 1969 of file ezuser.php.

eZUser::canAssignSectionToClassList ( checkSectionID)

Definition at line 2003 of file ezuser.php.

eZUser::canAssignSectionToObject ( checkSectionID,
contentObject 
)

Definition at line 1865 of file ezuser.php.

eZUser::canAssignToObjectSectionList ( contentObject)

Definition at line 1823 of file ezuser.php.

eZUser::canLoginToSiteAccess ( access)

Definition at line 2749 of file ezuser.php.

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 2447 of file ezuser.php.

static eZUser::cleanup ( ) [static]

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

Definition at line 987 of file ezuser.php.

Referenced by logoutCurrent(), and setCurrentlyLoggedInUser().

static eZUser::cleanupCache ( ) [static]

Expire user access / info cache globally.

Definition at line 2561 of file ezuser.php.

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

Definition at line 497 of file ezuser.php.

Referenced by removeSessionData().

static eZUser::contentClassIDs ( ) [static]

Returns the IDs of content classes that contain user accounts

Definition at line 2733 of file ezuser.php.

Referenced by eZApproveType::execute(), eZContentObjectTreeNodeOperations::move(), eZContentObjectTreeNode::removeSubtrees(), and eZContentObjectTreeNode::removeThis().

eZUser::contentObject ( )

Definition at line 2299 of file ezuser.php.

static eZUser::create ( contentObjectID) [static]
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 1660 of file ezuser.php.

Referenced by _loginUser(), authenticateHash(), eZTextFileUser::loginUser(), eZLDAPUser::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.

Definition at line 1630 of file ezuser.php.

static eZUser::currentUser ( ) [static]

Returns the currently logged in user.

Definition at line 1537 of file ezuser.php.

Referenced by eZDefaultShopAccountHandler::accountName(), eZCollaborationItemMessageLink::addMessage(), eZContentObject::allowedAssignSectionList(), eZContentObject::allowedAssignStateIDList(), eZSubTreeHandler::attribute(), eZGeneralDigestHandler::attribute(), eZWebDAVContentBackendAuth::authorize(), eZContentObject::cacheInfo(), eZContentObjectTreeNode::canCreateClassList(), eZContentObject::canCreateClassList(), eZContentObjectTreeNode::canEdit(), eZContentObject::canEdit(), eZContentClass::canInstantiateClasses(), eZContentClass::canInstantiateClassList(), eZOrder::canModifyStatus(), eZContentObject::canTranslate(), eZPackage::canUsePackagePolicyFunction(), eZPackage::canUsePolicyFunction(), eZContentObjectVersion::checkAccess(), eZContentObjectTreeNode::checkAccess(), eZContentObject::checkAccess(), eZSubtreeNotificationRule::checkObjectAccess(), eZPackageCreationHandler::checkPackageMaintainer(), checkUser(), eZUserType::classAttributeRemovableInformation(), eZContentObjectTreeNode::classListFromPolicy(), eZContentObject::classListFromPolicy(), eZContentObject::copy(), eZContentObject::copyVersion(), eZRSSImport::create(), eZInformationCollection::create(), eZContentObjectVersion::create(), eZCollaborationSimpleMessage::create(), eZBasket::createOrder(), eZContentObjectTreeNode::createPermissionCheckingSQL(), eZPackageCreationHandler::creatorList(), eZWishList::currentWishList(), eZWishList::discountPercent(), eZDefaultShopAccountHandler::email(), eZHTTPHeader::enabled(), eZMultiplexerType::execute(), eZApproveType::execute(), eZWebDAVContentServer::eZWebDAVContentServer(), 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(), isEnabled(), eZCollaborationGroup::itemCount(), eZLDAPUser::loginUser(), eZTopMenuOperator::modify(), eZAuthorType::objectAttributeContent(), eZSubtreeSubscriptionType::onPublish(), eZWebDAVContentServer::processClientRequest(), eZContentObjectTreeNode::removeSubtrees(), eZSubTreeHandler::rules(), eZCollaborationNotificationHandler::rules(), eZSubTreeHandler::rulesCount(), eZTrigger::runTrigger(), eZGeneralDigestHandler::settings(), eZPreferences::setValue(), eZOrder::statusModificationList(), eZRSSImport::store(), eZRSSExport::store(), eZPDFExport::store(), eZGeneralDigestHandler::storeSettings(), eZContentClass::storeVersioned(), eZSubTreeHandler::subscribedNodes(), eZCollaborationGroup::subTree(), eZPreferences::value(), eZPreferences::values(), eZDefaultShopAccountHandler::verifyAccountInformation(), and eZAudit::writeAudit().

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:

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" );
}

Reimplemented from eZPersistentObject.

Definition at line 66 of file ezuser.php.

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

eZUser::eZUser ( row = array())
eZUser::failedLoginAttempts ( )

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

Definition at line 1474 of file ezuser.php.

static eZUser::failedLoginAttemptsByUserID ( userID) [static]

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

Definition at line 1482 of file ezuser.php.

Referenced by failedLoginAttempts().

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 441 of file ezuser.php.

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 604 of file ezuser.php.

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.

Definition at line 556 of file ezuser.php.

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 415 of file ezuser.php.

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

Definition at line 305 of file ezuser.php.

static eZUser::fetchUserClassList ( asObject = false,
fields = false 
) [static]

Definition at line 2595 of file ezuser.php.

Referenced by fetchUserClassNames(), and fetchUserGroupClassNames().

static eZUser::fetchUserClassNames ( ) [static]

Definition at line 2627 of file ezuser.php.

Referenced by eZApproveType::customWorkflowEventHTTPAction().

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.

Definition at line 2535 of file ezuser.php.

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 1789 of file ezuser.php.

Referenced by accessArray().

eZUser::generateGroupIdList ( ) [protected]

Generate list of group id's.

Since:
4.4
Returns:
array

Definition at line 2399 of file ezuser.php.

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

Definition at line 1301 of file ezuser.php.

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

Definition at line 2547 of file ezuser.php.

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

Definition at line 2576 of file ezuser.php.

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 1196 of file ezuser.php.

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

Definition at line 1258 of file ezuser.php.

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 1271 of file ezuser.php.

Referenced by getUserCacheByAnonymousId(), and instance().

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

Definition at line 2325 of file ezuser.php.

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

Definition at line 1716 of file ezuser.php.

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

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

Definition at line 2054 of file ezuser.php.

static eZUser::hashType ( ) [static]
Returns:
the default hash type which is specified in UserSettings/HashType in site.ini

Definition at line 574 of file ezuser.php.

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

eZUser::hasManageLocations ( )

Check if current user has "content/manage_locations" access

Definition at line 186 of file ezuser.php.

eZUser::hasStoredLogin ( )

Definition at line 240 of file ezuser.php.

eZUser::id ( )
Returns:
the user id.

Definition at line 618 of file ezuser.php.

eZUser::isAnonymous ( )
Returns:
true if the user is the anonymous user.

Definition at line 1524 of file ezuser.php.

eZUser::isEnabled ( )
Returns:
true if the user is enabled and can be used on the site.

Definition at line 1506 of file ezuser.php.

static eZUser::isEnabledAfterFailedLogin ( userID,
ignoreTrusted = false 
) [static]

Definition at line 928 of file ezuser.php.

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

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

Definition at line 1496 of file ezuser.php.

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.

Definition at line 2312 of file ezuser.php.

static eZUser::isTrusted ( ) [static]

Returns true if current user is trusted user.

Definition at line 894 of file ezuser.php.

Referenced by isEnabledAfterFailedLogin(), and setFailedLoginAttempts().

static eZUser::isUserIPInList ( ipList) [static]

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

Definition at line 851 of file ezuser.php.

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

Definition at line 470 of file ezuser.php.

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 1602 of file ezuser.php.

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

eZUser::lastVisit ( )

Returns the last visit timestamp to the current user.

Definition at line 1375 of file ezuser.php.

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

Definition at line 2260 of file ezuser.php.

Referenced by limitValueList().

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

Definition at line 2281 of file ezuser.php.

eZUser::loginCount ( )

Returns the login count for the current user.

Since:
Version 4.1
Returns:
int Login count for current user.

Definition at line 1396 of file ezuser.php.

eZUser::loginCurrent ( )
Returns:
logs in the current user object

Definition at line 1002 of file ezuser.php.

static eZUser::loginFailed ( userID = false,
login 
) [static, protected]

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

Parameters:
mixed$userID
string$login

Definition at line 706 of file ezuser.php.

Referenced by loginUser().

static eZUser::loginSucceeded ( user) [static, protected]

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

Parameters:
eZUser$user

Definition at line 686 of file ezuser.php.

Referenced by loginUser().

eZUser::loginURI ( )

Check if login handler require special login URI

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

Definition at line 2525 of file ezuser.php.

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 eZLDAPUser, and eZTextFileUser.

Definition at line 665 of file ezuser.php.

Referenced by eZScript::initialize().

static eZUser::logoutCurrent ( ) [static]

Logs out the current user

Definition at line 1011 of file ezuser.php.

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

static eZUser::maxNumberOfFailedLogin ( ) [static]

Returns max number of failed login attempts.

Definition at line 913 of file ezuser.php.

Referenced by isEnabledAfterFailedLogin(), and setFailedLoginAttempts().

eZUser::originalPassword ( )

Definition at line 220 of file ezuser.php.

eZUser::originalPasswordConfirm ( )

Definition at line 230 of file ezuser.php.

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

Definition at line 1569 of file ezuser.php.

Referenced by createPassword().

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

Definition at line 151 of file ezuser.php.

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

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

Definition at line 117 of file ezuser.php.

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

Definition at line 2515 of file ezuser.php.

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 2501 of file ezuser.php.

eZUser::purgeUserCache ( )

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

Since:
4.4

Definition at line 1210 of file ezuser.php.

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 1234 of file ezuser.php.

Referenced by eZUserDiscountRule::store().

static eZUser::purgeUserCacheByUserId ( userId) [static]

Delete User cache pr user.

Since:
4.4
Parameters:
int$userId

Definition at line 1245 of file ezuser.php.

Referenced by eZContentObjectTreeNodeOperations::move(), purgeUserCache(), purgeUserCacheByAnonymousId(), eZContentObjectTreeNode::removeThis(), and 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

Definition at line 511 of file ezuser.php.

Referenced by eZContentObjectTreeNode::removeThis(), 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.

Definition at line 521 of file ezuser.php.

Referenced by eZUserType::deleteStoredObjectAttribute().

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

Definition at line 651 of file ezuser.php.

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

Definition at line 1289 of file ezuser.php.

eZUser::roleIDList ( )
Returns:
an array of role ids which the user is assigned to

Definition at line 2244 of file ezuser.php.

eZUser::roles ( )
Returns:
an array of roles which the user is assigned to

Definition at line 2234 of file ezuser.php.

eZUser::sessionCleanup ( )

Used by login handler to clean up session variables

Definition at line 978 of file ezuser.php.

Referenced by cleanup().

static eZUser::setCurrentlyLoggedInUser ( user,
userID 
) [static, 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.

Definition at line 962 of file ezuser.php.

Referenced by eZContentCacheManager::generateObjectViewCache(), instance(), loginCurrent(), loginSucceeded(), eZTextFileUser::loginUser(), eZLDAPUser::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.

Definition at line 1415 of file ezuser.php.

Referenced by loginFailed(), loginSucceeded(), eZTextFileUser::loginUser(), eZLDAPUser::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.

Definition at line 253 of file ezuser.php.

eZUser::setOriginalPassword ( password)

Definition at line 225 of file ezuser.php.

Referenced by setInformation().

eZUser::setOriginalPasswordConfirm ( password)

Definition at line 235 of file ezuser.php.

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

Definition at line 1223 of file ezuser.php.

Referenced by getUserCache().

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

Definition at line 594 of file ezuser.php.

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

eZUser::store ( fieldFilters = null)

Stores the object in the database, uses storeObject() to do the actual job and passes $fieldFilters to it.

Note:
Transaction unsafe. If you call several transaction unsafe methods you must enclose the calls within a db transaction; thus within db->begin and db->commit.

Reimplemented from eZPersistentObject.

Definition at line 209 of file ezuser.php.

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 1350 of file ezuser.php.

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

static eZUser::userInfoExpiry ( ) [static, protected]

Callback which figures out global expiry and returns it.

Definition at line 1802 of file ezuser.php.

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

Definition at line 2694 of file ezuser.php.

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

Definition at line 2671 of file ezuser.php.

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


Member Data Documentation

eZUser::$anonymousId = null [static, protected]

Definition at line 57 of file ezuser.php.

Referenced by anonymousId().

eZUser::$Email

Definition at line 2786 of file ezuser.php.

eZUser::$Groups

Definition at line 2789 of file ezuser.php.

eZUser::$Login

Definition at line 2785 of file ezuser.php.

eZUser::$OriginalPassword

Definition at line 2790 of file ezuser.php.

eZUser::$OriginalPasswordConfirm

Definition at line 2791 of file ezuser.php.

eZUser::$PasswordHash

Definition at line 2787 of file ezuser.php.

eZUser::$PasswordHashType

Definition at line 2788 of file ezuser.php.

eZUser::$UserCache = null [protected]

Definition at line 2800 of file ezuser.php.

eZUser::$userHasLoggedOut = false [static, protected]

Definition at line 2808 of file ezuser.php.

Definition at line 55 of file ezuser.php.

Authenticate by matching the email field.

Definition at line 53 of file ezuser.php.

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

Authenticate by matching the login field.

Definition at line 51 of file ezuser.php.

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

Definition at line 48 of file ezuser.php.

Referenced by hashType(), and passwordHashTypeID().

MD5 of password.

Definition at line 38 of file ezuser.php.

Referenced by hashType(), and passwordHashTypeID().

MD5 of site, user and password.

Definition at line 42 of file ezuser.php.

Referenced by hashType(), and passwordHashTypeID().

MD5 of user and password.

Definition at line 40 of file ezuser.php.

Referenced by hashType(), and passwordHashTypeID().

Legacy support for mysql hashed passwords.

Definition at line 44 of file ezuser.php.

Referenced by eZTextFileUser::loginUser(), eZLDAPUser::loginUser(), and passwordHashTypeID().

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

Definition at line 46 of file ezuser.php.

Referenced by hashType(), and passwordHashTypeID().


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