2 /************************************************************************
3 * Mailer v0.2.1-FINAL Start: 08/29/2003 *
4 * =================== Last change: 11/11/2004 *
6 * -------------------------------------------------------------------- *
7 * File : install-inc.php *
8 * -------------------------------------------------------------------- *
9 * Short description : Functions for installation procedure *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Funktionen fuer die Installationsroutine *
12 * -------------------------------------------------------------------- *
13 * Copyright (c) 2003 - 2009 by Roland Haeder *
14 * Copyright (c) 2009 - 2013 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 ************************************************************************/
33 // Some security stuff...
34 if ((!defined('__SECURITY')) || (!isInstaller())) {
38 // Load extension timezone
39 loadExtension('timezone', 'test');
42 setConfigEntry('timezone', 'Europe/Berlin');
45 FILTER_INIT_TIMEZONE(array());
46 FILTER_INIT_RANDOMIZER();
47 FILTER_INIT_RANDOM_NUMBER();
50 $GLOBALS['install_mysql'] = array();
51 if ((isPostRequestElementSet('mysql')) && (ifPostContainsSelections('mysql'))) {
52 // Transfer 'mysql' array
53 $GLOBALS['install_mysql'] = postRequestElement('mysql');
56 // Check if both passwords from SMTP are matching
57 if ((isGetRequestElementSet('install_page') && (getRequestElement('install_page') == 5))) {
58 // Okay, we have to check it
59 if (isPostRequestElementSet('smtp_user') && (!isPostRequestElementSet('smtp_host'))) {
61 addToInstallContent('<div class="para">{--INSTALLER_SMTP_HOSTNAME_EMPTY--}</div>');
62 setGetRequestElement('install_page', 3);
65 if ((!isPostRequestElementSet('smtp_password1')) && (isPostRequestElementSet('smtp_password2'))) {
67 addToInstallContent('<div class="para">{--INSTALLER_SMTP_PASSWORD1_EMPTY--}</div>');
68 setGetRequestElement('install_page', 3);
71 if ((isPostRequestElementSet('smtp_password1')) && (!isPostRequestElementSet('smtp_password2'))) {
72 // Password repeat is empty
73 addToInstallContent('<div class="para">{--INSTALLER_SMTP_PASSWORD2_EMPTY--}</div>');
74 setGetRequestElement('install_page', 3);
77 if (postRequestElement('smtp_password1') != postRequestElement('smtp_password1')) {
78 // Passwords are not matching
79 addToInstallContent('<div class="para">{--INSTALLER_SMTP_PASS_MISMATCH--}</div>');
80 setGetRequestElement('install_page', 3);
84 // Is the mailer installed or no admin registered so far?
85 if ((!isInstalled()) || (!isAdminRegistered())) {
86 // Construct include file name
87 $inc = 'inc/install/install_page_' . getRequestElement('install_page') . '.php';
89 // Is the include file there?
90 if (isIncludeReadable($inc)) {
92 loadIncludeOnce($inc);
94 // Not found, may be invalid page
95 logDebugMessage(__FILE__, __LINE__, sprintf('Wrong install_page=%s detected', getRequestElement('install_page')));
96 addTemplateToInstallContent('admin_settings_unsaved', '{%message,INSTALLER_WRONG_PAGE=' . getRequestElement('install_page') . '%}');
100 addFatalMessage(__FILE__, __LINE__, '{--MAILER_ALREADY_INSTALLED--}');