From cb6e4398782ad81351ef90305637e24132b99564 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 13 Jun 2008 10:46:34 +0000 Subject: [PATCH] Updated configuration file up to date check. -It uses a checksum now. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11330 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/contrib/gosa.conf | 2 +- gosa-core/include/class_config.inc | 23 +++++----------------- gosa-core/setup/class_setupStep_Finish.inc | 5 ++--- 3 files changed, 8 insertions(+), 22 deletions(-) diff --git a/gosa-core/contrib/gosa.conf b/gosa-core/contrib/gosa.conf index 7f85a31e2..2539a72c6 100644 --- a/gosa-core/contrib/gosa.conf +++ b/gosa-core/contrib/gosa.conf @@ -1,5 +1,5 @@ {literal}{/literal} - +
diff --git a/gosa-core/include/class_config.inc b/gosa-core/include/class_config.inc index 8001926bb..ebb2e73ec 100644 --- a/gosa-core/include/class_config.inc +++ b/gosa-core/include/class_config.inc @@ -870,9 +870,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 +878,12 @@ class config { */ session::set("LastChecked",$this->config_version); - if(preg_match("/\(Rev[^\)]*\)/",$current)){ - - /* 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{ + $current = md5(file_get_contents(CONFIG_TEMPLATE_DIR."/gosa.conf")); - /* 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.")); } } diff --git a/gosa-core/setup/class_setupStep_Finish.inc b/gosa-core/setup/class_setupStep_Finish.inc index bb69bce6c..b32aeea04 100644 --- a/gosa-core/setup/class_setupStep_Finish.inc +++ b/gosa-core/setup/class_setupStep_Finish.inc @@ -44,7 +44,7 @@ class Step_Finish extends setup_step { $smarty = get_smarty(); $smarty->assign("cv",xmlentities($this->parent->captured_values)); - $smarty->assign("get_gosa_version",get_gosa_version()); + $smarty->assign("config_checksum", md5(file_get_contents(CONFIG_TEMPLATE_DIR.$this->gosa_conf_contrib))); $str = $smarty->fetch(CONFIG_TEMPLATE_DIR.$this->gosa_conf_contrib); return($str); } @@ -55,8 +55,7 @@ class Step_Finish extends setup_step $info= posix_getgrgid(posix_getgid()); $webgroup = $info['name']; - - + /* Check if there is currently an active gosa.conf */ $exists = file_exists(CONFIG_DIR."/".CONFIG_FILE); -- 2.30.2