From: hickert Date: Tue, 25 Mar 2008 07:26:45 +0000 (+0000) Subject: Updated gosaSupportDaemon. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=33aa61c51cd104089a9a993949c61a2324aa88aa;p=gosa.git 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 --- 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); }