diff --git a/gosa-core/include/class_gosaSupportDaemon.inc b/gosa-core/include/class_gosaSupportDaemon.inc
index 5101e905a1abf5c567972b1df5d6e987ab0a970a..44d05cfe0d0e0e9628474e76c7c2b1a4cf4614d0 100644 (file)
#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;
return($this->is_connected);
}
+
+ /*! \brief Returns TRUE whether we are connected or not
+ @return BOOLEAN Returns TRUE when connected else FALSE
+ */
+ public function is_connected()
+ {
+ return($this->is_connected);
+ }
+
+
/*! \brief Disconnect from gosa daemon.
*/
}
if ($xml_elem['type'] == 'complete') {
+ $start_level = 1;
+ $test2 = &$params;
+ while($start_level < $xml_elem['level']) {
+ $test2 = &$test2[$level[$start_level]];
+ $start_level++;
+ }
+
/* Save tag attributes too.
e.g. <tag attr="val">
*/
}
}
- $start_level = 1;
- $test2 = &$params;
- while($start_level < $xml_elem['level']) {
- $test2 = &$test2[$level[$start_level]];
- $start_level++;
- }
if(!isset($test2[$xml_elem['tag']])){
if(isset($xml_elem['value'])){
$test2[$xml_elem['tag']] = $xml_elem['value'];
$key = preg_replace("/^.*\n\n/sim","",$key);
/* Remove footer */
$key = preg_replace("/-----.*$/sim","",$key);
+ }elseif (!preg_match('%^[a-zA-Z0-9/+]*={0,2}$%', $key)) {
+
+ /* Encode key if it is raw.
+ */
+ $key = base64_encode($key);
}
/* Create query
$xml_msg = "<xml>
<header>gosa_remove_dak_key</header>
<target>".$server."</target>
- <uid>".$key."</uid>
+ <keyid>".$key."</keyid>
<source>GOSA</source>
</xml>";