This repository has been archived by the owner on Mar 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.php
577 lines (550 loc) · 34.3 KB
/
setup.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
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
<?php
/**
* Setup File for the College Recruitment Application
*
* Author: Patrick Barnhardt
* Author Email: pbarnh1@wgu.edu
* Date: 10/10/2023
*
* Description: This setup script should help add user credentials and setup the application if it has not been run yet.
*
* @package RYM2
* Filename: setup.php
* @version 1.0.0
* @requires PHP 8.1.2+
*/
declare(strict_types=1); // Forces PHP to adhere to strict typing, if types do not match an error is thrown.
/* Include the base application config file */
require_once(__DIR__ . '/config/app.php');
/* Get the database variables from the .env file, if they don't exist or are empty set placeholders */
if (!isset($_ENV['DB_HOST']) || empty($_ENV['DB_HOST'])) {
$_ENV['DB_HOST'] = 'localhost';
}
if (!isset($_ENV['DB_PORT']) || empty($_ENV['DB_PORT'])) {
$_ENV['DB_PORT'] = '3306';
$PORT = strval($_ENV['DB_PORT']);
} else {
//convert port to a string
$PORT = strval($_ENV['DB_PORT']);
}
if (!isset($_ENV['DB_DATABASE']) || empty($_ENV['DB_DATABASE'])) {
$_ENV['DB_DATABASE'] = 'capstone_db';
}
if (!isset($_ENV['DB_USERNAME']) || empty($_ENV['DB_USERNAME'])) {
$_ENV['DB_USERNAME'] = 'capstone_user';
}
if (!isset($_ENV['DB_PASSWORD']) || empty($_ENV['DB_PASSWORD'])) {
$_ENV['DB_PASSWORD'] = 'password';
}
/* Include the database connector file */
include(BASEPATH . '/includes/connector.inc.php');
/* Placeholders for error variables */
$errorIsPHPVersion = false;
$errorIsMySQLiExtension = false;
$errorIsDBVarMissing = false;
$errorIsDBConnectionFailed = false;
$errorIsDBNotEmpty = false;
$errorIsTableNotExists = false;
$errorIsMailEnabled = false;
$errorIsMySQLVersion = false;
$errorIsDBConnectionFailed = false;
/**
* Check system requirements
*/
$errorFound = false; // Set the errorFound flag to false
/* Check if the PHP version is greater than or equal to 7.2.5 */
$phpVersion = PHP_VERSION;
if (version_compare($phpVersion, '7.2.5', '<')) {
/* If the PHP version is less than 7.2.5, throw an exception */
$errorFound = true;
$errorIsPHPVersion = true;
$phpErrorMessage = "PHP version must be greater than or equal to 7.2.5, current version is $phpVersion";
}
/* Check if the MySQLi extension is installed */
if (!extension_loaded('mysqli')) {
/* If the MySQLi extension is not installed, throw an exception */
$errorFound = true;
$errorIsMySQLiExtension = true;
$mysqliErrorMessage = "MySQLi extension is not installed";
}
/* If MySQLi is installed, check if the database variables are set in the .env file */
if (!isset($_ENV['DB_HOST']) || !isset($_ENV['DB_PORT']) || !isset($_ENV['DB_DATABASE']) || !isset($_ENV['DB_USERNAME']) || !isset($_ENV['DB_PASSWORD'])) {
/* If the database variables are not set, throw an exception */
$errorFound = true;
$errorIsDBVarMissing = true;
} else {
/* If the env vars contain database information, try to connect */
try {
$testConnection = testDatabaseConnection($_ENV['DB_HOST'], $_ENV['DB_USERNAME'], $_ENV['DB_PASSWORD'], $_ENV['DB_DATABASE'], $PORT);
} catch (Exception $e) {
// Log the error
error_log("Failed to connect to the database: " . $e->getMessage());
//throw an exception if the connection fails
$errorFound = true;
$errorIsDBConnectionFailed = true;
$dbErrorMessage = "Failed to connect to the database: " . $e->getMessage();
$testConnection = false;
}
/* Check if the connection failed */
if ($testConnection == false) {
//try to connect to the database if the connection failed, but only if the error is not a failed connection
if (!$errorIsDBConnectionFailed || !$errorFound) {
//try to connect to the database
try {
//port is a string, need to convert to int
$PORT = intval($PORT);
$mysqli = new mysqli($_ENV['DB_HOST'], $_ENV['DB_USERNAME'], $_ENV['DB_PASSWORD'], $_ENV['DB_DATABASE'], $PORT);
} catch (Exception $e) {
// Log the error
error_log("Failed to connect to the database: " . $e->getMessage());
//throw an exception if the connection fails
$errorFound = true;
$errorIsDBConnectionFailed = true;
$dbErrorMessage = "Failed to connect to the database: " . $e->getMessage();
}
}
//check if the error is a failed connection, if not close the connection
if (!$errorIsDBConnectionFailed) {
closeDatabaseConnection($mysqli);
}
} else {
/* If the connection was successful, check if the database is empty */
$mysqli = connectToDatabase($_ENV['DB_HOST'], $_ENV['DB_USERNAME'], $_ENV['DB_PASSWORD'], $_ENV['DB_DATABASE'], $PORT);
/* Query to check if the database is empty */
$sql = "SELECT * FROM users";
//try to run the query
try {
$result = $mysqli->query($sql);
} catch (Exception $e) {
// Log the error
error_log("Failed to run the query: " . $e->getMessage());
//throw an exception if the query fails
$errorFound = true;
$errorIsDBNotEmpty = true;
//return an empty result
$result = null;
}
//check if the result is null
if ($result == null) {
//if the result is null, the table does not exist
$errorIsTableNotExists = true;
//so the database is empty
$errorIsDBNotEmpty = false;
} else {
//if the result is not null, the table exists
$errorIsTableNotExists = false;
//so the database is not empty
$errorIsDBNotEmpty = true;
}
/* Check if the MySQL version is greater than or equal to 5.7.0 */
$mysqlVersion = $mysqli->server_info;
if (version_compare($mysqlVersion, '5.7.0', '<')) {
/* If the MySQL version is less than 5.7.0, throw an exception */
$errorFound = true;
$errorIsMySQLVersion = true;
$mysqlErrorMessage = "MySQL version must be greater than or equal to 5.7.0, current version is $mysqlVersion";
}
/* Close the connection to the database */
closeDatabaseConnection($mysqli);
}
}
/* Check if mail is enabled */
if (!function_exists('mail')) {
/* If mail is not enabled, throw an exception */
$errorFound = true;
$mailErrorMessage = "PHP Mail is not enabled";
}
?>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<title><?php echo htmlspecialchars(APP_NAME) ?> | First Time Setup</title>
<!-- Favicons/Icons and Manifest -->
<link rel="icon" href="/favicon.ico" sizes="32x32">
<link rel="icon" href="/icon.svg" type="image/svg+xml">
<link rel="icon" href="/favicon-16x16.png" sizes="16x16">
<link rel="icon" href="/favicon-32x32.png" sizes="32x32">
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
<link rel="android-chrome" href="/android-chrome-192x192.png" sizes="192x192">
<link rel="android-chrome" href="/android-chrome-512x512.png" sizes="512x512">
<link rel="manifest" href="/site.webmanifest">
<?php echo includeHeader(); ?>
</head>
<body class="nav-fixed">
<nav class="top-nav navbar navbar-expand-lg navbar-dark bg-dark schoolBrandedNav">
<!-- Navbar Brand-->
<div class="navbar-brand brand-container">
<span class="brand-text"><a class="navbar-brand ps-3" href="<?php echo APP_URL ?>"><?php echo htmlspecialchars(APP_NAME) ?></a></span>
</div>
</nav>
<main>
<div id="layout_content" class="w-95 mx-auto nav-less">
<div class="container-fluid px-4">
<div class="row">
<div class="container">
<!-- Application Logo -->
<div class="text-center">
<img src="/icon.svg" alt="Application Logo" class="img-fluid" style="max-width: 200px;">
<!-- #region -->
<h1 class="mt-3"><?php echo htmlspecialchars(APP_NAME) ?></h1>
<p class="lead">First Time Setup</p>
</div>
</div>
</div>
<div class="row">
<div class="container">
<?php /* Check if setup has already been run */
if (file_exists('ready.php')) { ?>
<div class="text-center">
<!-- Setup has already been run, notify the user -->
<h2>Setup has already been run.</h2>
<p>You do not need to load this file directly.</p>
<p>If you need to run setup again, please delete the ready.php file and refresh this page.
</p>
<p>Return to the <a href="index.php">application</a>.</p>
</div>
<?php } else { ?>
<div class="text-center">
<!-- Setup has not been run, run the setup process -->
<h2><?php echo htmlspecialchars(APP_NAME) ?> Installation</h2>
<p>Welcome to <?php echo htmlspecialchars(APP_NAME) ?>.</p>
<p>Before you can use the application, you must configure the database and create a user.
</p>
<h3>Checking the system configuration:</h3>
</div>
<ul>
<li>PHP Version: (Must be version 7.2.5 or newer)</li>
<li>MySQLi Extension: (Must be enabled)</li>
<li>MySQL Version: (Must be version 5.7.0 or newer, only checked if variables are set)
</li>
<li>PHP Mail: (Must be enabled)</li>
</ul>
<ul>
<?php if ($errorIsPHPVersion) { ?>
<li style="color: red;"><?php echo $phpErrorMessage; ?></li>
<?php } else { ?>
<li style="color: green;">PHP Version: <?php echo $phpVersion; ?> - OK!</li>
<?php } ?>
<?php if ($errorIsMySQLiExtension) { ?>
<li style="color: red;"><?php echo $mysqliErrorMessage; ?></li>
<?php } else { ?>
<li style="color: green;">MySQLi Extension - OK!</li>
<?php } ?>
<?php if ($errorIsDBVarMissing) { ?>
<li style="color: red;">Database variables are missing from the .env file, will attempt
to
configure them
below.</li>
<?php } else {
/* if the database variables are set, was the connection successful? */
if ($errorIsDBConnectionFailed) { ?>
<li style="color: red;"><?php echo $dbErrorMessage; ?></li>
<?php } else {
/* If the connection was successful, was the database empty? */
if ($errorIsDBNotEmpty) { ?>
<li style="color: red;">The database is not empty, please empty the database and try
again.
</li>
<?php } else {
/* If the database is empty, was the MySQL version greater than or equal to 5.7.0? */
if ($errorIsMySQLVersion) { ?>
<li style="color: red;"><?php echo $mysqlErrorMessage; ?></li>
<?php } else { ?>
<li style="color: green;">MySQL Version: <?php echo $mysqlVersion; ?> - OK!</li>
<?php }
}
}
} ?>
<?php if ($errorIsMailEnabled) { ?>
<li style="color: red;"><?php echo $mailErrorMessage; ?></li>
<?php } else { ?>
<li style="color: green;">PHP Mail - OK!</li>
<?php } ?>
</ul>
</div>
<!-- there were database errors of any kind, show the form to configure the database -->
<?php if ($errorFound && $errorIsDBVarMissing || $errorIsMySQLVersion || $errorIsDBConnectionFailed) { ?>
<h3>Configure the database:</h3>
<div>
<form action="setup.php" method="post">
<label for="db_host">Database Host:</label>
<input type="text" name="db_host" id="db_host" placeholder="<?php echo $_ENV['DB_HOST']; ?>" required>
<br>
<label for="db_port">Database Port:</label>
<input type="number" name="db_port" id="db_port" placeholder="<?php echo $_ENV['DB_PORT']; ?>" required>
<br>
<label for="db_database">Database Name:</label>
<input type="text" name="db_database" id="db_database" placeholder="<?php echo $_ENV['DB_DATABASE']; ?>" required>
<br>
<label for="db_username">Database Username:</label>
<input type="text" name="db_username" id="db_username" placeholder="<?php echo $_ENV['DB_USERNAME']; ?>" required>
<br>
<label for="db_password">Database Password:</label>
<input type="password" name="db_password" id="db_password" placeholder="<?php echo $_ENV['DB_PASSWORD']; ?>" required>
<br>
<input type="submit" name="db_submit" value="Submit">
</form>
<div>
<?php
/* Check if the form was submitted, if errored notify the user */
if (isset($_POST['db_submit'])) {
$testConnection = connectToDatabase($_POST['db_host'], $_POST['db_username'], $_POST['db_password'], $_POST['db_database'], $_POST['db_port']);
//get the result of the connection
if ($testConnection) {
$errorFound = false;
$errorIsDBConnectionFailed = false;
} else {
$errorFound = true;
$errorIsDBConnectionFailed = true;
$dbErrorMessage = "Failed to connect to the database";
}
if ($errorFound) { ?>
<p>There were errors found in the system configuration, please fix the following before
continuing:</p>
<?php if ($errorIsDBConnectionFailed) { ?>
<p><?php echo $dbErrorMessage; ?></p>
<?php } ?>
<?php } ?>
<ul>
<li>Database Host</li>
<li>Database Port</li>
<li>Database Name</li>
<li>Database Username</li>
<li>Database Password</li>
</ul>
<ul>
<?php if (empty($_POST['db_host'])) { ?>
<li style="color: red;">Database Host is required</li>
<?php } else { ?>
<li style="color: green;">Database Host - OK!</li>
<?php } ?>
<?php if (empty($_POST['db_port'])) { ?>
<li style="color: red;">Database Port is required</li>
<?php } else { ?>
<li style="color: green;">Database Port - OK!</li>
<?php } ?>
<?php if (empty($_POST['db_database'])) { ?>
<li style="color: red;">Database Name is required</li>
<?php } else { ?>
<li style="color: green;">Database Name - OK!</li>
<?php } ?>
<?php if (empty($_POST['db_username'])) { ?>
<li style="color: red;">Database Username is required</li>
<?php } else { ?>
<li style="color: green;">Database Username - OK!</li>
<?php } ?>
<?php if (empty($_POST['db_password'])) { ?>
<li style="color: red;">Database Password is required</li>
<?php } else { ?>
<li style="color: green;">Database Password - OK!</li>
<?php } ?>
</ul>
<?php } ?>
</div>
</div>
<?php } else { ?>
<!-- there were no database errors, show the form to have the user approve the table installation -->
<h3>Install the database tables:</h3>
<div>
<form action="setup.php" method="post">
<input type="submit" name="install_tables" value="Install Tables">
</form>
<div>
<?php
/* Check if the form was submitted, if errored notify the user */
if (isset($_POST['install_tables'])) {
//check the mysql version to see which file to use (helps with compatibility for different versions)
$mysqli = connectToDatabase($_ENV['DB_HOST'], $_ENV['DB_USERNAME'], $_ENV['DB_PASSWORD'], $_ENV['DB_DATABASE'], $PORT);
$mysqlVersion = $mysqli->server_info;
closeDatabaseConnection($mysqli);
//check if the mysql version is greater than or equal to 8.0.0
if (version_compare($mysqlVersion, '8.0.0', '>=')) {
//if the mysql version is greater than or equal to 8.0.0, use the 8.0.0 sql file
$sqlFile = BASEPATH . '/temp/talentflow8.sql';
} else {
//if the mysql version is less than 8.0.0, use the 5.7.0 sql file
$sqlFile = BASEPATH . '/temp/talentflow.sql';
}
//verify the sql file exists in the temp directory
if (file_exists($sqlFile)) {
//try to run the sql file
try {
$mysqli = connectToDatabase($_ENV['DB_HOST'], $_ENV['DB_USERNAME'], $_ENV['DB_PASSWORD'], $_ENV['DB_DATABASE'], $PORT);
//get the sql file
$sql = file_get_contents($sqlFile);
//run the sql file
if ($mysqli->multi_query($sql)) {
do {
//store the result
if ($result = $mysqli->store_result()) {
$result->free();
}
} while ($mysqli->more_results() && $mysqli->next_result());
}
//close the connection
closeDatabaseConnection($mysqli);
$errorFound = false;
$errorIsDBConnectionFailed = false;
} catch (Exception $e) {
// Log the error
error_log("Failed to install the database tables: " . $e->getMessage());
//throw an exception if the connection fails
$errorFound = true;
$errorIsDBConnectionFailed = true;
$dbErrorMessage = "Failed to install the database tables: " . $e->getMessage();
}
//if no errors were found, check if the database has a users table
$hasUsersTable = false;
try {
$mysqli = connectToDatabase($_ENV['DB_HOST'], $_ENV['DB_USERNAME'], $_ENV['DB_PASSWORD'], $_ENV['DB_DATABASE'], $PORT);
$sql = "SELECT * FROM users";
$result = $mysqli->query($sql);
if ($result) {
$hasUsersTable = true;
}
closeDatabaseConnection($mysqli);
} catch (Exception $e) {
// Log the error
error_log("User table does not exist: " . $e->getMessage());
//throw an exception if the connection fails
$errorFound = true;
$errorIsDBConnectionFailed = true;
$dbErrorMessage = "User table does not exist: " . $e->getMessage();
}
//if the users table exists, check for the admin user
if ($hasUsersTable) {
$hasAdminUser = false;
try {
$mysqli = connectToDatabase($_ENV['DB_HOST'], $_ENV['DB_USERNAME'], $_ENV['DB_PASSWORD'], $_ENV['DB_DATABASE'], $PORT);
$sql = "SELECT * FROM users WHERE username = 'admin'";
$result = $mysqli->query($sql);
if ($result->num_rows > 0) {
$hasAdminUser = true;
}
closeDatabaseConnection($mysqli);
} catch (Exception $e) {
// Log the error
error_log("Admin user does not exist: " . $e->getMessage());
//throw an exception if the connection fails
$errorFound = true;
$errorIsDBConnectionFailed = true;
$dbErrorMessage = "Admin user does not exist: " . $e->getMessage();
}
//if the admin user does not exist, create the admin user
if (!$hasAdminUser) {
$role_id = null;
//get the role id for the SUPERADMIN role
try {
$mysqli = connectToDatabase($_ENV['DB_HOST'], $_ENV['DB_USERNAME'], $_ENV['DB_PASSWORD'], $_ENV['DB_DATABASE'], $PORT);
$sql = "SELECT id FROM roles WHERE name = 'SUPERADMIN'";
$result = $mysqli->query($sql);
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
$role_id = $row['id'];
}
}
closeDatabaseConnection($mysqli);
} catch (Exception $e) {
// Log the error
error_log("Failed to get the role id: " . $e->getMessage());
//throw an exception if the connection fails
$errorFound = true;
$errorIsDBConnectionFailed = true;
$dbErrorMessage = "Failed to get the role id: " . $e->getMessage();
}
//if the role id was found, create the admin user
if ($role_id != null) {
try {
$mysqli = connectToDatabase($_ENV['DB_HOST'], $_ENV['DB_USERNAME'], $_ENV['DB_PASSWORD'], $_ENV['DB_DATABASE'], $PORT);
$sql = "INSERT INTO users (username, password, email, role_id) VALUES ('admin', '" . password_hash('admin', PASSWORD_DEFAULT, ["cost" => 10]) . "', intval($role_id))";
$result = $mysqli->query($sql);
closeDatabaseConnection($mysqli);
} catch (Exception $e) {
// Log the error
error_log("Failed to create the admin user: " . $e->getMessage());
//throw an exception if the connection fails
$errorFound = true;
$errorIsDBConnectionFailed = true;
$dbErrorMessage = "Failed to create the admin user: " . $e->getMessage();
}
}
//if there was an admin user, make sure the default password is set to admin
if ($hasAdminUser) {
try {
$mysqli = connectToDatabase($_ENV['DB_HOST'], $_ENV['DB_USERNAME'], $_ENV['DB_PASSWORD'], $_ENV['DB_DATABASE'], $PORT);
$sql = "UPDATE users SET password = '" . password_hash('admin', PASSWORD_DEFAULT, ["cost" => 10]) . "' WHERE username = 'admin'";
$result = $mysqli->query($sql);
closeDatabaseConnection($mysqli);
} catch (Exception $e) {
// Log the error
error_log("Failed to update the admin user password: " . $e->getMessage());
//throw an exception if the connection fails
$errorFound = true;
$errorIsDBConnectionFailed = true;
$dbErrorMessage = "Failed to update the admin user password: " . $e->getMessage();
}
}
}
}
} else {
//if the file does not exist, throw an exception
$errorFound = true;
$errorIsDBConnectionFailed = true;
$dbErrorMessage = "The database template file does not exist";
}
//try to connect to the database
try {
$mysqli = connectToDatabase($_ENV['DB_HOST'], $_ENV['DB_USERNAME'], $_ENV['DB_PASSWORD'], $_ENV['DB_DATABASE'], $PORT);
} catch (Exception $e) {
// Log the error
error_log("Failed to connect to the database: " . $e->getMessage());
//throw an exception if the connection fails
$errorFound = true;
$errorIsDBConnectionFailed = true;
$dbErrorMessage = "Failed to connect to the database: " . $e->getMessage();
}
if ($errorFound) { ?>
<p>There were errors found in the system configuration, please fix the following before
continuing:</p>
<?php if ($errorIsDBConnectionFailed) { ?>
<p><?php echo $dbErrorMessage; ?></p>
<?php } ?>
<?php } ?>
<ul>
<li>Database Tables</li>
</ul>
<ul>
<?php if ($errorIsDBConnectionFailed) { ?>
<li style="color: red;"><?php echo $dbErrorMessage; ?></li>
<?php } else { ?>
<li style="color: green;">Database Connection - OK!</li>
<li style="color: green;">Database Tables - OK!</li>
<?php } ?>
</ul>
<?php if (!$errorIsDBConnectionFailed) { ?>
<p>Setup is complete, you can now <a href="index.php">launch the application</a>.</p>
<p>The default login is: </p>
<p>Username: admin</p>
<p>Password: admin</p>
<p>It is recommended to change the default password after logging in.</p>
<?php } ?>
<!-- if the database tables were installed, create the ready file -->
<?php if (!$errorIsDBConnectionFailed) {
//create the ready file
$readyFile = fopen(BASEPATH . '/ready.php', 'w');
fclose($readyFile);
} ?>
<?php } ?>
</div>
</div>
<?php } ?>
<?php } ?>
</div>
</div>
</div>
</div>
</main>
</body>
<?php echo includeFooter(); ?>
<?php ?>