diff --git a/main/install/update_db.inc.php b/main/install/update_db.inc.php
index 17d276cf2b..a712950af9 100644
--- a/main/install/update_db.inc.php
+++ b/main/install/update_db.inc.php
@@ -3,7 +3,7 @@
==============================================================================
Dokeos - elearning and course management software
- Copyright (c) 2004 Dokeos S.A.
+ Copyright (c) 2004-2007 Dokeos S.A.
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) various contributors
@@ -25,7 +25,7 @@
/**
==============================================================================
* Update the Dokeos database from an older version
-* Notice : This script has to be included by index.php and update_courses.php
+* Notice : This script has to be included by index.php or update_courses.php
*
* @package dokeos.install
* @todo
@@ -36,6 +36,7 @@
==============================================================================
*/
+//load helper functions
require_once("install_upgrade.lib.php");
/*
@@ -44,18 +45,22 @@ require_once("install_upgrade.lib.php");
==============================================================================
*/
+//check if we come from index.php or update_courses.php - otherwise display error msg
if (defined('DOKEOS_INSTALL') || defined('DOKEOS_COURSE_UPDATE'))
{
+ //check if the current Dokeos install is elligible for update
if (empty ($updateFromConfigFile) || !file_exists($_POST['updatePath'].$updateFromConfigFile) || !in_array(get_config_param('clarolineVersion'), $updateFromVersion))
{
- echo 'Error ! Dokeos '.implode('|', $updateFromVersion).' has not been found.
- Please go back to step 1.
-