Class: I2CE UserAccess (Development): Difference between revisions

From IHRIS Wiki
(Created page with '{{otherversions|Class: I2CE_UserAccess}} This article describes the class ''I2CE_UserAccess'' . *Extends the class: [[Class: I2CE_UserAccess_Mechanism (Development) | I2CE_UserAc…')
 
No edit summary
 
Line 2: Line 2:
This article describes the class ''I2CE_UserAccess'' .
This article describes the class ''I2CE_UserAccess'' .
*Extends the class: [[Class: I2CE_UserAccess_Mechanism (Development) | I2CE_UserAccess_Mechanism]].
*Extends the class: [[Class: I2CE_UserAccess_Mechanism (Development) | I2CE_UserAccess_Mechanism]].
*Location: Part of the module [[I2CE Module List (Development)#UserAccess|UserAccess]] in the package [https://launchpad.net/i2ce I2CE] 4.0-dev
*Location: Part of the module [[I2CE Module List (Development)#UserAccess|UserAccess]] in the package [https://launchpad.net/i2ce I2CE] 4.1-dev
*Source: Defined in the file [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L34 modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 34
*Source: Defined in the file [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L34 modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 34
*Author: Carl Leitner <litlfred@ibiblio.org>
*Author: Carl Leitner <litlfred@ibiblio.org>
*Since: v4.0.3
*Since: v4.0.3
Line 10: Line 10:
===$detailTable===
===$detailTable===
@var protected string $userTable the user detail table.
@var protected string $userTable the user detail table.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L147 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 147
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L147 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 147
*Type: protected $detailTable
*Type: protected $detailTable


===$accessTable===
===$accessTable===
the user access table.
the user access table.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L152 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 152
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L152 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 152
*Type: protected [http://www.php.net/manual/en/language.types.string.php string ] $accessTable
*Type: protected [http://www.php.net/manual/en/language.types.string.php string ] $accessTable


===$logTable===
===$logTable===
the user acitivity log table.
the user acitivity log table.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L159 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 159
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L159 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 159
*Type: protected [http://www.php.net/manual/en/language.types.string.php string ] $logTable
*Type: protected [http://www.php.net/manual/en/language.types.string.php string ] $logTable


Line 26: Line 26:
===__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:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L136 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 136
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L136 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 136
*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:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L392 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 392
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L423 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 423
*Signature: public function _changePassword($username,$old_password,$new_password)
*Signature: public function _changePassword($username,$old_password,$new_password)
*Parameters:
*Parameters:
Line 39: Line 39:
===_createUser()===
===_createUser()===
Create user worker method
Create user worker method
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L479 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 479
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L614 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 614
*Signature: public function _createUser($username,$password,$role,$details)
*Signature: public function _createUser($username,$password,$role,$details)
*Parameters:
*Parameters:
Line 51: Line 51:
===_getUserId()===
===_getUserId()===
Gets the user id from the user name
Gets the user id from the user name
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L345 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 345
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L352 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 352
*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 id
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L371 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 371
*Signature: 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 the  role
Gets the indicated user details as well the  role
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L218 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 218
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L225 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 225
*Signature: public function _getUserInfo($username,$getRole,$details)
*Signature: public 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:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L365 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 365
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L396 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 396
*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:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L259 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 259
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L266 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 266
*Signature: public function _getUsersByInfo($role,$details)
*Signature: public function _getUsersByInfo($role,$details)
*Parameters:
*Parameters:
Line 86: Line 91:
===_setUserInfo()===
===_setUserInfo()===
Gets the role assigned to a user
Gets the role assigned to a user
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L174 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 174
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L174 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 174
*Signature: public function _setUserInfo($username,$setRole,$details)
*Signature: public 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:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L320 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 320
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L327 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 327
*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()===
checks to see if the user has a default password (one set by administrator) @param string $password
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L484 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 484
*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:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L422 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 422
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L455 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 455
*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:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L308 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 308
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L315 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 315
*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:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L50 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 50
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L50 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 50
*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:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L58 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 58
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L58 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 58
*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 ]
===displayName()===
===displayName()===
Gets the display name for the user
Gets the display name for the user
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L496 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 496
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L631 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 631
*Signature: public function displayName($username,$user)
*Signature: public function displayName($username,$user)
*Parameters:
*Parameters:
Line 136: Line 148:
===encryptPassword()===
===encryptPassword()===
Encrypts the password @param string $passwd
Encrypts the password @param string $passwd
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L42 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 42
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L42 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 42
*Signature: protected function encryptPassword($password)
*Signature: protected function encryptPassword($password)
*Parameters:
*Parameters:
Line 143: Line 155:
===ensureDefaultOptions()===
===ensureDefaultOptions()===
ensrure default options are set
ensrure default options are set
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L129 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 129
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L129 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 129
*Signature: public function ensureDefaultOptions($options)
*Signature: public function ensureDefaultOptions($options)
*Parameters:
*Parameters:
Line 150: Line 162:
===getAllowedDetails()===
===getAllowedDetails()===
Gets an array of the allowed details
Gets an array of the allowed details
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L68 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 68
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L68 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 68
*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 ]
===getDetailColumnTypes()===
===getDetailColumnTypes()===
An array of the details and their associated mdb2 types
An array of the details and their associated mdb2 types
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L92 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 92
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L92 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 92
*Signature: protected function getDetailColumnTypes()
*Signature: protected function getDetailColumnTypes()
===getDetailColumns()===
===getDetailColumns()===
An array of the details and their associated columns
An array of the details and their associated columns
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L78 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 78
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L78 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 78
*Signature: protected function getDetailColumns()
*Signature: protected function getDetailColumns()
===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:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L108 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 108
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L108 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 108
*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 ]
===hasBeenLoggedOut()===
Check to see if this user has been logged out by other means.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L574 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 574
*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 ]
===isLoggingFromAnotherIP()===
Check if the user is logged in from a given IP address
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L554 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 554
*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 <br/>defaults to 127.0.0.1
*Returns: boolean.<br/>true when a user is attempting multiple logins
===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:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L505 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 505
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L640 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 640
*Signature: public function isRequired($detail)
*Signature: public function isRequired($detail)
*Parameters:
*Parameters:
Line 176: Line 203:
===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:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L452 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 452
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L511 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 511
*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 any previous existing sessions if single login option is set.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php#L589 i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php] on line 589
*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 ]
==Inherited Methods==
==Inherited Methods==
===changePassword()===
===changePassword()===
Line 190: Line 226:
===createUser()===
===createUser()===
This public method is inherited from [[Class: I2CE_UserAccess_Mechanism (Development)#createUser() | I2CE_UserAccess_Mechanism->createUser()]]
This public method is inherited from [[Class: I2CE_UserAccess_Mechanism (Development)#createUser() | I2CE_UserAccess_Mechanism->createUser()]]
===doAutoLogin()===
This public method is inherited from [[Class: I2CE_UserAccess_Mechanism (Development)#doAutoLogin() | I2CE_UserAccess_Mechanism->doAutoLogin()]]


===generatePassword()===
===generatePassword()===
This public method is inherited from [[Class: I2CE_UserAccess_Mechanism (Development)#generatePassword() | I2CE_UserAccess_Mechanism->generatePassword()]]
This public method is inherited from [[Class: I2CE_UserAccess_Mechanism (Development)#generatePassword() | I2CE_UserAccess_Mechanism->generatePassword()]]
===getAutoLoginUser()===
This public method is inherited from [[Class: I2CE_UserAccess_Mechanism (Development)#getAutoLoginUser() | I2CE_UserAccess_Mechanism->getAutoLoginUser()]]
===getSessionActivity()===
This public method is inherited from [[Class: I2CE_UserAccess_Mechanism (Development)#getSessionActivity() | I2CE_UserAccess_Mechanism->getSessionActivity()]]


===getSessionDetails()===
===getSessionDetails()===
Line 208: Line 253:
===getUserId()===
===getUserId()===
This public method is inherited from [[Class: I2CE_UserAccess_Mechanism (Development)#getUserId() | I2CE_UserAccess_Mechanism->getUserId()]]
This public method is inherited from [[Class: I2CE_UserAccess_Mechanism (Development)#getUserId() | I2CE_UserAccess_Mechanism->getUserId()]]
===getUserIds()===
This public method is inherited from [[Class: I2CE_UserAccess_Mechanism (Development)#getUserIds() | I2CE_UserAccess_Mechanism->getUserIds()]]


===getUserInfo()===
===getUserInfo()===
Line 229: Line 277:
===unsetSession()===
===unsetSession()===
This public method is inherited from [[Class: I2CE_UserAccess_Mechanism (Development)#unsetSession() | I2CE_UserAccess_Mechanism->unsetSession()]]
This public method is inherited from [[Class: I2CE_UserAccess_Mechanism (Development)#unsetSession() | I2CE_UserAccess_Mechanism->unsetSession()]]
===updateSessionActivity()===
This public method is inherited from [[Class: I2CE_UserAccess_Mechanism (Development)#updateSessionActivity() | I2CE_UserAccess_Mechanism->updateSessionActivity()]]


===userExists()===
===userExists()===
This public method is inherited from [[Class: I2CE_UserAccess_Mechanism (Development)#userExists() | I2CE_UserAccess_Mechanism->userExists()]]
This public method is inherited from [[Class: I2CE_UserAccess_Mechanism (Development)#userExists() | I2CE_UserAccess_Mechanism->userExists()]]
===userHasDefaultPassword()===
This public method is inherited from [[Class: I2CE_UserAccess_Mechanism (Development)#userHasDefaultPassword() | I2CE_UserAccess_Mechanism->userHasDefaultPassword()]]


===userHasPassword()===
===userHasPassword()===

Latest revision as of 09:20, 6 May 2015


This article describes the class I2CE_UserAccess .

@filesource Class I2CE_UserAccess_Internal A user access control mechansim where username and the user details are stored in one table and access is in another table and the tables are joined on a userid.

Variables

$detailTable

@var protected string $userTable the user detail table.

$accessTable

the user access table.

$logTable

the user acitivity log table.

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

_getUserId()

Gets the user id from the user name

_getUserIds()

Gets the user id

_getUserInfo()

Gets the indicated user details as well the role

  • Defined in i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php on line 225
  • Signature: public function _getUserInfo($username,$getRole,$details)
  • Parameters:
    • string $username @oaram boolean $getRole Defaults to false
    • $getRole
      • Default Value: false
    • $details
      • Default Value: array()
  • Returns: array.
    associative array of user info (role, email and other details)

_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

_setUserInfo()

Gets the role assigned to a user

  • Defined in i2ce/modules/User/modules/UserAccess/lib/I2CE_UserAccess.php on line 174
  • Signature: public function _setUserInfo($username,$setRole,$details)
  • Parameters:
    • string $username
    • mixed $setRole
      Defaulst to false. If a string, it is the role to assign to the user @param string
      • Default Value: false
    • $details
      • Default Value: array()
  • Returns: boolean.
    true on success

_userExists()

See if a user is in the system

_userHasDefaultPassword()

checks to see if the user has a default password (one set by administrator) @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

displayName()

Gets the display name for the user

encryptPassword()

Encrypts the password @param string $passwd

ensureDefaultOptions()

ensrure default options are set

getAllowedDetails()

Gets an array of the allowed details

getDetailColumnTypes()

An array of the details and their associated mdb2 types

getDetailColumns()

An array of the details and their associated columns

getDetailName()

Returns the display name of the given detail

hasBeenLoggedOut()

Check to see if this user has been logged out by other means.

isLoggingFromAnotherIP()

Check if the user is logged in from a given IP address

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

logOutPreviousSessions()

Logs out any previous existing sessions if single login option is set.

Inherited Methods

changePassword()

This public method is inherited from I2CE_UserAccess_Mechanism->changePassword()

createUser()

This public method is inherited from I2CE_UserAccess_Mechanism->createUser()

doAutoLogin()

This public method is inherited from I2CE_UserAccess_Mechanism->doAutoLogin()

generatePassword()

This public method is inherited from I2CE_UserAccess_Mechanism->generatePassword()

getAutoLoginUser()

This public method is inherited from I2CE_UserAccess_Mechanism->getAutoLoginUser()

getSessionActivity()

This public method is inherited from I2CE_UserAccess_Mechanism->getSessionActivity()

getSessionDetails()

This public method is inherited from I2CE_UserAccess_Mechanism->getSessionDetails()

getSessionID()

This public method is inherited from I2CE_UserAccess_Mechanism->getSessionID()

getSessionRole()

This public method is inherited from I2CE_UserAccess_Mechanism->getSessionRole()

getSessionUserName()

This public method is inherited from I2CE_UserAccess_Mechanism->getSessionUserName()

getUserId()

This public method is inherited from I2CE_UserAccess_Mechanism->getUserId()

getUserIds()

This public method is inherited from I2CE_UserAccess_Mechanism->getUserIds()

getUserInfo()

This public method is inherited from I2CE_UserAccess_Mechanism->getUserInfo()

getUserNameFromId()

This public method is inherited from I2CE_UserAccess_Mechanism->getUserNameFromId()

getUsersByInfo()

This public method is inherited from I2CE_UserAccess_Mechanism->getUsersByInfo()

hasSession()

This public method is inherited from I2CE_UserAccess_Mechanism->hasSession()

setSession()

This public method is inherited from I2CE_UserAccess_Mechanism->setSession()

setUserInfo()

This public method is inherited from I2CE_UserAccess_Mechanism->setUserInfo()

unsetSession()

This public method is inherited from I2CE_UserAccess_Mechanism->unsetSession()

updateSessionActivity()

This public method is inherited from I2CE_UserAccess_Mechanism->updateSessionActivity()

userExists()

This public method is inherited from I2CE_UserAccess_Mechanism->userExists()

userHasDefaultPassword()

This public method is inherited from I2CE_UserAccess_Mechanism->userHasDefaultPassword()

userHasPassword()

This public method is inherited from I2CE_UserAccess_Mechanism->userHasPassword()

_hasMethod()

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

Inherited Variables

$options

Theis protected variable is inherited from I2CE_UserAccess_Mechanism->$options

$protocol

Theis protected variable is inherited from I2CE_UserAccess_Mechanism->$protocol

Inherited Fuzzy Methods

userMessage()

This method is inherited from I2CE_Fuzzy->userMessage()