1: <?php
2: /**
3: * The Horde_Core_Auth_Msad class provides Horde-specific code that
4: * extends the base LDAP driver.
5: *
6: * Copyright 2010-2012 Horde LLC (http://www.horde.org/)
7: *
8: * See the enclosed file COPYING for license information (LGPL). If you did
9: * not receive this file, see http://opensource.org/licenses/lgpl-2.1.php
10: *
11: * @author Michael Slusarz <slusarz@horde.org>
12: * @category Horde
13: * @license http://opensource.org/licenses/lgpl-2.1.php LGPL
14: * @package Core
15: */
16: class Horde_Core_Auth_Msad extends Horde_Auth_Msad
17: {
18: /**
19: * Add a set of authentication credentials.
20: *
21: * @param string $userId The user ID to add.
22: * @param array $credentials The credentials to use.
23: *
24: * @throws Horde_Auth_Exception
25: */
26: public function addUser($userId, $credentials)
27: {
28: list($userId, $credentials) = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Auth')->create()->runHook($userId, $credentials, 'preauthenticate', 'admin');
29:
30: parent::addUser($userId, $credentials);
31: }
32:
33: /**
34: * Update a set of authentication credentials.
35: *
36: * @param string $oldID The old user ID.
37: * @param string $newID The new user ID.
38: * @param array $credentials The new credentials
39: *
40: * @throws Horde_Auth_Exception
41: */
42: public function updateUser($oldID, $newID, $credentials, $olddn = null,
43: $newdn = null)
44: {
45: list($oldId, $credentials) = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Auth')->create()->runHook($oldId, $credentials, 'preauthenticate', 'admin');
46:
47: parent::updateUser($oldID, $newID, $credentials, $olddn, $newdn);
48: }
49:
50: /**
51: * Delete a set of authentication credentials.
52: *
53: * @param string $userId The user ID to delete.
54: * @param string $dn TODO
55: *
56: * @throws Horde_Auth_Exception
57: */
58: public function removeUser($userId, $dn = null)
59: {
60: list($userId, $credentials) = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Auth')->create()->runHook($userId, array(), 'preauthenticate', 'admin');
61:
62: parent::removeUser($userId, isset($credentials['ldap']) ? $credentials['ldap']['dn'] : $dn);
63: }
64:
65: }
66: