Error renamed to 'bug' #2
[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  * For more information visit: http://www.mxchange.org                  *
23  *                                                                      *
24  * This program is free software; you can redistribute it and/or modify *
25  * it under the terms of the GNU General Public License as published by *
26  * the Free Software Foundation; either version 2 of the License, or    *
27  * (at your option) any later version.                                  *
28  *                                                                      *
29  * This program is distributed in the hope that it will be useful,      *
30  * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
31  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
32  * GNU General Public License for more details.                         *
33  *                                                                      *
34  * You should have received a copy of the GNU General Public License    *
35  * along with this program; if not, write to the Free Software          *
36  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
37  * MA  02110-1301  USA                                                  *
38  ************************************************************************/
39
40 // Load security stuff here
41 require('inc/libs/security_functions.php');
42
43 // Init start time
44 $GLOBALS['startTime'] = microtime(true);
45
46 // Set module
47 $GLOBALS['module'] = 'index';
48
49 // Set CSS mode
50 $GLOBALS['output_mode'] = '0';
51
52 // Load config.php
53 require('inc/config-global.php');
54
55 // Set content type
56 setContentType('text/html');
57
58 // Fix missing array elements here
59 if (!isConfigEntrySet('index_delay'))  setConfigEntry('index_delay' , 0);
60 if (!isConfigEntrySet('index_cookie')) setConfigEntry('index_cookie', 0);
61
62 // Check for cookies
63 if ((isSessionVariableSet('visited')) || (getConfig('index_delay') > -1)) {
64         // Header
65         loadIncludeOnce('inc/header.php');
66
67         // Is the index page configured for redirect pr not?
68         if (getConfig('index_cookie') > 0) {
69                 // Set cookie and remeber it for specified time
70                 setSession('visited', 'true');
71         } elseif (isSessionVariableSet('visited')) {
72                 // Remove cookie when admin set 0 in setup
73                 setSession('visited', '');
74         }
75
76         // Template laden
77         loadTemplate('index');
78
79         // Shall I insert an automated forward?
80         if (getConfig('index_delay') > 0) {
81                 // This will be a JavaScript-redirect!
82                 $content['delay'] = (getConfig('index_delay') * 1000 + 500);
83                 $content['mod']   = 'index';
84
85                 // Load template
86                 loadTemplate('index_forward', false, $content);
87         } // END - if
88
89         // Footer
90         loadIncludeOnce('inc/footer.php');
91 } else {
92         // Redirect to main page
93         redirectToUrl('modules.php?module=index');
94 }
95
96 // [EOF]
97 ?>