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