forked from causefx/Organizr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
executable file
·2244 lines (1940 loc) · 89.5 KB
/
index.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
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
// Include functions if not already included
require_once('functions.php');
// Upgrade environment
upgradeCheck();
// Lazyload settings
$databaseConfig = configLazy('config/config.php');
// Load Colours/Appearance
foreach(loadAppearance() as $key => $value) {
$$key = $value;
}
//Set some variables
ini_set("display_errors", 1);
ini_set("error_reporting", E_ALL | E_STRICT);
$data = false;
$databaseLocation = "databaseLocation.ini.php";
$needSetup = "Yes";
$tabSetup = "Yes";
$hasOptions = "No";
$settingsicon = "No";
$settingsActive = "";
$action = "";
$loadingIcon = "images/organizr-load-w-thick.gif";
$baseURL = "";
$dbcreated = false;
$splash = false;
// Get Action
if(isset($_POST['action'])) {
$action = $_POST['action'];
unset($_POST['action']);
}
//Get Invite Code
$inviteCode = isset($_GET['inviteCode']) ? $_GET['inviteCode'] : null;
// Check for config file
if(!file_exists('config/config.php')) {
if($action == "createLocation") {
if (isset($_POST['database_Location'])) {
$_POST['database_Location'] = str_replace('//','/',$_POST['database_Location'].'/');
if(substr($_POST['database_Location'], -1) != "/") : $_POST['database_Location'] = $_POST['database_Location'] . "/"; endif;
$_POST['user_home'] = $_POST['database_Location'].'users/';
}
if (file_exists($_POST['database_Location'])) {
updateConfig($_POST);
} else {
debug_out('Dir doesn\'t exist: '.$_POST['database_Location'],1); // Pretty Up
}
} else {
$configReady = "No";
$userpic = "";
$showPic = "";
}
}
if (file_exists('config/config.php')) {
if (!DATABASE_LOCATION){
die(header("Refresh:0"));
}
$configReady = "Yes";
require_once("user.php");
$USER = new User("registration_callback");
$group = $USER->role;
$dbfile = DATABASE_LOCATION . constant('User::DATABASE_NAME') . ".db";
$database = new PDO("sqlite:" . $dbfile);
$query = "SELECT * FROM users";
foreach($database->query($query) as $data) {
$needSetup = "No";
}
$db = DATABASE_LOCATION . constant('User::DATABASE_NAME') . ".db";
$file_db = new PDO("sqlite:" . $db);
$file_db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$dbTab = q2a($file_db->query('SELECT name FROM sqlite_master WHERE type="table" AND name="tabs"'));
$dbOptions = q2a($file_db->query('SELECT name FROM sqlite_master WHERE type="table" AND name="options"'));
if (is_array($dbTab)) {
foreach($dbTab as $row) {
if (in_array("tabs", $row)) {
$tabSetup = "No";
}
}
}
if($tabSetup == "Yes"){
$settingsActive = "active";
}
if (is_array($dbOptions)) {
foreach($dbOptions as $row) {
if (in_array("options", $row)) {
$hasOptions = "Yes";
}
}
}
if($tabSetup == "No") {
if($USER->authenticated && $USER->role == "admin") {
$result = q2a($file_db->query('SELECT * FROM tabs WHERE active = "true" ORDER BY `order` asc'));
$splash = q2a($file_db->query('SELECT * FROM tabs WHERE active = "true" AND splash = "true" ORDER BY `order` asc'));
if (is_array($result)) {
foreach($result as $row) {
if(!empty($row['iconurl']) && $settingsicon == "No") {
$settingsicon = "Yes";
}
}
}
}elseif($USER->authenticated && $USER->role == "user") {
$result = q2a($file_db->query('SELECT * FROM tabs WHERE active = "true" AND user = "true" ORDER BY `order` asc'));
$splash = q2a($file_db->query('SELECT * FROM tabs WHERE active = "true" AND splash = "true" AND user = "true" ORDER BY `order` asc'));
}else {
$result = q2a($file_db->query('SELECT * FROM tabs WHERE active = "true" AND guest = "true" ORDER BY `order` asc'));
$splash = q2a($file_db->query('SELECT * FROM tabs WHERE active = "true" AND splash = "true" AND guest = "true" ORDER BY `order` asc'));
}
}
$userpic = md5( strtolower( trim( $USER->email ) ) );
$showPic = "<i class=\"mdi mdi-account-circle\"></i>";
if(LOADINGICON !== "") : $loadingIcon = LOADINGICON; endif;
if(SLIMBAR == "true") : $slimBar = "30"; $userSize = "25"; else : $slimBar = "56"; $userSize = "40"; endif;
//NEW CHAT
if(CHAT == "true" && qualifyUser(CHATAUTH)){
if( $db = new SQLite3("chatpack.db") ){
if( $db->busyTimeout(5000) ){
if( $db->exec("PRAGMA journal_mode = wal;") ) {
$logtable = "CREATE TABLE IF NOT EXISTS chatpack_log
(id INTEGER PRIMARY KEY,
timestamp INTEGER NOT NULL,
user TEXT NOT NULL,
avatar TEXT NOT NULL,
message TEXT NOT NULL,
liked INTEGER DEFAULT 0)";
if( $db->exec($logtable) ){
$usertable = "CREATE TABLE IF NOT EXISTS chatpack_typing
(id INTEGER PRIMARY KEY,
timestamp INTEGER NOT NULL,
user TEXT NOT NULL)";
$onlinetable = "CREATE TABLE IF NOT EXISTS chatpack_last_message
(
user TEXT PRIMARY KEY NOT NULL,
timestamp INTEGER NOT NULL,
avatar TEXT NOT NULL)";
if( $db->exec($usertable) && $db->exec($onlinetable) ){
$dbcreated = true;
}else{
errormessage("creating database table for typing");
}
}else{
errormessage("creating database table for messages");
}
if( !$db->close() ){
errormessage("closing database connection");
}
}else{
errormessage("setting journal mode");
}
}else{
errormessage("setting busy timeout");
}
}else{
errormessage("using SQLite");
}
}
}
if(!defined('SLIMBAR')) : define('SLIMBAR', 'true'); endif;
if(!defined('AUTOHIDE')) : define('AUTOHIDE', 'false'); endif;
if(!defined('ENABLEMAIL')) : define('ENABLEMAIL', 'false'); endif;
if(!defined('CUSTOMCSS')) : define('CUSTOMCSS', 'false'); endif;
if(!defined('LOADINGSCREEN')) : define('LOADINGSCREEN', 'true'); endif;
if(!isset($notifyExplode)) : $notifyExplode = array("bar","slidetop"); endif;
if(SLIMBAR == "true") : $slimBar = "30"; $userSize = "25"; $chatSize = "142px"; else : $slimBar = "56"; $userSize = "40"; $chatSize = "171px";endif;
if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon = "settings2.png"; else: $iconRotate = "true"; $settingsIcon = "settings.png"; endif;
$group = (isset($group) ? $group : "guest");
?>
<!--
___ ___ ___ ___ ___ ___ ___ ___
/\ \ /\ \ /\ \ /\ \ /\__\ /\ \ /\ \ /\ \
/::\ \ /::\ \ /::\ \ /::\ \ /:| _|_ _\:\ \ _\:\ \ /::\ \
/:/\:\__\ /::\:\__\ /:/\:\__\ /::\:\__\ /::|/\__\ /\/::\__\ /::::\__\ /::\:\__\
\:\/:/ / \;:::/ / \:\:\/__/ \/\::/ / \/|::/ / \::/\/__/ \::;;/__/ \;:::/ /
\::/ / |:\/__/ \::/ / /:/ / |:/ / \:\__\ \:\__\ |:\/__/
\/__/ \|__| \/__/ \/__/ \/__/ \/__/ \/__/ \|__|
[Organizr Version: <?php echo INSTALLEDVERSION; ?> - By: CauseFX]
-->
<!DOCTYPE html>
<html lang="<?php echo $language->getLang(); ?>" class="no-js">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="mobile-web-app-capable" content="yes" /
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="msapplication-tap-highlight" content="no" />
<title><?=$title;?><?php if($title !== "Organizr") : echo " - Organizr"; endif; ?></title>
<link rel="stylesheet" href="<?=$baseURL;?>bower_components/bootstrap/dist/css/bootstrap.min.css?v=<?php echo INSTALLEDVERSION; ?>">
<link rel="stylesheet" href="<?=$baseURL;?>bower_components/font-awesome/css/font-awesome.min.css?v=<?php echo INSTALLEDVERSION; ?>">
<link rel="stylesheet" href="<?=$baseURL;?>bower_components/mdi/css/materialdesignicons.min.css?v=<?php echo INSTALLEDVERSION; ?>">
<link rel="stylesheet" href="<?=$baseURL;?>bower_components/metisMenu/dist/metisMenu.min.css?v=<?php echo INSTALLEDVERSION; ?>">
<link rel="stylesheet" href="<?=$baseURL;?>bower_components/Waves/dist/waves.min.css?v=<?php echo INSTALLEDVERSION; ?>">
<link rel="stylesheet" href="<?=$baseURL;?>bower_components/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.css?v=<?php echo INSTALLEDVERSION; ?>">
<link rel="stylesheet" href="<?=$baseURL;?>js/selects/cs-select.css?v=<?php echo INSTALLEDVERSION; ?>">
<link rel="stylesheet" href="<?=$baseURL;?>js/selects/cs-skin-elastic.css?v=<?php echo INSTALLEDVERSION; ?>">
<link rel="stylesheet" href="<?=$baseURL;?>bower_components/google-material-color/dist/palette.css?v=<?php echo INSTALLEDVERSION; ?>">
<link rel="stylesheet" href="<?=$baseURL;?>bower_components/sweetalert/dist/sweetalert.css?v=<?php echo INSTALLEDVERSION; ?>">
<link rel="stylesheet" href="<?=$baseURL;?>bower_components/smoke/dist/css/smoke.min.css?v=<?php echo INSTALLEDVERSION; ?>">
<link rel="stylesheet" href="<?=$baseURL;?>js/notifications/ns-style-growl.css?v=<?php echo INSTALLEDVERSION; ?>">
<link rel="stylesheet" href="<?=$baseURL;?>js/notifications/ns-style-other.css?v=<?php echo INSTALLEDVERSION; ?>">
<script src="<?=$baseURL;?>js/menu/modernizr.custom.js?v=<?php echo INSTALLEDVERSION; ?>"></script>
<script type="text/javascript" src="<?=$baseURL;?>js/sha1.js?v=<?php echo INSTALLEDVERSION; ?>"></script>
<script type="text/javascript" src="<?=$baseURL;?>js/user.js?v=<?php echo INSTALLEDVERSION; ?>"></script>
<link rel="stylesheet" href="<?=$baseURL;?>css/style.css?v=<?php echo INSTALLEDVERSION; ?>">
<link rel="stylesheet" href="<?=$baseURL;?>css/weather-icons.css?v=<?php echo INSTALLEDVERSION; ?>">
<link rel="stylesheet" href="bower_components/animate.css/animate.min.css?v=<?php echo INSTALLEDVERSION; ?>">
<link rel="icon" type="image/png" href="<?=$baseURL;?>images/favicon/android-chrome-192x192.png" sizes="192x192">
<link rel="apple-touch-icon" sizes="180x180" href="<?=$baseURL;?>images/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" href="<?=$baseURL;?>images/favicon/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="<?=$baseURL;?>images/favicon/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="<?=$baseURL;?>images/favicon/manifest.json">
<link rel="mask-icon" href="<?=$baseURL;?>images/favicon/safari-pinned-tab.svg" color="#2d89ef">
<link rel="shortcut icon" href="<?=$baseURL;?>images/favicon/favicon.ico">
<meta name="msapplication-config" content="<?=$baseURL;?>images/favicon/browserconfig.xml">
<meta name="theme-color" content="#2d89ef">
<link rel="stylesheet" type="text/css" href="css/addtohomescreen.css">
<script src="js/addtohomescreen.js"></script>
<script src="js/push.js"></script>
<!--Other-->
<script src="js/ajax.js?v=<?php echo INSTALLEDVERSION; ?>"></script>
<!--[if lt IE 9]>
<script src="bower_components/html5shiv/dist/html5shiv.min.js"></script>
<script src="bower_components/respondJs/dest/respond.min.js"></script>
<![endif]-->
</head>
<style>
.la-ball-scale-multiple.la-3x {
width: auto !important;
height: auto !important;
}
.logo img {
display: block;
margin: auto;
}
#splashScreen ping span {
margin-top: 0 !important;
font-size: 10px;
zoom: 2;
}
#weather .w-icon.right.pull-right {
font-size: 70px;
}
.new-message{
color: #46bc99 !important;
}
@media screen and (max-width:737px){
.email-body{width: 100%; overflow: auto;height: 100%;}
.email-content, .email-new {
-webkit-overflow-scrolling: touch;
-webkit-transform: translateZ(0);
overflow: scroll;
position: fixed;
height:100% !important;
margin-top:<?=$slimBar;?>px;
}.email-content .email-header, .email-new .email-header{
padding: 10px 30px;
z-index: 1000;
}
}@media screen and (min-width:737px){
.email-body{width: 100%}
.email-content .close-button, .email-content .email-actions, .email-new .close-button, .email-new .email-actions {
position: relative;
top: 15px;
right: 0px;
float: right;
}.email-inner-section {
margin-top: 30px;
}.email-content, .email-new {
overflow: auto;
margin: <?=$slimBar;?>px 0 0 0 !important;
height: 100%;
position: fixed;
max-width: 100%;
width: calc(35%) !important;
right: calc(-35%);
}.email-content .email-header, .email-new .email-header{
position: fixed;
padding: 0px 30px;
width: calc(35%) !important;
z-index: 1000;
}
}
.loop-animation {
animation-iteration-count: infinite;
-webkit-animation-iteration-count: infinite;
-moz-animation-iteration-count: infinite;
-o-animation-iteration-count: infinite;
}
.loop-animation-timeout {
animation-iteration-count: 5;
-webkit-animation-iteration-count: 5;
-moz-animation-iteration-count: 5;
-o-animation-iteration-count: 5;
}
.ping-success {
background: #46bc99 !important;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}.ping-warning {
background: #ff3333 !important;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
.TabOpened {
-webkit-filter: drop-shadow(0px 0px 5px <?=$topbartext;?>);
filter: drop-shadow(0px 0px 5px <?=$topbartext;?>);
}.bottom-bnts a {
background: <?=$bottombar;?> !important;
color: <?=$topbartext;?> !important;
}.bottom-bnts {
background: <?=$bottombar;?> !important;
}.gn-menu-main {
background: <?=$topbar;?>;
}.gn-menu-main ul.gn-menu {
background: <?=$sidebar;?>;
}.gn-menu-wrapper {
background: <?=$sidebar;?>;
}.la-timer.la-dark {
color: <?=$topbartext;?>
}.refresh-preloader {
background: <?=$loading;?>;
}.la-timer {
width: 75px;
height: 75px;
padding-top: 20px;
border-radius: 100px;
background: <?=$sidebar;?>;
border: 2px solid <?=$topbar;?>;
}@media screen and (min-width:737px){
.tab-item:hover a {
color: <?=$hovertext;?> !important;
background: <?=$hoverbg;?>;
border-radius: 100px 0 0 100px;
}
}.gn-menu li.active > a {
color: <?=$activetabtext;?> !important;
background: <?=$activetabBG;?>;
border-radius: 100px 0 0 100px;
}.gn-menu li.rightActive > a {
background: <?=$hoverbg;?>;
border-radius: 100px 0 0 100px;
}.gn-menu li.active i.fa {
color: <?=$activetabicon;?>;
}.gn-menu li i.fa {
color: <?=$inactiveicon;?>;
}.gn-menu-main ul.gn-menu a {
color: <?=$inactivetext;?>;
}li.dropdown.some-btn .mdi {
color: <?=$topbartext;?>;
}li.dropdown.some-btn .mdi:hover {
color: <?=$hoverbg;?>;
}.nav>li>a:focus, .nav>li>a:hover {
text-decoration: none;
background-color: transparent;
}div#preloader {
background: <?=$loading;?>;
}.iframe {
-webkit-overflow-scrolling: touch;
}.main-wrapper{
position: absolute !important;
}#menu-toggle span {
background: <?=$topbartext;?>;
}logo.logo {
opacity: 0.5;
filter: alpha(opacity=50);
}.mini-nav .split {
width: calc(50% - 25px);
}.splitRight {
width: 50%;
margin-left: 50% !important;
position: absolute !important;
}.split {
width: 50%;
position: absolute !important;
}.mini-nav .splitRight {
margin-left: calc(50% + 25px) !important;
width: calc(50% - 25px);
}.form-control.material {
background-image: -webkit-gradient(linear, left top, left bottom, from(<?=$topbartext;?>), to(<?=$topbartext;?>)), -webkit-gradient(linear, left top, left bottom, from(#d2d2d2), to(#d2d2d2));
background-image: -webkit-linear-gradient(<?=$topbartext;?>, <?=$topbartext;?>), -webkit-linear-gradient(#d2d2d2, #d2d2d2);
background-image: linear-gradient(<?=$topbartext;?>, <?=$topbartext;?>), linear-gradient(#d2d2d2, #d2d2d2);
}img.titlelogoclass {
max-width: 250px;
max-height: <?=$slimBar;?>px;
}@media only screen and (max-width: 450px) {
img.titlelogoclass {
max-width: 150px;
}
}.login-btn {
-webkit-border-radius: 4;
-moz-border-radius: 4;
border-radius: 4px;
-webkit-box-shadow: 0px 1px 3px #666666;
-moz-box-shadow: 0px 1px 3px #666666;
box-shadow: 0px 1px 3px #666666;
font-family: Arial;
color: <?=$topbar;?>;
font-size: 10px;
vertical-align: top;
background: <?=$topbartext;?>;
padding: 5px 10px 5px 10px;
text-decoration: none;
font-weight: 700;
font-style: normal;
}.login-btn:hover {
background: <?=$hoverbg;?>;
color: <?=$hovertext;?>;
text-decoration: none;
font-weight: 700;
}
<?php if(SLIMBAR == "true") : ?>
/* Slim Styling */
body{
padding-top: 30px !important;
}.gn-menu-main {
height: 30px !important;
}.gn-menu-wrapper {
top: 30px !important;
}.gn-menu-main .navbar-right {
line-height: 30px !important;
}img.img-circle {
vertical-align: inherit;
margin-top: 2px;
}.menu-toggle .hamburger {
top: 0px !important;
}.top-clock {
line-height: 30px !important;
}img.titlelogoclass {
vertical-align: inherit;
}.members-sidebar {
top: 30px !important;
}.menu-toggle .cross span:nth-child(2) {
left: -9px;
top: 41px;
}.menu-toggle.gn-selected .cross span:nth-child(2) {
width: 53%;
}.menu-toggle.gn-selected .cross span:nth-child(1) {
height: 105% !important;
}.menu-toggle .cross span:nth-child(1) {
left: 6px !important;
top: 26px !important;
}.menu-toggle .hamburger span {
margin: 5px 0;
width: 25px;
}.menu-toggle .hamburger {
margin-left: -17px;
}.ns-effect-slidetop {
padding: 6px 22px;
}.ns-effect-exploader {
padding: 5px 22px;
}
[class^="icon-"]:before, [class*=" icon-"]:before {
display: inline !important;
}
<?php endif; ?>
<?php customCSS(); ?>
</style>
<body id="body-index" class="group-<?php echo $group;?>" style="overflow: hidden">
<?php if (LOADINGSCREEN == "true") : ?>
<!--Preloader-->
<div id="preloader" class="preloader table-wrapper">
<div class="table-row">
<div class="table-cell">
<div class="la-ball-scale-multiple la-3x" style="color: <?=$topbar;?>">
<logo class="logo"><img height="192px" src="<?=$loadingIcon;?>"></logo>
</div>
</div>
</div>
</div>
<?php endif; ?>
<div id="main-wrapper" class="main-wrapper" tabindex="-1">
<ul id="gn-menu" class="gn-menu-main">
<li class="gn-trigger">
<a id="menu-toggle" class="menu-toggle gn-icon gn-icon-menu">
<div class="hamburger">
<span></span>
<span></span>
<span></span>
</div>
<div class="cross">
<span></span>
<span></span>
</div>
</a>
<nav class="gn-menu-wrapper">
<div class="gn-scroller" id="gn-scroller">
<ul id="tabList" class="gn-menu metismenu">
<!--Start Tab List-->
<?php
if($tabSetup == "No") {
$tabCount = 1;
$allPings = array();
if (is_array($result)) {
foreach($result as $row) {
$name = str_replace(array(':', '\\', '/', '*'), 'x', $row['ping_url']);
if($row['defaultz'] == "true") {
$defaultz = "active";
}else {
$defaultz = "";
} ?>
<li window="<?=$row['window'];?>" class="tab-item <?=$defaultz;?>" id="<?=$row['url'];?>x" data-title="<?=$row['name'];?>" name="<?php echo strtolower($row['name']);?>">
<a class="tab-link">
<?php if($row['iconurl']) { ?>
<i style="font-size: 19px; padding: 0 10px; font-size: 19px" data-toggle="tooltip" data-placement="bottom" data-original-title="<?=$row['name'];?>">
<span id="<?=$row['url'];?>s" class="badge badge-success" style="position: absolute;z-index: 100;right: 0px;"></span>
<img src="<?=$row['iconurl'];?>" style="height: 30px; width: 30px; margin-top: -2px;">
<?php if($row['ping'] == "true" && $row['ping_url']){ $allPings["image".$name] = $row['ping_url']; ?>
<ping class="ping-<?=$name;?> startPingTimer"></ping>
<?php }?>
</i>
<?php }else { ?>
<i class="fa <?=$row['icon'];?> fa-lg" data-toggle="tooltip" data-placement="bottom" data-original-title="<?=$row['name'];?>">
<span id="<?=$row['url'];?>s" class="badge badge-success" style="position: absolute;z-index: 100;right: 0px;"></span>
<?php if($row['ping'] == "true" && $row['ping_url']){ $allPings["icon".$name] = $row['ping_url']; ?>
<ping class="ping-<?=$name;?> startPingTimer"></ping>
<?php }?>
</i>
<?php } ?>
<?=$row['name'];?>
</a>
</li>
<?php
$tabCount++;
};
}
}?>
<?php if($configReady == "Yes") : if($USER->authenticated && $USER->role == "admin") :?>
<li class="tab-item <?=$settingsActive;?>" id="settings.phpx" data-title="Settings" name="settings">
<a class="tab-link">
<?php if($settingsicon == "Yes") :
echo '<i style="font-size: 19px; padding: 0 10px; font-size: 19px;">
<img id="settings-icon" src="images/' . $settingsIcon . '" style="height: 30px; margin-top: -2px;"></i>';
else :
echo '<i id="settings-icon" class="fa fa-cog"></i>';
endif; ?>
<?php echo $language->translate("SETTINGS");?>
</a>
</li>
<li style="display: none;" class="tab-item" id="updatedb.phpx" data-title="Upgrade" name="upgrade">
<a class="tab-link">
<?php if($settingsicon == "Yes") :
echo '<i style="font-size: 19px; padding: 0 10px; font-size: 19px;">
<img id="upgrade-icon" src="images/upgrade.png" style="height: 30px; margin-top: -2px;"></i>';
else :
echo '<i id="upgrade-icon" class="fa fa-arrow-up"></i>';
endif; ?>
<?php echo $language->translate("UPGRADE");?>
</a>
</li>
<?php endif; endif;?>
<!--End Tab List-->
</ul>
</div>
<!-- /gn-scroller -->
<div class="bottom-bnts">
<a class="fix-nav"><i class="mdi mdi-pin"></i></a>
</div>
</nav>
</li>
<li class="top-clock">
<?php
if($configReady == "Yes") :
if(TITLELOGO == "") :
echo "<span><span style=\"color: $topbartext\"><b>$title</b></span></span>";
else :
echo "<img class='titlelogoclass' src='" . TITLELOGO . "'>";
endif;
else :
echo "<span><span style=\"color: $topbartext\"><b>$title</b></span></span>";
endif;
?>
</li>
<li class="pull-right">
<ul class="nav navbar-right right-menu">
<?php if($configReady == "Yes"){?>
<li class="dropdown some-btn">
<a class="show-members">
<i class="userpic"><?=$showPic;?></i>
</a>
</li>
<?php if(!$USER->authenticated){?>
<li class="dropdown some-btn">
<a class="log-in">
<login class='login-btn text-uppercase'><?php echo $language->translate("LOGIN"); ?></login>
</a>
</li>
<?php } }?>
<?php if(CHAT == "true" && qualifyUser(CHATAUTH)){?>
<li class="dropdown some-btn">
<a id="chat-open" class="chat-open">
<i class="mdi mdi-forum animated"></i>
<span class="label label-new-message"></span>
</a>
</li>
<?php } ?>
</ul>
</li>
</ul>
<!--Content-->
<div id="content" class="content" style="">
<script>addToHomescreen();</script>
<!--Load Framed Content-->
<?php if($needSetup == "Yes" && $configReady == "Yes") : ?>
<div class="table-wrapper" style="background:<?=$sidebar;?>;">
<div class="table-row">
<div class="table-cell text-center">
<div class="login i-block">
<div class="content-box">
<div class="biggest-box" style="background:<?=$topbar;?>;">
<h1 class="zero-m text-uppercase" style="color:<?=$topbartext;?>;"><?php echo $language->translate("CREATE_ADMIN");?></h1>
</div>
<div class="big-box text-left registration-form">
<h4 class="text-center"><?php echo $language->translate("CREATE_ACCOUNT");?></h4>
<form class="controlbox" name="new user registration" id="registration" action="" method="POST" data-smk-icon="glyphicon-remove-sign">
<input type="hidden" name="op" value="register"/>
<input type="hidden" name="sha1" value=""/>
<input type="hidden" name="settings" value="false"/>
<div class="form-group">
<input type="text" class="form-control material" name="username" autofocus placeholder="<?php echo $language->translate("USERNAME");?>" autocorrect="off" autocapitalize="off" minlength="3" maxlength="16" required>
</div>
<div class="form-group">
<input type="email" class="form-control material" name="email" placeholder="<?php echo $language->translate("EMAIL");?>">
</div>
<div class="form-group">
<input type="password" class="form-control material" name="password1" placeholder="<?php echo $language->translate("PASSWORD");?>" data-smk-strongPass="weak" required>
</div>
<div class="form-group">
<input type="password" class="form-control material" name="password2" placeholder="<?php echo $language->translate("PASSWORD_AGAIN");?>">
</div>
<button id="registerSubmit" style="background:<?=$topbar;?>;" type="submit" class="btn btn-block text-uppercase waves waves-effect waves-float" value="Register"><text style="color:<?=$topbartext;?>;"><?php echo $language->translate("REGISTER");?></text></button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<?php endif; ?>
<?php if($needSetup == "Yes" && $configReady == "No") : ?>
<div class="table-wrapper" style="background:<?=$sidebar;?>;">
<div class="table-row">
<div class="table-cell text-center">
<div class="login i-block">
<div class="content-box">
<div class="biggest-box" style="background:<?=$topbar;?>;">
<h1 class="zero-m text-uppercase" style="color:<?=$topbartext;?>;"><?php echo $language->translate("DATABASE_PATH");?></h1>
</div>
<div class="big-box text-left">
<h3 class="text-center"><?php echo $language->translate("SPECIFY_LOCATION");?></h3>
<h5 class="text-left"><strong><?php echo $language->translate("CURRENT_DIRECTORY");?>: <?php echo str_replace("\\","/",__DIR__); ?> <br><?php echo $language->translate("PARENT_DIRECTORY");?>: <?php echo str_replace("\\","/",dirname(__DIR__)); ?></strong></h5>
<form class="controlbox" name="setupDatabase" id="setupDatabase" action="" method="POST" data-smk-icon="glyphicon-remove-sign">
<input type="hidden" name="action" value="createLocation" />
<div class="form-group">
<input type="text" class="form-control material" name="database_Location" autofocus value="<?php echo str_replace("\\","/",dirname(__DIR__));?>" autocorrect="off" autocapitalize="off" required>
<h5><?php echo $language->translate("SET_DATABASE_LOCATION");?></h5>
<?php echo getTimezone();?>
<h5><?php echo $language->translate("SET_TIMEZONE");?></h5>
<?php
if(file_exists(dirname(__DIR__) . '/users.db') || file_exists(__DIR__ . '/users.db') || file_exists(__DIR__ . '/config/users.db')) :
echo '<h5 class="text-center red">';
echo $language->translate("DONT_WORRY");
echo '</h5>';
endif;?>
</div>
<button style="background:<?=$topbar;?>;" id="databaseLocationSubmit" type="submit" class="btn btn-block btn-sm text-uppercase waves waves-effect waves-float" value="Save Location"><text style="color:<?=$topbartext;?>;"><?php echo $language->translate("SAVE_LOCATION");?></text></button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<?php endif; ?>
<?php if($configReady == "Yes") : if(!$USER->authenticated && $tabSetup == "Yes" && $needSetup == "No") :?>
<div class="table-wrapper">
<div class="table-row">
<div class="table-cell text-center">
<div class="login i-block">
<div class="content-box">
<div class="blue-bg biggest-box">
<h1 class="zero-m text-uppercase"><?php echo $language->translate("AWESOME");?></h1>
</div>
<div class="big-box text-left">
<h4 class="text-center"><?php echo $language->translate("TIME_TO_LOGIN");?></h4>
<button type="submit" class="btn log-in btn-block btn-primary text-uppercase waves waves-effect waves-float"><?php echo $language->translate("LOGIN");?></button>
</div>
</div>
</div>
</div>
</div>
</div>
<?php endif; endif; ?>
<?php if($tabSetup == "No" && $needSetup == "No") :?>
<div id="tabEmpty" class="table-wrapper" style="display: none; background:<?=$sidebar;?>;">
<div class="table-row">
<div class="table-cell text-center">
<div class="login i-block">
<div class="content-box">
<div class="biggest-box" style="background:<?=$topbar;?>;">
<h1 class="zero-m text-uppercase" style="color:<?=$topbartext;?>;"><?php echo $language->translate("HOLD_UP");?></h1>
</div>
<div class="big-box text-left">
<!--<center><img src="images/sowwy.png" style="height: 200px;"></center>
<h2 class="text-center"><?php echo $language->translate("LOOKS_LIKE_YOU_DONT_HAVE_ACCESS");?></h2>-->
<?php if(!$USER->authenticated) : ?>
<button style="background:<?=$topbar;?>;" type="submit" class="btn log-in btn-block btn-primary text-uppercase waves waves-effect waves-float"><text style="color:<?=$topbartext;?>;"><?php echo $language->translate("LOGIN");?></text></button>
<?php endif; ?>
</div>
</div>
</div>
</div>
</div>
</div>
<?php endif;?>
<!--End Load Framed Content-->
</div>
<div id="contentRight" class="content splitRight" style="">
</div>
<!--End Content-->
</div>
<?php if($configReady == "Yes") : if(!$USER->authenticated && $configReady == "Yes") : ?>
<div id="loginModal" class="login-modal modal fade">
<div style="background:<?=$sidebar;?>;" class="table-wrapper">
<div class="table-row">
<div class="table-cell text-center">
<button style="color:<?=$topbartext;?>;" type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<div class="login i-block">
<div class="content-box">
<div style="background:<?=$topbar;?>;" class="biggest-box">
<h1 style="color:<?=$topbartext;?>;" class="zero-m text-uppercase"><?php echo $language->translate("WELCOME");?></h1>
</div>
<div class="big-box text-left login-form">
<?php if($USER->error!="") : ?>
<p class="error">Error: <?php echo $USER->error; ?></p>
<?php endif; ?>
<form name="log in" id="login" action="" method="POST">
<h4 class="text-center"><?php echo $language->translate("LOGIN");?></h4>
<div class="form-group">
<input type="hidden" name="op" value="login">
<input type="hidden" name="sha1" value="">
<input type="hidden" name="password" value="">
<input type="hidden" name="rememberMe" value="false"/>
<input type="text" class="form-control material" name="username" placeholder="<?php echo $language->translate("USERNAME");?>" autocomplete="off" autocorrect="off" autocapitalize="off" value="" autofocus required>
</div>
<div class="form-group">
<input type="password" class="form-control material" name="password1" value="" autocomplete="off" placeholder="<?php echo $language->translate("PASSWORD");?>" required>
</div>
<div class="form-group">
<div class="i-block"> <input id="rememberMe" name="rememberMe" class="switcher switcher-success switcher-medium pull-left" value="true" type="checkbox" checked="">
<label for="rememberMe" class="pull-left"></label>
<label class="pull-right"> <?php echo $language->translate("REMEMBER_ME");?></label>
</div>
</div>
<button id="loginSubmit" style="background:<?=$topbar;?>;" type="submit" class="btn btn-block btn-info text-uppercase waves" value="log in" onclick="User.processLogin()"><text style="color:<?=$topbartext;?>;"><?php echo $language->translate("LOGIN");?></text></button>
</form>
<?php if (ENABLEMAIL == "true") : ?>
<button id="switchForgot" style="background:<?=$topbartext;?>;" class="btn btn-block btn-info text-uppercase waves"><text style="color:<?=$topbar;?>;"><?php echo $language->translate("FORGOT_PASSWORD");?></text></button>
<?php endif; ?>
<?php if(REGISTERPASSWORD != "") : ?>
<button id="switchCreateUser" style="background:<?=$hoverbg;?>;" class="btn btn-block btn-info text-uppercase waves"><text style="color:<?=$hovertext;?>;"><?php echo $language->translate("CREATE_USER");?></text></button>
<?php endif; ?>
<form style="display: none;" name="forgotPassword" id="forgotPassword" action="" method="POST" data-smk-icon="glyphicon-remove-sign">
<h4 class="text-center"><?php echo $language->translate("FORGOT_PASSWORD");?></h4>
<div class="form-group">
<input type="hidden" name="op" value="reset">
<input type="text" class="form-control material" name="email" placeholder="<?php echo $language->translate("EMAIL");?>" autocorrect="off" autocapitalize="off" value="" autofocus required>
</div>
<button style="background:<?=$topbar;?>;" type="submit" class="btn btn-block btn-info text-uppercase waves" value="reset password"><text style="color:<?=$topbartext;?>;"><?php echo $language->translate("RESET_PASSWORD");?></text></button>
</form>
<button id="welcomeGoBack" style="background:<?=$topbartext;?>; display: none" class="btn btn-block btn-info text-uppercase waves"><text style="color:<?=$topbar;?>;"><?php echo $language->translate("GO_BACK");?></text></button>
<?php if(REGISTERPASSWORD != "") : ?>
<div id="userPassForm" style="display: none;">
<form id="userCreateForm" action="register.php" method="POST">
<h4 class="text-center"><?php echo $language->translate("ENTER_PASSWORD_TO_REGISTER");?></h4>
<center><h5 id="userCreateErrors" style="color: red"></h5></center>
<div class="form-group">
<input type="text" class="form-control material" name="registerPasswordValue" placeholder="<?php echo $language->translate("PASSWORD");?>" autocorrect="off" autocapitalize="off" value="" autofocus required>
</div>
<button style="background:<?=$topbar;?>;" type="submit" id="checkRegisterPass" class="btn btn-block btn-info text-uppercase waves" value="reset password"><text style="color:<?=$topbartext;?>;"><?php echo $language->translate("SUBMIT");?></text></button>
</form>
<button id="welcomeGoBack2" style="background:<?=$topbartext;?>; display: none" class="btn btn-block btn-info text-uppercase waves"><text style="color:<?=$topbar;?>;"><?php echo $language->translate("GO_BACK");?></text></button>
</div>
<form style="display: none;" name="createUser" id="registration" action="" method="POST" data-smk-icon="glyphicon-remove-sign">
<h4 class="text-center"><?php echo $language->translate("CREATE_USER");?></h4>
<input type="hidden" name="op" value="register"/>
<input type="hidden" name="sha1" value=""/>
<input type="hidden" name="settings" value="false"/>
<input type="hidden" name="validate" id="validate" value=""/>
<div class="form-group">
<input type="text" class="form-control material" name="username" autofocus placeholder="<?php echo $language->translate("USERNAME");?>" autocorrect="off" autocapitalize="off" minlength="3" maxlength="16" required>
</div>
<div class="form-group">
<input type="email" class="form-control material" name="email" placeholder="<?php echo $language->translate("EMAIL");?>">
</div>
<div class="form-group">
<input type="password" class="form-control material" name="password1" placeholder="<?php echo $language->translate("PASSWORD");?>" data-smk-strongPass="weak" required>
</div>
<div class="form-group">
<input type="password" class="form-control material" name="password2" placeholder="<?php echo $language->translate("PASSWORD_AGAIN");?>">
</div>
<button id="registerSubmit" type="submit" class="btn green-bg btn-block btn-warning text-uppercase waves waves-effect waves-float" value="Register"><?php echo $language->translate("REGISTER");?></button>
<button id="welcomeGoBack3" style="background:<?=$topbartext;?>; display: none" class="btn btn-block btn-info text-uppercase waves"><text style="color:<?=$topbar;?>;"><?php echo $language->translate("GO_BACK");?></text></button>
</form>
<?php endif; ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php endif; endif; ?>
<?php if($configReady == "Yes") : if($USER->authenticated) : ?>
<div style="background:<?=$topbar;?>;" class="logout-modal modal fade">
<div class="table-wrapper" style="background: <?=$sidebar;?>">
<div class="table-row">
<div class="table-cell text-center">
<div class="login i-block">
<div class="content-box">
<div style="background:<?=$topbar;?>;" class="biggest-box">
<h1 style="color:<?=$topbartext;?>;" class="zero-m text-uppercase"><?php echo $language->translate("LOGOUT");?></h1>
</div>
<div class="big-box login-form">
<form name="log out" id="logout" action="" method="POST">
<input type="hidden" name="op" value="logout">
<input type="hidden" name="username"value="<?php echo $_SESSION["username"]; ?>" >
<!--<center><img src="images/sowwy.png" style="height: 200px;"></center>-->
<h3 style="color:<?=$topbar;?>;" class="zero-m text-uppercase"><?php echo $language->translate("DO_YOU_WANT_TO_LOGOUT");?></h3>
<a style="color:<?=$topbar;?>;" id="logoutSubmit" class="i-block" data-dismiss="modal"><?php echo $language->translate("YES_WORD");?></a>
<a style="color:<?=$topbar;?>;" class="i-block" data-dismiss="modal"><?php echo $language->translate("NO_WORD");?></a>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php endif; endif;?>
<?php if(isset($_GET['inviteCode'])){ ?>
<div id="inviteSet" class="login-modal modal fade">
<div style="background:<?=$sidebar;?>;" class="table-wrapper">
<div class="table-row">
<div class="table-cell text-center">
<button style="color:<?=$topbartext;?>;" type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<div class="login i-block">
<div class="content-box">
<div style="background:<?=$topbar;?>;" class="biggest-box">
<h1 style="color:<?=$topbartext;?>;" class="zero-m text-uppercase"><?php echo $language->translate("WELCOME");?></h1>
</div>
<div class="big-box text-left login-form">
<?php if($USER->error!="") : ?>
<p class="error">Error: <?php echo $USER->error; ?></p>
<?php endif; ?>
<form name="checkInviteForm" id="checkInviteForm" onsubmit="return false;" data-smk-icon="glyphicon-remove-sign">
<h4 class="text-center"><?php echo $language->translate("CHECK_INVITE");?></h4>
<div class="form-group">
<input style="font-size: 400%; height: 100%" type="text" class="form-control yellow-bg text-center text-uppercase" name="inviteCode" placeholder="<?php echo $language->translate("CODE");?>" autocomplete="off" autocorrect="off" autocapitalize="off" value="<?=$inviteCode;?>" maxlength="6" spellcheck="false" autofocus required>
</div>
<button id="checkInviteForm_submit" style="background:<?=$topbar;?>;" type="submit" class="btn btn-block btn-info text-uppercase waves" value="checkInvite"><text style="color:<?=$topbartext;?>;"><?php echo $language->translate("SUBMIT_CODE");?></text></button>