Code

Added some array checks ...
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 21 Mar 2006 06:14:54 +0000 (06:14 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 21 Mar 2006 06:14:54 +0000 (06:14 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2863 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_opengw.inc

index f803002c113ea55d2d811ac086876abdfcd18486..44cc74d6768d9a9d3423419967bc5bfd5d52bffe 100755 (executable)
@@ -516,16 +516,19 @@ class ogw{
                          (SELECT company_id FROM team WHERE is_location_team=1));";
 
     $arr = array("company_assignment_id","company_id","sub_company_id","db_status");
-    foreach($this->info['TeamIDis'] as $TeamID){
-      $this->info['company_id']           = $TeamID;
-      $this->info['sub_company_id']       = $ist[0]['company_id'];
-      $this->info['company_assignment_id']= $this->ogo->gen_id();
-      foreach($arr as $attr){
-        $add_company_assignment[$attr]  = $this->info[$attr];
-      }    
-      $QUERY[] = gen_syntax($add_company_assignment,"company_assignment","ADD",false);
-    }
 
+    if(is_array($this->info['TeamIDis'])){
+      foreach($this->info['TeamIDis'] as $TeamID){
+        $this->info['company_id']           = $TeamID;
+        $this->info['sub_company_id']       = $ist[0]['company_id'];
+        $this->info['company_assignment_id']= $this->ogo->gen_id();
+        $add_company_assignment = array();
+        foreach($arr as $attr){
+          $add_company_assignment[$attr]  = $this->info[$attr];
+        }    
+        $QUERY[] = gen_syntax($add_company_assignment,"company_assignment","ADD",false);
+      }
+    }
     $remove_all = false;
 
     foreach($QUERY as $q ){