throw Horde_Auth_Exceptions instead of generic Horde_Exceptions
authorChuck Hagenbuch <chuck@horde.org>
Wed, 15 Jul 2009 14:40:37 +0000 (10:40 -0400)
committerChuck Hagenbuch <chuck@horde.org>
Wed, 15 Jul 2009 14:40:37 +0000 (10:40 -0400)
29 files changed:
framework/Auth/lib/Horde/Auth.php
framework/Auth/lib/Horde/Auth/Application.php
framework/Auth/lib/Horde/Auth/Auto.php
framework/Auth/lib/Horde/Auth/Base.php
framework/Auth/lib/Horde/Auth/Composite.php
framework/Auth/lib/Horde/Auth/Customsql.php
framework/Auth/lib/Horde/Auth/Cyrsql.php
framework/Auth/lib/Horde/Auth/Cyrus.php
framework/Auth/lib/Horde/Auth/Exception.php [new file with mode: 0644]
framework/Auth/lib/Horde/Auth/Ftp.php
framework/Auth/lib/Horde/Auth/Http.php
framework/Auth/lib/Horde/Auth/Http/Remote.php
framework/Auth/lib/Horde/Auth/Imap.php
framework/Auth/lib/Horde/Auth/Imsp.php
framework/Auth/lib/Horde/Auth/Ipbasic.php
framework/Auth/lib/Horde/Auth/Kolab.php
framework/Auth/lib/Horde/Auth/Krb5.php
framework/Auth/lib/Horde/Auth/Ldap.php
framework/Auth/lib/Horde/Auth/Login.php
framework/Auth/lib/Horde/Auth/Msad.php
framework/Auth/lib/Horde/Auth/Pam.php
framework/Auth/lib/Horde/Auth/Passwd.php
framework/Auth/lib/Horde/Auth/Peclsasl.php
framework/Auth/lib/Horde/Auth/Radius.php
framework/Auth/lib/Horde/Auth/Shibboleth.php
framework/Auth/lib/Horde/Auth/Smb.php
framework/Auth/lib/Horde/Auth/Smbclient.php
framework/Auth/lib/Horde/Auth/Sql.php
framework/Auth/package.xml

index 290f2bc..8ac3d75 100644 (file)
@@ -77,7 +77,7 @@ class Horde_Auth
      *                       parameters a subclass might need.
      *
      * @return Horde_Auth_Base  The newly created concrete instance.
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     static public function factory($driver, $params = null)
     {
@@ -91,7 +91,7 @@ class Horde_Auth
             return new $class($params);
         }
 
-        throw new Horde_Exception('Class definition of ' . $class . ' not found.');
+        throw new Horde_Auth_Exception('Class definition of ' . $class . ' not found.');
     }
 
     /**
@@ -107,7 +107,7 @@ class Horde_Auth
      *                       connection parameters a subclass might need.
      *
      * @return Horde_Auth_Base  The concrete reference.
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     static public function singleton($driver, $params = array())
     {
@@ -307,7 +307,7 @@ class Horde_Auth
      *
      * @param string $userId  The userId to delete.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     static public function removeUserData($userId)
     {
@@ -316,14 +316,14 @@ class Horde_Auth
         foreach ($GLOBALS['registry']->listApps(array('notoolbar', 'hidden', 'active', 'admin')) as $app) {
             try {
                 $GLOBALS['registry']->callByPackage($app, 'removeUserData', array($userId));
-            } catch (Horde_Exception $e) {
+            } catch (Horde_Auth_Exception $e) {
                 Horde::logMessage($e, __FILE__, __LINE__, PEAR_LOG_ERR);
                 $errApps[] = $app;
             }
         }
 
         if (count($errApps)) {
-            throw new Horde_Exception(sprintf(_("The following applications encountered errors removing user data: %s"), implode(', ', $errApps)));
+            throw new Horde_Auth_Exception(sprintf(_("The following applications encountered errors removing user data: %s"), implode(', ', $errApps)));
         }
     }
 
index bf3d69d..9818abb 100644 (file)
@@ -86,20 +86,20 @@ class Horde_Auth_Application extends Horde_Auth_Base
      * @param string $userId      The userId to check.
      * @param array $credentials  The credentials to use.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     protected function _authenticate($userId, $credentials)
     {
         if (!$this->hasCapability('authenticate')) {
-            throw new Horde_Exception($this->_params['app'] . ' does not provide an authenticate() method.');
+            throw new Horde_Auth_Exception($this->_params['app'] . ' does not provide an authenticate() method.');
         }
 
         $registry = Horde_Registry::singleton();
 
         try {
             $result = $registry->callByPackage($this->_params['app'], 'authenticate', array($userId, $credentials, $this->_params['params']));
-        } catch (Horde_Exception $e) {
-            throw new Horde_Exception('', Horde_Auth::REASON_BADLOGIN);
+        } catch (Horde_Auth_Exception $e) {
+            throw new Horde_Auth_Exception('', Horde_Auth::REASON_BADLOGIN);
         }
 
         // Horrific hack.  Avert your eyes.  Since an application may already
@@ -134,7 +134,7 @@ class Horde_Auth_Application extends Horde_Auth_Base
      * List all users in the system.
      *
      * @return array  The array of userIds.
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function listUsers()
     {
@@ -169,7 +169,7 @@ class Horde_Auth_Application extends Horde_Auth_Base
      * @param string $userId      The userId to add.
      * @param array $credentials  The credentials to use.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function addUser($userId, $credentials)
     {
@@ -188,7 +188,7 @@ class Horde_Auth_Application extends Horde_Auth_Base
      * @param string $newID       The new userId.
      * @param array $credentials  The new credentials
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function updateUser($oldID, $newID, $credentials)
     {
@@ -205,7 +205,7 @@ class Horde_Auth_Application extends Horde_Auth_Base
      *
      * @param string $userId  The userId to delete.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function removeUser($userId)
     {
index d9120d4..d10d35a 100644 (file)
@@ -51,18 +51,18 @@ class Horde_Auth_Auto extends Horde_Auth_Base
     }
 
     /**
-     * Horde_Exception should pass a message string (if any) in the message
+     * Horde_Auth_Exception should pass a message string (if any) in the message
      * field, and the REASON_* constant in the code field (defaults to
      * REASON_MESSAGE).
      *
      * @param string $userID      The userID to check.
      * @param array $credentials  An array of login credentials.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     protected function _authenticate($userId, $credentials)
     {
-        throw new Horde_Exception('unsupported');
+        throw new Horde_Auth_Exception('unsupported');
     }
 
     /**
index dd20cd6..bb08e0a 100644 (file)
@@ -110,7 +110,7 @@ abstract class Horde_Auth_Base
                     $auth = true;
                 }
             }
-        } catch (Horde_Exception $e) {
+        } catch (Horde_Auth_Exception $e) {
             Horde::logMessage($e, __FILE__, __LINE__, PEAR_LOG_DEBUG);
             Horde_Auth::setAuthError($e->getCode() || Horde_Auth::REASON_MESSAGE, $e->getMessage());
         }
@@ -121,14 +121,14 @@ abstract class Horde_Auth_Base
     /**
      * Authentication stub.
      *
-     * Horde_Exception should pass a message string (if any) in the message
+     * Horde_Auth_Exception should pass a message string (if any) in the message
      * field, and the REASON_* constant in the code field (defaults to
      * REASON_MESSAGE).
      *
      * @param string $userID      The userID to check.
      * @param array $credentials  An array of login credentials.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     abstract protected function _authenticate($userId, $credentials);
 
@@ -138,11 +138,11 @@ abstract class Horde_Auth_Base
      * @param string $userId      The userId to add.
      * @param array $credentials  The credentials to use.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function addUser($userId, $credentials)
     {
-        throw new Horde_Exception('unsupported');
+        throw new Horde_Auth_Exception('unsupported');
     }
 
     /**
@@ -152,11 +152,11 @@ abstract class Horde_Auth_Base
      * @param string $newID       The new userId.
      * @param array $credentials  The new credentials
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function updateUser($oldID, $newID, $credentials)
     {
-        throw new Horde_Exception('unsupported');
+        throw new Horde_Auth_Exception('unsupported');
     }
 
     /**
@@ -164,22 +164,22 @@ abstract class Horde_Auth_Base
      *
      * @param string $userId  The userId to delete.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function removeUser($userId)
     {
-        throw new Horde_Exception('unsupported');
+        throw new Horde_Auth_Exception('unsupported');
     }
 
     /**
      * Lists all users in the system.
      *
      * @return mixed  The array of userIds.
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function listUsers()
     {
-        throw new Horde_Exception('unsupported');
+        throw new Horde_Auth_Exception('unsupported');
     }
 
     /**
@@ -194,7 +194,7 @@ abstract class Horde_Auth_Base
         try {
             $users = $this->listUsers();
             return in_array($userId, $users);
-        } catch (Horde_Exception $e) {
+        } catch (Horde_Auth_Exception $e) {
             return false;
         }
     }
@@ -209,7 +209,7 @@ abstract class Horde_Auth_Base
     {
         try {
             return $this->_transparent();
-        } catch (Horde_Exception $e) {
+        } catch (Horde_Auth_Exception $e) {
             Horde_Auth::setAuthError($e->getCode() || Horde_Auth::REASON_MESSAGE, $e->getMessage());
             return false;
         }
@@ -218,14 +218,14 @@ abstract class Horde_Auth_Base
     /**
      * Transparent authentication stub.
      *
-     * If the auth error message is desired to be set, Horde_Exception should
+     * If the auth error message is desired to be set, Horde_Auth_Exception should
      * thrown instead of returning false.
-     * The Horde_Exception object should have a message string (if any) in the
+     * The Horde_Auth_Exception object should have a message string (if any) in the
      * message field, and the REASON_* constant in the code field (defaults to
      * REASON_MESSAGE).
      *
      * @return boolean  Whether transparent login is supported.
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     protected function _transparent()
     {
@@ -239,11 +239,11 @@ abstract class Horde_Auth_Base
      * @param string $userId  The user id for which to reset the password.
      *
      * @return string  The new password on success.
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function resetPassword($userId)
     {
-        throw new Horde_Exception('unsupported');
+        throw new Horde_Auth_Exception('unsupported');
     }
 
     /**
index 5d62556..dbb1306 100644 (file)
@@ -44,7 +44,7 @@ class Horde_Auth_Composite extends Horde_Auth_Base
      * @param string $userId      The userId to check.
      * @param array $credentials  The credentials to use.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     protected function _authenticate($userId, $credentials)
     {
@@ -60,7 +60,7 @@ class Horde_Auth_Composite extends Horde_Auth_Base
             return;
         }
 
-        throw new Horde_Exception('', Horde_Auth::REASON_FAILED);
+        throw new Horde_Auth_Exception('', Horde_Auth::REASON_FAILED);
     }
 
     /**
@@ -139,7 +139,7 @@ class Horde_Auth_Composite extends Horde_Auth_Base
      * @param string $userId       The userId to add.
      * @param array  $credentials  The credentials to use.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function addUser($userId, $credentials)
     {
@@ -158,7 +158,7 @@ class Horde_Auth_Composite extends Horde_Auth_Base
      * @param string $newID       The new userId.
      * @param array $credentials  The new credentials
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function updateUser($oldID, $newID, $credentials)
     {
@@ -175,7 +175,7 @@ class Horde_Auth_Composite extends Horde_Auth_Base
      *
      * @param string $userId  The userId to delete.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function removeUser($userId)
     {
@@ -191,7 +191,7 @@ class Horde_Auth_Composite extends Horde_Auth_Base
      * List all users in the system.
      *
      * @return array  The array of userIds.
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function listUsers()
     {
index 243e92e..ca1ed8b 100644 (file)
@@ -74,14 +74,14 @@ class Horde_Auth_Customsql extends Horde_Auth_Sql
      * @param string $userId      The userId to check.
      * @param array $credentials  The credentials to use.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     protected function _authenticate($userId, $credentials)
     {
         try {
             $this->_connect();
-        } catch (Horde_Exception $e) {
-            throw new Horde_Exception('', Horde_Auth::REASON_FAILED);
+        } catch (Horde_Auth_Exception $e) {
+            throw new Horde_Auth_Exception('', Horde_Auth::REASON_FAILED);
         }
 
         /* Build a custom query, based on the config file. */
@@ -95,7 +95,7 @@ class Horde_Auth_Customsql extends Horde_Auth_Sql
 
         $result = $this->_db->query($query);
         if ($result instanceof PEAR_Error) {
-            throw new Horde_Exception('', Horde_Auth::REASON_FAILED);
+            throw new Horde_Auth_Exception('', Horde_Auth::REASON_FAILED);
         }
 
         $row = $result->fetchRow(DB_GETMODE_ASSOC);
@@ -107,7 +107,7 @@ class Horde_Auth_Customsql extends Horde_Auth_Sql
         }
 
         $result->free();
-        throw new Horde_Exception('', Horde_Auth::REASON_BADLOGIN);
+        throw new Horde_Auth_Exception('', Horde_Auth::REASON_BADLOGIN);
     }
 
     /**
@@ -116,7 +116,7 @@ class Horde_Auth_Customsql extends Horde_Auth_Sql
      * @param string $userId      The userId to add.
      * @param array $credentials  The credentials to add.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function addUser($userId, $credentials)
     {
@@ -132,7 +132,7 @@ class Horde_Auth_Customsql extends Horde_Auth_Sql
 
         $result = $this->_db->query($query);
         if ($result instanceof PEAR_Error) {
-            throw new Horde_Exception($result);
+            throw new Horde_Auth_Exception($result);
         }
     }
 
@@ -143,7 +143,7 @@ class Horde_Auth_Customsql extends Horde_Auth_Sql
      * @param string $newId       The new userId.
      * @param array $credentials  The new credentials
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     function updateUser($oldId, $newId, $credentials)
     {
@@ -161,7 +161,7 @@ class Horde_Auth_Customsql extends Horde_Auth_Sql
 
         $result = $this->_db->query($query);
         if ($result instanceof PEAR_Error) {
-            throw new Horde_Exception($result);
+            throw new Horde_Auth_Exception($result);
         }
     }
 
@@ -172,7 +172,7 @@ class Horde_Auth_Customsql extends Horde_Auth_Sql
      * @param string $userId  The user id for which to reset the password.
      *
      * @return string  The new password on success.
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function resetPassword($userId)
     {
@@ -191,7 +191,7 @@ class Horde_Auth_Customsql extends Horde_Auth_Sql
 
         $result = $this->_db->query($query);
         if ($result instanceof PEAR_Error) {
-            throw new Horde_Exception($result);
+            throw new Horde_Auth_Exception($result);
         }
 
         return $password;
@@ -202,7 +202,7 @@ class Horde_Auth_Customsql extends Horde_Auth_Sql
      *
      * @param string $userId  The userId to delete.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function removeUser($userId)
     {
@@ -214,7 +214,7 @@ class Horde_Auth_Customsql extends Horde_Auth_Sql
 
         $result = $this->_db->query($query);
         if ($result instanceof PEAR_Error) {
-            throw new Horde_Exception($result);
+            throw new Horde_Auth_Exception($result);
         }
 
         $this->removeUserData($userId);
@@ -224,7 +224,7 @@ class Horde_Auth_Customsql extends Horde_Auth_Sql
      * List all users in the system.
      *
      * @return array  The array of userIds.
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function listUsers()
     {
@@ -236,7 +236,7 @@ class Horde_Auth_Customsql extends Horde_Auth_Sql
 
         $result = $this->_db->getAll($query, null, DB_FETCHMODE_ORDERED);
         if ($result instanceof PEAR_Error) {
-            throw new Horde_Exception($result);
+            throw new Horde_Auth_Exception($result);
         }
 
         /* Loop through and build return array. */
@@ -257,7 +257,7 @@ class Horde_Auth_Customsql extends Horde_Auth_Sql
     {
         try {
             $this->_connect();
-        } catch (Horde_Exception $e) {
+        } catch (Horde_Auth_Exception $e) {
             return false;
         }
 
index 87874f1..4d30aff 100644 (file)
@@ -160,15 +160,15 @@ class Horde_Auth_Cyrsql extends Horde_Auth_Sql
      * @param string $userId      The userId to check.
      * @param array $credentials  The credentials to use.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     protected function _authenticate($userId, $credentials)
     {
         try {
             $this->_connect();
-        } catch (Horde_Exception $e) {
+        } catch (Horde_Auth_Exception $e) {
             Horde::logMessage($e, __FILE__, __LINE__, PEAR_LOG_ERR);
-            throw new Horde_Exception('', Horde_Auth::REASON_FAILED);
+            throw new Horde_Auth_Exception('', Horde_Auth::REASON_FAILED);
         }
 
         if (!empty($this->_params['domain_field']) &&
@@ -192,26 +192,26 @@ class Horde_Auth_Cyrsql extends Horde_Auth_Sql
         $result = $this->_db->query($query, $values);
         if ($result instanceof PEAR_Error) {
             Horde::logMessage($result, __FILE__, __LINE__, PEAR_LOG_ERR);
-            throw new Horde_Exception('', Horde_Auth::REASON_FAILED);
+            throw new Horde_Auth_Exception('', Horde_Auth::REASON_FAILED);
         }
 
         $row = $result->fetchRow(DB_GETMODE_ASSOC);
         if (is_array($row)) {
             $result->free();
         } else {
-            throw new Horde_Exception('', Horde_Auth::REASON_BADLOGIN);
+            throw new Horde_Auth_Exception('', Horde_Auth::REASON_BADLOGIN);
         }
 
         if (!$this->_comparePasswords($row[$this->_params['password_field']],
                                       $credentials['password'])) {
-            throw new Horde_Exception('', Horde_Auth::REASON_BADLOGIN);
+            throw new Horde_Auth_Exception('', Horde_Auth::REASON_BADLOGIN);
         }
 
         $now = time();
         if (!empty($this->_params['hard_expiration_field']) &&
             !empty($row[$this->_params['hard_expiration_field']]) &&
             ($now > $row[$this->_params['hard_expiration_field']])) {
-            throw new Horde_Exception('', Horde_Auth::REASON_EXPIRED);
+            throw new Horde_Auth_Exception('', Horde_Auth::REASON_EXPIRED);
         }
 
         if (!empty($this->_params['soft_expiration_field']) &&
@@ -227,7 +227,7 @@ class Horde_Auth_Cyrsql extends Horde_Auth_Sql
      * @param string $userId       The userId to add.
      * @param array  $credentials  The credentials to add.
      *
-     * @throw Horde_Exception
+     * @throw Horde_Auth_Exception
      */
     public function addUser($userId, $credentials)
     {
@@ -259,7 +259,7 @@ class Horde_Auth_Cyrsql extends Horde_Auth_Sql
 
             $dbresult2 = $this->_db->query($query, $values);
             if ($dbresult2 instanceof PEAR_Error) {
-                throw new Horde_Exception($dbresult2);
+                throw new Horde_Auth_Exception($dbresult2);
             }
         } else {
             parent::addUser($userId, $credentials);
@@ -270,7 +270,7 @@ class Horde_Auth_Cyrsql extends Horde_Auth_Sql
             $ob->createMailbox($mailbox);
             $ob->setACL($mailbox, $this->_params['cyradm'], 'lrswipcda');
         } catch (Horde_Imap_Client_Exception $e) {
-            throw new Horde_Exception($e);
+            throw new Horde_Auth_Exception($e);
         }
 
         foreach ($this->_params['folders'] as $folders) {
@@ -293,14 +293,14 @@ Horde_String::convertCharset($userName . $this->_separator . $value . '@' . $dom
             try {
                 $this->_ob->setQuota($mailbox, array('storage' => $this->_params['quota']));
             } catch (Horde_Imap_Client_Exception $e) {
-                throw new Horde_Exception($e);
+                throw new Horde_Auth_Exception($e);
             }
         }
 
         if (isset($this->_params['quota']) &&
             ($this->_params['quota'] >= 0) &&
             !@imap_set_quota($this->_imapStream, 'user' . $this->_separator . $userId, $this->_params['quota'])) {
-            throw new Horde_Exception(sprintf(_("IMAP mailbox quota creation failed: %s"), imap_last_error()));
+            throw new Horde_Auth_Exception(sprintf(_("IMAP mailbox quota creation failed: %s"), imap_last_error()));
         }
     }
 
@@ -309,7 +309,7 @@ Horde_String::convertCharset($userName . $this->_separator . $value . '@' . $dom
      *
      * @param string $userId  The userId to delete.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     function removeUser($userId)
     {
@@ -348,7 +348,7 @@ Horde_String::convertCharset($userName . $this->_separator . $value . '@' . $dom
             $this->_ob->setACL($mailbox, $admin, array('rights' => 'lrswipcda'));
             $this->_ob->deleteMailbox($mailbox);
         } catch (Horde_Imap_Client_Exception $e) {
-            throw new Horde_Exception($e);
+            throw new Horde_Auth_Exception($e);
         }
 
         Horde_Auth::removeUserData($userId);
@@ -358,7 +358,7 @@ Horde_String::convertCharset($userName . $this->_separator . $value . '@' . $dom
      * List all users in the system.
      *
      * @return mixed  The array of userIds.
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function listUsers()
     {
@@ -384,7 +384,7 @@ Horde_String::convertCharset($userName . $this->_separator . $value . '@' . $dom
 
         $result = $this->_db->getAll($query, null, DB_FETCHMODE_ORDERED);
         if ($result instanceof PEAR_Error) {
-            throw new Horde_Exception($result);
+            throw new Horde_Auth_Exception($result);
         }
 
         /* Loop through and build return array. */
@@ -414,7 +414,7 @@ Horde_String::convertCharset($userName . $this->_separator . $value . '@' . $dom
      * @param string $newID       The new userId.
      * @param array $credentials  The new credentials
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function updateUser($oldID, $newID, $credentials)
     {
@@ -451,14 +451,14 @@ Horde_String::convertCharset($userName . $this->_separator . $value . '@' . $dom
 
         $res = $this->_db->query($query, $values);
         if ($res instanceof PEAR_Error) {
-            throw new Horde_Exception($res);
+            throw new Horde_Auth_Exception($res);
         }
     }
 
     /**
      * Attempts to open connections to the SQL and IMAP servers.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     protected function _connect()
     {
@@ -488,7 +488,7 @@ Horde_String::convertCharset($userName . $this->_separator . $value . '@' . $dom
             $this->_ob = Horde_Imap_Client::getInstance('Socket', $imap_config);
             $this->_ob->login();
         } catch (Horde_Imap_Client_Exception $e) {
-            throw new Horde_Exception($e);
+            throw new Horde_Auth_Exception($e);
         }
 
         $this->_connected = true;
index 3ce2227..fd7ec5c 100644 (file)
@@ -150,7 +150,7 @@ class Horde_Auth_Cyrus extends Horde_Auth_Base
      * @param string $userId      The userId to add.
      * @param array $credentials  The credentials to add.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function addUser($userId, $credentials)
     {
@@ -163,7 +163,7 @@ class Horde_Auth_Cyrus extends Horde_Auth_Base
         try {
             $this->_ob->createMailbox($mailbox);
         } catch (Horde_Imap_Client_Exception $e) {
-            throw new Horde_Exception($e);
+            throw new Horde_Auth_Exception($e);
         }
 
         if (isset($this->_params['folders']) &&
@@ -180,7 +180,7 @@ class Horde_Auth_Cyrus extends Horde_Auth_Base
             try {
                 $this->_ob->setQuota($mailbox, array('storage' => $this->_params['quota']));
             } catch (Horde_Imap_Client_Exception $e) {
-                throw new Horde_Exception($e);
+                throw new Horde_Auth_Exception($e);
             }
         }
     }
@@ -190,7 +190,7 @@ class Horde_Auth_Cyrus extends Horde_Auth_Base
      *
      * @param string $userId  The userId to delete.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function removeUser($userId)
     {
@@ -207,7 +207,7 @@ class Horde_Auth_Cyrus extends Horde_Auth_Base
             $this->_ob->setACL($mailbox, $admin, array('rights' => 'lrswipcda'));
             $this->_ob->deleteMailbox($mailbox);
         } catch (Horde_Imap_Client_Exception $e) {
-            throw new Horde_Exception($e);
+            throw new Horde_Auth_Exception($e);
         }
 
         Horde_Auth::removeUserData($userId);
@@ -216,7 +216,7 @@ class Horde_Auth_Cyrus extends Horde_Auth_Base
     /**
      * Attempts to open connections to the IMAP servers.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     protected function _connect()
     {
@@ -236,7 +236,7 @@ class Horde_Auth_Cyrus extends Horde_Auth_Base
             $this->_ob = Horde_Imap_Client::getInstance('Socket', $imap_config);
             $this->_ob->login();
         } catch (Horde_Imap_Client_Exception $e) {
-            throw new Horde_Exception($e);
+            throw new Horde_Auth_Exception($e);
         }
     }
 
@@ -244,7 +244,7 @@ class Horde_Auth_Cyrus extends Horde_Auth_Base
      * List all users in the system.
      *
      * @return array  The array of userIds.
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function listUsers()
     {
@@ -258,7 +258,7 @@ class Horde_Auth_Cyrus extends Horde_Auth_Base
      * @param string $newID       The new userId.
      * @param array $credentials  The new credentials
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function updateUser($oldID, $newID, $credentials)
     {
diff --git a/framework/Auth/lib/Horde/Auth/Exception.php b/framework/Auth/lib/Horde/Auth/Exception.php
new file mode 100644 (file)
index 0000000..ab33e1d
--- /dev/null
@@ -0,0 +1,16 @@
+<?php
+/**
+ * Authentication exceptions.
+ *
+ * Copyright 1999-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  Chuck Hagenbuch <chuck@horde.org>
+ * @author  Michael Slusarz <slusarz@curecanti.org>
+ * @package Horde_Auth
+ */
+class Horde_Auth_Exception extends Horde_Exception
+{
+}
index d35e794..ed2bfce 100644 (file)
@@ -27,12 +27,12 @@ class Horde_Auth_Ftp extends Horde_Auth_Base
      *
      * @param array $params  A hash containing connection parameters.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function __construct($params = array())
     {
         if (!Horde_Util::extensionExists('ftp')) {
-            throw new Horde_Exception('Horde_Auth_Ftp: Required FTP extension not found. Compile PHP with the --enable-ftp switch.');
+            throw new Horde_Auth_Exception('Horde_Auth_Ftp: Required FTP extension not found. Compile PHP with the --enable-ftp switch.');
         }
 
         $params = array_merge(array(
@@ -50,7 +50,7 @@ class Horde_Auth_Ftp extends Horde_Auth_Base
      * @param array $credentials  An array of login credentials. For FTP,
      *                            this must contain a password entry.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     protected function _authenticate($userId, $credentials)
     {
@@ -60,7 +60,7 @@ class Horde_Auth_Ftp extends Horde_Auth_Base
         @ftp_quit($ftp);
 
         if ($res) {
-            throw new Horde_Exception('', Horde_Auth::REASON_BADLOGIN);
+            throw new Horde_Auth_Exception('', Horde_Auth::REASON_BADLOGIN);
         }
     }
 
index f5a8508..cbe7b1d 100644 (file)
@@ -75,19 +75,19 @@ class Horde_Auth_Http extends Horde_Auth_Base
      * @param array  $credentials  An array of login credentials. For IMAP,
      *                             this must contain a password entry.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     protected function _authenticate($userId, $credentials)
     {
         if (empty($credentials['password']) ||
             empty($this->_users[$userId])) {
-            throw new Horde_Exception('', Horde_Auth::REASON_BADLOGIN);
+            throw new Horde_Auth_Exception('', Horde_Auth::REASON_BADLOGIN);
         }
 
         $hash = Horde_Auth::getCryptedPassword($credentials['password'], $this->_users[$userId], $this->_params['encryption'], !empty($this->_params['show_encryption']));
 
         if ($hash != $this->_users[$userId]) {
-            throw new Horde_Exception('', Horde_Auth::REASON_BADLOGIN);
+            throw new Horde_Auth_Exception('', Horde_Auth::REASON_BADLOGIN);
         }
     }
 
@@ -125,7 +125,7 @@ class Horde_Auth_Http extends Horde_Auth_Base
      * authentication info present.
      *
      * @return boolean  Whether or not the client is allowed.
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     protected function _transparent()
     {
@@ -134,7 +134,7 @@ class Horde_Auth_Http extends Horde_Auth_Base
             return Horde_Auth::setAuth(Horde_Util::dispelMagicQuotes($_SERVER['PHP_AUTH_USER']), array('password' => Horde_Util::dispelMagicQuotes($_SERVER['PHP_AUTH_PW']), 'transparent' => 1));
         }
 
-        throw new Horde_Exception(_("HTTP Authentication not found."));
+        throw new Horde_Auth_Exception(_("HTTP Authentication not found."));
     }
 
 }
index 6391fb5..1852e2d 100644 (file)
@@ -19,7 +19,7 @@ class Horde_Auth_Http_Remote extends Horde_Auth_Base
      * @param string $userId       The userId to check.
      * @param array  $credentials  An array of login credentials.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     protected function _authenticate($userId, $credentials)
     {
@@ -39,7 +39,7 @@ class Horde_Auth_Http_Remote extends Horde_Auth_Base
         $request->sendRequest();
 
         if ($request->getResponseCode() != 200) {
-            throw new Horde_Exception('', Horde_Auth::REASON_BADLOGIN);
+            throw new Horde_Auth_Exception('', Horde_Auth::REASON_BADLOGIN);
         }
     }
 
index 6571e13..6769a6d 100644 (file)
@@ -71,7 +71,7 @@ class Horde_Auth_Imap extends Horde_Auth_Base
      * @param array $credentials  An array of login credentials. For IMAP,
      *                            this must contain a password entry.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     protected function _authenticate($userId, $credentials)
     {
@@ -80,7 +80,7 @@ class Horde_Auth_Imap extends Horde_Auth_Base
             $ob->login();
             $ob->logout();
         } catch (Horde_Imap_Client_Exception $e) {
-            throw new Horde_Exception('', Horde_Auth::REASON_BADLOGIN);
+            throw new Horde_Auth_Exception('', Horde_Auth::REASON_BADLOGIN);
         }
     }
 
@@ -90,7 +90,7 @@ class Horde_Auth_Imap extends Horde_Auth_Base
      * @param string $userId       The userId to add.
      * @param array  $credentials  The credentials to use.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function addUser($userId, $credentials)
     {
@@ -100,7 +100,7 @@ class Horde_Auth_Imap extends Horde_Auth_Base
             $ob->createMailbox($mailbox);
             $ob->setACL($mailbox, $this->_params['admin_user'], 'lrswipcda');
         } catch (Horde_Imap_Client_Exception $e) {
-            throw new Horde_Exception($e);
+            throw new Horde_Auth_Exception($e);
         }
     }
 
@@ -109,7 +109,7 @@ class Horde_Auth_Imap extends Horde_Auth_Base
      *
      * @param string $userId  The userId to delete.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function removeUser($userId)
     {
@@ -118,7 +118,7 @@ class Horde_Auth_Imap extends Horde_Auth_Base
             $ob->setACL($mailbox, $this->_params['admin_user'], 'lrswipcda');
             $ob->deleteMailbox(Horde_String::convertCharset($this->_params['userhierarchy'] . $userId, Horde_Nls::getCharset(), 'utf7-imap'));
         } catch (Horde_Imap_Client_Exception $e) {
-            throw new Horde_Exception($e);
+            throw new Horde_Auth_Exception($e);
         }
 
         Horde_Auth::removeUserData($userId);
@@ -128,7 +128,7 @@ class Horde_Auth_Imap extends Horde_Auth_Base
      * List all users in the system.
      *
      * @return array  The array of userIds.
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function listUsers()
     {
@@ -136,7 +136,7 @@ class Horde_Auth_Imap extends Horde_Auth_Base
             $ob->_getOb($this->_params['admin_user'], $this->_params['admin_password']);
             $list = $ob->listMailboxes($this->_params['userhierarchy'] . '%', Horde_Imap_Client::MBOX_ALL, array('flat' => true));
         } catch (Horde_Imap_Client_Exception $e) {
-            throw new Horde_Exception($e);
+            throw new Horde_Auth_Exception($e);
         }
 
         return empty($list)
index ee0d058..f008e82 100644 (file)
@@ -30,12 +30,12 @@ class Horde_Auth_imsp extends Horde_Auth_Base
 
         $imsp = Net_IMSP_Auth::singleton($this->_params['auth_method']);
         if ($imsp instanceof PEAR_Error) {
-            throw new Horde_Exception($imsp->getMessage());
+            throw new Horde_Auth_Exception($imsp->getMessage());
         }
 
         $result = $imsp->authenticate($this->_params, false);
         if ($result instanceof PEAR_Error) {
-            throw new Horde_Exception('', Horde_Auth::REASON_BADLOGIN);
+            throw new Horde_Auth_Exception('', Horde_Auth::REASON_BADLOGIN);
         }
     }
 
index 1e89f22..e4e46a1 100644 (file)
@@ -51,12 +51,12 @@ class Horde_Auth_Ipbasic extends Horde_Auth_Base
      * block.
      *
      * @return boolean  Whether or not the client is allowed.
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     protected function _transparent()
     {
         if (!isset($_SERVER['REMOTE_ADDR'])) {
-            throw new Horde_Exception(_("IP Address not avaialble."));
+            throw new Horde_Auth_Exception(_("IP Address not avaialble."));
         }
 
         $client = $_SERVER['REMOTE_ADDR'];
@@ -66,7 +66,7 @@ class Horde_Auth_Ipbasic extends Horde_Auth_Base
             }
         }
 
-        throw new Horde_Exception(_("IP Address not within allowed CIDR block."));
+        throw new Horde_Auth_Exception(_("IP Address not within allowed CIDR block."));
     }
 
     /**
index f96c925..34ee5df 100644 (file)
@@ -39,7 +39,7 @@ class Horde_Auth_Kolab extends Horde_Auth_Base
      * @param array $credentials  An array of login credentials. For Kolab,
      *                            this must contain a "password" entry.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     protected function _authenticate($userId, $credentials)
     {
@@ -51,13 +51,13 @@ class Horde_Auth_Kolab extends Horde_Auth_Base
             try {
                 $session = Horde_Kolab_Session::singleton($userId, $credentials, true);
             } catch (Horde_Kolab_Server_MissingObjectException $e) {
-                throw new Horde_Exception('', Horde_Auth::REASON_BADLOGIN);
+                throw new Horde_Auth_Exception('', Horde_Auth::REASON_BADLOGIN);
             } catch (Exception $e) {
                 Horde::logMessage($e, __FILE__, __LINE__, PEAR_LOG_ERR);
-                throw new Horde_Exception('', Horde_Auth::REASON_FAILED);
+                throw new Horde_Auth_Exception('', Horde_Auth::REASON_FAILED);
             }
         } else {
-            throw new Horde_Exception('The class Horde_Kolab_Session is required for the Kolab auth driver but it is missing!', Horde_Auth::REASON_MESSAGE);
+            throw new Horde_Auth_Exception('The class Horde_Kolab_Session is required for the Kolab auth driver but it is missing!', Horde_Auth::REASON_MESSAGE);
         }
 
         if (!isset($conf['auth']['params']) ||
@@ -113,10 +113,10 @@ class Horde_Auth_Kolab extends Horde_Auth_Base
                                     'history_list' => $new_history_list), true);
 
                 if ($count > $max_count) {
-                    throw new Horde_Exception(_("Too many invalid logins during the last minutes."));
+                    throw new Horde_Auth_Exception(_("Too many invalid logins during the last minutes."));
                 }
 
-                throw new Horde_Exception('', Horde_Auth::REASON_BADLOGIN);
+                throw new Horde_Auth_Exception('', Horde_Auth::REASON_BADLOGIN);
             }
         }
 
@@ -153,12 +153,12 @@ class Horde_Auth_Kolab extends Horde_Auth_Base
      * List Users
      *
      * @return array  List of Users
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function listUsers()
     {
         if (!class_exists('Horde_Kolab_Session')) {
-            throw new Horde_Exception('The Horde_Kolab_Session class is not available.');
+            throw new Horde_Auth_Exception('The Horde_Kolab_Session class is not available.');
         }
 
         $session = Horde_Kolab_Session::singleton();
@@ -180,12 +180,12 @@ class Horde_Auth_Kolab extends Horde_Auth_Base
      * @param string $userId      The userId to add.
      * @param array $credentials  The credentials to be set.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function addUser($userId, $credentials)
     {
         if (!class_exists('Horde_Kolab_Session')) {
-            throw new Horde_Exception('The Horde_Kolab_Session class is not available.');
+            throw new Horde_Auth_Exception('The Horde_Kolab_Session class is not available.');
         }
 
         $session = Horde_Kolab_Session::singleton();
@@ -201,7 +201,7 @@ class Horde_Auth_Kolab extends Horde_Auth_Base
         } else if ($result instanceof PEAR_Error) {
             return $result;
         } else {
-            throw new Horde_Exception(sprintf('The new Kolab object is a %s rather than a ' . KOLAB_OBJECT_USER, get_class($result)));
+            throw new Horde_Auth_Exception(sprintf('The new Kolab object is a %s rather than a ' . KOLAB_OBJECT_USER, get_class($result)));
         }
     }
 
index ebf7f72..e6602bd 100644 (file)
@@ -25,12 +25,12 @@ class Horde_Auth_Krb5 extends Horde_Auth_Base
      *
      * @param array $params  Not used.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function __construct($params = array())
     {
         if (!Horde_Util::extensionExists('krb5')) {
-            throw new Horde_Exception(_("Horde_Auth_Krb5: Required krb5 extension not found."));
+            throw new Horde_Auth_Exception(_("Horde_Auth_Krb5: Required krb5 extension not found."));
         }
 
         parent::__construct($params);
@@ -44,12 +44,12 @@ class Horde_Auth_Krb5 extends Horde_Auth_Base
      *                            For kerberos, this must contain a password
      *                            entry.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     protected function _authenticate($userId, $credentials)
     {
         if (empty($credentials['password'])) {
-            throw new Horde_Exception('', Horde_Auth::REASON_BADLOGIN);
+            throw new Horde_Auth_Exception('', Horde_Auth::REASON_BADLOGIN);
         }
 
         $result = krb5_login($userId, $credentials['password']);
@@ -59,13 +59,13 @@ class Horde_Auth_Krb5 extends Horde_Auth_Base
             return;
 
         case KRB5_BAD_PASSWORD:
-            throw new Horde_Exception(_("Bad kerberos password."));
+            throw new Horde_Auth_Exception(_("Bad kerberos password."));
 
         case KRB5_BAD_USER:
-            throw new Horde_Exception(_("Bad kerberos username."));
+            throw new Horde_Auth_Exception(_("Bad kerberos username."));
 
         default:
-            throw new Horde_Exception(_("Kerberos server rejected authentication."));
+            throw new Horde_Auth_Exception(_("Kerberos server rejected authentication."));
         }
     }
 
index c5dd4fb..c29fcdc 100644 (file)
@@ -57,12 +57,12 @@ class Horde_Auth_Ldap extends Horde_Auth_Base
      *
      * @param array $params  A hash containing connection parameters.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function __construct($params = array())
     {
         if (!Horde_Util::extensionExists('ldap')) {
-            throw new Horde_Exception(_("Horde_Auth_Ldap: Required LDAP extension not found."));
+            throw new Horde_Auth_Exception(_("Horde_Auth_Ldap: Required LDAP extension not found."));
         }
 
         /* Ensure we've been provided with all of the necessary parameters. */
@@ -76,14 +76,14 @@ class Horde_Auth_Ldap extends Horde_Auth_Base
     /**
      * Does an ldap connect and binds as the guest user or as the optional dn.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     protected function _connect()
     {
         /* Connect to the LDAP server. */
         $this->_ds = @ldap_connect($this->_params['hostspec']);
         if (!$this->_ds) {
-            throw new Horde_Exception(_("Failed to connect to LDAP server."));
+            throw new Horde_Auth_Exception(_("Failed to connect to LDAP server."));
         }
 
         if (isset($this->_params['version'])) {
@@ -125,7 +125,7 @@ class Horde_Auth_Ldap extends Horde_Auth_Base
             : @ldap_bind($this->_ds);
 
         if (!$bind) {
-            throw new Horde_Exception(_("Could not bind to LDAP server."));
+            throw new Horde_Auth_Exception(_("Could not bind to LDAP server."));
         }
     }
 
@@ -135,7 +135,7 @@ class Horde_Auth_Ldap extends Horde_Auth_Base
      * @param string $userId  The userId to find.
      *
      * @return string  The users full DN
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     protected function _findDN($userId)
     {
@@ -152,14 +152,14 @@ class Horde_Auth_Ldap extends Horde_Auth_Base
                          array($this->_params['uid']));
         if (!$search) {
             Horde::logMessage(ldap_error($this->_ds), __FILE__, __LINE__, PEAR_LOG_ERR);
-            throw new Horde_Exception(_("Could not search the LDAP server."));
+            throw new Horde_Auth_Exception(_("Could not search the LDAP server."));
         }
 
         $result = @ldap_get_entries($this->_ds, $search);
         if (is_array($result) && (count($result) > 1)) {
             $dn = $result[0]['dn'];
         } else {
-            throw new Horde_Exception(_("Empty result."));
+            throw new Horde_Auth_Exception(_("Empty result."));
         }
 
         return $dn;
@@ -263,7 +263,7 @@ class Horde_Auth_Ldap extends Horde_Auth_Base
      * @param string $userId       The userId to check.
      * @param array  $credentials  An array of login credentials.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     protected function _authenticate($userId, $credentials)
     {
@@ -277,7 +277,7 @@ class Horde_Auth_Ldap extends Horde_Auth_Base
         $bind = @ldap_bind($this->_ds, $dn, $credentials['password']);
         if ($bind == false) {
             @ldap_close($this->_ds);
-            throw new Horde_Exception('', Horde_Auth::REASON_FAILED);
+            throw new Horde_Auth_Exception('', Horde_Auth::REASON_FAILED);
         }
 
         if ($this->_params['password_expiration'] == 'yes') {
@@ -297,7 +297,7 @@ class Horde_Auth_Ldap extends Horde_Auth_Base
                 if ($toexpire == 0) {
                     $this->_authCredentials['changeRequested'] = true;
                 } elseif ($toexpire < 0) {
-                    throw new Horde_Exception('', Horde_Auth::REASON_EXPIRED);
+                    throw new Horde_Auth_Exception('', Horde_Auth::REASON_EXPIRED);
                 }
             }
         }
@@ -311,12 +311,12 @@ class Horde_Auth_Ldap extends Horde_Auth_Base
      * @param string $userId      The userId to add.
      * @param array $credentials  The credentials to be set.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function addUser($userId, $credentials)
     {
         if ($this->_params['ad']) {
-            throw new Horde_Exception(_("Horde_Auth_Ldap: Adding users is not supported for Active Directory"));
+            throw new Horde_Auth_Exception(_("Horde_Auth_Ldap: Adding users is not supported for Active Directory"));
         }
 
         /* Connect to the LDAP server. */
@@ -353,7 +353,7 @@ class Horde_Auth_Ldap extends Horde_Auth_Base
         $result = @ldap_add($this->_ds, $dn, $entry);
 
         if (!$result) {
-           throw new Horde_Exception(sprintf(_("Horde_Auth_Ldap: Unable to add user \"%s\". This is what the server said: "), $userId) . @ldap_error($this->_ds));
+           throw new Horde_Auth_Exception(sprintf(_("Horde_Auth_Ldap: Unable to add user \"%s\". This is what the server said: "), $userId) . @ldap_error($this->_ds));
         }
 
         @ldap_close($this->_ds);
@@ -364,12 +364,12 @@ class Horde_Auth_Ldap extends Horde_Auth_Base
      *
      * @param string $userId  The userId to add.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function removeUser($userId)
     {
         if ($this->_params['ad']) {
-           throw new Horde_Exception(_("Horde_Auth_Ldap: Removing users is not supported for Active Directory"));
+           throw new Horde_Auth_Exception(_("Horde_Auth_Ldap: Removing users is not supported for Active Directory"));
         }
 
         /* Connect to the LDAP server. */
@@ -385,7 +385,7 @@ class Horde_Auth_Ldap extends Horde_Auth_Base
 
         $result = @ldap_delete($this->_ds, $dn);
         if (!$result) {
-           throw new Horde_Exception(sprintf(_("Auth_ldap: Unable to remove user \"%s\""), $userId));
+           throw new Horde_Auth_Exception(sprintf(_("Auth_ldap: Unable to remove user \"%s\""), $userId));
         }
 
         @ldap_close($this->_ds);
@@ -400,12 +400,12 @@ class Horde_Auth_Ldap extends Horde_Auth_Base
      * @param string $newID       The new userId.
      * @param array $credentials  The new credentials
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function updateUser($oldID, $newID, $credentials)
     {
         if ($this->_params['ad']) {
-           throw new Horde_Exception(_("Horde_Auth_Ldap: Updating users is not supported for Active Directory."));
+           throw new Horde_Auth_Exception(_("Horde_Auth_Ldap: Updating users is not supported for Active Directory."));
         }
 
         /* Connect to the LDAP server. */
@@ -430,7 +430,7 @@ class Horde_Auth_Ldap extends Horde_Auth_Base
             if ($shadow['shadowlastchange'] &&
                 $shadow['shadowmin'] &&
                 ($shadow['shadowlastchange'] + $shadow['shadowmin'] > (time() / 86400))) {
-                throw new Horde_Exception(_("Minimum password age has not yet expired"));
+                throw new Horde_Auth_Exception(_("Minimum password age has not yet expired"));
             }
 
             /* Set the lastchange field */
@@ -490,7 +490,7 @@ class Horde_Auth_Ldap extends Horde_Auth_Base
         }
 
         if (!$result) {
-            throw new Horde_Exception(sprintf(_("Horde_Auth_Ldap: Unable to update user \"%s\""), $newID));
+            throw new Horde_Auth_Exception(sprintf(_("Horde_Auth_Ldap: Unable to update user \"%s\""), $newID));
         }
 
         @ldap_close($this->_ds);
@@ -500,7 +500,7 @@ class Horde_Auth_Ldap extends Horde_Auth_Base
      * List Users
      *
      * @return array  List of Users
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function listUsers()
     {
index 2549cc5..e02ddfb 100644 (file)
@@ -59,17 +59,17 @@ class Horde_Auth_Login extends Horde_Auth_Base
     protected function _authenticate($userId, $credentials)
     {
         if (empty($credentials['password'])) {
-            throw new Horde_Exception('', Horde_Auth::REASON_BADLOGIN);
+            throw new Horde_Auth_Exception('', Horde_Auth::REASON_BADLOGIN);
         }
 
         $proc = @popen($this->_location . ' -c /bin/true ' . $userId, 'w');
         if (!is_resource($proc)) {
-            throw new Horde_Exception('', Horde_Auth::REASON_FAILED);
+            throw new Horde_Auth_Exception('', Horde_Auth::REASON_FAILED);
         }
 
         fwrite($proc, $credentials['password']);
         if (@pclose($proc) !== 0) {
-            throw new Horde_Exception('', Horde_Auth::REASON_FAILED);
+            throw new Horde_Auth_Exception('', Horde_Auth::REASON_FAILED);
         }
     }
 
index f46a5ea..327af68 100644 (file)
@@ -22,12 +22,12 @@ class Horde_Auth_Msad extends Horde_Auth_Ldap
      *
      * @param array $params  A hash containing connection parameters.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function __construct($params = array())
     {
         if (!Horde_Util::extensionExists('ldap')) {
-            throw new Horde_Exception(_("Horde_Auth_Ldap: Required LDAP extension not found."));
+            throw new Horde_Auth_Exception(_("Horde_Auth_Ldap: Required LDAP extension not found."));
         }
 
         $params = array_merge(array(
@@ -69,7 +69,7 @@ class Horde_Auth_Msad extends Horde_Auth_Ldap
      * @param string $accountName  The user sAMAccountName to find.
      * @param array $credentials   The credentials to be set.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function addUser($accountName, $credentials)
     {
@@ -114,7 +114,7 @@ class Horde_Auth_Msad extends Horde_Auth_Ldap
         $success = @ldap_add($this->_ds, $dn, $entry);
 
         if (!$success) {
-           throw new Horde_Exception(sprintf(_("Auth_msad: Unable to add user \"%s\". This is what the server said: "), $accountName) . ldap_error($this->_ds));
+           throw new Horde_Auth_Exception(sprintf(_("Auth_msad: Unable to add user \"%s\". This is what the server said: "), $accountName) . ldap_error($this->_ds));
         }
 
         @ldap_close($this->_ds);
@@ -125,7 +125,7 @@ class Horde_Auth_Msad extends Horde_Auth_Ldap
      *
      * @param string $accountName  The user sAMAccountName to remove.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function removeUser($accountName)
     {
@@ -139,7 +139,7 @@ class Horde_Auth_Msad extends Horde_Auth_Ldap
             : $entry['dn'];
 
         if (!@ldap_delete($this->_ds, $dn)) {
-            throw new Horde_Exception(sprintf(_("Horde_Auth_Msad: Unable to remove user \"%s\""), $accountName));
+            throw new Horde_Auth_Exception(sprintf(_("Horde_Auth_Msad: Unable to remove user \"%s\""), $accountName));
         }
         @ldap_close($this->_ds);
 
@@ -154,7 +154,7 @@ class Horde_Auth_Msad extends Horde_Auth_Ldap
      * @param string $newID       The new userId.
      * @param array $credentials  The new credentials
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function updateUser($oldId, $newId, $credentials)
     {
@@ -186,7 +186,7 @@ class Horde_Auth_Msad extends Horde_Auth_Ldap
         }
 
         if (!$success) {
-            throw new Horde_Exception(sprintf(_("Horde_Auth_Msad: Unable to update user \"%s\""), $newID), __FILE__, __LINE__);
+            throw new Horde_Auth_Exception(sprintf(_("Horde_Auth_Msad: Unable to update user \"%s\""), $newID), __FILE__, __LINE__);
         }
 
         @ldap_close($this->_ds);
@@ -199,7 +199,7 @@ class Horde_Auth_Msad extends Horde_Auth_Ldap
      * @param string $user_id  The user id for which to reset the password.
      *
      * @return string  The new password on success.
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function resetPassword($user_id)
     {
@@ -212,7 +212,7 @@ class Horde_Auth_Msad extends Horde_Auth_Ldap
     /**
      * Does an ldap connect and binds as the guest user.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     protected function _connect()
     {
index 7dba7fd..f1d7ae9 100644 (file)
@@ -33,12 +33,12 @@ class Horde_Auth_Pam extends Horde_Auth_Base
      *
      * @param array $params  A hash containing connection parameters.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function __construct($params = array())
     {
         if (!Horde_Util::extensionExists('pam')) {
-            throw new Horde_Exception(_("PAM authentication is not available."));
+            throw new Horde_Auth_Exception(_("PAM authentication is not available."));
         }
 
         if (!empty($params['service'])) {
@@ -54,17 +54,17 @@ class Horde_Auth_Pam extends Horde_Auth_Base
      * @param string $userId      The userId to check.
      * @param array $credentials  An array of login credentials.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     protected function _authenticate($userId, $credentials)
     {
         if (empty($credentials['password'])) {
-            throw new Horde_Exception('', Horde_Auth::REASON_BADLOGIN);
+            throw new Horde_Auth_Exception('', Horde_Auth::REASON_BADLOGIN);
         }
 
         $error = null;
         if (!pam_auth($userId, $credentials['password'], $error)) {
-            throw new Horde_Exception($error);
+            throw new Horde_Auth_Exception($error);
         }
     }
 
index 34971a6..14dca9f 100644 (file)
@@ -149,7 +149,7 @@ class Horde_Auth_Passwd extends Horde_Auth_Base
     /**
      * Read and, if requested, lock the password file.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     protected function _read()
     {
@@ -158,7 +158,7 @@ class Horde_Auth_Passwd extends Horde_Auth_Base
         }
 
         if (empty($this->_params['filename'])) {
-            throw new Horde_Exception('No password file set.');
+            throw new Horde_Auth_Exception('No password file set.');
         }
 
         if ($this->_params['lock']) {
@@ -169,7 +169,7 @@ class Horde_Auth_Passwd extends Horde_Auth_Base
 
         $fp = fopen($this->_params['filename'], 'r');
         if (!$fp) {
-            throw new Horde_Exception("Couldn't open '" . $this->_params['filename'] . "'.");
+            throw new Horde_Auth_Exception("Couldn't open '" . $this->_params['filename'] . "'.");
         }
 
         $this->_users = array();
@@ -215,7 +215,7 @@ class Horde_Auth_Passwd extends Horde_Auth_Base
         if (!empty($this->_params['group_filename'])) {
             $fp = fopen($this->_params['group_filename'], 'r');
             if (!$fp) {
-                throw new Horde_Exception("Couldn't open '" . $this->_params['group_filename'] . "'.");
+                throw new Horde_Auth_Exception("Couldn't open '" . $this->_params['group_filename'] . "'.");
             }
 
             $this->_groups = array();
@@ -242,24 +242,24 @@ class Horde_Auth_Passwd extends Horde_Auth_Base
      * @param array $credentials  An array of login credentials. For MCAL,
      *                            this must contain a password entry.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     protected function _authenticate($userId, $credentials)
     {
         if (empty($credentials['password'])) {
-            throw new Horde_Exception('', Horde_Auth::REASON_BADLOGIN);
+            throw new Horde_Auth_Exception('', Horde_Auth::REASON_BADLOGIN);
         }
 
         try {
             $this->_read();
-        } catch (Horde_Exception $e) {
+        } catch (Horde_Auth_Exception $e) {
             Horde::logMessage($e, __FILE__, __LINE__, PEAR_LOG_ERR);
-            throw new Horde_Exception('', Horde_Auth::REASON_FAILED);
+            throw new Horde_Auth_Exception('', Horde_Auth::REASON_FAILED);
         }
 
         if (!isset($this->_users[$userId]) ||
             !$this->_comparePasswords($this->_users[$userId]['password'], $credentials['password'])) {
-            throw new Horde_Exception('', Horde_Auth::REASON_BADLOGIN);
+            throw new Horde_Auth_Exception('', Horde_Auth::REASON_BADLOGIN);
         }
 
         if (!empty($this->_params['required_groups'])) {
@@ -272,7 +272,7 @@ class Horde_Auth_Passwd extends Horde_Auth_Base
             }
 
             if (!$allowed) {
-                throw new Horde_Exception('', Horde_Auth::REASON_BADLOGIN);
+                throw new Horde_Auth_Exception('', Horde_Auth::REASON_BADLOGIN);
             }
         }
     }
@@ -281,7 +281,7 @@ class Horde_Auth_Passwd extends Horde_Auth_Base
      * List all users in the system.
      *
      * @return array  The array of userIds.
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function listUsers()
     {
@@ -306,18 +306,18 @@ class Horde_Auth_Passwd extends Horde_Auth_Base
      * @param string $userId      The userId to add.
      * @param array $credentials  The credentials to add.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function addUser($userId, $credentials)
     {
         $this->_read();
 
         if (!$this->_locked) {
-            throw new Horde_Exception('Password file not locked');
+            throw new Horde_Auth_Exception('Password file not locked');
         }
 
         if (isset($this->_users[$userId])) {
-            throw new Horde_Exception("Couldn't add user '$user', because the user already exists.");
+            throw new Horde_Auth_Exception("Couldn't add user '$user', because the user already exists.");
         }
 
         $this->_users[$userId] = array(
@@ -336,18 +336,18 @@ class Horde_Auth_Passwd extends Horde_Auth_Base
      * @param string $newID        The new userId.
      * @param array  $credentials  The new credentials
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function updateUser($oldID, $newID, $credentials)
     {
         $this->_read();
 
         if (!$this->_locked) {
-            throw new Horde_Exception('Password file not locked');
+            throw new Horde_Auth_Exception('Password file not locked');
         }
 
         if (!isset($this->_users[$userId])) {
-            throw new Horde_Exception("Couldn't modify user '$oldID', because the user doesn't exist.");
+            throw new Horde_Auth_Exception("Couldn't modify user '$oldID', because the user doesn't exist.");
         }
 
         $this->_users[$newID] = array(
@@ -366,7 +366,7 @@ class Horde_Auth_Passwd extends Horde_Auth_Base
      * @param string $userId  The user id for which to reset the password.
      *
      * @return string  The new password.
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function resetPassword($userId)
     {
@@ -381,18 +381,18 @@ class Horde_Auth_Passwd extends Horde_Auth_Base
      *
      * @param string $userId  The userId to delete.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function removeUser($userId)
     {
         $this->_read();
 
         if (!$this->_locked) {
-            throw new Horde_Exception('Password file not locked');
+            throw new Horde_Auth_Exception('Password file not locked');
         }
 
         if (!isset($this->_users[$userId])) {
-            throw new Horde_Exception("Couldn't delete user '$oldID', because the user doesn't exist.");
+            throw new Horde_Auth_Exception("Couldn't delete user '$oldID', because the user doesn't exist.");
         }
 
         unset($this->_users[$userId]);
index 6b3dd9a..5672a0b 100644 (file)
@@ -34,12 +34,12 @@ class Horde_Auth_Peclsasl extends Horde_Auth_Base
      *
      * @param array $params  A hash containing connection parameters.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function __construct($params = array())
     {
         if (!Horde_Util::extensionExists('sasl')) {
-            throw new Horde_Exception('Horde_Auth_Peclsasl:: requires the sasl PECL extension to be loaded.');
+            throw new Horde_Auth_Exception('Horde_Auth_Peclsasl:: requires the sasl PECL extension to be loaded.');
         }
 
         $params = array_merge(array(
@@ -58,21 +58,21 @@ class Horde_Auth_Peclsasl extends Horde_Auth_Base
      * @param string $userId      The userId to check.
      * @param array $credentials  An array of login credentials.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     protected function _authenticate($userId, $credentials)
     {
         if (empty($credentials['password'])) {
-            throw new Horde_Exception('', Horde_Auth::REASON_BADLOGIN);
+            throw new Horde_Auth_Exception('', Horde_Auth::REASON_BADLOGIN);
         }
 
         $conn = sasl_server_new($this->_params['service']);
         if (!is_resource($conn)) {
-            throw new Horde_Exception(_("Failed to create new SASL connection."));
+            throw new Horde_Auth_Exception(_("Failed to create new SASL connection."));
         }
 
         if (!sasl_checkpass($conn, $userId, $credentials['password'])) {
-            throw new Horde_Exception(sasl_errdetail($conn));
+            throw new Horde_Auth_Exception(sasl_errdetail($conn));
         }
     }
 
index 05b42fe..0cd8600 100644 (file)
@@ -62,29 +62,29 @@ class Horde_Auth_Radius extends Horde_Auth_Base
      *
      * @param array $params  A hash containing connection parameters.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function __construct($params = array())
     {
         parent::__construct($params);
 
         if (!Horde_Util::extensionExists('radius')) {
-            throw new Horde_Exception('Horde_Auth_Radius:: requires the radius PECL extension to be loaded.');
+            throw new Horde_Auth_Exception('Horde_Auth_Radius:: requires the radius PECL extension to be loaded.');
         }
 
         /* A RADIUS host is required. */
         if (empty($this->_params['host'])) {
-            throw new Horde_Exception('Horde_Auth_Radius:: requires a RADIUS host to connect to.');
+            throw new Horde_Auth_Exception('Horde_Auth_Radius:: requires a RADIUS host to connect to.');
         }
 
         /* A RADIUS secret string is required. */
         if (empty($this->_params['secret'])) {
-            throw new Horde_Exception('Horde_Auth_Radius:: requires a RADIUS secret string.');
+            throw new Horde_Auth_Exception('Horde_Auth_Radius:: requires a RADIUS secret string.');
         }
 
         /* A RADIUS authentication method is required. */
         if (empty($this->_params['method'])) {
-            throw new Horde_Exception('Horde_Auth_Radius:: requires a RADIUS authentication method.');
+            throw new Horde_Auth_Exception('Horde_Auth_Radius:: requires a RADIUS authentication method.');
         }
 
         /* RADIUS NAS Identifier. */
@@ -123,13 +123,13 @@ class Horde_Auth_Radius extends Horde_Auth_Base
      *                            For radius, this must contain a password
      *                            entry.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     protected function _authenticate($username, $credentials)
     {
         /* Password is required. */
         if (!isset($credentials['password'])) {
-            throw new Horde_Exception(_("Password required for RADIUS authentication."));
+            throw new Horde_Auth_Exception(_("Password required for RADIUS authentication."));
         }
 
         $res = radius_auth_open();
@@ -153,10 +153,10 @@ class Horde_Auth_Radius extends Horde_Auth_Base
             break;
 
         case RADIUS_ACCESS_REJECT:
-            throw new Horde_Exception(_("Authentication rejected by RADIUS server."));
+            throw new Horde_Auth_Exception(_("Authentication rejected by RADIUS server."));
 
         default:
-            throw new Horde_Exception(radius_strerror($res));
+            throw new Horde_Auth_Exception(radius_strerror($res));
         }
     }
 
index cd7ee21..8d0fffa 100644 (file)
@@ -63,12 +63,12 @@ class Horde_Auth_Shibboleth extends Horde_Auth_Base
      * configured header.
      *
      * @return boolean  Whether or not the client is allowed.
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     protected function _transparent()
     {
         if (empty($_SERVER[$this->_params['username_header']])) {
-            throw new Horde_Exception(_("Shibboleth authentication not available."));
+            throw new Horde_Auth_Exception(_("Shibboleth authentication not available."));
         }
 
         $username = $_SERVER[$this->_params['username_header']];
index 9abfd85..2910046 100644 (file)
@@ -40,12 +40,12 @@ class Horde_Auth_Smb extends Horde_Auth_Base
      *
      * @param array $params  A hash containing connection parameters.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function __construct($params = array())
     {
         if (!Horde_Util::extensionExists('smbauth')) {
-            throw new Horde_Exception(_("Horde_Auth_Smb: Required smbauth extension not found."));
+            throw new Horde_Auth_Exception(_("Horde_Auth_Smb: Required smbauth extension not found."));
         }
 
         /* Ensure we've been provided with all of the necessary parameters. */
@@ -62,12 +62,12 @@ class Horde_Auth_Smb extends Horde_Auth_Base
      * @param string $userId      The userId to check.
      * @param array $credentials  An array of login credentials.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function _authenticate($userId, $credentials)
     {
         if (empty($credentials['password'])) {
-            throw new Horde_Exception('', Horde_Auth::REASON_BADLOGIN);
+            throw new Horde_Auth_Exception('', Horde_Auth::REASON_BADLOGIN);
         }
 
         /* Authenticate. */
@@ -78,9 +78,9 @@ class Horde_Auth_Smb extends Horde_Auth_Base
                          $credentials['password']);
 
         if ($rval === 1) {
-            throw new Horde_Exception(_("Failed to connect to SMB server."));
+            throw new Horde_Auth_Exception(_("Failed to connect to SMB server."));
         } elseif ($rval !== 0) {
-            throw new Horde_Exception(err2str());
+            throw new Horde_Auth_Exception(err2str());
         }
     }
 
index c2e7201..24f6b21 100644 (file)
@@ -49,12 +49,12 @@ class Horde_Auth_Smbclient extends Horde_Auth_Base
      * @param string $userId      The userId to check.
      * @param array $credentials  An array of login credentials.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     protected function _authenticate($userId, $credentials)
     {
         if (empty($credentials['password'])) {
-            throw new Horde_Exception('', Horde_Auth::REASON_BADLOGIN);
+            throw new Horde_Auth_Exception('', Horde_Auth::REASON_BADLOGIN);
         }
 
         /* Authenticate. */
@@ -68,14 +68,14 @@ class Horde_Auth_Smbclient extends Horde_Auth_Base
 
         $sc = popen($cmdline, 'w');
         if ($sc === false) {
-            throw new Horde_Exception(_("Unable to execute smbclient."));
+            throw new Horde_Auth_Exception(_("Unable to execute smbclient."));
         }
 
         fwrite($sc, $credentials['password']);
         $rc = pclose($sc);
 
         if ((int)($rc & 0xff) != 0) {
-            throw new Horde_Exception('', Horde_Auth::REASON_BADLOGIN);
+            throw new Horde_Auth_Exception('', Horde_Auth::REASON_BADLOGIN);
         }
     }
 
index dda5f55..e2674e3 100644 (file)
@@ -111,15 +111,15 @@ class Horde_Auth_Sql extends Horde_Auth_Base
      * @param string $userId      The userId to check.
      * @param array $credentials  The credentials to use.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     protected function _authenticate($userId, $credentials)
     {
         try {
             $this->_connect();
-        } catch (Horde_Exception $e) {
+        } catch (Horde_Auth_Exception $e) {
             Horde::logMessage($e, __FILE__, __LINE__, PEAR_LOG_ERR);
-            throw new Horde_Exception('', Horde_Auth::REASON_FAILED);
+            throw new Horde_Auth_Exception('', Horde_Auth::REASON_FAILED);
         }
 
         /* Build the SQL query. */
@@ -133,26 +133,26 @@ class Horde_Auth_Sql extends Horde_Auth_Base
         $result = $this->_db->query($query, $values);
         if ($result instanceof PEAR_Error) {
             Horde::logMessage($result, __FILE__, __LINE__, PEAR_LOG_ERR);
-            throw new Horde_Exception('', Horde_Auth::REASON_FAILED);
+            throw new Horde_Auth_Exception('', Horde_Auth::REASON_FAILED);
         }
 
         $row = $result->fetchRow(DB_GETMODE_ASSOC);
         if (is_array($row)) {
             $result->free();
         } else {
-            throw new Horde_Exception('', Horde_Auth::REASON_BADLOGIN);
+            throw new Horde_Auth_Exception('', Horde_Auth::REASON_BADLOGIN);
         }
 
         if (!$this->_comparePasswords($row[$this->_params['password_field']],
                                       $credentials['password'])) {
-            throw new Horde_Exception('', Horde_Auth::REASON_BADLOGIN);
+            throw new Horde_Auth_Exception('', Horde_Auth::REASON_BADLOGIN);
         }
 
         $now = time();
         if (!empty($this->_params['hard_expiration_field']) &&
             !empty($row[$this->_params['hard_expiration_field']]) &&
             ($now > $row[$this->_params['hard_expiration_field']])) {
-            throw new Horde_Exception('', Horde_Auth::REASON_EXPIRED);
+            throw new Horde_Auth_Exception('', Horde_Auth::REASON_EXPIRED);
         }
 
         if (!empty($this->_params['soft_expiration_field']) &&
@@ -168,7 +168,7 @@ class Horde_Auth_Sql extends Horde_Auth_Base
      * @param string $userId      The userId to add.
      * @param array $credentials  The credentials to add.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function addUser($userId, $credentials)
     {
@@ -189,7 +189,7 @@ class Horde_Auth_Sql extends Horde_Auth_Base
 
         $result = $this->_write_db->query($query, $values);
         if ($result instanceof PEAR_Error) {
-            throw new Horde_Exception($result);
+            throw new Horde_Auth_Exception($result);
         }
     }
 
@@ -200,7 +200,7 @@ class Horde_Auth_Sql extends Horde_Auth_Base
      * @param string $newID       The new userId.
      * @param array $credentials  The new credentials
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function updateUser($oldID, $newID, $credentials)
     {
@@ -258,7 +258,7 @@ class Horde_Auth_Sql extends Horde_Auth_Base
         $result = $this->_write_db->query($query, $values);
         if ($result instanceof PEAR_Error) {
             Horde::logMessage($result, __FILE__, __LINE__, PEAR_LOG_ERR);
-            throw new Horde_Exception($result);
+            throw new Horde_Auth_Exception($result);
         }
     }
 
@@ -269,7 +269,7 @@ class Horde_Auth_Sql extends Horde_Auth_Base
      * @param string $userId  The user id for which to reset the password.
      *
      * @return string  The new password on success.
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function resetPassword($userId)
     {
@@ -293,7 +293,7 @@ class Horde_Auth_Sql extends Horde_Auth_Base
 
         $result = $this->_write_db->query($query, $values);
         if ($result instanceof PEAR_Error) {
-            throw new Horde_Exception($result);
+            throw new Horde_Auth_Exception($result);
         }
 
         return $password;
@@ -304,7 +304,7 @@ class Horde_Auth_Sql extends Horde_Auth_Base
      *
      * @param string $userId  The userId to delete.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function removeUser($userId)
     {
@@ -320,7 +320,7 @@ class Horde_Auth_Sql extends Horde_Auth_Base
 
         $result = $this->_write_db->query($query, $values);
         if ($result instanceof PEAR_Error) {
-            throw new Horde_Exception($result);
+            throw new Horde_Auth_Exception($result);
         }
 
         Horde_Auth::removeUserData($userId);
@@ -330,7 +330,7 @@ class Horde_Auth_Sql extends Horde_Auth_Base
      * List all users in the system.
      *
      * @return array  The array of userIds.
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     public function listUsers()
     {
@@ -345,7 +345,7 @@ class Horde_Auth_Sql extends Horde_Auth_Base
 
         $res = $this->_db->getCol($query);
         if ($res instanceof PEAR_Error) {
-            throw new Horde_Exception($res);
+            throw new Horde_Auth_Exception($res);
         }
 
         return $res;
@@ -394,7 +394,7 @@ class Horde_Auth_Sql extends Horde_Auth_Base
     /**
      * Attempts to open a connection to the SQL server.
      *
-     * @throws Horde_Exception
+     * @throws Horde_Auth_Exception
      */
     function _connect()
     {
@@ -442,7 +442,7 @@ class Horde_Auth_Sql extends Horde_Auth_Base
                                         array('persistent' => !empty($this->_params['persistent']),
                                               'ssl' => !empty($this->_params['ssl'])));
         if ($this->_write_db instanceof PEAR_Error) {
-            throw new Horde_Exception($this->_write_db);
+            throw new Horde_Auth_Exception($this->_write_db);
         }
 
         // Set DB portability options.
@@ -462,7 +462,7 @@ class Horde_Auth_Sql extends Horde_Auth_Base
                                       array('persistent' => !empty($params['persistent']),
                                             'ssl' => !empty($params['ssl'])));
             if ($this->_db instanceof PEAR_Error) {
-                throw new Horde_Exception($this->_db);
+                throw new Horde_Auth_Exception($this->_db);
             }
 
             switch ($this->_db->phptype) {
index ca8c026..eacb2c2 100644 (file)
@@ -51,6 +51,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
       <file name="Customsql.php" role="php" />
       <file name="Cyrsql.php" role="php" />
       <file name="Cyrus.php" role="php" />
+      <file name="Exception.php" role="php" />
       <file name="Ftp.php" role="php" />
       <file name="Http.php" role="php" />
       <file name="Imap.php" role="php" />
@@ -153,6 +154,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
    <install name="lib/Horde/Auth/Customsql.php" as="Horde/Auth/Customsql.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/Exception.php" as="Horde/Auth/Exception.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" />