Code

Updated gosaSupportDaemon.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 25 Mar 2008 07:26:45 +0000 (07:26 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 25 Mar 2008 07:26:45 +0000 (07:26 +0000)
-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

index ede15bc3671a273d7633e737902cbcfbae29ae5a..9850be249085bfbe7e6229c44f012277a0f5f442 100644 (file)
@@ -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);
   }