-
Notifications
You must be signed in to change notification settings - Fork 5
/
configure_system.php
623 lines (553 loc) · 23.4 KB
/
configure_system.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
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
<?php
/*.
require_module 'standard';
.*/
const ENV_FILE = __DIR__.'/.env';
const DB_HOST = 'DBHOST';
const DB_USER = 'DBUSER';
const DB_NAME = 'DBNAME';
const DB_PASS = 'DBPASS';
const DB_PORT = 'DBPORT';
const NEW_NEONID = 'NEW_NEONID';
const NEW_NEONKEY = 'NEW_NEONKEY';
const NEW_NEONBETA = 'NEW_NEONBETA';
const NEW_ADMINACCOUNTS = 'NEW_ADMINACCOUNTS';
const NEW_ADMINEMAIL = 'NEW_ADMINEMAIL';
const NEW_NOREPLY_EMAIL = 'NEW_NOREPLY_EMAIL';
const NEW_FEEDBACK_EMAIL = 'NEW_FEEDBACK_EMAIL';
const NEW_SECURITY_EMAIL = 'NEW_SECURITY_EMAIL';
const NEW_HELP_EMAIL = 'NEW_HELP_EMAIL';
const NEW_ADMINCRED = 'NEW_ADMINPASSWORD';
const NEW_CONHOST = 'NEW_CONHOST';
const NEW_TIMEZONE = 'NEW_TIMEZONE';
const SQL_INSERT = "INSERT INTO `Configuration`(`Field`, `Value`)";
const SQL_ON_DUP = "ON DUPLICATE KEY UPDATE `Value` = '";
const VALUE_EQ = '" value="';
const UI_PROBLEM = 'UI-red';
const NEW_COLOR_PRIMARY = 'NEW_COLOR_PRIMARY';
const NEW_COLOR_PRIM_BACK = 'NEW_COLOR_PRIM_BACK';
const NEW_COLOR_SECONDARY = 'NEW_COLOR_SECONDARY';
const NEW_COLOR_SECOND_BACK = 'NEW_COLOR_SECOND_BACK';
require __DIR__."/vendor/autoload.php";
if (is_file(ENV_FILE)) {
$dotenv = Dotenv\Dotenv::create(__DIR__);
$dotenv->load();
$configure = false;
try {
$dotenv->required([DB_HOST, DB_USER, DB_NAME, DB_PASS, 'DB_BACKEND']);
} catch (RuntimeException $e) {
$configure = true;
}
if ($_ENV['DOCKER'] && !$configure) {
require_once(__DIR__."/functions/functions.inc");
$sql = "SELECT COUNT(`AccountID`) as count FROM `Authentication`;";
$result = DB::run($sql);
$value = $result->fetch();
if ($value === false || $value['count'] == 0) {
$configure = true;
}
}
} else {
$configure = true;
}
function delete_files($target)
{
if (is_dir($target)) {
$files = glob($target.'*', GLOB_MARK);
foreach ($files as $file) {
delete_files($file);
}
@rmdir($target);
} elseif (is_file($target)) {
@unlink($target);
}
}
require_once __DIR__."/functions/locations.inc";
if (!$configure) {
header("Location: ".$BASEURL."/index.php?Function=public");
}
$updateData = null;
$failed_message = "";
$tried = false;
/* Clear scss */
delete_files(@sys_get_temp_dir().'/scss_cache');
/* Pre headers */
if (!empty($_POST)) {
$arguments = [
DB_HOST => FILTER_SANITIZE_SPECIAL_CHARS,
DB_USER => FILTER_SANITIZE_SPECIAL_CHARS,
DB_NAME => FILTER_SANITIZE_SPECIAL_CHARS,
DB_PASS => FILTER_SANITIZE_SPECIAL_CHARS,
DB_PORT => FILTER_SANITIZE_SPECIAL_CHARS,
NEW_NEONID => FILTER_SANITIZE_SPECIAL_CHARS,
NEW_NEONKEY => FILTER_SANITIZE_SPECIAL_CHARS,
NEW_NEONBETA => FILTER_SANITIZE_SPECIAL_CHARS,
NEW_ADMINACCOUNTS => FILTER_SANITIZE_SPECIAL_CHARS,
NEW_ADMINEMAIL => FILTER_SANITIZE_SPECIAL_CHARS,
NEW_NOREPLY_EMAIL => FILTER_SANITIZE_SPECIAL_CHARS,
NEW_FEEDBACK_EMAIL => FILTER_SANITIZE_SPECIAL_CHARS,
NEW_SECURITY_EMAIL => FILTER_SANITIZE_SPECIAL_CHARS,
NEW_HELP_EMAIL => FILTER_SANITIZE_SPECIAL_CHARS,
NEW_ADMINCRED => FILTER_SANITIZE_SPECIAL_CHARS,
NEW_CONHOST => FILTER_SANITIZE_SPECIAL_CHARS,
NEW_TIMEZONE => FILTER_SANITIZE_SPECIAL_CHARS,
NEW_COLOR_PRIMARY => FILTER_SANITIZE_SPECIAL_CHARS,
NEW_COLOR_PRIM_BACK => FILTER_SANITIZE_SPECIAL_CHARS,
NEW_COLOR_SECONDARY => FILTER_SANITIZE_SPECIAL_CHARS,
NEW_COLOR_SECOND_BACK => FILTER_SANITIZE_SPECIAL_CHARS,
];
$updateData = filter_input_array(INPUT_POST, $arguments);
$tried = true;
$DBHOST = $updateData[DB_HOST];
$DBUSER = $updateData[DB_USER];
$DBNAME = $updateData[DB_NAME];
$DBPASS = $updateData[DB_PASS];
$DBPORT = $updateData[DB_PORT];
$NEW_NEONID = $updateData[NEW_NEONID];
$NEW_NEONKEY = $updateData[NEW_NEONKEY];
$NEW_NEONBETA = $updateData[NEW_NEONBETA];
$NEW_ADMINACCOUNTS = $updateData[NEW_ADMINACCOUNTS];
$NEW_CONHOST = $updateData[NEW_CONHOST];
$NEW_ADMINEMAIL = $updateData[NEW_ADMINEMAIL];
$NEW_FEEDBACK_EMAIL = $updateData[NEW_FEEDBACK_EMAIL];
$NEW_SECURITY_EMAIL = $updateData[NEW_SECURITY_EMAIL];
$NEW_HELP_EMAIL = $updateData[NEW_HELP_EMAIL];
$NEW_NOREPLY_EMAIL = $updateData[NEW_NOREPLY_EMAIL];
$NEW_ADMINPASSWORD = $updateData[NEW_ADMINCRED];
$NEW_TIMEZONE = $updateData[NEW_TIMEZONE];
$NEW_COLOR_PRIMARY = $updateData[NEW_COLOR_PRIMARY];
$NEW_COLOR_PRIM_BACK = $updateData[NEW_COLOR_PRIM_BACK];
$NEW_COLOR_SECONDARY = $updateData[NEW_COLOR_SECONDARY];
$NEW_COLOR_SECOND_BACK = $updateData[NEW_COLOR_SECOND_BACK];
if (strlen($DBHOST) > 0 &&
strlen($DBUSER) > 0 &&
strlen($DBNAME) > 0 &&
strlen($DBPASS) > 0 &&
strlen($NEW_CONHOST) > 0 &&
strlen($NEW_ADMINEMAIL) > 0 &&
strlen($NEW_NOREPLY_EMAIL) > 0 &&
strlen($NEW_TIMEZONE) > 0 &&
(strlen($NEW_NEONKEY) || strlen($NEW_ADMINPASSWORD))) {
if (!isset($_ENV['DOCKER'])) {
if (file_exists(ENV_FILE)) {
chmod(ENV_FILE, 0600);
}
$myfile = fopen(ENV_FILE, "w");
if ($NEW_NEONKEY || $NEW_NEONID) {
$crm = 'CRM_BACKEND=neon.inc';
} else {
$crm = '# CRM_BACKEND=none.inc';
}
fwrite($myfile, <<<DONE
# CON-In-A-Box Site Config (module)
# Setup via web page
DB_BACKEND=mysqlpdo.inc
$crm
# DBConfig, passwords, etc
# Do not share this info
DBHOST="$DBHOST" # Where the DB Runs
DBUSER="$DBUSER" # The Database Username
DBNAME="$DBNAME" # The Database Name
DBPASS="$DBPASS" # *PLAIN TEXT* database user's password
DONE
);
fclose($myfile);
chmod(ENV_FILE, 0400);
}
$good = true;
try {
/* Load the database */
require_once(__DIR__."/functions/functions.inc");
} catch (Exception $e) {
$good = false;
$failed_message = "Failed to connect to Database";
}
if ($good) {
if (strpos($NEW_ADMINEMAIL, '@') != false) {
require_once(__DIR__."/functions/users.inc");
require_once(__DIR__."/functions/authentication.inc");
if (empty($NEW_NEONID) && empty($NEW_NEONKEY)) {
$aid = \createUser($NEW_ADMINEMAIL, 1000);
if ($aid !== null) {
\createPassword($NEW_ADMINEMAIL, $NEW_ADMINPASSWORD);
if (!empty($NEW_ADMINACCOUNTS)) {
$NEW_ADMINACCOUNTS = implode(',', [$NEW_ADMINACCOUNTS, $aid]);
} else {
$NEW_ADMINACCOUNTS = $aid;
}
} else {
$output = lookup_users_by_email($NEW_ADMINEMAIL);
if (count($output['users']) != 0) {
$aid = $output['users'][0]['Id'];
}
}
}
}
$sql = SQL_INSERT;
$sql .= " VALUES ('CONHOST', '".$NEW_CONHOST."') ";
$sql .= SQL_ON_DUP.$NEW_CONHOST."';";
DB::run($sql);
if (!empty($NEW_ADMINEMAIL)) {
$sql = SQL_INSERT;
$sql .= " VALUES ('ADMINEMAIL', '".$NEW_ADMINEMAIL."') ";
$sql .= SQL_ON_DUP.$NEW_ADMINEMAIL."';";
DB::run($sql);
}
if (!empty($NEW_ADMINACCOUNTS)) {
$sql = SQL_INSERT;
$sql .= " VALUES ('ADMINACCOUNTS', '".$NEW_ADMINACCOUNTS."') ";
$sql .= SQL_ON_DUP.$NEW_ADMINACCOUNTS."';";
DB::run($sql);
}
if (!empty($NEW_NEONID)) {
$sql = SQL_INSERT;
$sql .= " VALUES ('NEONID', '".$NEW_NEONID."') ";
$sql .= SQL_ON_DUP.$NEW_NEONID."';";
DB::run($sql);
}
if (!empty($NEW_NEONKEY)) {
$sql = SQL_INSERT;
$sql .= " VALUES ('NEONKEY', '".$NEW_NEONKEY."') ";
$sql .= SQL_ON_DUP.$NEW_NEONKEY."';";
DB::run($sql);
}
if (!empty($NEW_NEONBETA)) {
$sql = SQL_INSERT;
$sql .= " VALUES ('NEONTRIAL', '".$NEW_NEONBETA."') ";
$sql .= SQL_ON_DUP.$NEW_NEONBETA."';";
DB::run($sql);
}
$sql = SQL_INSERT;
$sql .= " VALUES ('TIMEZONE', '".$NEW_TIMEZONE."') ";
$sql .= SQL_ON_DUP.$NEW_TIMEZONE."';";
DB::run($sql);
if (!empty($NEW_FEEDBACK_EMAIL)) {
$sql = SQL_INSERT;
$sql .= " VALUES ('FEEDBACK_EMAIL', '".$NEW_FEEDBACK_EMAIL."') ";
$sql .= SQL_ON_DUP.$NEW_FEEDBACK_EMAIL."';";
DB::run($sql);
}
if (!empty($NEW_SECURITY_EMAIL)) {
$sql = SQL_INSERT;
$sql .= " VALUES ('SECURITY_EMAIL', '".$NEW_SECURITY_EMAIL."') ";
$sql .= SQL_ON_DUP.$NEW_SECURITY_EMAIL."';";
DB::run($sql);
}
if (!empty($NEW_HELP_EMAIL)) {
$sql = SQL_INSERT;
$sql .= " VALUES ('HELP_EMAIL', '".$NEW_HELP_EMAIL."') ";
$sql .= SQL_ON_DUP.$NEW_HELP_EMAIL."';";
DB::run($sql);
}
if (!empty($NEW_NOREPLY_EMAIL)) {
$sql = SQL_INSERT;
$sql .= " VALUES ('NOREPLY_EMAIL', '".$NEW_NOREPLY_EMAIL."') ";
$sql .= SQL_ON_DUP.$NEW_NOREPLY_EMAIL."';";
DB::run($sql);
}
if (!empty($NEW_COLOR_PRIMARY)) {
$sql = SQL_INSERT;
$sql .= " VALUES ('col.primary', '".$NEW_COLOR_PRIMARY."') ";
$sql .= SQL_ON_DUP.$NEW_COLOR_PRIMARY."';";
DB::run($sql);
}
if (!empty($NEW_COLOR_PRIM_BACK)) {
$sql = SQL_INSERT;
$sql .= " VALUES ('col.prim-back', '".$NEW_COLOR_PRIM_BACK."') ";
$sql .= SQL_ON_DUP.$NEW_COLOR_PRIM_BACK."';";
DB::run($sql);
}
if (!empty($NEW_COLOR_SECONDARY)) {
$sql = SQL_INSERT;
$sql .= " VALUES ('col.secondary', '".$NEW_COLOR_SECONDARY."') ";
$sql .= SQL_ON_DUP.$NEW_COLOR_SECONDARY."';";
DB::run($sql);
}
if (!empty($NEW_COLOR_SECOND_BACK)) {
$sql = SQL_INSERT;
$sql .= " VALUES ('col.second-back', '".$NEW_COLOR_SECOND_BACK."') ";
$sql .= SQL_ON_DUP.$NEW_COLOR_SECOND_BACK."';";
DB::run($sql);
}
header("Location: ".$BASEURL."/index.php?Function=public");
exit();
}
} else {
$failed_message = "Fields left empty.";
}
}
$CONSITENAME = "First Run Setup";
require(__DIR__.'/pages/base/header_start.inc');
print "<link rel='stylesheet' href='style.php/styles.scss'/>\n";
print "<script src='sitesupport/common.js'></script>\n";
print "<script src='sitesupport/dropdownsection.js'></script>\n";
require(__DIR__.'/pages/base/header_end.inc');
require(__DIR__.'/pages/base/body_begin.inc');
?>
<div id="page" class="UI-container">
<div class="UI-maincontent">
<h2 class="UI-center event-color-primary"> First Run Setup </h2>
<?php
if (strlen($failed_message)) {
echo '<div class="UI-configure-panel UI-red UI-center"><h2>'.$failed_message."</h2></div>\n";
}
?>
<div class="UI-configure-panel">
<p> Hello and welcome to Con-In-A-Box. This page will help to get your instance up and running. Please make sure all the information is correct before submitting. </p>
</div>
<div class="UI-configure-panel">
<em>Note: The Database and database user have to be created by hand before you begin the process. </em>
</div>
<div class="UI-configure-info-panel">
<p> In order to configure your site we need to know the following information. </p>
</div>
<form action="configure_system.php" method="POST" class="UI-container">
<div class="UI-event-sectionbar UI-margin">Database Configuration (Required)</div>
<div class="UI-margin UI-padding UI-border">
<div class="UI-pad-bottom">
<label>Database Host:</label>
<input type="text" name="DBHOST" class="UI-input <?php
if ($updateData != null && strlen($updateData[DB_HOST])) {
echo VALUE_EQ.$updateData[DB_HOST];
} elseif (isset($_ENV[DB_HOST])) {
echo VALUE_EQ.$_ENV[DB_HOST];
} elseif ($tried) {
echo UI_PROBLEM;
}
?>">
</div>
<div class="UI-pad-bottom">
<label>Database Username:</label> <br>
<input type="text" name="DBUSER" class="UI-input <?php
if ($updateData != null && strlen($updateData[DB_USER])) {
echo VALUE_EQ.$updateData[DB_USER];
} elseif (isset($_ENV[DB_USER])) {
echo VALUE_EQ.$_ENV[DB_USER];
} elseif ($tried) {
echo UI_PROBLEM;
}
?>">
</div>
<div class="UI-pad-bottom">
<label>Database Name:</label> <br>
<input type="text" name="DBNAME" class="UI-input <?php
if ($updateData != null && strlen($updateData[DB_NAME])) {
echo VALUE_EQ.$updateData[DB_NAME];
} elseif (isset($_ENV[DB_NAME])) {
echo VALUE_EQ.$_ENV[DB_NAME];
} elseif ($tried) {
echo UI_PROBLEM;
}
?>">
</div>
<div class="UI-pad-bottom">
<label>Database Password:</label> <br>
<input type="text" name="DBPASS" class="UI-input <?php
if ($updateData != null && strlen($updateData[DB_PASS])) {
echo VALUE_EQ.$updateData[DB_PASS];
} elseif (isset($_ENV[DB_PASS])) {
echo VALUE_EQ.$_ENV[DB_PASS];
} elseif ($tried) {
echo UI_PROBLEM;
}
?>">
</div>
<div class="UI-pad-bottom">
<label>Database Port:</label> <br>
<input type="text" name="DBPORT" class="UI-input <?php
if ($updateData != null && strlen($updateData[DB_PORT])) {
echo VALUE_EQ.$updateData[DB_PORT];
} elseif (isset($_ENV[DB_PORT])) {
echo VALUE_EQ.$_ENV[DB_PORT];
} else {
echo VALUE_EQ."3306";
}
?>">
</div>
</div>
<div id="crm_content" class="UI-margin">
<button type="button" class="UI-event-dropdown-bar" onclick="expandSection('crm')">
<span>Neon CRM Data (Optional)</span> <em id="crm_arrow" class="fas fa-caret-down"></em>
</button>
<div id="crm" class="UI-container UI-padding UI-adminborder UI-hide">
<div class="UI-orange UI-configure-info-panel">
Use of Neon CRM is optional. Define BOTH keys if Neon CRM is in use.
</div>
<div>
<label>Neon CRM Key:</label> <br>
<input type="text" name="NEW_NEONKEY" class="UI-input <?php
if ($updateData != null && strlen($updateData[NEW_NEONKEY])) {
echo VALUE_EQ.$updateData[NEW_NEONKEY];
} elseif ($tried) {
echo UI_PROBLEM;
}
?>" placeholder="<example: bbbbbccccdddfae12341aabbccddeeff>">
</br>
<label>Neon CRM ID:</label> <br>
<input type="text" name="NEW_NEONID" class="UI-input <?php
if ($updateData != null && strlen($updateData[NEW_NEONID])) {
echo VALUE_EQ.$updateData[NEW_NEONID];
} elseif ($tried) {
echo UI_PROBLEM;
}
?>" placeholder="<example: home>">
</br>
<label>Is Neon Trial Account:</label> <br>
<input type="checkbox" name="NEW_NEONBETA" class="UI-checkbox <?php
if ($updateData != null && $updateData[NEW_NEONBETA]) {
echo '" checked';
} elseif ($tried) {
echo UI_PROBLEM;
}
?>">
</br>
<div class="w3-orange w3-panel w3-padding-16">
If you are importing from CRM put a comma seperated list of user IDs of the primary admins here. If we do not find an '@' in the entry we will just add the contents here as the admin Ids being imported.
</div>
<label>Admin User IDs (comma seperated):</label> <br>
<input type="text" name="NEW_ADMINACCOUNTS" class="UI-input <?php
if ($updateData != null && strlen($updateData[NEW_ADMINACCOUNTS])) {
echo VALUE_EQ.$updateData[NEW_ADMINACCOUNTS];
} elseif ($tried) {
echo UI_PROBLEM;
}
?>" placeholder="<example: 1234,5678,901234>">
</div>
</div>
</div>
<div class="UI-event-sectionbar UI-margin">Event Configuration (Required)</div>
<div class="UI-margin UI-configure-panel UI-border">
<div class="UI-pad-bottom">
<label>Event Host:</label> <br>
<input type="text" name="NEW_CONHOST" class="UI-input <?php
if ($updateData != null && strlen($updateData[NEW_CONHOST])) {
echo VALUE_EQ.$updateData[NEW_CONHOST];
} elseif ($tried) {
echo UI_PROBLEM;
}
?>" placeholder="<example: AwesomeaCon>">
</div>
<div class="UI-pad-bottom">
<label>Timezone:</label> <br>
<input type="text" name="NEW_TIMEZONE" class="UI-input <?php
if ($updateData != null && strlen($updateData[NEW_TIMEZONE])) {
echo VALUE_EQ.$updateData[NEW_TIMEZONE];
} elseif ($tried) {
echo UI_PROBLEM;
}
?>" placeholder="<example: America/Chicago>">
</div>
<div class="UI-pad-bottom">
<label for="NEW_COLOR_PRIMARY">Primary Banner Text Color:</label>
<input type="color" name="NEW_COLOR_PRIMARY<?php
if ($updateData != null && strlen($updateData[NEW_COLOR_PRIMARY])) {
echo VALUE_EQ.$updateData[NEW_COLOR_PRIMARY];
} else {
echo "\" value=\"#FFFFFF";
}
?>">
</div>
<div class="UI-pad-bottom">
<label for="NEW_COLOR_PRIM_BACK">Primary Banner Color:</label>
<input type="color" name="NEW_COLOR_PRIM_BACK<?php
if ($updateData != null && strlen($updateData[NEW_COLOR_PRIM_BACK])) {
echo VALUE_EQ.$updateData[NEW_COLOR_PRIM_BACK];
} else {
echo "\" value=\"#4CAF50";
}
?>">
</div>
<div class="UI-pad-bottom">
<label for="NEW_COLOR_SECONDARY">Secondary Banner Text Color:</label>
<input type="color" name="NEW_COLOR_SECONDARY<?php
if ($updateData != null && strlen($updateData[NEW_COLOR_SECONDARY])) {
echo VALUE_EQ.$updateData[NEW_COLOR_SECONDARY];
} else {
echo "\" value=\"#FFFFFF";
}
?>">
</div>
<div class="UI-pad-bottom">
<label for="NEW_COLOR_SECOND_BACK">Secondary Banner Color:</label>
<input type="color" name="NEW_COLOR_SECOND_BACK<?php
if ($updateData != null && strlen($updateData[NEW_COLOR_SECOND_BACK])) {
echo VALUE_EQ.$updateData[NEW_COLOR_SECOND_BACK];
} else {
echo "\" value=\"#2196F3";
}
?>">
</div>
</div>
<div class="UI-event-sectionbar UI-margin">Admin Configuration (Required, If not using CRM)</div>
<div class="UI-configure-panel UI-border UI-margin">
<div class="UI-pad-bottom">
<label>Admin Email: <span class="UI-configure-note">Account will be created</span></label> <br>
<input type="text" name="NEW_ADMINEMAIL" class="UI-input <?php
if ($updateData != null && strlen($updateData[NEW_ADMINEMAIL])) {
echo VALUE_EQ.$updateData[NEW_ADMINEMAIL];
} elseif ($tried && empty($NEW_NEONKEY)) {
echo UI_PROBLEM;
}
?>" placeholder="<example: [email protected]>">
</div>
<div class="UI-pad-bottom">
<label>Admin Password: <span class="UI-configure-note">Required.</span></label> <br>
<input type="text" name="NEW_ADMINPASSWORD" class="UI-input <?php
if ($updateData != null && strlen($updateData[NEW_ADMINCRED])) {
echo VALUE_EQ.$updateData[NEW_ADMINCRED];
} elseif ($tried && empty($NEW_NEONKEY)) {
echo UI_PROBLEM;
}
?>" placeholder="<example: aabbccddee>">
</div>
</div>
<div class="UI-event-sectionbar UI-margin">Email Configuration (Required)</div>
<div class="UI-margin UI-configure-panel UI-border">
<div class="UI-pad-bottom">
<label>No-Reply Email:</label> <br>
<input type="text" name="NEW_NOREPLY_EMAIL" class="UI-input <?php
if ($updateData != null && strlen($updateData[NEW_NOREPLY_EMAIL])) {
echo VALUE_EQ.$updateData[NEW_NOREPLY_EMAIL];
} elseif ($tried) {
echo UI_PROBLEM;
}
?>" placeholder="<example: [email protected]>">
</div>
<div class="UI-pad-bottom">
<label>Feedback Email: <span class='UI-configure-note'>Address for the feedback buttons and links. If unset, defaults to Admin Email address</span></label> <br>
<input type="text" name="NEW_FEEDBACK_EMAIL" class="UI-input <?php
if ($updateData != null && strlen($updateData[NEW_FEEDBACK_EMAIL])) {
echo VALUE_EQ.$updateData[NEW_FEEDBACK_EMAIL].'"';
} else {
echo '"';
}
?> placeholder="<example: [email protected]>">
</div>
<div class="UI-pad-bottom">
<label>Security Email: <span class='UI-configure-note'>This email recieves all the forgotten password request and other security notices. If unset, defaults to Admin Email address</span></label> <br>
<input type="text" name="NEW_SECURITY_EMAIL" class="UI-input <?php
if ($updateData != null && strlen($updateData[NEW_SECURITY_EMAIL])) {
echo VALUE_EQ.$updateData[NEW_SECURITY_EMAIL].'"';
} else {
echo '"';
}
?> placeholder="<example: [email protected]>">
</div>
<div class="UI-pad-bottom">
<label>Help Email: <span class='UI-configure-note'>Address for the help buttons and links. If unset, defaults to Admin Email address</span></label> <br>
<input type="text" name="NEW_HELP_EMAIL" class="UI-input <?php
if ($updateData != null && strlen($updateData[NEW_HELP_EMAIL])) {
echo VALUE_EQ.$updateData[NEW_HELP_EMAIL].'"';
} else {
echo '"';
}
?> placeholder="<example: [email protected]>">
</div>
</div>
<div class='UI-center'>
<input type="submit" class="UI-eventbutton UI-center">
</div>
</form>
</div>
<?php
require(__DIR__.'/pages/base/body_end.inc');