Index: common.php
===================================================================
--- common.php (revision 9939)
+++ common.php (working copy)
@@ -143,6 +143,11 @@
$captchapath=$rooturl.'/';
}
+//check if databasename is set in config file
+if (!$databasename)
+{
+ die("Database Information not provided. If you try to install LimeSurvey please refer to the installation docs and/or contact the system administrator of this webpage.");
+}
//BEFORE SESSIONCONTOL BECAUSE OF THE CONNECTION
//CACHE DATA
@@ -223,8 +228,13 @@
}
-// Check if the DB is up to date
-If ($dbexistsbutempty && $sourcefrom=='admin') {
+//check if database exist and access is not via install script
+if (!$database_exists && (strcasecmp($slashlesspath,str_replace(array("\\", "/"), "", $homedir."install")) != 0)) {
+ die ("
The LimeSurvey database does not exist. Please run the install script to create the necessary database.");
+}
+
+ // Check if the DB is up to date
+if ($dbexistsbutempty && (strcasecmp($slashlesspath,str_replace(array("\\", "/"), "", $homedir."install")) != 0)) {
die ("
The LimeSurvey database does exist but it seems to be empty. Please run the install script to create the necessary tables.");
}