wCMF  3.6
 All Classes Namespaces Files Functions Variables Groups Pages
AuthUser Class Reference
+ Inheritance diagram for AuthUser:

Public Member Functions

 login ($login, $password, $isPasswordEncrypted=false)
 
 addPolicies ($policies)
 
 authorize ($actionKey)
 
 matchRoles ($val)
 
 parsePolicy ($val)
 
 setDefaultPolicy ($val)
 
 getLoginTime ()
 
 toString ()
 
 getType ()
 
 setLogin ($login)
 
 getLogin ()
 
 setPassword ($password)
 
 getPassword ()
 
 setName ($name)
 
 getName ()
 
 setFirstname ($firstname)
 
 getFirstname ()
 
 setConfig ($config)
 
 getConfig ()
 
 addRole ($rolename)
 
 removeRole ($rolename)
 
 hasRole ($rolename)
 
 getRoles ()
 
 getClassDefinitionFiles ()
 
 loadFromSession ()
 
- Public Member Functions inherited from User
 User ($oid=null, $type='User')
 
getUser ($login, $password)
 
 getUserId ()
 
 setLogin ($login)
 
 getLogin ()
 
 setPassword ($password)
 
 getPassword ()
 
 setName ($name)
 
 getName ()
 
 setFirstname ($firstname)
 
 getFirstname ()
 
 setConfig ($config)
 
 getConfig ()
 
 addRole ($rolename, $commit=false)
 
 removeRole ($rolename, $commit=false)
 
 hasRole ($rolename)
 
 getRoles ()
 
getRoleByName ($rolename)
 
 resetRoleCache ()
 
- Public Member Functions inherited from Node
 Node ($type, $oid=null)
 
 getNumChildren ($memOnly=true, $type=null)
 
 addChild (&$child, $addtype=ADDCHILD_BACK)
 
 updateParent (&$parent, $recursive=true)
 
 deleteChild ($childOID, $reallyDelete=false)
 
 loadChildren ($type, $buildDepth=BUILDDEPTH_SINGLE, $forceUpdate=false)
 
getFirstChild ($type, $values, $properties, $useRegExp=true)
 
 getChildren ()
 
 getChildrenEx ($oid, $type, $values, $properties, $useRegExp=true)
 
 sortChildren ($criteria, $recursive=false, $changeSortkey=false, $sortFunction='')
 
 sort (&$nodeList, $criteria, $recursive=false, $changeSortkey=false, $sortFunction='')
 
 filter (&$nodeList, $oid, $type, $values, $properties, $useRegExp=true)
 
 getNextSibling ()
 
 getPreviousSibling ()
 
 loadParents ($type, $forceUpdate=false)
 
 getNumParents ($memOnly=true, $type=null)
 
getParent ()
 
getFirstParent ($type, $values, $properties, $useRegExp=true)
 
getParents ()
 
 getParentsEx ($oid, $type, $values, $properties, $useRegExp=true)
 
 getDepth ()
 
 getPath ()
 
 acceptVisitor (&$visitor)
 
 setState ($state, $recursive=true)
 
 removeDuplicateOidsWithoutRole ($oids)
 
 getDisplayValue ($useDisplayType=false)
 
 getDisplayValues ($useDisplayType=false)
 
 toString ($verbose=false)
 
- Public Member Functions inherited from PersistentObject
 PersistentObject ($type, $oid=null)
 
 getType ()
 
 setType ($type)
 
 getBaseType ()
 
 getOID ()
 
 getBaseOID ()
 
 setOID ($oid)
 
 getDBID ()
 
 setDBID ($id)
 
getMapper ()
 
getDataConverter ()
 
 save ()
 
 delete ($recursive=true)
 
 getState ()
 
 setState ($state, $recursive=true)
 
 setImmutable ()
 
 getLock ()
 
duplicate ()
 
 copyValues (&$object, $dataTypes=array(), $copyPkValues=true)
 
 copyValueIntern (&$node, $valueName, $dataType, &$targetNode, $dataTypes, $valuesToIgnore)
 
 clearValues ($dataTypes=array())
 
 clearValueIntern (&$node, $valueName, $dataType, $dataTypes)
 
 updateOID ()
 
 afterCreate ()
 
 beforeInsert ()
 
 afterInsert ()
 
 afterLoad ()
 
 beforeUpdate ()
 
 afterUpdate ()
 
 beforeDelete ()
 
 afterDelete ()
 
 hasValue ($name, $type=null)
 
 getValue ($name, $type=null)
 
 removeValue ($name, $type=null)
 
 getUnconvertedValue ($name, $type=null)
 
 getConvertedValue ($name, $type=null)
 
 getValueTypes ($name)
 
 validateValues ()
 
 validateValueIntern (&$node, $valueName, $dataType, &$errorMsg)
 
 validateValue ($name, $value, $type=null)
 
 validateValueAgainstRestrictions ($name, $value, $type=null)
 
 setValue ($name, $value, $type=null, $forceSet=false)
 
 getValueProperties ($name, $type=null)
 
 setValueProperties ($name, $properties, $type=null)
 
 getValueProperty ($name, $property, $type=null)
 
 setValueProperty ($name, $property, $value, $type=null)
 
 getValueNames ($type=null)
 
 getDataTypes ()
 
 getProperty ($name)
 
 setProperty ($name, $value)
 
 getPropertyNames ()
 
 addChangeListener (&$listener)
 
 removeChangeListener (&$listener)
 
 propagateValueChange ($name, $type, $oldValue, $newValue)
 
 propagatePropertyChange ($name, $oldValue, $newValue)
 
 propagateStateChange ($oldValue, $newValue)
 
 getObjectDisplayName ()
 
 getObjectDescription ()
 
 getDisplayValue ()
 
 getValueDisplayName ($name, $type=null)
 
 getValueDescription ($name, $type=null)
 
 toString ($verbose=false)
 
 isIndexInSearch ()
 
- Public Member Functions inherited from Storable
 getClassDefinitionFiles ()
 
 loadFromSession ()
 
 saveToSession ()
 

Public Attributes

 $_login_time = ""
 
 $_policies = array()
 
 $_defaulPolicy = true
 
 $_user = null
 
- Public Attributes inherited from User
 $_cachedRoles = array()
 
 $_hasOwnRolesLoaded = false
 
- Public Attributes inherited from Node
 $_children = array()
 
 $_parents = array()
 
 $_depth = -1
 
 $_path = ''
 
- Public Attributes inherited from PersistentObject
 $_oid = null
 
 $_type = ''
 
 $_data = array()
 
 $_properties = array()
 
 $_state = STATE_CLEAN
 
 $_isImmutable = false
 
 $_changeListeners = array()
 

Detailed Description

AuthUser provides a storage and methods for user data used for authentication/authorization purposes. This class requires php >= 4.1.0.

wCMF - wemove Content Management Framework Copyright (C) 2005-2014 wemove digital solutions GmbH

Licensed under the terms of any of the following licenses at your choice:

See the license.txt file distributed with this work for additional information.

Id:
class.AuthUser.php 1462 2014-02-04 23:52:27Z iherwig
Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 34 of file class.AuthUser.php.

Member Function Documentation

AuthUser::login (   $login,
  $password,
  $isPasswordEncrypted = false 
)

Log a user into the application.

Parameters
loginThe login string of the user
passwordThe password string of the user
isPasswordEncryptedTrue/False wether the password is encrypted or not [default: false]
Returns
True/False whether login succeeded.

Definition at line 48 of file class.AuthUser.php.

References $GLOBALS, addPolicies(), BUILDDEPTH_SINGLE, UserManager\encryptPassword(), getConfig(), PersistenceFacade\getInstance(), InifileParser\getInstance(), RightsManager\getInstance(), UserManager\getUserClassName(), PersistentObject\setOID(), and WCMFException\throwEx().

+ Here is the call graph for this function:

AuthUser::addPolicies (   $policies)

Adds one ore more policies to the policy repository of the user.

Parameters
policiesAn associative array with the policy information (key=action, value=policy string).
Note
A policy string looks like this "+*, -guest, +admin"

Definition at line 106 of file class.AuthUser.php.

References parsePolicy().

Referenced by login().

+ Here is the call graph for this function:

AuthUser::authorize (   $actionKey)

Checks, if the user is authorized for this action. Returns defaulPolicy if action key is not defined.

Parameters
actionKeyAn action key string
Returns
True/False whether authorization succeeded

Definition at line 124 of file class.AuthUser.php.

References $_defaulPolicy, and matchRoles().

+ Here is the call graph for this function:

AuthUser::matchRoles (   $val)

Matches the roles of the user and the roles for a certain key

Parameters
valAn array containing policy information as an associative array with the keys ('default', 'allow', 'deny'). Where 'allow', 'deny' are arrays itselves holding roles. 'allow' overwrites 'deny' overwrites 'default'
Returns
True/False whether the user has access right according to this policy.

Definition at line 141 of file class.AuthUser.php.

References hasRole().

Referenced by authorize().

+ Here is the call graph for this function:

AuthUser::parsePolicy (   $val)

Parse an policy string and returns an associative array with the keys ('default', 'allow', 'deny'). Where 'allow', 'deny' are arrays itselves holding roles. 'deny' overwrites 'allow' overwrites 'default'

Parameters
valAn role string (+*, +admin, -guest, entries without '+' or '-' prefix default to allow rules).
Returns
An array containing the policy data as an associative array with the keys 'default', 'allow', 'deny'.

Definition at line 162 of file class.AuthUser.php.

Referenced by addPolicies(), and RightsManager\getRight().

AuthUser::setDefaultPolicy (   $val)

Assign the default policy.

Parameters
valA boolean value.

Definition at line 197 of file class.AuthUser.php.

AuthUser::getLoginTime ( )

Get login time of the user.

Returns
A formatted time string.

Definition at line 206 of file class.AuthUser.php.

References $_login_time.

AuthUser::toString ( )

Get a string representation of the user.

Returns
The string

Definition at line 215 of file class.AuthUser.php.

AuthUser::getType ( )

Implementation of abstract base class methods. Delegates to internal user instance. Get the type

Definition at line 230 of file class.AuthUser.php.

References UserManager\getUserClassName().

+ Here is the call graph for this function:

AuthUser::setLogin (   $login)
See Also
User::setLogin()

Definition at line 238 of file class.AuthUser.php.

AuthUser::getLogin ( )
See Also
User::getLogin()

Definition at line 247 of file class.AuthUser.php.

AuthUser::setPassword (   $password)
See Also
User::setPassword()

Definition at line 257 of file class.AuthUser.php.

AuthUser::getPassword ( )
See Also
User::getPassword()

Definition at line 266 of file class.AuthUser.php.

AuthUser::setName (   $name)
See Also
User::setName()

Definition at line 276 of file class.AuthUser.php.

AuthUser::getName ( )
See Also
User::getName()

Definition at line 285 of file class.AuthUser.php.

AuthUser::setFirstname (   $firstname)
See Also
User::setFirstname()

Definition at line 295 of file class.AuthUser.php.

AuthUser::getFirstname ( )
See Also
User::getFirstname()

Definition at line 304 of file class.AuthUser.php.

AuthUser::setConfig (   $config)
See Also
User::setConfig()

Definition at line 314 of file class.AuthUser.php.

AuthUser::getConfig ( )
See Also
User::getConfig()

Definition at line 323 of file class.AuthUser.php.

Referenced by login().

AuthUser::addRole (   $rolename)
See Also
User::addRole()

Definition at line 335 of file class.AuthUser.php.

AuthUser::removeRole (   $rolename)
See Also
User::removeRole()

Definition at line 343 of file class.AuthUser.php.

AuthUser::hasRole (   $rolename)
See Also
User::hasRole()

Definition at line 351 of file class.AuthUser.php.

Referenced by matchRoles().

AuthUser::getRoles ( )
See Also
User::getRoles()

Definition at line 362 of file class.AuthUser.php.

AuthUser::getClassDefinitionFiles ( )

Implementation of the storable interface.

See Also
Storable::getClassDefinitionFiles()

Definition at line 377 of file class.AuthUser.php.

References ObjectFactory\getInstance(), InifileParser\getInstance(), and WCMFException\throwEx().

+ Here is the call graph for this function:

AuthUser::loadFromSession ( )
See Also
Storable::loadFromSession() Load the user object.

Definition at line 397 of file class.AuthUser.php.

Member Data Documentation

AuthUser::$_login_time = ""

Definition at line 36 of file class.AuthUser.php.

Referenced by getLoginTime().

AuthUser::$_policies = array()

Definition at line 37 of file class.AuthUser.php.

AuthUser::$_defaulPolicy = true

Definition at line 38 of file class.AuthUser.php.

Referenced by authorize().

AuthUser::$_user = null

Definition at line 39 of file class.AuthUser.php.


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