Code

Store currently selcted base in session
[gosa.git] / gosa-core / include / class_gosaSupportDaemon.inc
index 1f0ace96d53023ff967279645cc5fa577357232e..44d05cfe0d0e0e9628474e76c7c2b1a4cf4614d0 100644 (file)
@@ -46,13 +46,18 @@ class gosaSupportDaemon
     #FIXME: bad idea about referencing global variables from within classes
     global $config;
 
+    /* This should only be the case if we call this from setup.
+        __autoload() 
+     */
+    if(!is_object($config)) { return; }
+
     # load from config, store statically
-    if (isset($config->current['GOSA_SI'])){
+    if ($config->get_cfg_value("gosa_si") != ""){
 
       if ($this->s_host == ""){
-        $this->s_host= preg_replace("/^.*@([^:]+):.*$/", "$1", $config->current['GOSA_SI']);
-        $this->i_port= preg_replace("/^.*@[^:]+:(.*)$/", "$1", $config->current['GOSA_SI']);
-        $this->s_encryption_key = preg_replace("/^(.*)@[^:]+:.*$/", "$1", $config->current['GOSA_SI']);
+        $this->s_host= preg_replace("/^.*@([^:]+):.*$/", "$1", $config->get_cfg_value("gosa_si"));
+        $this->i_port= preg_replace("/^.*@[^:]+:(.*)$/", "$1", $config->get_cfg_value("gosa_si"));
+        $this->s_encryption_key = preg_replace("/^(.*)@[^:]+:.*$/", "$1", $config->get_cfg_value("gosa_si"));
       }
 
       $this->f_timeout = $timeout;