Added local files + mods
[mailer.git] / install.php
1 <?php
2 /************************************************************************
3  * Mailer v0.2.1-FINAL                                Start: 08/25/2003 *
4  * ===================                          Last change: 04/26/2004 *
5  *                                                                      *
6  * -------------------------------------------------------------------- *
7  * File              : install.php                                      *
8  * -------------------------------------------------------------------- *
9  * Short description : Installation script.                             *
10  * -------------------------------------------------------------------- *
11  * Kurzbeschreibung  : Installationsscript.                             *
12  * -------------------------------------------------------------------- *
13  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
14  * Copyright (c) 2009 - 2016 by Mailer Developer Team                   *
15  * For more information visit: http://mxchange.org                      *
16  *                                                                      *
17  * This program is free software; you can redistribute it and/or modify *
18  * it under the terms of the GNU General Public License as published by *
19  * the Free Software Foundation; either version 2 of the License, or    *
20  * (at your option) any later version.                                  *
21  *                                                                      *
22  * This program is distributed in the hope that it will be useful,      *
23  * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
24  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
25  * GNU General Public License for more details.                         *
26  *                                                                      *
27  * You should have received a copy of the GNU General Public License    *
28  * along with this program; if not, write to the Free Software          *
29  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
30  * MA  02110-1301  USA                                                  *
31  ************************************************************************/
32
33 // XDEBUG call
34 //* DEBUG: */ xdebug_start_trace();
35
36 // Load security system
37 require('inc/libs/security_functions.php');
38
39 // Init start time
40 $GLOBALS['__start_time'] = microtime(TRUE);
41
42 // Tell every module / require file we are installing
43 $GLOBALS['__mailer_installing'] = TRUE;
44
45 // Set module and output mode
46 $GLOBALS['__module']      = 'install';
47 $GLOBALS['__output_mode'] = '0';
48
49 // Initialize application
50 require('inc/init.php');
51
52 // Set content type
53 setContentType('text/html');
54
55 // Is 'install_page' set?
56 if (!isGetRequestElementSet('install_page')) {
57         // No, so set it to 'welcome'
58         setGetRequestElement('install_page', 'welcome');
59 } // END - if
60
61 // Set username
62 setUsername('{--USERNAME_INSTALLER--}');
63
64 // Already installed?
65 if ((isInstalled()) && (getRequestElement('install_page') != 'finished')) {
66         // Add fatal message
67         addFatalMessage(__FILE__, __LINE__, '{--MAILER_ALREADY_INSTALLED--}');
68 } // END - if
69
70 // Load header here
71 loadPageHeader();
72
73 // Handle fatal errors
74 runFilterChain('handle_fatal_errors');
75
76 // Is plain or AJAX-enabled installation used?
77 if (isGetRequestElementSet('installer')) {
78         // Set installer type
79         setSession('installer', getRequestElement('installer'));
80
81         // Redirect to install.php again
82         redirectToUrl('install.php');
83 } elseif (isAjaxInstaller()) {
84         // AJAX-enabled installer:
85         // Load 'init' page
86         addTemplateToInstallContent('install_page_init');
87
88         // Prepare content
89         $content = array(
90                 'install_page' => getRequestElement('install_page')
91         );
92
93         // Load main installation table
94         loadTemplate('install_main_ajax', FALSE, $content);
95 } elseif (isPlainInstaller()) {
96         // Plain installer:
97         // Load include file
98         loadIncludeOnce('inc/install-inc.php');
99
100         // Load main template
101         loadTemplate('install_main_plain');
102 } else {
103         // What do you want, red or blue pill? AJAX or plain installer? ;-)
104         loadTemplate('install_selector');
105 }
106
107 // Footer
108 loadPageFooter();
109
110 // [EOF]
111 ?>