Check for config file mismatches. Greatly improve language handling. Fixed bug...
authorchriskl <chriskl>
Thu, 2 Jan 2003 03:42:08 +0000 (03:42 +0000)
committerchriskl <chriskl>
Thu, 2 Jan 2003 03:42:08 +0000 (03:42 +0000)
conf/config.inc.php-dist
lang/english.php
lang/italian.php
libraries/lib.inc.php
public_html/intro.php

index e8b7fee42af12ca858c771fd4e2602223b97c379..e489357a144cc6aa6a6249bb511c9421bf582828 100644 (file)
@@ -4,17 +4,17 @@
         * Central WebDB configuration.  As a user you may modify the\r
         * settings here for your particular configuration.\r
         *\r
-        * $Id: config.inc.php-dist,v 1.5 2002/12/24 07:38:23 chriskl Exp $\r
+        * $Id: config.inc.php-dist,v 1.6 2003/01/02 03:42:08 chriskl Exp $\r
         */\r
 \r
        // Set error reporting level\r
        error_reporting(E_ALL);\r
 \r
        // App settings\r
-       $appName = 'WebDB';\r
-       $appIntro = 'Welcome to WebDB.';\r
        $appBase = '../public_html';\r
-       $appVersion = '0.6';\r
+\r
+       // Language setting.  eg 'english', 'polish', etc.\r
+       $appLanguage = 'english';\r
        \r
        /*\r
         * GUI settings\r
@@ -55,9 +55,8 @@
         * Don't modify anything below this line *\r
         *****************************************/\r
 \r
-       // Language\r
-       include_once('../lang/english.php');\r
-       \r
+       $appConfVersion = 1;\r
+\r
        // Main library\r
        include_once('../libraries/lib.inc.php');\r
        \r
index 49ab46e043585966114f4245bf2bf0558ccd0bb7..757c44f2e86afab243469221b0fd84045bb1c96d 100755 (executable)
@@ -4,13 +4,15 @@
         * Language template file for WebDB.  Use this to base language
         * files.
         *
-        * $Id: english.php,v 1.25 2003/01/02 02:27:47 chriskl Exp $
+        * $Id: english.php,v 1.26 2003/01/02 03:42:08 chriskl Exp $
         */
 
        $appLang = 'English';
        $appCharset = 'ISO-8859-1';
 
+       $strIntro = 'Welcome to WebDB.';
        $strNoFrames = 'You need a frames-enabled browser to use this application.';
+       $strBadConfig = 'Your config.inc.php is out of date.  You will need to regenerate it from the new config.inc.php-dist.';
        $strLogin = 'Login';
        $strLoginFailed = 'Login failed';
        $strNoTables = 'No tables found.';
index 2392f8885cc35a4d4deb354babc1c92c3296fb62..2201d4a1b0e5342900d15c573577807c219ceb90 100644 (file)
@@ -3,7 +3,7 @@
         * Italian language template, based on the english language template file for WebDB.
         * @maintainer Calogero Calì [<kalef@libero.it>]
         *      
-        * $Id: italian.php,v 1.3 2002/12/24 02:44:21 chriskl Exp $
+        * $Id: italian.php,v 1.4 2003/01/02 03:42:08 chriskl Exp $
         */
 
        $appLang = 'Italiano';
@@ -41,7 +41,7 @@
        $strPrev = 'Precedente';
        $strNext = 'Successivo';
        $strFailed = 'Fallito';
-       $strNotLoaded = 'Non &egrave; stato compilato un adeguato supporto ai database nell'installazione di PHP';
+       $strNotLoaded = 'Non &egrave; stato compilato un adeguato supporto ai database nell\'installazione di PHP';
        
        // Users - Utenti
        $strUsername = 'Username';
index f234ab773e668c3b19f10589d1ec32e451c5b67a..3b154fb42e6fe2e899bc11c78f3686af15b82a34 100644 (file)
@@ -3,9 +3,32 @@
        /**
         * Function library read in upon startup
         *
-        * $Id: lib.inc.php,v 1.6 2002/12/27 17:25:56 chriskl Exp $
+        * $Id: lib.inc.php,v 1.7 2003/01/02 03:42:08 chriskl Exp $
         */
 
+       // Application name 
+       $appName = 'WebDB';
+
+       // Application version
+       $appVersion = '0.7';
+
+       // Configuration file version.  If this is greater than that in config.inc.php, then
+       // the app will refuse to run.  This and $appConfVersion should be incremented whenever
+       // backwards incompatible changes are made to config.inc.php-dist.
+       $appBaseConfVersion = 1;
+
+       // Language settings.  Always include english.php, since it's the master
+       // language file, and then overwrite it with the user-specified language.
+       $appLanguage = strtolower($appLanguage);
+       include_once('../lang/english.php');
+       include_once("../lang/{$appLanguage}.php");
+
+       // Check for config file version mismatch
+       if (!isset($appConfVersion) || $appBaseConfVersion > $appConfVersion) {
+               echo $strBadConfig;
+               exit;
+       }
+
        // Create Misc class references
        include_once('../classes/Misc.php');
        $misc = new Misc();
index dd1c05d26cdd97b4b3bb75b876f1dfc348e015ac..002fbace5f5e7971ce184987d59ac9030570a610 100755 (executable)
@@ -3,7 +3,7 @@
        /**
         * Intro screen
         *
-        * $Id: intro.php,v 1.8 2003/01/02 02:27:47 chriskl Exp $
+        * $Id: intro.php,v 1.9 2003/01/02 03:42:08 chriskl Exp $
         */
 
        // Include application functions
@@ -19,7 +19,7 @@
 
 <h1><?php echo $appName ?></h1>
 
-<p><?php echo $appIntro ?></p>
+<p><?php echo $strIntro ?></p>
 
 </body>
 </html>