Code

Updated gosa si DAK remove key ring entry.
[gosa.git] / gosa-core / include / class_config.inc
index 8001926bbbdfcf5221470710755c41de9d72c83f..db862c0f887929ba03f86b9105f767b07d44d86f 100644 (file)
@@ -160,11 +160,13 @@ class config  {
       case 'LOCATION':
                   if ($this->tags[$this->level-2] == 'MAIN'){
                     $name= $attrs['NAME'];
+                    $name = preg_replace("/[<>\"']/","",$name);
+                    $attrs['NAME'] = $name;
                     $this->currentLocation= $name;
 
                     /* Add location elements */
-                      $this->data['LOCATIONS'][$name]= $attrs;
-                    }
+                    $this->data['LOCATIONS'][$name]= $attrs;
+                  }
                   break;
 
                   /* Handle referral tags */
@@ -268,6 +270,7 @@ class config  {
   function set_current($name)
   {
     $this->current= $this->data['LOCATIONS'][$name];
+
     if (!isset($this->current['PEOPLE'])){
       $this->current['PEOPLE']= "ou=people";
     }
@@ -870,9 +873,6 @@ class config  {
 
   function check_config_version()
   {
-
-    $current = get_gosa_version();
-
     /* Skip check, if we've already mentioned the mismatch 
      */
     if(session::is_set("LastChecked") && session::get("LastChecked") == $this->config_version) return;
@@ -881,22 +881,12 @@ class config  {
      */
     session::set("LastChecked",$this->config_version);
 
-    if(preg_match("/\(Rev[^\)]*\)/",$current)){
+    $current = md5(file_get_contents(CONFIG_TEMPLATE_DIR."/gosa.conf"));
 
-      /* Development Version 
-       */
-      $c_v = preg_replace("/^.*\(Rev ([0-9]*)\).*$/","\\1",$current);
-      $g_v = preg_replace("/^.*\(Rev ([0-9]*)\).*$/","\\1",$this->config_version);
-      if($c_v != $g_v){
-#        msg_dialog::display(_("Configuration"),_("The configuration file you are using seems to be outdated. Please move the GOsa configuration file away to run the GOsa setup again."));
-      }
-    }else{
-
-      /* Tagged version 
-       */
-      if($this->config_version != $current){
-        msg_dialog::display(_("Configuration"),_("The configuration file you are using seems to be outdated. Please move the GOsa configuration file away to run the GOsa setup again."));
-      }
+    /* Check contributed config version and current config version.
+     */
+    if($this->config_version != $current && !empty($this->config_version)){
+      msg_dialog::display(_("Configuration"),_("The configuration file you are using seems to be outdated. Please move the GOsa configuration file away to run the GOsa setup again."));
     }
   }