From: hickert Date: Tue, 4 Mar 2008 06:40:41 +0000 (+0000) Subject: Updated gosaDaemon X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ebe8e21f6712e37cfe5470876b046eedda66a22e;p=gosa.git Updated gosaDaemon -To support sending multiple attributes, like 12 git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9271 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/class_gosaSupportDaemon.inc b/gosa-core/include/class_gosaSupportDaemon.inc index 576228143..96dc1efc3 100644 --- a/gosa-core/include/class_gosaSupportDaemon.inc +++ b/gosa-core/include/class_gosaSupportDaemon.inc @@ -481,7 +481,7 @@ $xml_msg.= " @param Array The variables to update. @return Boolean Returns TRUE on success. */ - public function update_entries($ids,$entry) + public function update_entries($ids,$data) { $this->reset_error(); if(!is_array($ids)){ @@ -489,15 +489,22 @@ $xml_msg.= " return; } - if(!is_array($entry)){ + if(!is_array($data)){ trigger_error("Requires an array as second parameter."); return; } $attr = ""; - foreach($entry as $name => $entry){ - $attr.="<".strtolower($name).">".$entry."\n"; + foreach($data as $key => $value){ + if(is_array($value)){ + foreach($value as $sub_value){ + $attr.= "<$key>".strtolower($sub_value)."\n"; + } + }else{ + $attr.= "<$key>".strtolower($value)."\n"; + } } + $xml_msg = "
gosa_update_status_jobdb_entry
GOSA @@ -519,6 +526,7 @@ $xml_msg.= "
"; if($this->connect()){ + $this->o_sock->write($xml_msg); $str = trim($this->o_sock->read()); $entries = $this->xml_to_array($str); @@ -559,7 +567,13 @@ $xml_msg.= " /* Prepare data */ foreach ($data as $key => $value){ - $xml_message.= "<$key>$value"; + if(is_array($value)){ + foreach($value as $sub_val){ + $xml_message.= "<$key>$sub_value"; + } + }else{ + $xml_message.= "<$key>$value"; + } } /* Multiple targets? */ @@ -665,7 +679,13 @@ $xml_msg.= " /* Prepare data */ foreach ($data as $key => $value){ - $xml_message.= "<$key>$value"; + if(is_array($value)){ + foreach($value as $sub_val){ + $xml_message.= "<$key>$sub_value"; + } + }else{ + $xml_message.= "<$key>$value"; + } } /* Multiple targets? */