* @category Horde * @copyright 2011-2017 Horde LLC * @license http://www.horde.org/licenses/gpl GPL * @package Passwd */ class Passwd_Driver_Horde extends Passwd_Driver { /** */ protected function _changePassword($user, $oldpass, $newpass) { $auth = $this->_params['auth']; if (!$auth->hasCapability('update')) { throw new Passwd_Exception(_("The current horde configuration does not allow changing passwords.")); } /* Check the provided old password. */ try { if ($auth->authenticate($user, array('password' => $oldpass, false))) { /* Actually modify the password. */ $auth->updateUser($user, $user, array( 'password' => $newpass )); } else { throw new Passwd_Exception(_("Incorrect old password.")); } } catch (Horde_Auth_Exception $e) { throw new Passwd_Exception($e); } } }