From: hickert Date: Tue, 21 Mar 2006 06:14:54 +0000 (+0000) Subject: Added some array checks ... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f7a7286b3421498f276b3c36789edd37602dbae3;p=gosa.git Added some array checks ... git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2863 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/include/class_opengw.inc b/include/class_opengw.inc index f803002c1..44cc74d67 100755 --- a/include/class_opengw.inc +++ b/include/class_opengw.inc @@ -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 ){