/** * 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); }
/** * 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); }