NEW FEATURE: display if someone is sick during the init phase
[e-DoKo.git] / index.php
index d1d2926f15271ab80566a4d252ee86c20317ac36..76bbc29a55dc115ccc12f7e94f0666c46cea396b 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1,11 +1,20 @@
 <?php
 error_reporting(E_ALL);
 
+/* start a session, if it is not already running.
+ * This way people don't have to log in all the times. 
+ * The session variables can also be read out from different
+ * php scripts, so that the code can be easily split up across several files
+ */
+session_start();
+
+
 include_once("config.php");                /* needs to be first in list, since other includes use this */
 include_once("./include/output.php");      /* html output only */
 include_once("./include/db.php");          /* database only */
 include_once("./include/functions.php");   /* the rest */
 
+
 /* make sure that user has set all variables in config.php */
 config_check();
 
@@ -19,13 +28,6 @@ if(DB_open()<0)
     exit();
   }
 
-/* start a session, if it is not already running.
- * This way people don't have to log in all the times. 
- * The session variables can also be read out from different
- * php scripts, so that the code can be easily split up across several files
- */
-session_start();
-
 /* done major error checking, output header of HTML page */
 output_header();
 
@@ -60,9 +62,18 @@ switch($action)
   case 'register':
     require './include/register.php';
     break;
+  case 'prefs':
+    require './include/preferences.php';
+    break;
   case 'game':
     require './include/game.php';
     break;
+  case 'stats':
+    if(isset($_SESSION["name"]))
+      require './include/stats.php';
+    else
+      require './include/welcome.php';
+    break;
   default:
     if(isset($_SESSION["name"]))
       require './include/user.php';