Remove getLoginScreen().
authorMichael M Slusarz <slusarz@curecanti.org>
Wed, 15 Jul 2009 05:12:33 +0000 (23:12 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 21 Jul 2009 22:25:59 +0000 (16:25 -0600)
framework/Auth/lib/Horde/Auth/Application.php
framework/Auth/lib/Horde/Auth/Base.php
framework/Auth/lib/Horde/Auth/Composite.php
framework/Auth/lib/Horde/Auth/Cyrus.php
framework/Auth/lib/Horde/Auth/Http.php

index 391401e..f3e8534 100644 (file)
@@ -118,19 +118,6 @@ class Horde_Auth_Application extends Horde_Auth_Base
     }
 
     /**
-     * Return the URI of the login screen for this authentication method.
-     *
-     * @param string $app  The application to use.
-     * @param string $url  The URL to redirect to after login.
-     *
-     * @return string  The login screen URI.
-     */
-    public function getLoginScreen($app = 'horde', $url = '')
-    {
-        return parent::getLoginScreen($this->_params['app'], $url);
-    }
-
-    /**
      * List all users in the system.
      *
      * @return array  The array of userIds.
index bb08e0a..603db2e 100644 (file)
@@ -78,7 +78,7 @@ abstract class Horde_Auth_Base
                 if (Horde_Auth::getAuthError() != Horde_Auth::REASON_MESSAGE) {
                     Horde_Auth::setAuthError(Horde_Auth::REASON_FAILED);
                 }
-                return false;
+                return $auth;
             }
         }
 
@@ -111,8 +111,11 @@ abstract class Horde_Auth_Base
                 }
             }
         } catch (Horde_Auth_Exception $e) {
-            Horde::logMessage($e, __FILE__, __LINE__, PEAR_LOG_DEBUG);
-            Horde_Auth::setAuthError($e->getCode() || Horde_Auth::REASON_MESSAGE, $e->getMessage());
+            if ($e->getCode()) {
+                Horde_Auth::setAuthError($e->getCode());
+            } else {
+                Horde_Auth::setAuthError(Horde_Auth::REASON_MESSAGE, $e->getMessage());
+            }
         }
 
         return $auth;
@@ -260,24 +263,6 @@ abstract class Horde_Auth_Base
     }
 
     /**
-     * Returns the URI of the login screen for the current authentication
-     * method.
-     *
-     * @param string $app  The application to use.
-     * @param string $url  The URL to redirect to after login.
-     *
-     * @return string  The login screen URI.
-     */
-    public function getLoginScreen($app = 'horde', $url = '')
-    {
-        $login = Horde::url($GLOBALS['registry']->get('webroot', $app) . '/login.php', true);
-        if (!empty($url)) {
-            $login = Horde_Util::addParameter($login, 'url', $url);
-        }
-        return $login;
-    }
-
-    /**
      * Returns the named parameter for the current auth driver.
      *
      * @param string $param  The parameter to fetch.
index dbb1306..ddb0113 100644 (file)
@@ -116,24 +116,6 @@ class Horde_Auth_Composite extends Horde_Auth_Base
     }
 
     /**
-     * Return the URI of the login screen for this authentication object.
-     *
-     * @param string $app  The application to use.
-     * @param string $url  The URL to redirect to after login.
-     *
-     * @return string  The login screen URI.
-     */
-    public function getLoginScreen($app = 'horde', $url = '')
-    {
-        if (($login_driver = Horde_Auth::getDriverByParam('loginscreen_switch', $this->_params)) &&
-            $this->_loadDriver($login_driver)) {
-            return $this->_drivers[$login_driver]->getLoginScreen($app, $url);
-        }
-
-        return parent::getLoginScreen($app, $url);
-    }
-
-    /**
      * Add a set of authentication credentials.
      *
      * @param string $userId       The userId to add.
index acac535..b5141c1 100644 (file)
@@ -34,7 +34,6 @@
  * Example Usage:
  * <pre>
  * $conf['auth']['driver'] = 'composite';
- * $conf['auth']['params']['loginscreen_switch'] = '_horde_select_loginscreen';
  * $conf['auth']['params']['admin_driver'] = 'cyrus';
  * $conf['auth']['params']['drivers']['imp'] = array(
  *     'driver' => 'application',
@@ -268,19 +267,6 @@ class Horde_Auth_Cyrus extends Horde_Auth_Base
     }
 
     /**
-     * Return the URI of the login screen for this authentication method.
-     *
-     * @param string $app  The application to use.
-     * @param string $url  The URL to redirect to after login.
-     *
-     * @return string  The login screen URI.
-     */
-    public function getLoginScreen($app = 'horde', $url = '')
-    {
-        return $this->_backend->getLoginScreen($app, $url);
-    }
-
-    /**
      * Checks if a userId exists in the system.
      *
      * @return boolean  Whether or not the userId already exists.
index cbe7b1d..62dbe7f 100644 (file)
@@ -92,25 +92,6 @@ class Horde_Auth_Http extends Horde_Auth_Base
     }
 
     /**
-     * Return the URI of the login screen for this authentication object.
-     *
-     * @param string $app  The application to use.
-     * @param string $url  The URL to redirect to after login.
-     *
-     * @return string  The login screen URI.
-     */
-    public function getLoginScreen($app = 'horde', $url = '')
-    {
-        if (!empty($this->_params['loginScreen'])) {
-            return $url
-                ? Horde_Util::addParameter($this->_params['loginScreen'], 'url', $url)
-                : $this->_params['loginScreen'];
-        }
-
-        return parent::getLoginScreen($app, $url);
-    }
-
-    /**
      * List all users in the system.
      *
      * @return array  The array of userIds.