Some fixes for password scrambling.
[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  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
15  * Copyright (c) 2009 - 2013 by Mailer Developer Team                   *
16  * For more information visit: http://mxchange.org                      *
17  *                                                                      *
18  * This program is free software; you can redistribute it and/or modify *
19  * it under the terms of the GNU General Public License as published by *
20  * the Free Software Foundation; either version 2 of the License, or    *
21  * (at your option) any later version.                                  *
22  *                                                                      *
23  * This program is distributed in the hope that it will be useful,      *
24  * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
25  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
26  * GNU General Public License for more details.                         *
27  *                                                                      *
28  * You should have received a copy of the GNU General Public License    *
29  * along with this program; if not, write to the Free Software          *
30  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
31  * MA  02110-1301  USA                                                  *
32  ************************************************************************/
33
34 // XDEBUG call
35 //* DEBUG: */ xdebug_start_trace();
36
37 // Load security stuff here
38 require('inc/libs/security_functions.php');
39
40 // Init start time
41 $GLOBALS['__start_time'] = microtime(TRUE);
42
43 // Set module/what and output mode
44 $GLOBALS['__module']      = 'index';
45 $GLOBALS['__what']        = 'welcome';
46 $GLOBALS['__output_mode'] = '0';
47
48 // Load config.php
49 require('inc/config-global.php');
50
51 // Fix what to 'home'
52 setWhat(getIndexHome());
53
54 // Shall we display 'home' in index.php?
55 if ((isExtensionInstalledAndNewer('sql_patches', '0.8.3')) && (isDisplayHomeInIndexEnabled())) {
56         // Include module
57         doIncludeModule();
58 } // END - if
59
60 //////////////////////////////////////////////////
61 // Display regular index 'front' page from here
62 //////////////////////////////////////////////////
63
64 // Check for cookies
65 if ((isSessionVariableSet('visited')) || (getIndexDelay() > -1)) {
66         // Set content type
67         setContentType('text/html');
68
69         // Header
70         loadPageHeader();
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 (getIndexDelay() > 0) {
86                 // This will be a JavaScript-redirect!
87                 $content['delay']  = (getIndexDelay() * 1000 + 500);
88                 $content['module'] = 'index';
89
90                 // Load template
91                 loadTemplate('index_forward', FALSE, $content);
92         } // END - if
93
94         // Footer (which will call doShutdown() for us)
95         loadPageFooter();
96 } else {
97         // Redirect to main page
98         redirectToUrl('modules.php?module=index');
99 }
100
101 // [EOF]
102 ?>