Code

Added check for goFonServer
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 14 Sep 2005 08:49:02 +0000 (08:49 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 14 Sep 2005 08:49:02 +0000 (08:49 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1359 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/ogroups/class_phonequeue.inc
plugins/admin/ogroups/tabs_ogroups.inc
plugins/gofon/macro/class_gofonMacro.inc

index 058cddade033c248d50af03d5d406aaf4aedeaf7..9cefb8574b3283e19ce12fcb5ffbb70706ebe028 100644 (file)
@@ -104,6 +104,8 @@ class phonequeue extends plugin
       $this->is_account= !$this->is_account;
     }
 
+    unset($_SESSION['config']->data['SERVERS']['FON']);
+
     /* Show tab dialog headers */
     if ($this->parent != NULL){
       if ($this->is_account){
@@ -219,7 +221,12 @@ class phonequeue extends plugin
   {
 
     $SQL = array();
+
+    if(!isset($_SESSION['config']->data['SERVERS']['FON'])){
+      return(_("There is currently no asterisk server defined. Possibly you are missing a server that handles the asterisk management (goFonServer). \n  Your Settings can't be saved to asterisk Database. "));
+      return(false);
+    }
+
     // Get Configuration for Mysql database Server
     $a_SETUP = $_SESSION['config']->data['SERVERS']['FON'];
     $s_parameter  ="";
index 02593ea36d102044c33194248095011d75e9da6f..28718e287df44087423be6231d7c7df9ac75e91c 100644 (file)
@@ -22,15 +22,17 @@ class ogrouptabs extends tabs
 
           break;
 
-        case "U":
-          /* Append a PhoneQueue, if objectClass = goFonAccount */
-          $use = false;
+          case "U":
+            /* Append a PhoneQueue, if objectClass = goFonAccount */
+            $use = false;
           foreach($this->by_object['ogroup']->memberList as $dn => $val){
-            if(in_array("goFonAccount",$val['objectClass'])){
-              $use = true; 
+            if(isset($val['objectClass'])){
+              if(in_array("goFonAccount",$val['objectClass'])){
+                $use = true; 
+              }
             }
           }
-    
+
           /* We found goFonAccount in users objectClasses*/
           if($use){
             require_once("class_phonequeue.inc");
index 2a809a9ec44ce09863d5459ead86d5e48b9eca03..ffc4076a26166e8eacf82840e290ae3fb0ac0259 100755 (executable)
@@ -16,7 +16,6 @@ class macro extends plugin
   /*! CLI vars */
   var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser");
 
-
   /*! Macro attributes,  */
   var $generate_error= "";