From: hickert Date: Wed, 10 Aug 2005 09:39:18 +0000 (+0000) Subject: Fixed undefined index error, if last users leaves the queue X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ec5265fba603d01c681219d188f7c090c4d605ce;p=gosa.git Fixed undefined index error, if last users leaves the queue git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1098 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/ogroups/class_phonequeue.inc b/plugins/admin/ogroups/class_phonequeue.inc index 37e716138..90480d9a5 100644 --- a/plugins/admin/ogroups/class_phonequeue.inc +++ b/plugins/admin/ogroups/class_phonequeue.inc @@ -161,6 +161,7 @@ class phonequeue extends plugin function check() { $message= array(); + if(!$this->is_account) return($message); if($this->is_number_used()){ $message[] = $this->is_number_used(); @@ -249,6 +250,7 @@ class phonequeue extends plugin /* Append new Member for this queue */ $i = 0; + $queueuser =array(); foreach($this->parent->by_object['ogroup']->memberList as $member){ if(in_array("goFonAccount",$member['objectClass'])){ $i ++ ; @@ -259,17 +261,19 @@ class phonequeue extends plugin } /* Parse and Add members to query Array */ - foreach($queueuser as $user){ - $entries = ""; - $values = ""; - foreach($user as $attr => $val){ - $entries.= "`".$attr."`,"; - $values .= "'".$val."',"; + if(is_array($queueuser)){ + foreach($queueuser as $user){ + $entries = ""; + $values = ""; + foreach($user as $attr => $val){ + $entries.= "`".$attr."`,"; + $values .= "'".$val."',"; + } + $values = preg_replace("/,$/","",$values); + $entries = preg_replace("/,$/","",$entries ); + + $SQL[]="INSERT INTO ".$a_SETUP['QUEUE_MEMBER_TABLE']." (".$entries.") VALUES (".$values.")"; } - $values = preg_replace("/,$/","",$values); - $entries = preg_replace("/,$/","",$entries ); - - $SQL[]="INSERT INTO ".$a_SETUP['QUEUE_MEMBER_TABLE']." (".$entries.") VALUES (".$values.")"; } @@ -456,6 +460,7 @@ class phonequeue extends plugin function save() { + if(!$this->is_account) return; $ldap= $this->config->get_ldap_link(); plugin::save();