summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5622f49)
raw | patch | inline | side by side (parent: 5622f49)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 4 Mar 2008 06:40:41 +0000 (06:40 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 4 Mar 2008 06:40:41 +0000 (06:40 +0000) |
-To support sending multiple attributes, like <name>1</name><name>2</name>
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9271 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9271 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/class_gosaSupportDaemon.inc | patch | blob | history |
diff --git a/gosa-core/include/class_gosaSupportDaemon.inc b/gosa-core/include/class_gosaSupportDaemon.inc
index 57622814380b1bb7c070f9f5176e603c96f541d7..96dc1efc358c0d609c21df6a9a708158e1b8fbaa 100644 (file)
@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)){
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."</".strtolower($name).">\n";
+ foreach($data as $key => $value){
+ if(is_array($value)){
+ foreach($value as $sub_value){
+ $attr.= "<$key>".strtolower($sub_value)."</$key>\n";
+ }
+ }else{
+ $attr.= "<$key>".strtolower($value)."</$key>\n";
+ }
}
+
$xml_msg = "<xml>
<header>gosa_update_status_jobdb_entry</header>
<target>GOSA</target>
</xml>";
if($this->connect()){
+
$this->o_sock->write($xml_msg);
$str = trim($this->o_sock->read());
$entries = $this->xml_to_array($str);
/* Prepare data */
foreach ($data as $key => $value){
- $xml_message.= "<$key>$value</$key>";
+ if(is_array($value)){
+ foreach($value as $sub_val){
+ $xml_message.= "<$key>$sub_value</$key>";
+ }
+ }else{
+ $xml_message.= "<$key>$value</$key>";
+ }
}
/* Multiple targets? */
/* Prepare data */
foreach ($data as $key => $value){
- $xml_message.= "<$key>$value</$key>";
+ if(is_array($value)){
+ foreach($value as $sub_val){
+ $xml_message.= "<$key>$sub_value</$key>";
+ }
+ }else{
+ $xml_message.= "<$key>$value</$key>";
+ }
}
/* Multiple targets? */