From 07eaa06dbe81c7acd9626a7918eeaf809488adcb Mon Sep 17 00:00:00 2001 From: Benoit Mortier <benoit.mortier@opensides.be> Date: Wed, 22 Feb 2012 16:10:10 +0100 Subject: [PATCH] Fixes: #623 get_gosa_version() should be removed and replace by a static var in variables.inc --- html/index.php | 6 +----- html/setup.php | 8 +++----- include/functions.inc | 7 ------- include/php_setup.inc | 6 ++---- include/variables.inc | 2 ++ plugins/generic/welcome/main.inc | 4 +--- 6 files changed, 9 insertions(+), 24 deletions(-) diff --git a/html/index.php b/html/index.php index 845b661af..de4480edd 100644 --- a/html/index.php +++ b/html/index.php @@ -94,11 +94,7 @@ function displayLogin() $smarty->assign("usePrototype", "false"); $smarty->display (get_template_path('headers.tpl')); - if(function_exists("get_gosa_version")){ - $smarty->assign("version",get_gosa_version()); - }else{ - $smarty->assign("version",""); - } + $smarty->assign("version",FD_VERSION); $smarty->display(get_template_path('login.tpl')); exit(); diff --git a/html/setup.php b/html/setup.php index 37a898911..b3fff6a74 100644 --- a/html/setup.php +++ b/html/setup.php @@ -143,11 +143,9 @@ if ($error_collector != ""){ } else { $smarty->assign("php_errors", ""); } -if(function_exists("get_gosa_version")){ - $smarty->assign("version",get_gosa_version()); -}else{ - $smarty->assign("version",""); -} + +$smarty->assign("version",FD_VERSION); + echo $header.$smarty->fetch("../setup/setup_frame.tpl"); // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: diff --git a/include/functions.inc b/include/functions.inc index 11ffa49cb..2bd4bba6e 100644 --- a/include/functions.inc +++ b/include/functions.inc @@ -2279,13 +2279,6 @@ function validate($string) return (strip_tags(str_replace('\0', '', $string))); } -/*! \brief Evaluate the current FusionDirectory version from the build in revision string */ -function get_gosa_version() -{ - global $svn_revision; - - return (sprintf(_("FusionDirectory $svn_revision"))); -} /*! \brief Recursively delete a path in the file system * diff --git a/include/php_setup.inc b/include/php_setup.inc index e6218174a..cfe84a268 100644 --- a/include/php_setup.inc +++ b/include/php_setup.inc @@ -71,10 +71,8 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline) /* Mailto body header */ if(function_exists("prepare4mailbody")){ - $version= "unknown"; - if(function_exists("get_gosa_version")){ - $version= get_gosa_version(); - } + $version = FD_VERSION; + $error_collector_mailto .=prepare4mailbody( "Oups. Seems like you've catched some kind of bug inside FusionDirectory/PHP. You may want to help ". "us to improve the software stability. If so, please provide some more information below.". diff --git a/include/variables.inc b/include/variables.inc index 33baf4bad..9859975e0 100644 --- a/include/variables.inc +++ b/include/variables.inc @@ -83,4 +83,6 @@ define("CLASS_CACHE", "class.cache"); /* name of the utility used to create windows passwords */ define ("MKNTPWD", "/usr/sbin/fusiondirectory-mkntpassword"); +/* FusionDirectory Version */ +define ("FD_VERSION", "1.0.3"); ?> diff --git a/plugins/generic/welcome/main.inc b/plugins/generic/welcome/main.inc index 402cee4e7..6292f76b6 100644 --- a/plugins/generic/welcome/main.inc +++ b/plugins/generic/welcome/main.inc @@ -26,9 +26,7 @@ if (!$cleanup){ $smarty->assign("header", print_header(get_template_path('images/welcome.png'), sprintf(_("Welcome %s!"), $ui->cn))); $smarty->assign("year", date("Y")); - if(function_exists("get_gosa_version")){ - $smarty->assign("revision", get_gosa_version()); - } + $smarty->assign("version",FD_VERSION); $display= $smarty->fetch(get_template_path('welcome.tpl', TRUE)); } -- GitLab