'preauthenticate' hook should return LDAP connection information in the 'ldap' credentials key.
Author: Jon Parise (jon@horde.org)
Inheritance: extends Horde_Auth_Base
示例#1
0
文件: Msad.php 项目: raz0rsdge/horde
 /**
  * Constructor.
  *
  * @param array $params  A hash containing connection parameters.
  *
  * @throws Horde_Auth_Exception
  */
 public function __construct($params = array())
 {
     $params = array_merge(array('adduser' => true, 'authId' => 'initials', 'encryption' => 'msad', 'newuser_objectclass' => 'user', 'password_expiration' => 'no', 'port' => 389, 'ssl' => false, 'uid' => array('samaccountname')), $params);
     if (!is_array($params['uid'])) {
         $params['uid'] = array($params['uid']);
     }
     /* Ensure we've been provided with all of the necessary parameters. */
     //Horde::assertDriverConfig($params, 'auth',
     //    array('hostspec', 'basedn'), 'authentication MSAD');
     /* Adjust capabilities: depending on if SSL encryption is
      * enabled or not */
     $this->_capabilities = array('add' => $params['ssl'] || $params['adduser'], 'list' => true, 'remove' => true, 'resetpassword' => $params['ssl'], 'update' => $params['ssl']);
     parent::__construct($params);
 }
示例#2
0
文件: Ldap.php 项目: jubinpatel/horde
 /**
  * Delete a set of authentication credentials.
  *
  * @param string $userId  The user ID to delete.
  * @param string $dn      NOT USED.
  *
  * @throws Horde_Auth_Exception
  */
 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);
 }