*/
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);
}
--- /dev/null
+<?php
+/**
+ * The Horde_Auth_Http_Remote class authenticates users against a remote
+ * HTTP-Auth endpoint.
+ *
+ * Copyright 2007-2009 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (LGPL). If you did
+ * not receive this file, see http://opensource.org/licenses/lgpl-2.1.php
+ *
+ * @author Duck <duck@obala.net>
+ * @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);
+ }
+ }
+
+}
+++ /dev/null
-<?php
-/**
- * The Auth_Http_Remote class authenticates users against a remote
- * HTTP-Auth endpoint.
- *
- * Copyright 2007-2009 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (LGPL). If you did
- * not receive this file, see http://opensource.org/licenses/lgpl-2.1.php
- *
- * @author Duck <duck@obala.net>
- * @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);
- }
- }
-
-}
<dir name="lib">
<dir name="Horde">
<dir name="Auth">
+ <dir name="Http">
+ <file name="Remote.php" role="php" />
+ </dir> <!-- /lib/Horde/Auth/Http -->
<dir name="Signup">
<file name="Sql.php" role="php" />
</dir> <!-- /lib/Horde/Auth/Signup -->
<file name="Cyrus.php" role="php" />
<file name="Ftp.php" role="php" />
<file name="Http.php" role="php" />
- <file name="HttpRemote.php" role="php" />
<file name="Imap.php" role="php" />
<file name="Imsp.php" role="php" />
<file name="Ipbasic.php" role="php" />
</dependencies>
<phprelease>
<filelist>
- <install name="lib/Horde/Auth/Signup/Sql.php" as="Horde/Auth/Signup/Sql.php" />
<install name="lib/Horde/Auth/Application.php" as="Horde/Auth/Application.php" />
<install name="lib/Horde/Auth/Auto.php" as="Horde/Auth/Auto.php" />
<install name="lib/Horde/Auth/Base.php" as="Horde/Auth/Base.php" />
<install name="lib/Horde/Auth/Cyrsql.php" as="Horde/Auth/Cyrsql.php" />
<install name="lib/Horde/Auth/Cyrus.php" as="Horde/Auth/Cyrus.php" />
<install name="lib/Horde/Auth/Ftp.php" as="Horde/Auth/Ftp.php" />
+ <install name="lib/Horde/Auth/Http/Remote.php" as="Horde/Auth/Http/Remote.php" />
<install name="lib/Horde/Auth/Http.php" as="Horde/Auth/Http.php" />
- <install name="lib/Horde/Auth/HttpRemote.php" as="Horde/Auth/HttpRemote.php" />
<install name="lib/Horde/Auth/Imap.php" as="Horde/Auth/Imap.php" />
<install name="lib/Horde/Auth/Imsp.php" as="Horde/Auth/Imsp.php" />
<install name="lib/Horde/Auth/Ipbasic.php" as="Horde/Auth/Ipbasic.php" />
<install name="lib/Horde/Auth/Peclsasl.php" as="Horde/Auth/Peclsasl.php" />
<install name="lib/Horde/Auth/Radius.php" as="Horde/Auth/Radius.php" />
<install name="lib/Horde/Auth/Shibboleth.php" as="Horde/Auth/Shibboleth.php" />
+ <install name="lib/Horde/Auth/Signup/Sql.php" as="Horde/Auth/Signup/Sql.php" />
<install name="lib/Horde/Auth/Signup.php" as="Horde/Auth/Signup.php" />
<install name="lib/Horde/Auth/Smb.php" as="Horde/Auth/Smb.php" />
<install name="lib/Horde/Auth/Smbclient.php" as="Horde/Auth/Smbclient.php" />