From f9d2ad4946337575b985410ad0c6c289b611f31c Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 22 Jan 2008 08:28:46 +0000 Subject: [PATCH] Updated gosaServerDeamon -Empty queue will no longer be interpreted as error. - git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8531 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_gosaSupportDaemon.inc | 16 +++++++++++----- gosa-core/include/class_socketClient.inc | 2 +- .../addons/gotomasses/class_gotomasses.inc | 10 ++++++---- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/gosa-core/include/class_gosaSupportDaemon.inc b/gosa-core/include/class_gosaSupportDaemon.inc index 6d29cc6d1..2eba2f8eb 100644 --- a/gosa-core/include/class_gosaSupportDaemon.inc +++ b/gosa-core/include/class_gosaSupportDaemon.inc @@ -39,10 +39,11 @@ class gosaSupportDaemon public function connect() { $this->o_sock = new Socket_Client($this->s_host,$this->i_port,TRUE,$this->f_timeout); - $this->o_sock->setEncryptionKey($this->s_encryption_key); if($this->o_sock->connected()){ + $this->o_sock->setEncryptionKey($this->s_encryption_key); $this->is_connected = TRUE; }else{ + $this->error = $this->o_sock->get_error(); $this->is_connected = FALSE; } } @@ -99,12 +100,17 @@ class gosaSupportDaemon $this->o_sock->write($xml_msg); $str = trim($this->o_sock->read()); $entries = $this->xml_to_array($str); - if(!isset($entries['XML'])){ - $this->set_error("Couldn't parse xml."); + + if(!array_key_exists("XML",$entries)){ + $this->set_error("!!!Couldn't parse xml."); $this->disconnect(); return; }else{ - $ret = array_values($entries['XML']); + if(!is_array($entries['XML'])) { + $ret = array(); + }else{ + $ret = $entries['XML']; + } } return($ret); } @@ -244,7 +250,7 @@ class gosaSupportDaemon $start_level++; } $php_stmt .= '[$xml_elem[\'tag\']] = $xml_elem[\'value\'];'; - eval($php_stmt); + @eval($php_stmt); } } } diff --git a/gosa-core/include/class_socketClient.inc b/gosa-core/include/class_socketClient.inc index 008308e75..685711211 100644 --- a/gosa-core/include/class_socketClient.inc +++ b/gosa-core/include/class_socketClient.inc @@ -172,7 +172,7 @@ class Socket_Client } /* Terminate decryption handle and close module */ - mcrypt_generic_deinit($this->td); + @mcrypt_generic_deinit($this->td); } } ?> diff --git a/gosa-core/plugins/addons/gotomasses/class_gotomasses.inc b/gosa-core/plugins/addons/gotomasses/class_gotomasses.inc index 2df2bd6b1..3f85caf56 100644 --- a/gosa-core/plugins/addons/gotomasses/class_gotomasses.inc +++ b/gosa-core/plugins/addons/gotomasses/class_gotomasses.inc @@ -24,7 +24,7 @@ class gotomasses extends plugin /* Include config object */ $this->config= &$config; $this->divlist = new divListMasses($this->config,$this); - $this->o_queue = new gosaSupportDaemon("10.3.67.111","20081","secret-gosa-password",TRUE,0.2); + $this->o_queue = new gosaSupportDaemon("10.3.67.111","20081","secret-gosa-password",TRUE,2); } @@ -38,7 +38,7 @@ class gotomasses extends plugin $s_entry = $s_action = ""; $arr = array( - "/^stop_/" => "stop", + "/^stop/" => "stop", "/^stop_all/" => "stop_all", "/^start/" => "start", "/^start_all/" => "start_all", @@ -58,6 +58,8 @@ class gotomasses extends plugin } } + #print_a(array($s_entry,$s_action));; + /* Edit posted from list link */ if(isset($_GET['act']) && $_GET['act'] == "edit" && isset($_GET['id']) && isset($this->tasks[$_GET['id']])){ $s_action = "edit"; @@ -205,7 +207,7 @@ class gotomasses extends plugin ************/ $this->divlist->execute(); - $entries = $this->get_queue_entries(); + $entries = $this->get_queued_entries(); $this->divlist->SetEntries($entries); return($this->divlist->Draw()); } @@ -254,7 +256,7 @@ class gotomasses extends plugin /*! \brief Request list of queued jobs. * @return Returns an array of all queued jobs. */ - function get_queue_entries() + function get_queued_entries() { $entries = $this->o_queue->get_queued_entries(); -- 2.30.2