Class: I2CE UserAccess Mechanism (4.0.4)

From IHRIS Wiki
Revision as of 07:44, 27 May 2010 by Litlfred (talk | contribs) (Created page with '{{otherversions|Class: I2CE_UserAccess_Mechanism}} This article describes the class ''I2CE_UserAccess_Mechanism'' . *Extends the class: I2CE_Fuzzy…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


This article describes the class I2CE_UserAccess_Mechanism .

@filesource Class I2CE_UserAccess_Mechanism

Variables

$options

. Intialization options

$protocol

. The user access protocol this is.

Methods

__construct()

Create a new instance of a default I2CE table user access mechanism

_changePassword()

Change the password for this user. Worker method This will update a user's record to change the password in the database. It checks to make sure the new password matches the confirmation.

_createUser()

Create user worker method

  • Defined in i2ce/lib/I2CE_UserAccess_Mechanism.php on line 448
  • Signature: public function _createUser($username,$password,$role,$details)
  • Parameters:
    • string $username
    • string $password
    • string $role
      Defaults to false
      • Default Value: false
    • array $details
      Defatuls to empty array,
      • Default Value: array()
  • Returns: boolean.
    true on success

_getUserId()

Gets the user id from the username. Worker method

_getUserInfo()

Gets the indicated user details as well as the role. worker function

  • Defined in i2ce/lib/I2CE_UserAccess_Mechanism.php on line 251
  • Signature: protected function _getUserInfo($username,$getRole,$details)
  • Parameters:
    • string $username
      the user name @oaram boolean $getRole Defaults to false
    • $getRole
      • Default Value: false
    • array $details
      of string. The details we wish on the user. Defaults to empty array
      • Default Value: array()
  • Returns: array
    with indexed by the values of $details and values the corresponding detail. Returns false on failure

_getUserNameFromId()

Gets the user id from the username

_getUsersByInfo()

Gets the userss by the indicated details as well as the role. worker method @oaram boolean $role Defaults to false

  • Defined in i2ce/lib/I2CE_UserAccess_Mechanism.php on line 336
  • Signature: public function _getUsersByInfo($role,$details)
  • Parameters:
    • $role
      • Default Value: false
    • array $details
      of string. The details we wish on the user. Defaults to empty array
      • Default Value: array()
  • Returns: array
    of usernames which mathc the give input

_setUserInfo()

sets the indicated user details/role . worker function

  • Defined in i2ce/lib/I2CE_UserAccess_Mechanism.php on line 286
  • Signature: protected function _setUserInfo($username,$setRole,$details)
  • Parameters:
    • string $username
      the user name
    • mixed $setRole
      Defaulst to false. If a string, it is the role to assign to the user
      • Default Value: false
    • array $details
      of string. The keys are the detail, e.g. 'email' and the value at the key is the value of that detail
      • Default Value: array()
  • Returns: boolean
    true on success

_userExists()

See if a user is in the system

_userHasPassword()

verifies that the specified user has the specified password.

canChangePassword()

Whether or not this acccess mechansim can change a user's password

canCreateNewUser()

Whether or not this acccess mechansim can create ne users

canEditUserDetails()

Whether or not this acccess mechansim can create edit details of existing users

changePassword()

Change the password for this user. This will update a user's record to change the password in the database. It checks to make sure the new password matches the confirmation.

  • Defined in i2ce/lib/I2CE_UserAccess_Mechanism.php on line 380
  • Signature: final public function changePassword($username,$old_password,$new_password)
  • Parameters:
    • string $username
    • string $old_password
      If false then we don't check against the old password
    • string $new_password
  • Returns: booelan.
    true on success

createUser()

Create user .

displayName()

Gets the display name for the userdetails

ensureDefaultOptions()

Ensure default options are set

generatePassword()

Generate a password

getAllowedDetails()

Gets an array of the allowed user details such as email, firstname, lastname

getDetailName()

Returns the display name of the given detail

getSessionDetails()

Get any user details stored in the session

getSessionID()

Get any user id

getSessionRole()

Get any user role

getSessionUserName()

Get any username stored in the suession

getUserId()

Gets the user id from the username

getUserInfo()

Gets the indicated user details as well as the role

  • Defined in i2ce/lib/I2CE_UserAccess_Mechanism.php on line 217
  • Signature: final public function getUserInfo($username,$getRole,$details)
  • Parameters:
    • string $username
      the user name @oaram boolean $getRole Defaults to false
    • $getRole
      • Default Value: false
    • array $details
      of string. The details we wish on the user. Defaults to empty array
      • Default Value: array()
  • Returns: array
    with indexed by the values of $details and values the corresponding detail. Returns false on failture

getUserNameFromId()

Gets the user id from the username

getUsersByInfo()

Gets the userss by the indicated details as well as the role. worker method @oaram boolean $role Defaults to false

  • Defined in i2ce/lib/I2CE_UserAccess_Mechanism.php on line 298
  • Signature: public function getUsersByInfo($role,$details,$include_internal)
  • Parameters:
    • $role
      • Default Value: false
    • array $details
      of string. The details we wish on the user. Defaults to empty array
      • Default Value: array()
    • boolean $include_internal
      Defaults to true. If so, then we include the internal administrator user if they match the given details and role
      • Default Value: true
  • Returns: array
    of usernames which mathc the give input

hasSession()

Checks to see if a user has been stored in the session

isRequired()

Checks to see if the indicated detail is required $param string $detail returns boolean

logActivity()

Logs a user activiity @param string $actitivty, such as login, logout, access. Default is access @param int $timesamp. Defaults to null, in which case it should be now

  • Defined in i2ce/lib/I2CE_UserAccess_Mechanism.php on line 461
  • Signature: public function logActivity($username,$activity,$timestamp)
  • Parameters:
    • string $username
    • $activity
      • Default Value: 'access'
    • $timestamp
      • Default Value: null

setSession()

Store info on the authenticated user in session variables @param array $deatails. array of user details

setUserInfo()

sets the indicated user details/role.

  • Defined in i2ce/lib/I2CE_UserAccess_Mechanism.php on line 263
  • Signature: final public function setUserInfo($username,$setRole,$details)
  • Parameters:
    • string $username
      the user name
    • mixed $setRole
      Defaulst to false. If a string, it is the role to assign to the user
      • Default Value: false
    • array $details
      of string. The keys are the detail, e.g. 'email' and the value at the key is the value of that detail
      • Default Value: array()
  • Returns: boolean
    true on success

unsetSession()

Store info on the authenticated user in session variables @param string $username @param string $role @param array $deatails. array of user details

userExists()

See if a user is in the system

userHasPassword()

verifies that the specified user has the specified password.

Inherited Methods

_hasMethod()

This public method is inherited from I2CE_Fuzzy->_hasMethod()

Inherited Fuzzy Methods

userMessage()

This method is inherited from I2CE_Fuzzy->userMessage()