Class: I2CE UserAccess Mechanism (Development)

From IHRIS Wiki


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 515
  • 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

_getUserIds()

Gets the user ids @param string $username

_getUserInfo()

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

  • Defined in i2ce/lib/I2CE_UserAccess_Mechanism.php on line 318
  • 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 403
  • 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 353
  • 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

_userHasDefaultPassword()

verifies that the specified user has the specified password. @param string $password

_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 447
  • 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

doAutoLogin()

Check to see if we should do a automatic login

ensureDefaultOptions()

Ensure default options are set

generatePassword()

Generate a password

getAllowedDetails()

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

getAutoLoginUser()

Get the username for an autologin

getDetailName()

Returns the display name of the given detail

getSessionActivity()

Get the last activity time for this session.

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

getUserIds()

Gets the user ids

getUserInfo()

Gets the indicated user details as well as the role

  • Defined in i2ce/lib/I2CE_UserAccess_Mechanism.php on line 284
  • 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 365
  • 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

hasBeenLoggedOut()

Checks to see if this user has been logged out by other means to invalidate login. This is a placeholder to be implemented in sub classes.

hasSession()

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

isLoggingFromAnotherIP()

Checks to see if a person is logging in from another IP address. This is a placeholder than sub classes can implement. No checks can be done from here.

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 528
  • Signature: public function logActivity($username,$activity,$ip_address,$timestamp)
  • Parameters:
    • string $username
    • $activity
      • Default Value: 'access'
    • $ip_address
      • Default Value: '127.0.0.1'
    • $timestamp
      • Default Value: null

logOutPreviousSessions()

Logs out other sessions with the same username if single login option is set. This does nothing in the base class, but can be implemented in subclasses.

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 330
  • 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

updateSessionActivity()

Update the session activity time.

userExists()

See if a user is in the system

userHasDefaultPassword()

checks to see if a user has a default password. @param string $password

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