Possible fix for nested error message 'what is empty'
[mailer.git] / index.php
1 <?php
2 /************************************************************************
3  * Mailer v0.2.1-FINAL                                Start: 08/25/2003 *
4  * ===================                          Last change: 11/23/2004 *
5  *                                                                      *
6  * -------------------------------------------------------------------- *
7  * File              : index.php                                        *
8  * -------------------------------------------------------------------- *
9  * Short description : Index page. A simple redirection to modules.php  *
10  * -------------------------------------------------------------------- *
11  * Kurzbeschreibung  : Index-Seite. Eine simple Weiterleitung auf die   *
12  *           modules.php                                                *
13  * -------------------------------------------------------------------- *
14  * $Revision::                                                        $ *
15  * $Date::                                                            $ *
16  * $Tag:: 0.2.1-FINAL                                                 $ *
17  * $Author::                                                          $ *
18  * Needs to be in all Files and every File needs "svn propset           *
19  * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
20  * -------------------------------------------------------------------- *
21  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
22  * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
23  * For more information visit: http://www.mxchange.org                  *
24  *                                                                      *
25  * This program is free software; you can redistribute it and/or modify *
26  * it under the terms of the GNU General Public License as published by *
27  * the Free Software Foundation; either version 2 of the License, or    *
28  * (at your option) any later version.                                  *
29  *                                                                      *
30  * This program is distributed in the hope that it will be useful,      *
31  * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
32  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
33  * GNU General Public License for more details.                         *
34  *                                                                      *
35  * You should have received a copy of the GNU General Public License    *
36  * along with this program; if not, write to the Free Software          *
37  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
38  * MA  02110-1301  USA                                                  *
39  ************************************************************************/
40
41 // XDEBUG call
42 //* DEBUG: */ xdebug_start_trace();
43
44 // Load security stuff here
45 require('inc/libs/security_functions.php');
46
47 // Init start time
48 $GLOBALS['startTime'] = microtime(true);
49
50 // Set module/what
51 $GLOBALS['module'] = 'index';
52 $GLOBALS['what'] = 'index';
53
54 // Set CSS mode
55 $GLOBALS['output_mode'] = '0';
56
57 // Load config.php
58 require('inc/config-global.php');
59
60 // Set content type
61 setContentType('text/html');
62
63 // Fix missing array elements here
64 if (!isConfigEntrySet('index_delay'))  setConfigEntry('index_delay' , 0);
65 if (!isConfigEntrySet('index_cookie')) setConfigEntry('index_cookie', 0);
66
67 // Check for cookies
68 if ((isSessionVariableSet('visited')) || (getConfig('index_delay') > -1)) {
69         // Header
70         loadIncludeOnce('inc/header.php');
71
72         // Is the index page configured for redirect pr not?
73         if (getConfig('index_cookie') > 0) {
74                 // Set cookie and remeber it for specified time
75                 setSession('visited', 'true');
76         } elseif (isSessionVariableSet('visited')) {
77                 // Remove cookie when admin set 0 in setup
78                 setSession('visited', '');
79         }
80
81         // Template laden
82         loadTemplate('index');
83
84         // Shall I insert an automated forward?
85         if (getConfig('index_delay') > 0) {
86                 // This will be a JavaScript-redirect!
87                 $content['delay']  = (getConfig('index_delay') * 1000 + 500);
88                 $content['module'] = 'index';
89
90                 // Load template
91                 loadTemplate('index_forward', false, $content);
92         } // END - if
93
94         // Footer
95         loadIncludeOnce('inc/footer.php');
96 } else {
97         // Redirect to main page
98         redirectToUrl('modules.php?module=index');
99 }
100
101 // [EOF]
102 ?>