2 /************************************************************************
3 * Mailer v0.2.1-FINAL Start: 08/25/2003 *
4 * =================== Last change: 04/26/2004 *
6 * -------------------------------------------------------------------- *
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 *
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. *
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. *
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, *
31 ************************************************************************/
34 //* DEBUG: */ xdebug_start_trace();
36 // Load security system
37 require('inc/libs/security_functions.php');
40 $GLOBALS['__start_time'] = microtime(TRUE);
42 // Tell every module / require file we are installing
43 $GLOBALS['__mailer_installing'] = TRUE;
45 // Set module and output mode
46 $GLOBALS['__module'] = 'install';
47 $GLOBALS['__output_mode'] = '0';
49 // Initialize application
50 require('inc/init.php');
53 setContentType('text/html');
55 // Is 'install_page' set?
56 if (!isGetRequestElementSet('install_page')) {
57 // No, so set it to 'welcome'
58 setGetRequestElement('install_page', 'welcome');
62 setUsername('{--USERNAME_INSTALLER--}');
65 if ((isInstalled()) && (getRequestElement('install_page') != 'finished')) {
67 addFatalMessage(__FILE__, __LINE__, '{--MAILER_ALREADY_INSTALLED--}');
73 // Handle fatal errors
74 runFilterChain('handle_fatal_errors');
76 // Is plain or AJAX-enabled installation used?
77 if (isGetRequestElementSet('installer')) {
79 setSession('installer', getRequestElement('installer'));
81 // Redirect to install.php again
82 redirectToUrl('install.php');
83 } elseif (isAjaxInstaller()) {
84 // AJAX-enabled installer:
86 addTemplateToInstallContent('install_page_init');
90 'install_page' => getRequestElement('install_page')
93 // Load main installation table
94 loadTemplate('install_main_ajax', FALSE, $content);
95 } elseif (isPlainInstaller()) {
98 loadIncludeOnce('inc/install-inc.php');
100 // Load main template
101 loadTemplate('install_main_plain');
103 // What do you want, red or blue pill? AJAX or plain installer? ;-)
104 loadTemplate('install_selector');