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 * -------------------------------------------------------------------- *
15 * $Tag:: 0.2.1-FINAL $ *
17 * -------------------------------------------------------------------- *
18 * Copyright (c) 2003 - 2009 by Roland Haeder *
19 * Copyright (c) 2009 - 2012 by Mailer Developer Team *
20 * For more information visit: http://mxchange.org *
22 * This program is free software; you can redistribute it and/or modify *
23 * it under the terms of the GNU General Public License as published by *
24 * the Free Software Foundation; either version 2 of the License, or *
25 * (at your option) any later version. *
27 * This program is distributed in the hope that it will be useful, *
28 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
29 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
30 * GNU General Public License for more details. *
32 * You should have received a copy of the GNU General Public License *
33 * along with this program; if not, write to the Free Software *
34 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
36 ************************************************************************/
38 // Some security stuff...
39 if ((!defined('__SECURITY')) || (!isInstallationPhase())) {
43 // Load extension timezone
44 loadExtension('timezone', 'test');
47 setConfigEntry('timezone', 'Europe/Berlin');
50 FILTER_INIT_TIMEZONE(array());
53 $GLOBALS['install_mysql'] = array();
54 if ((isPostRequestElementSet('mysql')) && (ifPostContainsSelections('mysql'))) {
55 // Transfer 'mysql' array
56 $GLOBALS['install_mysql'] = postRequestElement('mysql');
59 // Check if both passwords from SMTP are matching
60 if ((isGetRequestElementSet('install_page') && (getRequestElement('install_page') == 5))) {
61 // Okay, we have to check it
62 if (isPostRequestElementSet('smtp_user') && (!isPostRequestElementSet('smtp_host'))) {
64 addToInstallContent('<div class="para">{--INSTALLER_SMTP_HOSTNAME_EMPTY--}</div>');
65 setGetRequestElement('install_page', 3);
68 if ((!isPostRequestElementSet('smtp_pass1')) && (isPostRequestElementSet('smtp_pass2'))) {
70 addToInstallContent('<div class="para">{--INSTALLER_SMTP_PASSWORD1_EMPTY--}</div>');
71 setGetRequestElement('install_page', 3);
74 if ((isPostRequestElementSet('smtp_pass1')) && (!isPostRequestElementSet('smtp_pass2'))) {
75 // Password repeat is empty
76 addToInstallContent('<div class="para">{--INSTALLER_SMTP_PASSWORD2_EMPTY--}</div>');
77 setGetRequestElement('install_page', 3);
80 if (postRequestElement('smtp_pass1') != postRequestElement('smtp_pass1')) {
81 // Passwords are not matching
82 addToInstallContent('<div class="para">{--INSTALLER_SMTP_PASS_MISMATCH--}</div>');
83 setGetRequestElement('install_page', 3);
87 // Is the mailer installed or no admin registered so far?
88 if ((!isInstalled()) || (!isAdminRegistered())) {
89 // Construct include file name
90 $inc = 'inc/install/install_page_' . getRequestElement('install_page');
92 // Is the include file there?
93 if (isIncludeReadable($inc)) {
95 loadIncludeOnce($inc);
97 // Not found, may be invalid page
98 logDebugMessage(__FILE__, __LINE__, sprintf("Wrong install_page=%s detected", getRequestElement('install_page')));
99 addTemplateToInstallContent('admin_settings_unsaved', '{--WRONG_PAGE--}');
102 // Already installed!
103 addFatalMessage(__FILE__, __LINE__, '{--MAILER_ALREADY_INSTALLED--}');