2 /* Copyright 2006, 2007, 2008, 2009, 2010 Arun Persaud <arun@nubati.net>
4 * This file is part of e-DoKo.
6 * e-DoKo is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * e-DoKo is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with e-DoKo. If not, see <http://www.gnu.org/licenses/>.
21 error_reporting(E_ALL);
23 /* start a session, if it is not already running.
24 * This way people don't have to log in all the times.
25 * The session variables can also be read out from different
26 * php scripts, so that the code can be easily split up across several files
30 include_once("config.php"); /* needs to be first in list, since other includes use this */
31 include_once("./include/output.php"); /* html output only */
32 include_once("./include/db.php"); /* database only */
33 include_once("./include/functions.php"); /* the rest */
35 /* make sure that user has set all variables in config.php */
38 /* open the database */
42 echo "Database error, can't connect... Please wait a while and try again. ".
43 "If the problem doesn't go away feel free to contact $ADMIN_NAME at $ADMIN_EMAIL.";
48 /* done major error checking, output5B header of HTML page */
51 /* The rest of the file consists of handling user input.
52 * The user sends information via html GET and POST variables,
53 * and the action variable tells the prog what the user wants to do
56 $action=$_REQUEST['action'];
58 $action=""; /* so that we can use a default option below */
63 require './include/newgame.php';
66 require './include/cancelgame.php';
69 require './include/reminder.php';
72 require './include/logout.php';
73 require './include/welcome.php';
76 require './include/login.php';
77 require './include/user.php';
80 require './include/register.php';
83 require './include/preferences.php';
86 require './include/game.php';
89 if(isset($_SESSION["name"]))
90 require './include/stats.php';
92 require './include/welcome.php';
95 if(isset($_SESSION["name"]))
96 require './include/user.php';
98 require './include/welcome.php';
101 /* ask for login or display login info, needs to go at the end, so that we have the
102 * session-variable already set.