From ec5265fba603d01c681219d188f7c090c4d605ce Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 10 Aug 2005 09:39:18 +0000 Subject: [PATCH] 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 --- plugins/admin/ogroups/class_phonequeue.inc | 25 +++++++++++++--------- 1 file changed, 15 insertions(+), 10 deletions(-) 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(); -- 2.30.2