eZUser Class Reference
[Content datatypes]

eZUser handles eZ publish user accounts More...

Inheritance diagram for eZUser:
eZPersistentObject eZLDAPUser eZTextFileUser

List of all members.

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)

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

Definition at line 66 of file ezuser.php.


Member Function Documentation

& eZUser::accessArray (  ) 

Definition at line 1584 of file ezuser.php.

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.

Definition at line 1395 of file ezuser.php.

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

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

Definition at line 639 of file ezuser.php.

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

Definition at line 2149 of file ezuser.php.

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 

Definition at line 963 of file ezuser.php.

Referenced by logoutCurrent().

eZUser::cleanupCache (  ) 

Definition at line 2262 of file ezuser.php.

Referenced by eZContentObjectTreeNodeOperations::move().

eZUser::clearSessionCache (  )  [static]

Removes any cached session information, this is:

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

Definition at line 513 of file ezuser.php.

Referenced by removeSessionData().

& eZUser::contentObject (  ) 

Definition at line 1965 of file ezuser.php.

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

Definition at line 1493 of file ezuser.php.

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

Definition at line 1463 of file ezuser.php.

& eZUser::currentUser (  )  [static]

Returns the currently logged in user.

Definition at line 1372 of file ezuser.php.

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

eZUser::currentUserID (  )  [static]
eZUser::definition (  ) 
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:

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

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

eZUser::eZUser ( row  ) 
eZUser::failedLoginAttempts ( userID = false  ) 

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

Definition at line 1300 of file ezuser.php.

eZUser::fetch ( id,
asObject = true 
)
eZUser::fetchAnonymousCount (  )  [static]
Returns:
the number of anonymous users in the system.
See also:
fetchLoggedInCount

Definition at line 453 of file ezuser.php.

& eZUser::fetchBuiltin ( id  ) 

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

Definition at line 614 of file ezuser.php.

eZUser::fetchByEmail ( email,
asObject = true 
)
eZUser::fetchByName ( login,
asObject = true 
)
eZUser::fetchContentList (  ) 
Returns:
a list of valid and enabled users, the data returned is an array with ezcontentobject database data.

Definition at line 566 of file ezuser.php.

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

Definition at line 424 of file ezuser.php.

eZUser::fetchLoggedInList ( asObject = false,
offset = false,
limit = false,
sortBy = false 
) [static]
Returns:
a list of the logged in users.
Parameters:
$asObject If false it will return a list with only the names of the users as elements and user ID as key, otherwise each entry is a eZUser object.
See also:
fetchLoggedInCount

Definition at line 310 of file ezuser.php.

eZUser::fetchUserClassList ( asObject = false,
fields = false 
)

Definition at line 2298 of file ezuser.php.

Referenced by fetchUserClassNames(), and fetchUserGroupClassNames().

eZUser::fetchUserClassNames (  ) 

Definition at line 2330 of file ezuser.php.

Referenced by eZApproveType::customWorkflowEventHTTPAction().

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.

Definition at line 2238 of file ezuser.php.

eZUser::generateAccessArray (  ) 

Definition at line 1667 of file ezuser.php.

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

Definition at line 2249 of file ezuser.php.

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

Definition at line 2276 of file ezuser.php.

Referenced by accessArray().

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

Definition at line 1995 of file ezuser.php.

Referenced by generateAccessArray(), and limitList().

eZUser::hasAccessTo ( module,
function = false 
)

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

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

Definition at line 1539 of file ezuser.php.

Referenced by hasAccessToView(), and hasManageLocations().

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

Definition at line 1702 of file ezuser.php.

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

Definition at line 584 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 184 of file ezuser.php.

& eZUser::hasStoredLogin (  ) 

Definition at line 244 of file ezuser.php.

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

Definition at line 631 of file ezuser.php.

& eZUser::instance ( id = false  ) 
eZUser::isAnonymous (  ) 
Returns:
true if the user is the anonymous user.

Definition at line 1359 of file ezuser.php.

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

Definition at line 1339 of file ezuser.php.

eZUser::isEnabledAfterFailedLogin ( userID,
ignoreTrusted = false 
)

Definition at line 900 of file ezuser.php.

Referenced by isLocked(), loginUser(), 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 1328 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 1981 of file ezuser.php.

eZUser::isTrusted (  )  [static]

Returns true if current user is trusted user.

Definition at line 866 of file ezuser.php.

Referenced by isEnabledAfterFailedLogin(), and setFailedLoginAttempts().

eZUser::isUserIPInList ( ipList  )  [static]

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

Definition at line 823 of file ezuser.php.

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

Definition at line 482 of file ezuser.php.

eZUser::isUserObject ( contentObject  ) 

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

Parameters:
ContentObject 
Returns:
true or false

Definition at line 1435 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 1219 of file ezuser.php.

eZUser::limitList (  ) 
Returns:
an array of limited assignments

Definition at line 1910 of file ezuser.php.

Referenced by limitValueList().

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

Definition at line 1928 of file ezuser.php.

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

Definition at line 989 of file ezuser.php.

eZUser::loginURI (  ) 

Check if login handler require special login URI

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

Definition at line 2228 of file ezuser.php.

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

Reimplemented in eZLDAPUser, and eZTextFileUser.

Definition at line 676 of file ezuser.php.

Referenced by eZScript::initialize().

eZUser::logoutCurrent (  )  [static]

Logs out the current user

Definition at line 998 of file ezuser.php.

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

eZUser::maxNumberOfFailedLogin (  )  [static]

Returns max number of failed login attempts.

Definition at line 885 of file ezuser.php.

Referenced by isEnabledAfterFailedLogin(), and setFailedLoginAttempts().

& eZUser::originalPassword (  ) 

Definition at line 224 of file ezuser.php.

& eZUser::originalPasswordConfirm (  ) 

Definition at line 234 of file ezuser.php.

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

Definition at line 1404 of file ezuser.php.

Referenced by createPassword().

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

Definition at line 153 of file ezuser.php.

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

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

Definition at line 123 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 2218 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 2204 of file ezuser.php.

eZUser::removeSessionData ( userID  )  [static]

Remove session data for user $userID.

Definition at line 524 of file ezuser.php.

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.

Definition at line 536 of file ezuser.php.

Referenced by eZUserType::deleteStoredObjectAttribute().

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

Definition at line 665 of file ezuser.php.

Referenced by eZUserType::validateObjectAttributeHTTPInput().

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

Definition at line 1869 of file ezuser.php.

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

Definition at line 1857 of file ezuser.php.

eZUser::sessionCleanup (  ) 

Used by login handler to clean up session variables

Definition at line 952 of file ezuser.php.

Referenced by cleanup().

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.

Definition at line 934 of file ezuser.php.

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

Definition at line 1240 of file ezuser.php.

Referenced by loginUser(), 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 258 of file ezuser.php.

eZUser::setOriginalPassword ( password  ) 

Definition at line 229 of file ezuser.php.

Referenced by setInformation().

eZUser::setOriginalPasswordConfirm ( password  ) 

Definition at line 239 of file ezuser.php.

Referenced by setInformation().

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

Definition at line 603 of file ezuser.php.

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

eZUser::store (  ) 

Definition at line 208 of file ezuser.php.

eZUser::updateLastVisit ( userID  ) 

Updates the user's last visit timestamp

Definition at line 1196 of file ezuser.php.

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

eZUser::userInfoExpiry (  )  [private]

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

Definition at line 1679 of file ezuser.php.

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

Definition at line 2374 of file ezuser.php.

Referenced by setInformation().


Member Data Documentation

eZUser::$Email [private]

Definition at line 2390 of file ezuser.php.

eZUser::$Groups [private]

Definition at line 2393 of file ezuser.php.

eZUser::$Login [private]

Definition at line 2389 of file ezuser.php.

eZUser::$OriginalPassword [private]

Definition at line 2394 of file ezuser.php.

eZUser::$OriginalPasswordConfirm [private]

Definition at line 2395 of file ezuser.php.

eZUser::$PasswordHash [private]

Definition at line 2391 of file ezuser.php.

eZUser::$PasswordHashType [private]

Definition at line 2392 of file ezuser.php.


The documentation for this class was generated from the following file:
Generated on Mon Jul 12 07:10:32 2010 for eZ publish by  doxygen 1.6.3