Code

Don not't reset server settings, if gosa.conf was modified
[gosa.git] / gosa-core / include / class_gosaSupportDaemon.inc
index 0a782df027e2d30274561b831fd137096b59d619..2f619e84ed0647dfc27a8ecd5e2fdef544dddd95 100644 (file)
@@ -31,8 +31,8 @@ class gosaSupportDaemon
   private $s_error      = "";
   private $b_error      = FALSE;
 
-  private $is_connected     = FALSE;
-
+  private $is_connected   = FALSE;
+  private $is_configured  = FALSE;
   protected $use_alternative_xml_parse_method = FALSE;
 
   public function get_host()
@@ -70,7 +70,7 @@ class gosaSupportDaemon
         $this->i_port= preg_replace("/^.*@[^:]+:(.*)$/", "$1", $config->get_cfg_value("gosaSupportURI"));
         $this->s_encryption_key = preg_replace("/^(.*)@[^:]+:.*$/", "$1", $config->get_cfg_value("gosaSupportURI"));
       }
-
+      $this->is_configured = TRUE;
       $this->f_timeout = $timeout;
       if($connect){
         $this->connect();
@@ -79,6 +79,12 @@ class gosaSupportDaemon
   }
 
 
+  public function is_configured()
+  {
+    return($this->is_configured);
+  }
+
+
   /*! \brief  Establish daemon connection. 
     @return boolean Returns true if the connection was succesfully established. 
    */
@@ -215,7 +221,7 @@ class gosaSupportDaemon
         $ret .= $msg." ";
       }
     }
-    $ret = preg_replace("/ /"," ",$ret);
+    $ret = str_replace(" "," ",$ret);
     return($ret);
   }
 
@@ -1491,7 +1497,7 @@ class gosaSupportDaemon
    */
   public function krb5_get_policy($server,$name)
   {
-    $res = array();  
+    $ret = array();  
 
     /* Check if the given name is a valid request value 
      */
@@ -1859,7 +1865,7 @@ class gosaSupportDaemon
         There may be some Header lines like:
         -----BEGIN PGP PUBLIC KEY BLOCK-----   Version: GnuPG v1.4.6 (GNU/Linux)
      */
-    if(preg_match("/".normalizePreg("BEGIN PGP PUBLIC KEY BLOCK")."/",$key)){
+    if(preg_match("/BEGIN PGP PUBLIC KEY BLOCK/",$key)){
 
       /* Remove header */
       $key = preg_replace("/^.*\n\n/sim","",$key);