From 33aa61c51cd104089a9a993949c61a2324aa88aa Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 25 Mar 2008 07:26:45 +0000 Subject: [PATCH] Updated gosaSupportDaemon. -Added better error message, if daemon connect string (gosa_si="server:port..") is missing. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9965 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_gosaSupportDaemon.inc | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/gosa-core/include/class_gosaSupportDaemon.inc b/gosa-core/include/class_gosaSupportDaemon.inc index ede15bc36..9850be249 100644 --- a/gosa-core/include/class_gosaSupportDaemon.inc +++ b/gosa-core/include/class_gosaSupportDaemon.inc @@ -68,14 +68,18 @@ class gosaSupportDaemon */ public function connect() { - $this->o_sock = new Socket_Client($this->s_host,$this->i_port,TRUE,$this->f_timeout); - if($this->o_sock->connected()){ - $this->o_sock->setEncryptionKey($this->s_encryption_key); - $this->is_connected = TRUE; + if(!empty($this->s_host) && !empty($this->i_port)){ + $this->o_sock = new Socket_Client($this->s_host,$this->i_port,TRUE,$this->f_timeout); + if($this->o_sock->connected()){ + $this->o_sock->setEncryptionKey($this->s_encryption_key); + $this->is_connected = TRUE; + }else{ + $this->set_error($this->o_sock->get_error()); + $this->disconnect(); + new log("debug","gosaSupportDaemon::connect()", "Could not connect to server.", array(),$this->get_error()); + } }else{ - $this->set_error($this->o_sock->get_error()); - $this->disconnect(); - new log("debug","gosaSupportDaemon::connect()", "Could not connect to server.", array(),$this->get_error()); + $this->set_error(msgPool::cmdnotfound("GOSA_SI",_("GOsa support daemon"))); } return($this->is_connected); } -- 2.30.2