*
* @param string $userId The user ID to check.
* @param array $credentials The credentials to check.
+ * @param boolean $login Whether to log the user in. If false, we'll
+ * only test the credentials and won't modify
+ * the current session. Defaults to true.
*
* @return boolean Whether or not the credentials are valid.
*/
- public function authenticate($userId, $credentials)
+ public function authenticate($userId, $credentials, $login = true)
{
try {
list($userId, $credentials) = $this->runHook(trim($userId), $credentials, 'preauthenticate', 'authenticate');
}
if ($this->_base) {
- if (!$this->_base->authenticate($userId, $credentials)) {
+ if (!$this->_base->authenticate($userId, $credentials, $login)) {
return false;
}
- } elseif (!parent::authenticate($userId, $credentials)) {
+ } elseif (!parent::authenticate($userId, $credentials, $login)) {
return false;
}
*
* @throws Horde_Auth_Exception
*/
- public function updateUser($oldID, $newID, $credentials)
+ public function updateUser($oldID, $newID, $credentials, $olddn = null,
+ $newdn = null)
{
list($oldId, $credentials) = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Auth')->create()->runHook($oldId, $credentials, 'preauthenticate', 'admin');
- parent::updateUser($oldID, $newID, $credentials);
+ parent::updateUser($oldID, $newID, $credentials, $olddn, $newdn);
}
/**
* Delete a set of authentication credentials.
*
* @param string $userId The user ID to delete.
+ * @param string $dn TODO
*
* @throws Horde_Auth_Exception
*/
- public function removeUser($userId)
+ public function removeUser($userId, $dn = null)
{
list($userId, $credentials) = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Auth')->create()->runHook($userId, array(), 'preauthenticate', 'admin');
- parent::removeUser($userId, isset($credentials['ldap']) ? $credentials['ldap']['dn'] : null);
+ parent::removeUser($userId, isset($credentials['ldap']) ? $credentials['ldap']['dn'] : $dn);
}
}