Class: I2CE UserAccess Mechanism (Development): Difference between revisions

From IHRIS Wiki
(Created page with '{{otherversions|Class: I2CE_UserAccess_Mechanism}} This article describes the class ''I2CE_UserAccess_Mechanism'' . *Extends the class: [[Class: I2CE_Fuzzy (Development) | I2CE_F…')
 
No edit summary
 
Line 7: Line 7:
** [[Class: I2CE_UserAccess_LDAP (Development) | I2CE_UserAccess_LDAP]]
** [[Class: I2CE_UserAccess_LDAP (Development) | I2CE_UserAccess_LDAP]]
** [[Class: I2CE_UserAccess_LDAP_DB (Development) | I2CE_UserAccess_LDAP_DB]]
** [[Class: I2CE_UserAccess_LDAP_DB (Development) | I2CE_UserAccess_LDAP_DB]]
*Location: Part of the module [[I2CE Module List (Development)#I2CE|I2CE]] in the package [https://launchpad.net/i2ce I2CE] 4.0-dev
** [[Class: I2CE_UserAccess_Single (Development) | I2CE_UserAccess_Single]]
*Source: Defined in the file [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L33 lib/I2CE_UserAccess_Mechanism.php] on line 33
*Location: Part of the module [[I2CE Module List (Development)#I2CE|I2CE]] in the package [https://launchpad.net/i2ce I2CE] 4.1-dev
*Source: Defined in the file [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L33 lib/I2CE_UserAccess_Mechanism.php] on line 33
*Author: Carl Leitner <litlfred@ibiblio.org>
*Author: Carl Leitner <litlfred@ibiblio.org>
*Since: v4.0.3
*Since: v4.0.3
Line 15: Line 16:
===$options===
===$options===
. Intialization options
. Intialization options
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L37 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 37
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L37 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 37
*Type: protected [http://www.php.net/manual/en/language.types.array.php array ] $options
*Type: protected [http://www.php.net/manual/en/language.types.array.php array ] $options


===$protocol===
===$protocol===
.  The user access protocol this is.
.  The user access protocol this is.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L42 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 42
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L42 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 42
*Type: protected [http://www.php.net/manual/en/language.types.string.php string ] $protocol
*Type: protected [http://www.php.net/manual/en/language.types.string.php string ] $protocol


Line 26: Line 27:
===__construct()===
===__construct()===
Create a new instance of a default I2CE  table user access mechanism
Create a new instance of a default I2CE  table user access mechanism
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L46 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 46
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L46 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 46
*Signature: public function __construct()
*Signature: public function __construct()
===_changePassword()===
===_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.
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.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L406 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 406
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L473 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 473
*Signature: public function _changePassword($username,$old_password,$new_password)
*Signature: public function _changePassword($username,$old_password,$new_password)
*Parameters:
*Parameters:
Line 39: Line 40:
===_createUser()===
===_createUser()===
Create user worker method
Create user worker method
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L448 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 448
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L515 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 515
*Signature: public function _createUser($username,$password,$role,$details)
*Signature: public function _createUser($username,$password,$role,$details)
*Parameters:
*Parameters:
Line 51: Line 52:
===_getUserId()===
===_getUserId()===
Gets the user id from the username. Worker method
Gets the user id from the username. Worker method
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L133 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 133
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L176 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 176
*Signature: public function _getUserId($username)
*Signature: public function _getUserId($username)
*Parameters:
*Parameters:
** [http://www.php.net/manual/en/language.types.string.php string ] $username
** [http://www.php.net/manual/en/language.types.string.php string ] $username
*Returns: [http://www.php.net/manual/en/language.types.integer.php int ]<br/>or false on failure
*Returns: [http://www.php.net/manual/en/language.types.integer.php int ]<br/>or false on failure
===_getUserIds()===
Gets the user ids @param string $username
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L148 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 148
*Signature: public function _getUserIds()
===_getUserInfo()===
===_getUserInfo()===
Gets the indicated user details as well as the  role. worker function
Gets the indicated user details as well as the  role. worker function
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L251 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 251
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L318 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 318
*Signature: protected function _getUserInfo($username,$getRole,$details)
*Signature: protected function _getUserInfo($username,$getRole,$details)
*Parameters:
*Parameters:
Line 69: Line 74:
===_getUserNameFromId()===
===_getUserNameFromId()===
Gets the user id from the username
Gets the user id from the username
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L155 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 155
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L198 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 198
*Signature: public function _getUserNameFromId($userid)
*Signature: public function _getUserNameFromId($userid)
*Parameters:
*Parameters:
Line 76: Line 81:
===_getUsersByInfo()===
===_getUsersByInfo()===
Gets the userss by the indicated  details as well as the  role. worker method @oaram boolean $role Defaults to false
Gets the userss by the indicated  details as well as the  role. worker method @oaram boolean $role Defaults to false
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L336 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 336
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L403 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 403
*Signature: public function _getUsersByInfo($role,$details)
*Signature: public function _getUsersByInfo($role,$details)
*Parameters:
*Parameters:
Line 86: Line 91:
===_setUserInfo()===
===_setUserInfo()===
sets the indicated user details/role . worker function
sets the indicated user details/role . worker function
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L286 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 286
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L353 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 353
*Signature: protected function _setUserInfo($username,$setRole,$details)
*Signature: protected function _setUserInfo($username,$setRole,$details)
*Parameters:
*Parameters:
Line 97: Line 102:
===_userExists()===
===_userExists()===
See if a user is in the system
See if a user is in the system
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L486 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 486
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L594 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 594
*Signature: public function _userExists($username,$has_role)
*Signature: public function _userExists($username,$has_role)
*Parameters:
*Parameters:
Line 103: Line 108:
** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $has_role <br/>If true  we verify that they have a role set.
** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $has_role <br/>If true  we verify that they have a role set.
*Returns: boolean.
*Returns: boolean.
===_userHasDefaultPassword()===
verifies that the specified user has the specified password. @param string $password
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L240 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 240
*Signature: public function _userHasDefaultPassword($username)
*Parameters:
** [http://www.php.net/manual/en/language.types.string.php string ] $username
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
===_userHasPassword()===
===_userHasPassword()===
verifies that the specified user has the specified password.
verifies that the specified user has the specified password.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L197 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 197
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L264 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 264
*Signature: public function _userHasPassword($username,$password)
*Signature: public function _userHasPassword($username,$password)
*Parameters:
*Parameters:
Line 113: Line 125:
===canChangePassword()===
===canChangePassword()===
Whether or not this acccess mechansim can change a user's password
Whether or not this acccess mechansim can change a user's password
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L346 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 346
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L413 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 413
*Signature: public function canChangePassword()
*Signature: public function canChangePassword()
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
===canCreateNewUser()===
===canCreateNewUser()===
Whether or not this acccess mechansim can create ne users
Whether or not this acccess mechansim can create ne users
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L164 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 164
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L207 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 207
*Signature: public function canCreateNewUser()
*Signature: public function canCreateNewUser()
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
===canEditUserDetails()===
===canEditUserDetails()===
Whether or not this acccess mechansim can create edit details of existing users
Whether or not this acccess mechansim can create edit details of existing users
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L172 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 172
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L215 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 215
*Signature: public function canEditUserDetails()
*Signature: public function canEditUserDetails()
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
===changePassword()===
===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.
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 [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L380 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 380
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L447 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 447
*Signature: final public function changePassword($username,$old_password,$new_password)
*Signature: final public function changePassword($username,$old_password,$new_password)
*Parameters:
*Parameters:
Line 137: Line 149:
===createUser()===
===createUser()===
Create user .
Create user .
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L421 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 421
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L488 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 488
*Signature: final public function createUser($username,$password,$role,$details)
*Signature: final public function createUser($username,$password,$role,$details)
*Parameters:
*Parameters:
Line 148: Line 160:
===displayName()===
===displayName()===
Gets the display name for the userdetails
Gets the display name for the userdetails
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L497 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 497
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L605 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 605
*Signature: public function displayName($username,$user)
*Signature: public function displayName($username,$user)
*Parameters:
*Parameters:
Line 154: Line 166:
** [http://www.php.net/manual/en/language.types.array.php array ] $user <br/>user details
** [http://www.php.net/manual/en/language.types.array.php array ] $user <br/>user details
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]
===doAutoLogin()===
Check to see if we should do a automatic login
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L83 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 83
*Signature: public function doAutoLogin()
===ensureDefaultOptions()===
===ensureDefaultOptions()===
Ensure default options are set
Ensure default options are set
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L80 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 80
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L99 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 99
*Signature: protected function ensureDefaultOptions($options)
*Signature: protected function ensureDefaultOptions($options)
*Parameters:
*Parameters:
Line 163: Line 179:
===generatePassword()===
===generatePassword()===
Generate a password
Generate a password
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L93 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 93
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L112 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 112
*Signature: public function generatePassword()
*Signature: public function generatePassword()
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]
===getAllowedDetails()===
===getAllowedDetails()===
Gets an array of the allowed user details such as email, firstname, lastname
Gets an array of the allowed user details such as email, firstname, lastname
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L206 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 206
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L273 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 273
*Signature: public function getAllowedDetails()
*Signature: public function getAllowedDetails()
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]
===getAutoLoginUser()===
Get the username for an autologin
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L90 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 90
*Signature: public function getAutoLoginUser()
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]
===getDetailName()===
===getDetailName()===
Returns the display name of the given detail
Returns the display name of the given detail
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L355 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 355
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L422 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 422
*Signature: public function getDetailName($detail)
*Signature: public function getDetailName($detail)
*Parameters:
*Parameters:
** [http://www.php.net/manual/en/language.types.string.php string ] $detail
** [http://www.php.net/manual/en/language.types.string.php string ] $detail
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]
===getSessionActivity()===
Get the last activity time for this session.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L724 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 724
*Signature: static final public function getSessionActivity()
*Returns: integer
===getSessionDetails()===
===getSessionDetails()===
Get any user details stored in the session
Get any user details stored in the session
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L578 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 578
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L710 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 710
*Signature: static final public function getSessionDetails()
*Signature: static final public function getSessionDetails()
*Returns: mixed.<br/>an array of details on succes, null on failture
*Returns: mixed.<br/>an array of details on succes, null on failture
===getSessionID()===
===getSessionID()===
Get any user id
Get any user id
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L565 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 565
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L697 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 697
*Signature: static final public function getSessionID()
*Signature: static final public function getSessionID()
*Returns: mixed.<br/>an int on succes, false on failture
*Returns: mixed.<br/>an int on succes, false on failture
===getSessionRole()===
===getSessionRole()===
Get any user role
Get any user role
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L552 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 552
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L684 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 684
*Signature: static final public function getSessionRole()
*Signature: static final public function getSessionRole()
*Returns: mixed.<br/>an strint on succes, null on failture
*Returns: mixed.<br/>an strint on succes, null on failture
===getSessionUserName()===
===getSessionUserName()===
Get any username stored in the suession
Get any username stored in the suession
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L540 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 540
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L672 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 672
*Signature: static final public function getSessionUserName()
*Signature: static final public function getSessionUserName()
*Returns: mixed.<br/>an string on succes, null on failture
*Returns: mixed.<br/>an string on succes, null on failture
===getUserId()===
===getUserId()===
Gets the user id from the username
Gets the user id from the username
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L114 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 114
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L157 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 157
*Signature: final public function getUserId($username)
*Signature: final public function getUserId($username)
*Parameters:
*Parameters:
** [http://www.php.net/manual/en/language.types.string.php string ] $username
** [http://www.php.net/manual/en/language.types.string.php string ] $username
*Returns: [http://www.php.net/manual/en/language.types.integer.php int ]<br/>or false on failure
*Returns: [http://www.php.net/manual/en/language.types.integer.php int ]<br/>or false on failure
===getUserIds()===
Gets the user ids
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L134 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 134
*Signature: final public function getUserIds()
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]<br/>of ids
===getUserInfo()===
===getUserInfo()===
Gets the indicated user details as well as the  role
Gets the indicated user details as well as the  role
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L217 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 217
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L284 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 284
*Signature: final public function getUserInfo($username,$getRole,$details)
*Signature: final public function getUserInfo($username,$getRole,$details)
*Parameters:
*Parameters:
Line 218: Line 249:
===getUserNameFromId()===
===getUserNameFromId()===
Gets the user id from the username
Gets the user id from the username
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L142 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 142
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L185 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 185
*Signature: final public function getUserNameFromId($userid)
*Signature: final public function getUserNameFromId($userid)
*Parameters:
*Parameters:
Line 225: Line 256:
===getUsersByInfo()===
===getUsersByInfo()===
Gets the userss by the indicated  details as well as the  role. worker method @oaram boolean $role Defaults to false
Gets the userss by the indicated  details as well as the  role. worker method @oaram boolean $role Defaults to false
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L298 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 298
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L365 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 365
*Signature: public function getUsersByInfo($role,$details,$include_internal)
*Signature: public function getUsersByInfo($role,$details,$include_internal)
*Parameters:
*Parameters:
Line 235: Line 266:
***Default Value: true
***Default Value: true
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]<br/>of usernames which mathc the give input
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]<br/>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.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L551 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 551
*Signature: public function hasBeenLoggedOut($username)
*Parameters:
** [http://www.php.net/manual/en/language.types.string.php string ] $username
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
===hasSession()===
===hasSession()===
Checks to see if a user has been stored in the session
Checks to see if a user has been stored in the session
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L532 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 532
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L642 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 642
*Signature: static final public function hasSession()
*Signature: static final public function hasSession()
===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.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L540 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 540
*Signature: public function isLoggingFromAnotherIP($username,$ip_address)
*Parameters:
** [http://www.php.net/manual/en/language.types.string.php string ] $username
** [http://www.php.net/manual/en/language.types.string.php string ] $ip_address
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
===isRequired()===
===isRequired()===
Checks to see if the indicated detail is required $param string $detail returns boolean
Checks to see if the indicated detail is required $param string $detail returns boolean
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L365 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 365
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L432 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 432
*Signature: public function isRequired($detail)
*Signature: public function isRequired($detail)
*Parameters:
*Parameters:
Line 247: Line 293:
===logActivity()===
===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
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 [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L461 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 461
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L528 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 528
*Signature: public function logActivity($username,$activity,$timestamp)
*Signature: public function logActivity($username,$activity,$ip_address,$timestamp)
*Parameters:
*Parameters:
** [http://www.php.net/manual/en/language.types.string.php string ] $username
** [http://www.php.net/manual/en/language.types.string.php string ] $username
**$activity  
**$activity  
***Default Value: 'access'
***Default Value: 'access'
**$ip_address
***Default Value: '127.0.0.1'
**$timestamp  
**$timestamp  
***Default Value: null
***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.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L563 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 563
*Signature: public function logOutPreviousSessions($username)
*Parameters:
** [http://www.php.net/manual/en/language.types.string.php string ] $username
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
===setSession()===
===setSession()===
Store info on the authenticated user in session variables @param array $deatails.  array of user details
Store info on the authenticated user in session variables @param array $deatails.  array of user details
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L508 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 508
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L616 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 616
*Signature: static final public function setSession($username,$role,$details,$id)
*Signature: static final public function setSession($username,$role,$details,$id)
*Parameters:
*Parameters:
Line 266: Line 321:
===setUserInfo()===
===setUserInfo()===
sets the indicated user details/role.
sets the indicated user details/role.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L263 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 263
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L330 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 330
*Signature: final public function setUserInfo($username,$setRole,$details)
*Signature: final public function setUserInfo($username,$setRole,$details)
*Parameters:
*Parameters:
Line 277: Line 332:
===unsetSession()===
===unsetSession()===
Store info on the authenticated user in session variables @param string $username @param string $role @param array $deatails.  array of user details
Store info on the authenticated user in session variables @param string $username @param string $role @param array $deatails.  array of user details
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L522 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 522
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L631 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 631
*Signature: static final public function unsetSession()
*Signature: static final public function unsetSession()
===updateSessionActivity()===
Update the session activity time.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L735 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 735
*Signature: static final public function updateSessionActivity()
===userExists()===
===userExists()===
See if a user is in the system
See if a user is in the system
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L471 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 471
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L579 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 579
*Signature: final public function userExists($username,$has_role)
*Signature: final public function userExists($username,$has_role)
*Parameters:
*Parameters:
Line 287: Line 346:
** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $has_role <br/>If true  we verify that they have a role set.
** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $has_role <br/>If true  we verify that they have a role set.
*Returns: boolean.
*Returns: boolean.
===userHasDefaultPassword()===
checks to see if a user has a default password. @param string $password
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L225 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 225
*Signature: final public function userHasDefaultPassword($username)
*Parameters:
** [http://www.php.net/manual/en/language.types.string.php string ] $username
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
===userHasPassword()===
===userHasPassword()===
verifies that the specified user has the specified password.
verifies that the specified user has the specified password.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L183 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 183
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/lib/I2CE_UserAccess_Mechanism.php#L250 i2ce/lib/I2CE_UserAccess_Mechanism.php] on line 250
*Signature: final public function userHasPassword($username,$password)
*Signature: final public function userHasPassword($username,$password)
*Parameters:
*Parameters:

Latest revision as of 08:20, 6 May 2015


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