-
-
Notifications
You must be signed in to change notification settings - Fork 142
/
ConfirmConfig.php
279 lines (267 loc) · 12.2 KB
/
ConfirmConfig.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
<?php
/*+**********************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
************************************************************************************/
require_once 'modules/Utilities/Currencies.php';
session_start();
if (isset($_REQUEST['db_hostname'])) {
$_SESSION['config_file_info']['db_hostname'] = $db_hostname = $_REQUEST['db_hostname'];
}
if (isset($_REQUEST['db_username'])) {
$_SESSION['config_file_info']['db_username'] = $db_username = $_REQUEST['db_username'];
}
if (isset($_REQUEST['db_password'])) {
$_SESSION['config_file_info']['db_password'] = $db_password = $_REQUEST['db_password'];
}
if (isset($_REQUEST['db_name'])) {
$_SESSION['config_file_info']['db_name'] = $db_name = trim($_REQUEST['db_name']);
}
if (isset($_REQUEST['db_type'])) {
$_SESSION['config_file_info']['db_type'] = $db_type = $_REQUEST['db_type'];
}
if (isset($_REQUEST['site_URL'])) {
$_SESSION['config_file_info']['site_URL']= $site_URL = $_REQUEST['site_URL'];
}
if (isset($_REQUEST['root_directory'])) {
$_SESSION['config_file_info']['root_directory'] = $root_directory = $_REQUEST['root_directory'];
}
if (isset($_REQUEST['currency_name'])) {
$_SESSION['config_file_info']['currency_name'] = $currency_name = $_REQUEST['currency_name'];
}
if (isset($_REQUEST['admin_email'])) {
$_SESSION['config_file_info']['admin_email']= $admin_email = $_REQUEST['admin_email'];
}
if (isset($_REQUEST['currency_name'])) {
$_SESSION['installation_info']['currency_name'] = $currency_name = $_REQUEST['currency_name'];
}
if (isset($_REQUEST['check_createdb'])) {
$_SESSION['installation_info']['check_createdb'] = $check_createdb = $_REQUEST['check_createdb'];
}
if (isset($_REQUEST['root_user'])) {
$_SESSION['installation_info']['root_user'] = $root_user = $_REQUEST['root_user'];
}
if (isset($_REQUEST['root_password'])) {
$_SESSION['installation_info']['root_password'] = $root_password = $_REQUEST['root_password'];
}
if (isset($_REQUEST['admin_email'])) {
$_SESSION['installation_info']['admin_email']= $admin_email = $_REQUEST['admin_email'];
}
if (isset($_REQUEST['admin_password'])) {
$_SESSION['installation_info']['admin_password'] = $admin_password = $_REQUEST['admin_password'];
}
if (isset($_REQUEST['create_utf8_db'])) {
$_SESSION['installation_info']['create_utf8_db'] = $create_utf8_db = 'true';
} else {
$_SESSION['installation_info']['create_utf8_db'] = $create_utf8_db = 'false';
}
if (isset($_REQUEST['db_populate'])) {
$_SESSION['installation_info']['db_populate'] = $db_populate = 'true';
} else {
$_SESSION['installation_info']['db_populate'] = $db_populate = 'false';
}
if (isset($currency_name)) {
$_SESSION['installation_info']['currency_code'] = $currencies[$currency_name][0];
$_SESSION['installation_info']['currency_symbol'] = $currencies[$currency_name][1];
}
$create_db = (isset($_REQUEST['check_createdb']) && $_REQUEST['check_createdb'] == 'on');
$dbCheckResult = Installation_Utils::checkDbConnection($db_type, $db_hostname, $db_username, $db_password, $db_name, $create_db, $create_utf8_db, $root_user, $root_password);
$next = $dbCheckResult['flag'];
$error_msg = isset($dbCheckResult['error_msg']) ? $dbCheckResult['error_msg'] : '';
$error_msg_info = isset($dbCheckResult['error_msg_info']) ? $dbCheckResult['error_msg_info'] : '';
$db_utf8_support = true;
$vt_charset = 'UTF-8';
$_SESSION['config_file_info']['vt_charset']= $vt_charset;
$configFileUtils = new ConfigFile_Utils($_SESSION['config_file_info']);
if (!$configFileUtils->createConfigFile()) {
die("<strong class='big'><font color='red'>{$installationStrings['ERR_CANNOT_WRITE_CONFIG_FILE']}</font></strong>");
}
if ($next) {
$_SESSION['authentication_key'] = md5(microtime());
require_once 'include/utils/utils.php'; // Required - Especially to create adb instance in global scope.
}
$mode = (isset($_REQUEST['mode']) ? $_REQUEST['mode'] : '');
if ($mode == 'migration') {
$prev_file_name = 'SetMigrationConfig.php';
$file_name = 'MigrationProcess.php';
} else {
$prev_file_name = 'SetInstallationConfig.php';
$file_name = 'CreateTables.php';
}
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><?php echo $installationStrings['APP_NAME']. ' - ' . $installationStrings['LBL_CONFIG_WIZARD']. ' - ' . $installationStrings['LBL_CONFIRM_SETTINGS']?></title>
<link href="include/install/install.css" rel="stylesheet" type="text/css">
<link href="themes/softed/style.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="include/jquery/jquery.js"></script>
<script type="text/javascript" src="include/js/vtlib.js"></script>
<script type="text/javascript" src="include/js/general.js"></script>
</head>
<body class="small cwPageBg" topmargin="0" leftmargin="0">
<br>
<!-- Table for cfgwiz starts -->
<table border=0 cellspacing=0 cellpadding=0 width=80% align=center>
<tr>
<td class="cwHeadBg" align=left>
<img src="include/install/images/configwizard.gif" alt="<?php echo $installationStrings['LBL_CONFIG_WIZARD']; ?>" hspace="20" title="<?php echo $installationStrings['LBL_CONFIG_WIZARD']; ?>">
</td>
<td class="cwHeadBg1" align=right>
<img src="include/install/images/app_logo.png" alt="<?php echo $installationStrings['APP_NAME'];?>" title="<?php echo $installationStrings['APP_NAME'];?>">
</td>
<td class="cwHeadBg1" width=2%></td>
</tr>
</table>
<table border=0 cellspacing=0 cellpadding=0 width=80% align=center>
<tr>
<td background="include/install/images/topInnerShadow.gif" align=left><img height="10" src="include/install/images/topInnerShadow.gif" ></td>
</tr>
</table>
<table border=0 cellspacing=0 cellpadding=2 width=80% align=center>
<tr>
<td class="small" bgcolor="#4572BE" align=center>
<!-- Master display -->
<table border=0 cellspacing=0 cellpadding=0 width=97%>
<tr>
<td width=80% valign=top class="cwContentDisplay" align=center>
<table border=0 cellspacing=0 cellpadding=10 width=100%>
<tr>
<td align=left colspan=2 class="small paddingTop">
<span class="bigHeading"><?php echo $installationStrings['LBL_CONFIRM_CONFIG_SETTINGS']; ?></span>
<br>
<hr noshade size=1>
</td>
</tr>
<?php if ($error_msg) { ?>
<tr>
<td align=left class="small" colspan=2 width=50% style="padding-left:10px">
<div style="background-color:#ff0000;color:#ffffff;padding:5px">
<strong><?php echo $error_msg ?></strong>
</div>
<?php if ($error_msg_info) { ?>
<p><?php echo $error_msg_info ?><p>
<?php } ?>
</td>
</tr>
<?php } ?>
<tr>
<td align=left class="small" width=50% style="padding-left:10px">
<table width="100%" cellpadding="0" border="0" align=center class="level3" cellspacing="1">
<tr>
<td colspan=2><strong><?php echo $installationStrings['LBL_DATABASE_CONFIGURATION']; ?></strong><hr noshade size=1></td>
</tr>
<tr>
<td noWrap width="40%"><?php echo $installationStrings['LBL_DATABASE_TYPE']; ?></td>
<td align="left" nowrap> <font class="dataInput"><em><?php echo isset($db_type) ? $db_type : ''; ?></em></font></td>
</tr>
<tr>
<td noWrap width="40%"><?php echo $installationStrings['LBL_DATABASE_NAME']; ?></td>
<td align="left" nowrap> <font class="dataInput"><em><?php echo isset($db_name) ? $db_name : ''; ?></em></font></td>
</tr>
<tr>
<td noWrap width="40%">
<?php echo $installationStrings['LBL_DATABASE'].' '.$installationStrings['LBL_UTF8_SUPPORT']; ?>
</td>
<td align="left" nowrap>
<font class="dataInput">
<?php echo $db_utf8_support ? $installationStrings['LBL_ENABLED'] : "<strong style='color:#DF0000';>{$installationStrings['LBL_NOT_ENABLED']}</strong>"; ?>
</font>
</td>
</tr>
</table>
</td>
<td align=left class="small" width=50% style="padding-left:10px">
<table width="100%" cellpadding="0" border="0" align=center class="level3" cellspacing="1">
<tr>
<td colspan=2 ><strong><?php echo $installationStrings['LBL_SITE_CONFIGURATION']; ?></strong><hr noshade size=1></td>
</tr>
<tr>
<td width="40%"><?php echo $installationStrings['LBL_URL']; ?></td>
<td align="left"> <em><?php echo isset($site_URL) ? $site_URL : ''; ?></em></td>
</tr>
<tr>
<td width="40%"><?php echo $installationStrings['LBL_DEFAULT_CHARSET']; ?></td>
<td align="left"> <em><?php echo isset($vt_charset) ? $vt_charset : ''; ?></em></td>
</tr>
<tr>
<td width="40%"><?php echo $installationStrings['LBL_CURRENCY_NAME']; ?></td>
<td align="left">
<em><?php echo isset($currency_name) ? $currency_name.'('.$currencies[$currency_name][1].')' : ''; ?></em>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan=2>
<table width="100%" cellpadding="0" border="0" align=center class="level3" cellspacing="1">
<tr>
<td colspan=3 ><strong><?php echo $installationStrings['LBL_USER_CONFIGURATION']; ?></strong><hr noshade size=1></td>
</tr>
<tr>
<td width="40%"><?php echo $installationStrings['LBL_USERNAME']; ?></td>
<td align="left" width="30%"> <em>admin</em></td>
</tr>
<tr>
<td width="40%"><?php echo $installationStrings['LBL_EMAIL']; ?></td>
<td align="left" width="30%"> <em><?php echo isset($admin_email) ? $admin_email : ''; ?></em></td>
</tr>
</table>
<br>
<table width="100%" cellpadding="5" border="0" class="small" >
<tr>
<td align="left" valign="bottom">
<form action="install.php" method="post" name="form" id="form">
<input type="hidden" name="file" value="<?php echo $prev_file_name; ?>">
<input type="submit" class="button" value="‹‹ <?php echo $installationStrings['LBL_CHANGE']; ?>" title="<?php echo $installationStrings['LBL_CHANGE']; ?>" />
</form>
</td>
<?php if ($next) { ?>
<td align="right" valign="bottom">
<form action="install.php" method="post" name="form" id="form">
<input type="hidden" name="mode" value="installation">
<input type="hidden" name="file" value="<?php echo $file_name; ?>">
<input type="hidden" name="auth_key" value="<?php echo $_SESSION['authentication_key']; ?>" />
<input type="submit" class="button" value="<?php echo $installationStrings['LBL_NEXT']; ?> ››" title="<?php echo $installationStrings['LBL_NEXT']; ?>" onClick="VtigerJS_DialogBox.progress();submit();"/>
</form>
</td>
<?php } ?>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- Master display stops -->
<br>
</td>
</tr>
</table>
<table border=0 cellspacing=0 cellpadding=0 width=80% align=center>
<tr>
<td background="include/install/images/bottomGradient.gif"><img src="include/install/images/bottomGradient.gif"></td>
</tr>
</table>
<table border=0 cellspacing=0 cellpadding=0 width=80% align=center>
<tr>
<td align=center><img src="include/install/images/bottomShadow.jpg"></td>
</tr>
</table>
<table border=0 cellspacing=0 cellpadding=0 width=80% align=center>
<tr>
<td class=small align=center> <a href="<?php echo $coreBOS_app_url; ?>" target="_blank"><?php echo $coreBOS_app_name; ?></a></td>
</tr>
</table>
<!-- Prefetch image to display later for Screen blocker -->
<img style="display: none;" src="include/install/images/loading.gif">
<img src="themes/softed/images/layerPopupBg.gif" style="display: none;"/>
</body>
</html>