Horde_Exception conversions.
authorMichael M Slusarz <slusarz@curecanti.org>
Mon, 13 Jul 2009 20:05:48 +0000 (20:05 +0000)
committerBen Klang <ben@alkaloid.net>
Sun, 10 Jan 2010 04:05:30 +0000 (23:05 -0500)
lib/base.php

index 4a689f7..17ab6b5 100644 (file)
@@ -2,7 +2,7 @@
 /**
  * Operator base application file.
  *
- * $Horde: incubator/operator/lib/base.php,v 1.7 2009/07/09 06:08:45 slusarz Exp $
+ * $Horde: incubator/operator/lib/base.php,v 1.8 2009/07/13 20:05:48 slusarz Exp $
  *
  * This file brings in all of the dependencies that every Operator script will
  * need, and sets up objects that all scripts use.
@@ -23,11 +23,13 @@ require_once HORDE_BASE . '/lib/core.php';
 
 // Registry.
 $registry = Horde_Registry::singleton();
-if (is_a(($pushed = $registry->pushApp('operator', !defined('AUTH_HANDLER'))), 'PEAR_Error')) {
-    if ($pushed->getCode() == 'permission_denied') {
+try {
+    $registry->pushApp('operator', !defined('AUTH_HANDLER'));
+} catch (Horde_Exception $e) {
+    if ($e->getCode() == 'permission_denied') {
         Horde::authenticationFailureRedirect();
     }
-    Horde::fatal($pushed, __FILE__, __LINE__, false);
+    Horde::fatal($e, __FILE__, __LINE__, false);
 }
 $conf = &$GLOBALS['conf'];
 @define('OPERATOR_TEMPLATES', $registry->get('templates'));