From d44500f96ad0cecab59209276e158622202d1c8c Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 18 Mar 2008 14:55:23 +0000 Subject: [PATCH] Updated gosaSupportDaemon -Added FAI server/release functions. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9926 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_gosaSupportDaemon.inc | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/gosa-core/include/class_gosaSupportDaemon.inc b/gosa-core/include/class_gosaSupportDaemon.inc index bbb417f79..dcfe2dd44 100644 --- a/gosa-core/include/class_gosaSupportDaemon.inc +++ b/gosa-core/include/class_gosaSupportDaemon.inc @@ -41,7 +41,7 @@ class gosaSupportDaemon @param boolean Connect Directly connect to daemon socket. @param float Timeout The timelimit for all socket actions. */ - public function __construct($connect=TRUE,$timeout=2) + public function __construct($connect=TRUE,$timeout=10) { #FIXME: bad idea about referencing global variables from within classes global $config; @@ -146,13 +146,17 @@ class gosaSupportDaemon if(isset($entries['XML'])){ if(isset($entries['XML']['ERROR_STRING'])) { $this->set_error($entries['XML']['ERROR_STRING']); - new log("debug","DaemonEvent (IDS) ", "gosaSupportDaemon::update_entries()", $ids,"FAILED setting (".$attr.") error was ".$this->get_error()); + new log("debug","GOsa-si", + get_class($this)."::".__FUNCTION__, array(), + "FAILED error was ".$this->get_error()); return($ret); } /* Unset header tags */ - foreach(array("HEADER","SOURCE","TARGET") as $type){ - unset($entries['XML'][$type]); + foreach(array("HEADER","SOURCE","TARGET","SESSION_ID") as $type){ + if(isset($entries['XML'][$type])){ + unset($entries['XML'][$type]); + } } $ret = $entries['XML']; } @@ -162,32 +166,32 @@ class gosaSupportDaemon } - public function FAI_get_classes($name = "") + public function FAI_get_classes($name) { $this->reset_error(); - - $xml_msg = "
gosa_query_fai_release
GOSAsigaGOSA
"; - $xml_msg = "
gosa_query_fai_release
GOSAGOSAsiga
"; - $xml_msg = "
gosa_query_fai_release
GOSAGOSA
"; + $xml_msg = "
gosa_query_fai_release
GOSAGOSA".$name."
";; $ret = array(); if($this->connect()){ $this->o_sock->write($xml_msg); $str = trim($this->o_sock->read()); $entries = $this->xml_to_array($str); - print_a($entries); if(isset($entries['XML']) && is_array($entries['XML'])){ /* Check if returned values represent a valid answer */ if(isset($entries['XML'])){ if(isset($entries['XML']['ERROR_STRING'])) { $this->set_error($entries['XML']['ERROR_STRING']); - new log("debug","DaemonEvent (IDS) ", "gosaSupportDaemon::update_entries()", $ids,"FAILED setting (".$attr.") error was ".$this->get_error()); + new log("debug","GOsa-si", + get_class($this)."::".__FUNCTION__, array($name), + "FAILED error was ".$this->get_error()); return($ret); } /* Unset header tags */ - foreach(array("HEADER","SOURCE","TARGET") as $type){ - unset($entries['XML'][$type]); + foreach(array("HEADER","SOURCE","TARGET","SESSION_ID") as $type){ + if(isset($entries['XML'][$type])){ + unset($entries['XML'][$type]); + } } $ret = $entries['XML']; } -- 2.30.2