From: Chuck Hagenbuch Date: Tue, 14 Jul 2009 04:45:10 +0000 (-0400) Subject: HttpRemote -> Http_Remote and tweak class loading so that this allworks X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=9af768a7e621122e0ed7d8a21e4535450cd34d14;p=horde.git HttpRemote -> Http_Remote and tweak class loading so that this allworks --- diff --git a/framework/Auth/lib/Horde/Auth.php b/framework/Auth/lib/Horde/Auth.php index 285eb87aa..290f2bc8f 100644 --- a/framework/Auth/lib/Horde/Auth.php +++ b/framework/Auth/lib/Horde/Auth.php @@ -81,12 +81,12 @@ class Horde_Auth */ static public function factory($driver, $params = null) { - $driver = basename($driver); + $driver = str_replace(' ', '_' , ucwords(str_replace('_', ' ', basename($driver)))); if (empty($params)) { $params = Horde::getDriverConfig('auth', $driver); } - $class = 'Horde_Auth_' . ucfirst($driver); + $class = 'Horde_Auth_' . $driver; if (class_exists($class)) { return new $class($params); } diff --git a/framework/Auth/lib/Horde/Auth/Http/Remote.php b/framework/Auth/lib/Horde/Auth/Http/Remote.php new file mode 100644 index 000000000..6391fb54c --- /dev/null +++ b/framework/Auth/lib/Horde/Auth/Http/Remote.php @@ -0,0 +1,46 @@ + + * @package Horde_Auth + */ +class Horde_Auth_Http_Remote extends Horde_Auth_Base +{ + /** + * Find out if a set of login credentials are valid. + * + * @param string $userId The userId to check. + * @param array $credentials An array of login credentials. + * + * @throws Horde_Exception + */ + protected function _authenticate($userId, $credentials) + { + $options = array( + 'allowRedirects' => true, + 'method' => 'GET', + 'timeout' => 5 + ); + + if (!empty($GLOBALS['conf']['http']['proxy']['proxy_host'])) { + $options = array_merge($options, $GLOBALS['conf']['http']['proxy']); + } + + $request = new HTTP_Request($this->_params['url'], $options); + $request->setBasicAuth($userId, $credentials['password']); + + $request->sendRequest(); + + if ($request->getResponseCode() != 200) { + throw new Horde_Exception('', Horde_Auth::REASON_BADLOGIN); + } + } + +} diff --git a/framework/Auth/lib/Horde/Auth/HttpRemote.php b/framework/Auth/lib/Horde/Auth/HttpRemote.php deleted file mode 100644 index 79bd206c7..000000000 --- a/framework/Auth/lib/Horde/Auth/HttpRemote.php +++ /dev/null @@ -1,46 +0,0 @@ - - * @package Horde_Auth - */ -class Horde_Auth_HttpRemote extends Horde_Auth_Base -{ - /** - * Find out if a set of login credentials are valid. - * - * @param string $userId The userId to check. - * @param array $credentials An array of login credentials. - * - * @throws Horde_Exception - */ - protected function _authenticate($userId, $credentials) - { - $options = array( - 'allowRedirects' => true, - 'method' => 'GET', - 'timeout' => 5 - ); - - if (!empty($GLOBALS['conf']['http']['proxy']['proxy_host'])) { - $options = array_merge($options, $GLOBALS['conf']['http']['proxy']); - } - - $request = new HTTP_Request($this->_params['url'], $options); - $request->setBasicAuth($userId, $credentials['password']); - - $request->sendRequest(); - - if ($request->getResponseCode() != 200) { - throw new Horde_Exception('', Horde_Auth::REASON_BADLOGIN); - } - } - -} diff --git a/framework/Auth/package.xml b/framework/Auth/package.xml index 78e56b64a..67ae1eb50 100644 --- a/framework/Auth/package.xml +++ b/framework/Auth/package.xml @@ -38,6 +38,9 @@ http://pear.php.net/dtd/package-2.0.xsd"> + + + @@ -50,7 +53,6 @@ http://pear.php.net/dtd/package-2.0.xsd"> - @@ -140,7 +142,6 @@ http://pear.php.net/dtd/package-2.0.xsd"> - @@ -149,8 +150,8 @@ http://pear.php.net/dtd/package-2.0.xsd"> + - @@ -164,6 +165,7 @@ http://pear.php.net/dtd/package-2.0.xsd"> +