Class: I2CE UserAccess LDAP (Development): Difference between revisions
(Created page with '{{otherversions|Class: I2CE_UserAccess_LDAP}} This article describes the class ''I2CE_UserAccess_LDAP'' . *Extends the class: [[Class: I2CE_UserAccess_Mechanism (Development) | I…') |
No edit summary |
||
Line 2: | Line 2: | ||
This article describes the class ''I2CE_UserAccess_LDAP'' . | This article describes the class ''I2CE_UserAccess_LDAP'' . | ||
*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_LDAP|UserAccess_LDAP]] in the package [https://launchpad.net/i2ce I2CE] 4. | *Location: Part of the module [[I2CE Module List (Development)#UserAccess_LDAP|UserAccess_LDAP]] in the package [https://launchpad.net/i2ce I2CE] 4.1-dev | ||
*Source: Defined in the file [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Source: Defined in the file [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php#L33 modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.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 10: | Line 10: | ||
===$options=== | ===$options=== | ||
An array of options for connecting and querying to the ldap server | An array of options for connecting and querying to the ldap server | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php#L66 i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php] on line 66 | ||
*Type: protected $options | *Type: protected $options | ||
===$ldap=== | ===$ldap=== | ||
the ldap connect; | the ldap connect; | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php#L83 i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php] on line 83 | ||
*Type: protected [http://www.php.net/manual/en/language.types.resource.php resource ] $ldap | *Type: protected [http://www.php.net/manual/en/language.types.resource.php resource ] $ldap | ||
Line 21: | Line 21: | ||
===_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. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php#L670 i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php] on line 670 | ||
*Signature: public function _changePassword($username,$old_password,$new_password) | *Signature: public function _changePassword($username,$old_password,$new_password) | ||
*Parameters: | *Parameters: | ||
Line 30: | Line 30: | ||
===_createUser()=== | ===_createUser()=== | ||
Create user worker method | Create user worker method | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php#L746 i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php] on line 746 | ||
*Signature: public function _createUser($username,$password,$role,$details) | *Signature: public function _createUser($username,$password,$role,$details) | ||
*Parameters: | *Parameters: | ||
Line 42: | Line 42: | ||
===_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. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php#L306 i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php] on line 306 | ||
*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_LDAP/lib/I2CE_UserAccess_LDAP.php#L279 i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php] on line 279 | |||
*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 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. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php#L380 i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php] on line 380 | ||
*Signature: protected function _getUserInfo($username,$getRole,$details) | *Signature: protected function _getUserInfo($username,$getRole,$details) | ||
*Parameters: | *Parameters: | ||
Line 60: | Line 65: | ||
===_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. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php#L331 i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php] on line 331 | ||
*Signature: public function _getUserNameFromId($userid) | *Signature: public function _getUserNameFromId($userid) | ||
*Parameters: | *Parameters: | ||
Line 67: | Line 72: | ||
===_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. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php#L494 i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php] on line 494 | ||
*Signature: public function _getUsersByInfo($role,$details) | *Signature: public function _getUsersByInfo($role,$details) | ||
*Parameters: | *Parameters: | ||
Line 77: | Line 82: | ||
===_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. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php#L730 i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php] on line 730 | ||
*Signature: protected function _setUserInfo($username,$setRole,$details) | *Signature: protected function _setUserInfo($username,$setRole,$details) | ||
*Parameters: | *Parameters: | ||
Line 88: | Line 93: | ||
===_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. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php#L431 i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php] on line 431 | ||
*Signature: public function _userExists($username,$has_role) | *Signature: public function _userExists($username,$has_role) | ||
*Parameters: | *Parameters: | ||
Line 96: | Line 101: | ||
===_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. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php#L254 i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php] on line 254 | ||
*Signature: public function _userHasPassword($username,$password) | *Signature: public function _userHasPassword($username,$password) | ||
*Parameters: | *Parameters: | ||
Line 104: | Line 109: | ||
===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. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php#L165 i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php] on line 165 | ||
*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. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php#L181 i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php] on line 181 | ||
*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. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php#L173 i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php] on line 173 | ||
*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. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php#L469 i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php] on line 469 | ||
*Signature: public function displayName($username,$user) | *Signature: public function displayName($username,$user) | ||
*Parameters: | *Parameters: | ||
Line 127: | Line 132: | ||
===encryptPassword()=== | ===encryptPassword()=== | ||
Encrypts the password | Encrypts the password | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php#L129 i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php] on line 129 | ||
*Signature: protected function encryptPassword($passwd) | *Signature: protected function encryptPassword($passwd) | ||
*Parameters: | *Parameters: | ||
Line 134: | Line 139: | ||
===ensureDefaultOptions()=== | ===ensureDefaultOptions()=== | ||
ensrure default options are set | ensrure default options are set | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php#L75 i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php] on line 75 | ||
*Signature: public function ensureDefaultOptions($options) | *Signature: public function ensureDefaultOptions($options) | ||
*Parameters: | *Parameters: | ||
Line 141: | Line 146: | ||
===ensureID()=== | ===ensureID()=== | ||
Ensures that an id is set for the given username @param string $usernmae | Ensures that an id is set for the given username @param string $usernmae | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php#L552 i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php] on line 552 | ||
*Signature: protected function ensureID($username) | *Signature: protected function ensureID($username) | ||
*Parameters: | *Parameters: | ||
Line 148: | Line 153: | ||
===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. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php#L190 i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php] on line 190 | ||
*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 ] | ||
===getConnection()=== | ===getConnection()=== | ||
Get the ldap connection @param string $dn. The dn underwhich the user lives. Defaults to null in which case we user $this->options['ldap_user_dn']; | Get the ldap connection @param string $dn. The dn underwhich the user lives. Defaults to null in which case we user $this->options['ldap_user_dn']; | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php#L92 i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php] on line 92 | ||
*Signature: protected function getConnection($cached,$bind_user,$bind_dn,$bind_pass) | *Signature: protected function getConnection($cached,$bind_user,$bind_dn,$bind_pass) | ||
*Parameters: | *Parameters: | ||
Line 167: | Line 172: | ||
===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. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php#L153 i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php] on line 153 | ||
*Signature: public function getDetailName($detail) | *Signature: public function getDetailName($detail) | ||
*Parameters: | *Parameters: | ||
Line 174: | Line 179: | ||
===getIdQry()=== | ===getIdQry()=== | ||
Gets the id query for the application for the given username | Gets the id query for the application for the given username | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php#L220 i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php] on line 220 | ||
*Signature: protected function getIdQry($username) | *Signature: protected function getIdQry($username) | ||
*Parameters: | *Parameters: | ||
Line 182: | Line 187: | ||
===getPeopleQry()=== | ===getPeopleQry()=== | ||
Gets the query for the people for the given username | Gets the query for the people for the given username | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php#L239 i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php] on line 239 | ||
*Signature: protected function getPeopleQry($username) | *Signature: protected function getPeopleQry($username) | ||
*Parameters: | *Parameters: | ||
Line 190: | Line 195: | ||
===getRoleQry()=== | ===getRoleQry()=== | ||
Gets the role query for the application for the given username | Gets the role query for the application for the given username | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php#L202 i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php] on line 202 | ||
*Signature: protected function getRoleQry($username) | *Signature: protected function getRoleQry($username) | ||
*Parameters: | *Parameters: | ||
Line 198: | Line 203: | ||
===getUIDFromDN()=== | ===getUIDFromDN()=== | ||
Looks for the UID in a DN | Looks for the UID in a DN | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php#L357 i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php] on line 357 | ||
*Signature: protected function getUIDFromDN($dn) | *Signature: protected function getUIDFromDN($dn) | ||
*Parameters: | *Parameters: | ||
Line 205: | Line 210: | ||
===ldap_escape()=== | ===ldap_escape()=== | ||
LDAP escaping function to prevent against injection. | LDAP escaping function to prevent against injection. | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php#L44 i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php] on line 44 | ||
*Signature: protected function ldap_escape($str,$for_dn) | *Signature: protected function ldap_escape($str,$for_dn) | ||
*Parameters: | *Parameters: | ||
Line 213: | Line 218: | ||
===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. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php#L772 i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php] on line 772 | ||
*Signature: public function logActivity($username,$activity,$timestamp) | *Signature: public function logActivity($username,$activity,$timestamp) | ||
*Parameters: | *Parameters: | ||
Line 223: | Line 228: | ||
===setPerson()=== | ===setPerson()=== | ||
Set the person details. | Set the person details. | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php#L682 i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php] on line 682 | ||
*Signature: protected function setPerson($username,$password,$details,$create) | *Signature: protected function setPerson($username,$password,$details,$create) | ||
*Parameters: | *Parameters: | ||
Line 232: | Line 237: | ||
===setRole()=== | ===setRole()=== | ||
Sets the role in the ldap hierarchy for the indicated user | Sets the role in the ldap hierarchy for the indicated user | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php#L607 i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php] on line 607 | ||
*Signature: protected function setRole($username,$role) | *Signature: protected function setRole($username,$role) | ||
*Parameters: | *Parameters: | ||
Line 241: | Line 246: | ||
===__construct()=== | ===__construct()=== | ||
This public method is inherited from [[Class: I2CE_UserAccess_Mechanism (Development)#__construct() | I2CE_UserAccess_Mechanism->__construct()]] | This public method is inherited from [[Class: I2CE_UserAccess_Mechanism (Development)#__construct() | I2CE_UserAccess_Mechanism->__construct()]] | ||
===_userHasDefaultPassword()=== | |||
This public method is inherited from [[Class: I2CE_UserAccess_Mechanism (Development)#_userHasDefaultPassword() | I2CE_UserAccess_Mechanism->_userHasDefaultPassword()]] | |||
===changePassword()=== | ===changePassword()=== | ||
Line 247: | Line 255: | ||
===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 265: | Line 282: | ||
===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 274: | Line 294: | ||
===getUsersByInfo()=== | ===getUsersByInfo()=== | ||
This public method is inherited from [[Class: I2CE_UserAccess_Mechanism (Development)#getUsersByInfo() | I2CE_UserAccess_Mechanism->getUsersByInfo()]] | This public method is inherited from [[Class: I2CE_UserAccess_Mechanism (Development)#getUsersByInfo() | I2CE_UserAccess_Mechanism->getUsersByInfo()]] | ||
===hasBeenLoggedOut()=== | |||
This public method is inherited from [[Class: I2CE_UserAccess_Mechanism (Development)#hasBeenLoggedOut() | I2CE_UserAccess_Mechanism->hasBeenLoggedOut()]] | |||
===hasSession()=== | ===hasSession()=== | ||
This public method is inherited from [[Class: I2CE_UserAccess_Mechanism (Development)#hasSession() | I2CE_UserAccess_Mechanism->hasSession()]] | This public method is inherited from [[Class: I2CE_UserAccess_Mechanism (Development)#hasSession() | I2CE_UserAccess_Mechanism->hasSession()]] | ||
===isLoggingFromAnotherIP()=== | |||
This public method is inherited from [[Class: I2CE_UserAccess_Mechanism (Development)#isLoggingFromAnotherIP() | I2CE_UserAccess_Mechanism->isLoggingFromAnotherIP()]] | |||
===isRequired()=== | ===isRequired()=== | ||
This public method is inherited from [[Class: I2CE_UserAccess_Mechanism (Development)#isRequired() | I2CE_UserAccess_Mechanism->isRequired()]] | This public method is inherited from [[Class: I2CE_UserAccess_Mechanism (Development)#isRequired() | I2CE_UserAccess_Mechanism->isRequired()]] | ||
===logOutPreviousSessions()=== | |||
This public method is inherited from [[Class: I2CE_UserAccess_Mechanism (Development)#logOutPreviousSessions() | I2CE_UserAccess_Mechanism->logOutPreviousSessions()]] | |||
===setSession()=== | ===setSession()=== | ||
Line 289: | Line 318: | ||
===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 08:20, 6 May 2015
This article describes the class I2CE_UserAccess_LDAP .
- Extends the class: I2CE_UserAccess_Mechanism.
- Location: Part of the module UserAccess_LDAP in the package I2CE 4.1-dev
- Source: Defined in the file modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php on line 33
- Author: Carl Leitner <litlfred@ibiblio.org>
- Since: v4.0.3
@filesource Class I2CE_UserAccess_LDAP
Variables
$options
An array of options for connecting and querying to the ldap server
- Defined in i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php on line 66
- Type: protected $options
$ldap
the ldap connect;
- Defined in i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php on line 83
- Type: protected resource $ldap
Methods
_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.
- Defined in i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php on line 670
- Signature: public function _changePassword($username,$old_password,$new_password)
- Parameters:
- Returns: boolean
true on success
_createUser()
Create user worker method
- Defined in i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php on line 746
- Signature: public function _createUser($username,$password,$role,$details)
- Parameters:
- Returns: boolean.
true on success
_getUserId()
Gets the user id from the username
- Defined in i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php on line 306
- Signature: public function _getUserId($username)
- Parameters:
- string $username
- Returns: int
or false on failure
_getUserIds()
Gets the user id
- Defined in i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php on line 279
- Signature: public function _getUserIds()
- Returns: array
of ids
_getUserInfo()
Gets the indicated user details as well as the role. worker function
- Defined in i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php on line 380
- Signature: protected function _getUserInfo($username,$getRole,$details)
- Parameters:
- Returns: array
with indexed by the values of $details and values the corresponding detail
_getUserNameFromId()
Gets the user id from the username
- Defined in i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php on line 331
- Signature: public function _getUserNameFromId($userid)
- Parameters:
- int $userid
- Returns: string
or false on failure
_getUsersByInfo()
Gets the userss by the indicated details as well as the role. worker method @oaram boolean $role Defaults to false
- Defined in i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php on line 494
- 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()
- $role
- Returns: array
of usernames which mathc the give input
_setUserInfo()
sets the indicated user details/role . worker function
- Defined in i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php on line 730
- Signature: protected function _setUserInfo($username,$setRole,$details)
- Parameters:
- Returns: boolean
true on success
_userExists()
See if a user is in the system
- Defined in i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php on line 431
- Signature: public function _userExists($username,$has_role)
- Parameters:
- Returns: boolean.
_userHasPassword()
verifies that the specified user has the specified password
- Defined in i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php on line 254
- Signature: public function _userHasPassword($username,$password)
- Parameters:
- Returns: boolean
canChangePassword()
Whether or not this acccess mechansim can change a user's password
- Defined in i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php on line 165
- Signature: public function canChangePassword()
- Returns: boolean
canCreateNewUser()
Whether or not this acccess mechansim can create ne users
- Defined in i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php on line 181
- Signature: public function canCreateNewUser()
- Returns: boolean
canEditUserDetails()
Whether or not this acccess mechansim can create edit details of existing users
- Defined in i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php on line 173
- Signature: public function canEditUserDetails()
- Returns: boolean
displayName()
Gets the display name for the user
- Defined in i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php on line 469
- Signature: public function displayName($username,$user)
- Parameters:
- Returns: string
encryptPassword()
Encrypts the password
- Defined in i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php on line 129
- Signature: protected function encryptPassword($passwd)
- Parameters:
- string $passwd
- Returns: string
ensureDefaultOptions()
ensrure default options are set
- Defined in i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php on line 75
- Signature: public function ensureDefaultOptions($options)
- Parameters:
- array $options
- Returns: array
ensureID()
Ensures that an id is set for the given username @param string $usernmae
- Defined in i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php on line 552
- Signature: protected function ensureID($username)
- Parameters:
- $username
- Returns: int
the id, 0 on failure
getAllowedDetails()
Gets an array of the allowed user details such as email, firstname, lastname
- Defined in i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php on line 190
- Signature: public function getAllowedDetails()
- Returns: array
getConnection()
Get the ldap connection @param string $dn. The dn underwhich the user lives. Defaults to null in which case we user $this->options['ldap_user_dn'];
- Defined in i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php on line 92
- Signature: protected function getConnection($cached,$bind_user,$bind_dn,$bind_pass)
- Parameters:
- boolean $cached
Defaiults to true in which case we get the cached connection- Default Value: true
- boolean $bind_user
Defaults to null in which case we get the user from $this->options['ldap_user']- Default Value: null
- $bind_dn
- Default Value: null
- boolean $bind_pass
Defaults to null in which case we get the user from $this->options['ldap_user']- Default Value: null
- boolean $cached
- Returns: mixed.
False on failure or resource on success
getDetailName()
Returns the display name of the given detail
- Defined in i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php on line 153
- Signature: public function getDetailName($detail)
- Parameters:
- string $detail
- Returns: string
getIdQry()
Gets the id query for the application for the given username
- Defined in i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php on line 220
- Signature: protected function getIdQry($username)
- Parameters:
- string $username
Defaults to null in which we get the dn for the node containing the uid's- Default Value: null
- string $username
- Returns: string
getPeopleQry()
Gets the query for the people for the given username
- Defined in i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php on line 239
- Signature: protected function getPeopleQry($username)
- Parameters:
- string $username
Defaults to null in which we get the dn for the node containing the uid's- Default Value: null
- string $username
- Returns: string
getRoleQry()
Gets the role query for the application for the given username
- Defined in i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php on line 202
- Signature: protected function getRoleQry($username)
- Parameters:
- string $username
Defaults to null in which we get the dn for the node containing the uid's- Default Value: null
- string $username
- Returns: string
getUIDFromDN()
Looks for the UID in a DN
- Defined in i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php on line 357
- Signature: protected function getUIDFromDN($dn)
- Parameters:
- string $dn
- Returns: mixed.
String, the uid on success, false on failure
ldap_escape()
LDAP escaping function to prevent against injection.
- Defined in i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php on line 44
- Signature: protected function ldap_escape($str,$for_dn)
- Parameters:
- string $str
the string to escape - booleans $for_dn
Defaults to false. True if we are escaping for a dn returns string- Default Value: false
- string $str
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/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php on line 772
- Signature: public function logActivity($username,$activity,$timestamp)
- Parameters:
- string $username
- $activity
- Default Value: 'access'
- $timestamp
- Default Value: null
setPerson()
Set the person details.
- Defined in i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php on line 682
- Signature: protected function setPerson($username,$password,$details,$create)
- Parameters:
setRole()
Sets the role in the ldap hierarchy for the indicated user
- Defined in i2ce/modules/User/modules/UserAccess_LDAP/lib/I2CE_UserAccess_LDAP.php on line 607
- Signature: protected function setRole($username,$role)
- Parameters:
- Returns: boolean.
true on success
Inherited Methods
__construct()
This public method is inherited from I2CE_UserAccess_Mechanism->__construct()
_userHasDefaultPassword()
This public method is inherited from I2CE_UserAccess_Mechanism->_userHasDefaultPassword()
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()
hasBeenLoggedOut()
This public method is inherited from I2CE_UserAccess_Mechanism->hasBeenLoggedOut()
hasSession()
This public method is inherited from I2CE_UserAccess_Mechanism->hasSession()
isLoggingFromAnotherIP()
This public method is inherited from I2CE_UserAccess_Mechanism->isLoggingFromAnotherIP()
isRequired()
This public method is inherited from I2CE_UserAccess_Mechanism->isRequired()
logOutPreviousSessions()
This public method is inherited from I2CE_UserAccess_Mechanism->logOutPreviousSessions()
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()