Various bugfixes
authorBen Klang <ben@alkaloid.net>
Sat, 15 Jul 2006 22:39:14 +0000 (22:39 +0000)
committerBen Klang <ben@alkaloid.net>
Sat, 15 Jul 2006 22:39:14 +0000 (22:39 +0000)
git-svn-id: https://svn.alkaloid.net/gpl/shout/trunk@369 06cd67b6-e706-0410-b29e-9de616bca6e9

config/conf.xml
index.php
lib/Driver.php
lib/Driver/ldap.php

index 10c100b..9162f71 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <!-- $Id$ -->
 <configuration>
-<!--   <configtab name="storage" desc="Storage Backend"> -->
+  <configtab name="storage" desc="Storage Backend">
     <configsection name="storage">
       <configheader>Shout Storage</configheader>
       <configswitch name="driver" desc="What backend should we use for
@@ -37,6 +37,6 @@
         </case>
       </configswitch>
     </configsection>
-<!--   </configtab> -->
+  </configtab>
 </configuration>
 
index d4f94e5..c3c668c 100644 (file)
--- a/index.php
+++ b/index.php
@@ -32,6 +32,10 @@ if (is_a($contexts, 'PEAR_Error')) {
 } elseif (!$context) {
     # Attempt to locate the user's "home" context
     $context = $shout->getHomeContext();
+    if (is_a($context, 'PEAR_Error')) {
+        $notification->push($context);
+    }
+    $context = '';
 }
 
 $vars = &Variables::getDefaultVariables();
@@ -57,4 +61,4 @@ require SHOUT_BASE . "/$section.php";
 #print '<div style="width:95%;left:10px;position:relative">';
 
 #print '</div>';
-require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
+require $registry->get('templates', 'horde') . '/common-footer.inc';
index 0d86a22..841b41b 100644 (file)
@@ -163,7 +163,8 @@ class Shout_Driver {
         require_once dirname(__FILE__) . '/Driver/' . $driver . '.php';
         $class = 'Shout_Driver_' . $driver;
         if (class_exists($class)) {
-            return $shout = &new $class($params);
+            $shout = new $class($params);
+            return $shout;
         } else {
             return false;
         }
@@ -214,4 +215,4 @@ class Shout_Driver {
         return $instances[$signature];
     }
 }
-// }}}
\ No newline at end of file
+// }}}
index 5bcba9e..0bcabc8 100644 (file)
@@ -367,11 +367,12 @@ type");
         # FIXME: Handle cases where the managing user isn't a valid telephone
         # system user
         # FIXME: Handle cases where no attribute is found?
+        if ($res['count'] != 1) {
+            return PEAR::raiseError(_("Unable to determine default context"));
+        }
         return $res[0]['context'][0];
     }
-    // }}}
 
-    // {{{
     /**
      * Get a context's properties
      *