Class: I2CE UserAccess LDAP DB (4.1.4)
This article describes the class I2CE_UserAccess_LDAP_DB .
- Extends the class: I2CE_UserAccess_Mechanism.
- Location: Part of the module UserAccess_LDAP_Hybrid in the package I2CE 4.1.4-release
- Source: Defined in the file modules/User/modules/UserAccess_LDAP_Hybrid/lib/I2CE_UserAccess_LDAP_DB.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_Hybrid/lib/I2CE_UserAccess_LDAP_DB.php on line 66
- Type: protected $options
$ldap
the ldap connect;
- Defined in i2ce/modules/User/modules/UserAccess_LDAP_Hybrid/lib/I2CE_UserAccess_LDAP_DB.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_Hybrid/lib/I2CE_UserAccess_LDAP_DB.php on line 537
- 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_Hybrid/lib/I2CE_UserAccess_LDAP_DB.php on line 618
- 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_Hybrid/lib/I2CE_UserAccess_LDAP_DB.php on line 270
- 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_Hybrid/lib/I2CE_UserAccess_LDAP_DB.php on line 244
- 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_Hybrid/lib/I2CE_UserAccess_LDAP_DB.php on line 354
- 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_Hybrid/lib/I2CE_UserAccess_LDAP_DB.php on line 312
- 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_Hybrid/lib/I2CE_UserAccess_LDAP_DB.php on line 455
- 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_Hybrid/lib/I2CE_UserAccess_LDAP_DB.php on line 600
- 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_Hybrid/lib/I2CE_UserAccess_LDAP_DB.php on line 405
- 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_Hybrid/lib/I2CE_UserAccess_LDAP_DB.php on line 217
- 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_Hybrid/lib/I2CE_UserAccess_LDAP_DB.php on line 164
- 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_Hybrid/lib/I2CE_UserAccess_LDAP_DB.php on line 180
- 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_Hybrid/lib/I2CE_UserAccess_LDAP_DB.php on line 172
- Signature: public function canEditUserDetails()
- Returns: boolean
displayName()
Gets the display name for the user
- Defined in i2ce/modules/User/modules/UserAccess_LDAP_Hybrid/lib/I2CE_UserAccess_LDAP_DB.php on line 430
- Signature: public function displayName($username,$user)
- Parameters:
- Returns: string
encryptPassword()
Encrypts the password
- Defined in i2ce/modules/User/modules/UserAccess_LDAP_Hybrid/lib/I2CE_UserAccess_LDAP_DB.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_Hybrid/lib/I2CE_UserAccess_LDAP_DB.php on line 75
- Signature: public function ensureDefaultOptions($options)
- Parameters:
- array $options
- Returns: array
getAllowedDetails()
Gets an array of the allowed user details such as email, firstname, lastname
- Defined in i2ce/modules/User/modules/UserAccess_LDAP_Hybrid/lib/I2CE_UserAccess_LDAP_DB.php on line 189
- 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_Hybrid/lib/I2CE_UserAccess_LDAP_DB.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_Hybrid/lib/I2CE_UserAccess_LDAP_DB.php on line 152
- Signature: public function getDetailName($detail)
- Parameters:
- string $detail
- Returns: string
getPeopleQry()
Gets the query for the people for the given username
- Defined in i2ce/modules/User/modules/UserAccess_LDAP_Hybrid/lib/I2CE_UserAccess_LDAP_DB.php on line 202
- 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
getRole()
Gets the user's role from the username
- Defined in i2ce/modules/User/modules/UserAccess_LDAP_Hybrid/lib/I2CE_UserAccess_LDAP_DB.php on line 291
- Signature: protected function getRole($username)
- Parameters:
- string $username
- Returns: string
or faluse on failure
getUIDFromDN()
Looks for the UID in a DN
- Defined in i2ce/modules/User/modules/UserAccess_LDAP_Hybrid/lib/I2CE_UserAccess_LDAP_DB.php on line 331
- 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_Hybrid/lib/I2CE_UserAccess_LDAP_DB.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_Hybrid/lib/I2CE_UserAccess_LDAP_DB.php on line 639
- 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_Hybrid/lib/I2CE_UserAccess_LDAP_DB.php on line 549
- 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_Hybrid/lib/I2CE_UserAccess_LDAP_DB.php on line 512
- 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()
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()
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()
isRequired()
This public method is inherited from I2CE_UserAccess_Mechanism->isRequired()
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()
userExists()
This public method is inherited from I2CE_UserAccess_Mechanism->userExists()
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()