- obsolete templates/scripts removed
[mailer.git] / 0.2.1 / index.php
1 <?php\r
2 /************************************************************************\r
3  * MXChange v0.2.1                                    Start: 08/25/2003 *\r
4  * ===============                              Last change: 11/23/2004 *\r
5  *                                                                      *\r
6  * -------------------------------------------------------------------- *\r
7  * File              : index.php                                        *\r
8  * -------------------------------------------------------------------- *\r
9  * Short description : Index page. A simple redirection to modules.php  *\r
10  * -------------------------------------------------------------------- *\r
11  * Kurzbeschreibung  : Index-Seite. Eine simple Weiterleitung auf die   *\r
12  *           modules.php                                                *\r
13  * -------------------------------------------------------------------- *\r
14  *                                                                      *\r
15  * -------------------------------------------------------------------- *\r
16  * Copyright (c) 2003 - 2008 by Roland Haeder                           *\r
17  * For more information visit: http://www.mxchange.org                  *\r
18  *                                                                      *\r
19  * This program is free software; you can redistribute it and/or modify *\r
20  * it under the terms of the GNU General Public License as published by *\r
21  * the Free Software Foundation; either version 2 of the License, or    *\r
22  * (at your option) any later version.                                  *\r
23  *                                                                      *\r
24  * This program is distributed in the hope that it will be useful,      *\r
25  * but WITHOUT ANY WARRANTY; without even the implied warranty of       *\r
26  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *\r
27  * GNU General Public License for more details.                         *\r
28  *                                                                      *\r
29  * You should have received a copy of the GNU General Public License    *\r
30  * along with this program; if not, write to the Free Software          *\r
31  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *\r
32  * MA  02110-1301  USA                                                  *\r
33  ************************************************************************/\r
34 \r
35 // Load security stuff here (Oh, I hope this is not unsecure? Am I paranoia??? ;-) )\r
36 require_once("inc/libs/security_functions.php");\r
37 \r
38 // Init "action" and "what"\r
39 global $what, $action;\r
40 $GLOBALS['what'] = ""; $GLOBALS['action'] = "";\r
41 if (!empty($_GET['action'])) $GLOBALS['action'] = secureString($_GET['action']);\r
42 if (!empty($_GET['what'])) $GLOBALS['what'] = secureString($_GET['what']);\r
43 \r
44 // Set module\r
45 $GLOBALS['module'] = "index";\r
46 \r
47 // Load config.php\r
48 require ("inc/config.php");\r
49 \r
50 // Is the script installed?\r
51 if (defined('mxchange_installed') && (mxchange_installed))\r
52 {\r
53         // Header\r
54         require(PATH."inc/header.php");\r
55 \r
56         // Check for cookies\r
57         if (empty($_COOKIE['visited']) || ($CONFIG['index_delay'] == 0) || ($CONFIG['index_cookie'] == 0))\r
58         {\r
59                 if ($CONFIG['index_cookie'] > 0)\r
60                 {\r
61                         // Set cookie and remeber it for specified time\r
62                         @setcookie("visited", "true", (time() + $CONFIG['index_cookie']), COOKIE_PATH);\r
63                 }\r
64                  elseif (!empty($_COOKIE['visited']))\r
65                 {\r
66                         // Remove cookie when admin set 0 in setup\r
67                         @setcookie("visited", "", (time() - 3600), COOKIE_PATH);\r
68                 }\r
69 \r
70                 // Template laden\r
71                 LOAD_TEMPLATE("index", false, ADD_URL_DATA(""));\r
72 \r
73                 // Shall I insert an automated forward?\r
74                 if ($CONFIG['index_delay'] > 0)\r
75                 {\r
76                         // This will be a JavaScript-redirect!\r
77                         define('__DELAY_VALUE', ($CONFIG['index_delay'] * 1000 + 500));\r
78                         define('__MOD_VALUE'  , ADD_URL_DATA("index"));\r
79                         LOAD_TEMPLATE("index_forward");\r
80                 }\r
81         }\r
82          else\r
83         {\r
84                 // Redirect to main page\r
85                 LOAD_URL(URL."/modules.php?module=index");\r
86         }\r
87 \r
88         // Footer\r
89         require(PATH."inc/footer.php");\r
90 }\r
91  else\r
92 {\r
93         // You have to configure first!\r
94         LOAD_URL("install.php");\r
95 }\r
96 // All done here...\r
97 ?>\r