From: hickert Date: Tue, 19 Feb 2008 08:03:00 +0000 (+0000) Subject: Udpated GOsa support daemon X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=5dc9cfae9dff24285d1171262daf85e0d7139b4a;p=gosa.git Udpated GOsa support daemon git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8944 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/class_gosaSupportDaemon.inc b/gosa-core/include/class_gosaSupportDaemon.inc index 7dc12f1d2..b712d7614 100644 --- a/gosa-core/include/class_gosaSupportDaemon.inc +++ b/gosa-core/include/class_gosaSupportDaemon.inc @@ -167,7 +167,16 @@ class gosaSupportDaemon $str = trim($this->o_sock->read()); $entries = $this->xml_to_array($str); if(isset($entries['XML']) && is_array($entries['XML'])){ - $ret = $entries; + + /* Check if returned values represent a valid answer */ + if($entries['XML']['HEADER'] == "answer"){ + + /* Unset header tags */ + foreach(array("HEADER","SOURCE","TARGET") as $type){ + unset($entries['XML'][$type]); + } + $ret = $entries; + } } } @@ -211,7 +220,9 @@ class gosaSupportDaemon $entries = $this->xml_to_array($str); if(isset($entries['XML']) && is_array($entries['XML'])){ foreach($entries['XML'] as $entry){ - $ret[] = $entry['ID']; + if(isset($entry['ID'])){ + $ret[] = $entry['ID']; + } } } } @@ -244,7 +255,6 @@ class gosaSupportDaemon eq ".$id." "; - $ret[$id] = FALSE; } $xml_msg .= " @@ -255,7 +265,11 @@ class gosaSupportDaemon $str = trim($this->o_sock->read()); $entries = $this->xml_to_array($str); if(isset($entries['XML'])){ - $ret = $entries['XML']; + foreach($entries['XML'] as $name => $entry){ + if(preg_match("/^ANSWER[0-9]*$/",$name)){ + $ret[$name] = $entry; + } + } } } return($ret); @@ -291,7 +305,9 @@ class gosaSupportDaemon $this->o_sock->write($xml_msg); $str = trim($this->o_sock->read()); $entries = $this->xml_to_array($str); - if(isset($entries['XML']['ANSWER1'])){ + if( isset($entries['XML']['HEADER']) && + $entries['XML']['HEADER']=="answer" && + isset($entries['XML']['ANSWER1'])){ return(TRUE); } } @@ -328,7 +344,9 @@ class gosaSupportDaemon $this->o_sock->write($xml_msg); $str = trim($this->o_sock->read()); $entries = $this->xml_to_array($str); - if(isset($entries['XML']['ANSWER1'])){ + if( isset($entries['XML']['HEADER']) && + $entries['XML']['HEADER']=="answer" && + isset($entries['XML']['ANSWER1'])){ $ret = $entries['XML']['ANSWER1']; } }