-
Notifications
You must be signed in to change notification settings - Fork 48
/
profile.php
683 lines (645 loc) · 45.4 KB
/
profile.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
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
<?php
/**
*
* Vesta Web Interface
*
* Copyright (C) 2020 Carter Roeser <carter@cdgtech.one>
* https://cdgco.github.io/VestaWebInterface
*
* Vesta Web Interface is free software: you can redistribute it and/or modify
* it under the terms of version 3 of the GNU General Public License as published
* by the Free Software Foundation.
*
* Vesta Web Interface is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Vesta Web Interface. If not, see
* <https://github.com/cdgco/VestaWebInterface/blob/master/LICENSE>.
*
*/
session_set_cookie_params(['samesite' => 'none']); session_start();
$configlocation = "includes/";
if (file_exists( 'includes/config.php' )) { require( 'includes/includes.php'); } else { header( 'Location: install' ); exit(); };
if(base64_decode($_SESSION['loggedin']) == 'true') {}
else { header('Location: login.php?to=profile.php'); exit(); }
if(isset($profileenabled) && $profileenabled != 'true'){ header("Location: error-pages/403.html"); }
$postvars = array(array('hash' => $vst_apikey, 'user' => $vst_username,'password' => $vst_password,'cmd' => 'v-list-user','arg1' => $username,'arg2' => 'json'));
$curl0 = curl_init();
$curlstart = 0;
while($curlstart <= 0) {
curl_setopt(${'curl' . $curlstart}, CURLOPT_URL, $vst_url);
curl_setopt(${'curl' . $curlstart}, CURLOPT_RETURNTRANSFER,true);
curl_setopt(${'curl' . $curlstart}, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt(${'curl' . $curlstart}, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt(${'curl' . $curlstart}, CURLOPT_POST, true);
curl_setopt(${'curl' . $curlstart}, CURLOPT_POSTFIELDS, http_build_query($postvars[$curlstart]));
$curlstart++;
}
$admindata = json_decode(curl_exec($curl0), true)[$username];
if(isset($admindata['LANGUAGE'])){ $locale = $ulang[$admindata['LANGUAGE']]; }
_setlocale('LC_CTYPE', $locale);
_setlocale('LC_MESSAGES', $locale);
_bindtextdomain('messages', 'locale');
_textdomain('messages');
foreach ($plugins as $result) {
if (file_exists('plugins/' . $result)) {
if (file_exists('plugins/' . $result . '/manifest.xml')) {
$get = file_get_contents('plugins/' . $result . '/manifest.xml');
$xml = simplexml_load_string($get, 'SimpleXMLElement', LIBXML_NOCDATA);
$arr = json_decode(json_encode((array)$xml), TRUE);
if (isset($arr['name']) && !empty($arr['name']) && isset($arr['fa-icon']) && !empty($arr['fa-icon']) && isset($arr['section']) && !empty($arr['section']) && isset($arr['admin-only']) && !empty($arr['admin-only']) && isset($arr['new-tab']) && !empty($arr['new-tab']) && isset($arr['hide']) && !empty($arr['hide'])){
array_push($pluginlinks,$result);
array_push($pluginnames,$arr['name']);
array_push($pluginicons,$arr['fa-icon']);
array_push($pluginsections,$arr['section']);
array_push($pluginadminonly,$arr['admin-only']);
array_push($pluginnewtab,$arr['new-tab']);
array_push($pluginhide,$arr['hide']);
}
}
}
}
if($auth0) {
$curl1 = curl_init();
curl_setopt($curl1, CURLOPT_URL, 'https://' . $config["AUTH0_DOMAIN"] . '/oauth/token');
curl_setopt($curl1, CURLOPT_RETURNTRANSFER,true);
curl_setopt($curl1, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl1, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl1, CURLOPT_POST, true);
curl_setopt($curl1, CURLOPT_POSTFIELDS, "grant_type=client_credentials&client_id=".$config['AUTH0_CLIENT_ID']."&client_secret=".$config['AUTH0_CLIENT_SECRET']."&audience=https://".$config['AUTH0_DOMAIN']."/api/v2/");
$auth0token = json_decode(curl_exec($curl1), true)['access_token'];
if(isset($auth0token) && $auth0token != '') {
$curl2 = curl_init();
curl_setopt($curl2, CURLOPT_URL, 'https://' . $config["AUTH0_DOMAIN"] . '/api/v2/connections');
curl_setopt($curl2, CURLOPT_RETURNTRANSFER,true);
curl_setopt($curl2, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl2, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl2, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($curl2, CURLOPT_POSTFIELDS, "");
curl_setopt($curl2, CURLOPT_HTTPHEADER, array("Authorization: Bearer ".$auth0token, "cache-control: no-cache"));
$auth0connections = json_decode(curl_exec($curl2), true);
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/ico" href="plugins/images/<?php echo $cpfavicon; ?>">
<title><?php echo $sitetitle; ?> - <?php echo __("Account"); ?></title>
<link href="plugins/components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="plugins/components/bootstrap-select/css/bootstrap-select.min.css" rel="stylesheet">
<link href="plugins/components/metismenu/dist/metisMenu.min.css" rel="stylesheet">
<link href="plugins/components/select2/select2.min.css" rel="stylesheet">
<link href="plugins/components/animate.css/animate.min.css" rel="stylesheet">
<link href="plugins/components/bootstrap-brand-buttons/brand-buttons-inversed.css" rel="stylesheet">
<script src="https://kit.fontawesome.com/9ce2a0b093.js" crossorigin="anonymous"></script>
<link rel="stylesheet" href="plugins/components/sweetalert2/sweetalert2.min.css" />
<link href="css/style.css" rel="stylesheet">
<link href="css/colors/<?php if(isset($_COOKIE['theme']) && $themecolor != 'custom.css') { echo base64_decode($_COOKIE['theme']); } else {echo $themecolor; } ?>" id="theme" rel="stylesheet">
<?php if($themecolor == "custom.css") { require( 'css/colors/custom.php'); } ?>
<style>
.select2-results{
max-height: 200px;
padding: 0 0 0 4px;
margin: 4px 4px 4px 0;
position: relative;
overflow-x: hidden;
overflow-y: auto;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
</style>
<?php if(GOOGLE_ANALYTICS_ID != ''){ echo "<script async src='https://www.googletagmanager.com/gtag/js?id=" . GOOGLE_ANALYTICS_ID . "'></script>
<script>window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', '" . GOOGLE_ANALYTICS_ID . "');</script>"; } ?>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body class="fix-header">
<?php if(INTERAKT_APP_ID != ''){ echo '<script>
window.mySettings = {
first_name: "' . $admindata['FNAME'] . '",
last_name: "' . $admindata['LNAME'] . '",
suspended: "' . $admindata['SUSPENDED'] . '",
package: "' . $admindata['PACKAGE'] . '",
language: "' . $admindata['LANGUAGE'] . '",
uname: "' . $username . '",
email: "' . $admindata['CONTACT'] . '",
created_at: ' . strtotime($admindata['DATE'] . ' ' . $admindata['TIME']) . ',
joined_at: "' . $admindata['DATE'] . ' ' . $admindata['TIME'] . '",
app_id: "' . INTERAKT_APP_ID . '"
};
</script>'; } ?>
<script src="plugins/components/sweetalert2/sweetalert2.min.js"></script>
<?php
if(isset($_GET['password'])) { $pwcode = $_GET['password']; }
if(isset($_GET['email'])) { $emailcode = $_GET['email']; }
if(isset($_GET['lang'])) { $langcode = $_GET['lang']; }
if(isset($_GET['ns'])) { $nscode = $_GET['ns']; }
if(isset($_GET['name'])) { $namecode = $_GET['name']; }
if(isset($_GET['password']) && isset($_GET['email']) && isset($_GET['lang']) && isset($_GET['ns']) && isset($_GET['name'])) { $answer1 = $pwcode + $emailcode + $langcode + $nscode + $namecode; }
if(isset($answer1)) { $answer = (int)$answer1; }
if(isset($pwcode) || isset($emailcode) || isset($langcode) || isset($nscode) || isset($namecode)){
if($answer == "0") {
echo "<script> Swal.fire({title:'" . __("Successfully Updated!") . "', icon:'success'})</script>";
}
if(isset($answer) && $answer == "1" || isset($answer) && $answer == "2") { echo "<script> Swal.fire('" . __("Invalid data entered in form.") . "<br>" . __("Please try again.") . "', '<br>";
if(isset($pwcode) && $pwcode != "0"){ echo " P: " . $pwcode;}
if(isset($emailcode) && $emailcode != "0"){ echo " E: " . $emailcode;}
if(isset($langcode) && $langcode != "0"){ echo " L: " . $langcode;}
if(isset($nscode) && $nscode != "0"){ echo " NS: " . $nscode;}
if(isset($namecode) && $namecode != "0"){ echo " N: " . $namecode;}
echo "', 'error')</script>";}
if(isset($answer) && $answer > "2") { echo "<script> Swal.fire('" . __("Please try again or contact support.") . "', '<br>";
if(isset($pwcode) && $pwcode != "0"){ echo " P: " . $pwcode;}
if(isset($emailcode) && $emailcode != "0"){ echo " E: " . $emailcode;}
if(isset($langcode) && $langcode != "0"){ echo " L: " . $langcode;}
if(isset($nscode) && $nscode != "0"){ echo " NS: " . $nscode;}
if(isset($namecode) && $namecode != "0"){ echo " N: " . $namecode;}
echo "', 'error')</script>";}
}
?>
<div id="wrapper">
<nav class="navbar navbar-default navbar-static-top m-b-0">
<div class="navbar-header">
<div class="top-left-part">
<a class="logo" href="index.php">
<img src="plugins/images/<?php echo $cpicon; ?>" alt="home" class="logo-1 dark-logo" />
<img src="plugins/images/<?php echo $cplogo; ?>" alt="home" class="hidden-xs dark-logo" />
</a>
</div>
<ul class="nav navbar-top-links navbar-left">
<li><a href="javascript:void(0)" class="open-close waves-effect waves-light visible-xs"><i class="ti-close ti-menu"></i></a></li>
<?php notifications(); ?>
</ul>
<ul class="nav navbar-top-links navbar-right pull-right">
<li>
<form class="app-search m-r-10" id="searchform" action="process/search.php" method="get">
<input type="text" placeholder="<?php echo __("Search..."); ?>" class="form-control" name="q"> <a href="javascript:void(0);" onclick="document.getElementById('searchform').submit();"><i class="fa fa-search"></i></a> </form>
</li>
<li class="dropdown">
<a class="dropdown-toggle profile-pic" data-toggle="dropdown" href="#"><b class="hidden-xs"><?php print_r($displayname); ?></b><span class="caret"></span> </a>
<ul class="dropdown-menu dropdown-user animated flipInY">
<li>
<div class="dw-user-box">
<div class="u-text">
<h4>
<?php print_r($displayname); ?>
</h4>
<p class="text-muted">
<?php print_r($admindata['CONTACT']); ?>
</p>
</div>
</div>
</li>
<li role="separator" class="divider"></li>
<li><a href="profile.php"><i class="ti-home"></i> <?php echo __("My Account"); ?></a></li>
<li><a href="profile.php?settings=open"><i class="ti-settings"></i> <?php echo __("Account Settings"); ?></a></li>
<li role="separator" class="divider"></li>
<li><a href="process/logout.php"><i class="fa fa-power-off"></i> <?php echo __("Logout"); ?></a></li>
</ul>
</li>
</ul>
</div>
</nav>
<div class="navbar-default sidebar" role="navigation">
<div class="sidebar-nav slimscrollsidebar">
<div class="sidebar-head">
<h3>
<span class="fa-fw open-close">
<i class="ti-menu hidden-xs"></i>
<i class="ti-close visible-xs"></i>
</span>
<span class="hide-menu"><?php echo __("Navigation"); ?></span>
</h3>
</div>
<ul class="nav" id="side-menu">
<?php indexMenu("./");
adminMenu("admin/list/", "");
?>
<li class="devider"></li>
<li>
<a href="#" class="waves-effect"><i class="ti-user fa-fw"></i><span class="hide-menu"> <?php print_r($displayname); ?><span class="fa arrow"></span></span>
</a>
<ul class="nav nav-second-level collapse" id="appendaccount">
<li> <a href="profile.php" id="profileactive"><i class="ti-home fa-fw <?php if(isset($_GET['settings']) && $_GET['settings'] == "open") { echo 'text-inverse';} ?>"></i> <span style="<?php if(isset($_GET['settings']) && $_GET['settings'] == "open") { echo 'color:#54667a;font-weight:300;';} ?>" class="hide-menu"> <?php echo __("My Account"); ?></span></a></li>
<li> <a href="profile.php?settings=open" id="settingsactive"><i class="ti-settings fa-fw "></i> <span class="hide-menu"> <?php echo __("Account Settings"); ?></span></a></li>
<li> <a href="log.php"><i class="ti-layout-list-post fa-fw"></i><span class="hide-menu"><?php echo __("Log"); ?></span></a> </li>
</ul>
</li>
<?php primaryMenu("list/", "process/", ""); ?>
</ul>
</div>
</div>
<div id="page-wrapper">
<div class="container-fluid">
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title"><?php echo __("My Account"); ?></h4>
</div>
<?php headerad(); ?>
</div>
<div class="row">
<div class="col-md-4 col-xs-12">
<div class="white-box">
<div class="user-bg bg-theme">
<div class="overlay-box bg-theme">
<div class="user-content"><br><br>
<h4 class="text-white"><?php print_r($username); ?></h4>
<h5 class="text-white"><?php print_r($admindata['CONTACT']); ?></h5>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-8 col-xs-12">
<div class="white-box">
<ul class="nav nav-tabs tabs customtab">
<li class="<?php if(!isset($_GET['settings']) || isset($_GET['settings']) && $_GET['settings'] != "open") { echo "active tab"; } else { echo "tab"; } ?>" >
<a href="profile.php"> <span class="visible-xs"><i class="fa fa-user"></i></span> <span class="hidden-xs"><?php echo __("Account"); ?></span> </a>
</li>
<li class="<?php if(isset($_GET['settings']) && $_GET['settings'] == "open") { echo "active tab"; } else { echo "tab"; } ?>">
<a href="profile.php?settings=open"> <span class="visible-xs"><i class="fa fa-cog"></i></span> <span class="hidden-xs"><?php echo __("Settings"); ?></span> </a>
</li>
</ul>
<div class="tab-content ">
<div class="tab-pane <?php if(!isset($_GET['settings']) || isset($_GET['settings']) && $_GET['settings'] != "open") { echo "active"; } ?>" id="profile">
<div class="row">
<div class="col-md-3 col-xs-6 b-r"> <strong><?php echo __("Name"); ?></strong>
<br>
<p class="text-muted"><?php print_r($admindata['FNAME'] . ' ' . $admindata['LNAME']); ?></p>
</div>
<div class="col-md-3 col-xs-6 b-r"> <strong><?php echo __("Joined"); ?></strong>
<br>
<p class="text-muted"><?php $date=date_create($admindata['DATE'] . ' ' . $admindata['TIME']);
echo date_format($date,"F j, Y - g:i A"); ?></p>
</div>
<div class="col-md-3 col-xs-6 b-r"> <strong><?php echo __("Plan"); ?></strong>
<br>
<p class="text-muted"><?php print_r(ucfirst($admindata['PACKAGE'])); ?></p>
</div>
<div class="col-md-3 col-xs-6"> <strong><?php echo __("Language"); ?></strong>
<br>
<p class="text-muted"><?php if($admindata['LANGUAGE'] == ""){echo "Not Set";} else{ print_r($countries[$admindata['LANGUAGE']]);} ?></p>
</div>
</div>
<hr>
<strong><?php echo __("Nameservers"); ?>:</strong>
<p class="m-t-30">
<ul class="dashed">
<?php
$nsArray = explode(',', ($admindata['NS']));
foreach ($nsArray as &$value) {
$value = "<li>" . $value . "</li>";
}
foreach($nsArray as $val) {
echo $val;
}
?>
</ul>
</p>
<?php if($auth0) {
echo '<hr>
<strong>'.__("External Accounts").':</strong>
<br><br>';
if($auth0connections) {
foreach($auth0connections as $connection) {
socialloginhtmlsmall($connection['name']);
}
echo '<br><br><small>' . __('Note: You may only link 1 extenal account at a time. Linking a new account will unlink all other accounts.') . '</small>';
}
else {
echo __("No external accounts available.");
}
}
?>
</div>
<div class="tab-pane <?php if(isset($_GET['settings']) && $_GET['settings'] == "open") { echo "active"; } ?>" id="settings">
<form class="form-horizontal form-material" id="form" autocomplete="off" action="process/updatesettings.php" method="post">
<input type="hidden" name="fname-x" value="<?php print_r($admindata['FNAME']); ?>"/>
<input type="hidden" name="lname-x" value="<?php print_r($admindata['LNAME']); ?>"/>
<input type="hidden" name="email-x" value="<?php print_r($admindata['CONTACT']); ?>"/>
<input type="hidden" name="language-x" value="<?php print_r($admindata['LANGUAGE']); ?>"/>
<input type="hidden" name="ns1-x" value="<?php print_r(explode(',', ($admindata['NS']))[0]); ?>"/>
<input type="hidden" name="ns2-x" value="<?php print_r(explode(',', ($admindata['NS']))[1]); ?>"/>
<input type="hidden" name="ns3-x" value="<?php print_r(explode(',', ($admindata['NS']))[2]); ?>"/>
<input type="hidden" name="ns4-x" value="<?php print_r(explode(',', ($admindata['NS']))[3]); ?>"/>
<input type="hidden" name="ns5-x" value="<?php print_r(explode(',', ($admindata['NS']))[4]); ?>"/>
<input type="hidden" name="ns6-x" value="<?php print_r(explode(',', ($admindata['NS']))[5]); ?>"/>
<input type="hidden" name="ns7-x" value="<?php print_r(explode(',', ($admindata['NS']))[6]); ?>"/>
<input type="hidden" name="ns8-x" value="<?php print_r(explode(',', ($admindata['NS']))[7]); ?>"/>
<div class="form-group">
<label for="username" class="col-md-12"><?php echo __("Username"); ?></label>
<div class="col-md-12">
<input type="text" disabled value="<?php print_r($username); ?>" class="form-control form-control-line" name="username" id="username">
</div>
</div>
<div class="form-group">
<label for="password" class="col-md-12"><?php echo __("Password"); ?> / <a style="cursor:pointer" onclick="generatePassword(10)"> <?php echo __("Generate"); ?></a></label>
<div class="col-md-12 input-group" style="padding-left: 15px;">
<input type="password" class="form-control form-control-line" autocomplete="new-password" name="password" id="password"> <span class="input-group-btn">
<button class="btn btn-inverse" style="margin-right: 15px;" name="Show" onclick="toggler(this)" id="tg" type="button"><i class="ti-eye"></i></button>
</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-12"><?php echo __("First Name"); ?></label>
<div class="col-sm-12">
<input type="text" name="fname" value="<?php print_r($admindata['FNAME']); ?>" class="form-control form-control-line">
</div>
</div>
<div class="form-group">
<label class="col-sm-12"><?php echo __("Last Name"); ?></label>
<div class="col-sm-12">
<input type="text" name="lname" value="<?php print_r($admindata['LNAME']); ?>" class="form-control form-control-line">
</div>
</div>
<div class="form-group">
<label for="email" class="col-md-12"><?php echo __("Email"); ?></label>
<div class="col-md-12">
<input type="email" value="<?php print_r($admindata['CONTACT']); ?>" class="form-control form-control-line" name="email" id="email">
</div>
</div>
<div class="form-group" style="overflow: visible;">
<label class="col-md-12"><?php echo __("Language"); ?></label>
<div class="col-md-12">
<select class="form-control select2" name="language" id="select2">
<option value="ar"><?php print_r($countries['ar']); ?></option>
<option value="bs"><?php print_r($countries['bs']); ?></option>
<option value="cn"><?php print_r($countries['cn']); ?></option>
<option value="cz"><?php print_r($countries['cz']); ?></option>
<option value="da"><?php print_r($countries['da']); ?></option>
<option value="de"><?php print_r($countries['de']); ?></option>
<option value="el"><?php print_r($countries['el']); ?></option>
<option value="en"><?php print_r($countries['en']); ?></option>
<option value="es"><?php print_r($countries['es']); ?></option>
<option value="fa"><?php print_r($countries['fa']); ?></option>
<option value="fi"><?php print_r($countries['fi']); ?></option>
<option value="fr"><?php print_r($countries['fr']); ?></option>
<option value="hu"><?php print_r($countries['hu']); ?></option>
<option value="id"><?php print_r($countries['id']); ?></option>
<option value="it"><?php print_r($countries['it']); ?></option>
<option value="ja"><?php print_r($countries['ja']); ?></option>
<option value="ka"><?php print_r($countries['ka']); ?></option>
<option value="nl"><?php print_r($countries['nl']); ?></option>
<option value="no"><?php print_r($countries['no']); ?></option>
<option value="pl"><?php print_r($countries['pl']); ?></option>
<option value="pt-BR"><?php print_r($countries['pt-BR']); ?></option>
<option value="pt"><?php print_r($countries['pt']); ?></option>
<option value="ro"><?php print_r($countries['ro']); ?></option>
<option value="ru"><?php print_r($countries['ru']); ?></option>
<option value="se"><?php print_r($countries['se']); ?></option>
<option value="tr"><?php print_r($countries['tr']); ?></option>
<option value="tw"><?php print_r($countries['tw']); ?></option>
<option value="ua"><?php print_r($countries['ua']); ?></option>
<option value="vi"><?php print_r($countries['vi']); ?></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-md-12"><?php echo __("Default Nameservers"); ?></label>
<div class="col-md-12">
<div><input type="text" value="<?php print_r(explode(',', ($admindata['NS']))[0]); ?>" class="form-control form-control-line" name="ns1" id="ns1x"><br></div>
<div><input type="text" value="<?php print_r(explode(',', ($admindata['NS']))[1]); ?>" class="form-control form-control-line" name="ns2" id="ns2x"><br><div id="ns2wrapper"><a style="cursor:pointer;" id="addmore" onclick="add1();"><?php echo __("Add One"); ?></a></div></div>
<div id="ns3" style="display:<?php if(explode(',', ($admindata['NS']))[2] == ''){ echo "none"; } else { echo "block"; } ?>"><input type="text" value="<?php print_r(explode(',', ($admindata['NS']))[2]); ?>" class="form-control form-control-line" name="ns3" id="ns3x"><br><div id="ns3wrapper"><a style="cursor:pointer;" id="addmore1" onclick="add2();"><?php echo __("Add One"); ?></a> / <a style="cursor:pointer;" id="remove1" onclick="rem2();"><?php echo __("Remove One"); ?></a></div></div>
<div id="ns4" style="display:<?php if(explode(',', ($admindata['NS']))[3] == ''){ echo "none"; } else { echo "block"; } ?>"><input type="text" value="<?php print_r(explode(',', ($admindata['NS']))[3]); ?>" class="form-control form-control-line" name="ns4" id="ns4x"><br><div id="ns4wrapper"><a style="cursor:pointer;" id="addmore2" onclick="add3();"><?php echo __("Add One"); ?></a> / <a style="cursor:pointer;" id="remove2" onclick="rem3();"><?php echo __("Remove One"); ?></a></div></div>
<div id="ns5" style="display:<?php if(explode(',', ($admindata['NS']))[4] == ''){ echo "none"; } else { echo "block"; } ?>"><input type="text" value="<?php print_r(explode(',', ($admindata['NS']))[4]); ?>" class="form-control form-control-line" name="ns5" id="ns5x"><br><div id="ns5wrapper"><a style="cursor:pointer;" id="addmore3" onclick="add4();"><?php echo __("Add One"); ?></a> / <a style="cursor:pointer;" id="remove3" onclick="rem4();"><?php echo __("Remove One"); ?></a></div></div>
<div id="ns6" style="display:<?php if(explode(',', ($admindata['NS']))[5] == ''){ echo "none"; } else { echo "block"; } ?>"><input type="text" value="<?php print_r(explode(',', ($admindata['NS']))[5]); ?>" class="form-control form-control-line" name="ns6" id="ns6x"><br><div id="ns6wrapper"><a style="cursor:pointer;" id="addmore4" onclick="add5();"><?php echo __("Add One"); ?></a> / <a style="cursor:pointer;" id="remove4" onclick="rem5();"><?php echo __("Remove One"); ?></a></div></div>
<div id="ns7" style="display:<?php if(explode(',', ($admindata['NS']))[6] == ''){ echo "none"; } else { echo "block"; } ?>"><input type="text" value="<?php print_r(explode(',', ($admindata['NS']))[6]); ?>" class="form-control form-control-line" name="ns7" id="ns7x"><br><div id="ns7wrapper"><a style="cursor:pointer;" id="addmore5" onclick="add6();"><?php echo __("Add One"); ?></a> / <a style="cursor:pointer;" id="remove5" onclick="rem6();"><?php echo __("Remove One"); ?></a></div></div>
<div id="ns8" style="display:<?php if(explode(',', ($admindata['NS']))[7] == ''){ echo "none"; } else { echo "block"; } ?>"><input type="text" value="<?php print_r(explode(',', ($admindata['NS']))[7]); ?>" class="form-control form-control-line" name="ns8" id="ns8x"><br><div id="ns8wrapper"><a style="cursor:pointer;" id="remove6" onclick="rem7();"><?php echo __("Remove One"); ?></a></div></div>
</div>
</div>
<?php if($themecolor != 'custom.css') { echo '
<div class="form-group" style="overflow: visible;">
<label class="col-md-12">' . __("Theme") . '</label>
<div class="col-md-12">
<select class="form-control" name="cookie">
<option value="default" '; if(base64_decode($_COOKIE["theme"]) == "default.css") { echo "selected"; } echo '>' . __("Default") . '</option>
<option value="blue" '; if(base64_decode($_COOKIE["theme"]) == "blue.css") { echo "selected"; } echo '>' . __("Blue") . '</option>
<option value="purple" '; if(base64_decode($_COOKIE["theme"]) == "purple.css") { echo "selected"; } echo '>' . __("Purple") . '</option>
<option value="orange" '; if(base64_decode($_COOKIE["theme"]) == "orange.css") { echo "selected"; } echo '>' . __("Orange") . '</option>
<option value="dark" '; if(base64_decode($_COOKIE["theme"]) == "dark.css") { echo "selected"; } echo '>' . __("Dark") . '</option>
</select>
</div>
</div>'; } ?>
<div class="form-group">
<div class="col-sm-12">
<button class="btn btn-success" type="submit"><?php echo __("Update Profile"); ?></button>
<a href="profile.php" style="color: inherit;text-decoration: inherit;"><button class="btn btn-muted" type="button" onclick="loadLoader();"><?php echo __("Back"); ?></button></a>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
function submitForm() { document.getElementById("form").submit(); };
function exitForm() { window.location.href="profile.php"; };
</script>
<?php hotkeys($configlocation); ?>
<?php footerad(); ?><footer class="footer text-center"><?php footer(); ?></footer>
</div>
</div>
<script src="plugins/components/jquery/jquery.min.js"></script>
<script src="plugins/components/jquery-slimscroll/jquery.slimscroll.min.js"></script>
<script src="plugins/components/popper.js/popper.js"></script>
<script src="plugins/components/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="plugins/components/bootstrap-select/js/bootstrap-select.min.js"></script>
<script src="plugins/components/metismenu/dist/metisMenu.min.js"></script>
<script src="plugins/components/select2/select2.min.js"></script>
<script src="plugins/components/waves/waves.js"></script>
<script src="https://cdn.auth0.com/js/auth0/9.11/auth0.min.js"></script>
<script src="js/notifications.js"></script>
<script src="js/main.js"></script>
<script type="text/javascript">
if(window.location.href.split("/").pop().includes('profile.php?settings=open#')) {
window.history.pushState({}, document.title, "profile.php?settings=open");
}
else if(window.location.href.split("/").pop().includes('profile.php?a=0#')) {
window.history.pushState({}, document.title, "profile.php?a=0");
}
else if(window.location.href.split("/").pop().includes('profile.php#')) {
window.history.pushState({}, document.title, "profile.php");
}
Waves.attach('.button', ['waves-effect']);
Waves.init();
var processLocation = "process/";
$('#form').submit(function(ev) {
ev.preventDefault();
processLoader();
this.submit();
});
function processLoader(){
Swal.fire({
title: '<?php echo __("Processing"); ?>',
text: '',
onOpen: function () {
swal.showLoading()
}
})};
function loadLoader(){
Swal.fire({
title: '<?php echo __("Loading"); ?>',
text: '',
onOpen: function () {
swal.showLoading()
}
})};
$(function () {
$('[data-toggle="popper"]').popover({trigger: 'hover'})
});
function toggler(e) {
if( e.name == 'Hide' ) {
e.name = 'Show'
document.getElementById('password').type="password";
} else {
e.name = 'Hide'
document.getElementById('password').type="text";
}
}
function generatePassword(length) {
var password = '', character;
while (length > password.length) {
if (password.indexOf(character = String.fromCharCode(Math.floor(Math.random() * 94) + 33), Math.floor(password.length / 94) * 94) < 0) {
password += character;
}
}
document.getElementById('password').value = password;
document.getElementById('tg').name='Hide';
document.getElementById('password').type="text";
}
$(document).ready(function() {
$('.select2').select2();
});
document.getElementById('select2').value = '<?php print_r($admindata['LANGUAGE']); ?>';
<?php
if($auth0) {
echo '
var webAuth = new auth0.WebAuth({
domain: "'.AUTH0_DOMAIN.'",
clientID: "'.AUTH0_CLIENT_ID.'",
responseMode: "query",
redirectUri: "'.$auth0location.'",
responseType: "code"
});
function unlink(e){
e1 = String(e)
Swal.fire({
title: "'.__("Unlink Account?").'",
icon: "question",
showCancelButton: true,
confirmButtonColor: "#3085d6",
cancelButtonColor: "#d33",
confirmButtonText: "'.__("Confirm"). '"
}).then((result) => {
if (result.value) {
Swal.fire({
title: "'.__("Processing").'",
text: "",
onOpen: function () {
swal.showLoading()
}
});
window.location.replace("process/unlink.php");
}
})}
function link(e){
e1 = String(e)
Swal.fire({
title: "'.__("Link Account?").'",
icon: "question",
showCancelButton: true,
confirmButtonColor: "#3085d6",
cancelButtonColor: "#d33",
confirmButtonText: "'.__("Confirm"). '"
}).then((result) => {
if (result.value) {
Swal.fire({
title: "'.__("Processing").'",
text: "",
onOpen: function () {
swal.showLoading()
}
});
window.location.replace("process/link.php?auth0=" + e1);
}
})}';
}
processPlugins();
includeScript();
$checkcount = 2;
$check1count = 3;
while($checkcount <= 7) {
echo "if( document.getElementById('ns" . $check1count . "x').value != '') {
document.getElementById('ns" . $checkcount . "wrapper').style.display = 'none';
}";
$checkcount++;
$check1count++;
}
$addcount = 1;
$add1count = 2;
$add2count = 3;
while($addcount <= 6) {
echo "function add" . $addcount ."() {
if( document.getElementById('ns" . $add2count . "').style.display = 'none' ) {
document.getElementById('ns" . $add2count . "').style.display = 'block';
document.getElementById('ns" . $add1count . "wrapper').style.display = 'none';
}
}";
$addcount++;
$add1count++;
$add2count++;
}
$remcount = 2;
$rem1count = 3;
while($remcount <= 7) {
echo "function rem" . $remcount ."() {
if( document.getElementById('ns" . $rem1count . "').style.display = 'block' ) {
document.getElementById('ns" . $rem1count . "').style.display = 'none';
document.getElementById('ns" . $remcount . "wrapper').style.display = 'block';
document.getElementById('ns" . $rem1count . "x').value = '';
}
}";
$remcount++;
$rem1count++;
}
$returntotal = $_POST['r1'] + $_POST['r2'] + $_POST['r3'] + $_POST['r4'] + $_POST['r5'];
if(isset($_POST['r1']) && $returntotal == 0) {
echo "Swal.fire({title:'" . __("Successfully Updated!") . "', icon:'success'});";
}
if(isset($_POST['a1']) && $_POST['a1'] == 0) {
echo "Swal.fire({title:'" . __("Account Unlinked!") . "', icon:'success'});";
}
if(isset($_GET['a']) && $_GET['a'] == 0) {
echo "Swal.fire({title:'" . __("Account Linked!") . "', icon:'success'});";
}
if(isset($_POST['r1']) && $returntotal != 0) {
echo "Swal.fire({title:'" . __("Error Updating Profile") . "', html:'" . __("Please try again or contact support.") . "<br><br><span onclick=\"$(\'.errortoggle\').toggle();\" class=\"swal-error-title\">View Error Code <i class=\"errortoggle fa fa-angle-double-right\"></i><i style=\"display:none;\" class=\"errortoggle fa fa-angle-double-down\"></i></span><span class=\"errortoggle\" style=\"display:none;\"><br><br>(E: " . $_POST['r1'] . "." . $_POST['r2'] . "." . $_POST['r3'] . "." . $_POST['r4'] . "." . $_POST['r5'] . ")</span>', icon:'error'});";
}
if(isset($_POST['a1']) && $_POST['a1'] != 0) {
echo "Swal.fire({title:'" . __("Error Unlinking Account") . "', html:'" . __("Please try again or contact support.") . "<br><br><span onclick=\"$(\'.errortoggle\').toggle();\" class=\"swal-error-title\">View Error Code <i class=\"errortoggle fa fa-angle-double-right\"></i><i style=\"display:none;\" class=\"errortoggle fa fa-angle-double-down\"></i></span><span class=\"errortoggle\" style=\"display:none;\"><br><br>(E: " . $_POST['a1'] . ")</span>', icon:'error'});";
}
if(isset($_GET['a']) && $_GET['a'] != 0) {
echo "Swal.fire({title:'" . __("Error Linking Account") . "', html:'" . __("Please try again or contact support.") . "<br><br><span onclick=\"$(\'.errortoggle\').toggle();\" class=\"swal-error-title\">View Error Code <i class=\"errortoggle fa fa-angle-double-right\"></i><i style=\"display:none;\" class=\"errortoggle fa fa-angle-double-down\"></i></span><span class=\"errortoggle\" style=\"display:none;\"><br><br>(E: " . $_GET['a'] . ")</span>', icon:'error'});";
}
?>
<?php if(INTERAKT_APP_ID != ''){ echo '
(function() {
var interakt = document.createElement("script");
interakt.type = "text/javascript"; interakt.async = true;
interakt.src = "//cdn.interakt.co/interakt/' . INTERAKT_APP_ID . '.js";
var scrpt = document.getElementsByTagName("script")[0];
scrpt.parentNode.insertBefore(interakt, scrpt);
})()'; } ?>
</script>
</body>
</html>