1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15:
16: class Horde_Core_Auth_Ldap extends Horde_Auth_Ldap
17: {
18: 19: 20: 21: 22: 23: 24: 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: 35: 36: 37: 38: 39: 40: 41:
42: public function updateUser($oldID, $newID, $credentials)
43: {
44: $auth = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Auth')->create();
45:
46: list($oldID, $old_credentials) = $auth->runHook($oldID, $credentials, 'preauthenticate', 'admin');
47: list($newID, $new_credentials) = $auth->runHook($newID, $credentials, 'preauthenticate', 'admin');
48: $olddn = isset($old_credentials['dn']) ? $old_credentials['dn'] : null;
49: $newdn = isset($new_credentials['dn']) ? $new_credentials['dn'] : null;
50:
51: parent::updateUser($oldID, $newID, $new_credentials, $olddn, $newdn);
52: }
53:
54: 55: 56: 57: 58: 59: 60:
61: public function removeUser($userId)
62: {
63: list($userId, $credentials) = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Auth')->create()->runHook($userId, array(), 'preauthenticate', 'admin');
64:
65: parent::removeUser($userId, isset($credentials['ldap']) ? $credentials['ldap']['dn'] : null);
66: }
67:
68: }
69: