forked from nilsteampassnet/TeamPass
-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin.settings.php
1715 lines (1669 loc) · 121 KB
/
admin.settings.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
/**
*
* @file admin.settings.php
* @author Nils Laumaillé
* @version 2.1.13
* @copyright (c) 2009-2013 Nils Laumaillé
* @licensing GNU AFFERO GPL 3.0
* @link http://www.teampass.net
*
* This library 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.
*/
if (!isset($_SESSION['CPM']) || $_SESSION['CPM'] != 1) {
die('Hacking attempt...');
}
/*
* FUNCTION permitting to store into DB the settings changes
*/
function updateSettings ($setting, $val, $type = '')
{
global $server, $user, $pass, $database, $pre;
if (empty($type)) {
$type = 'admin';
}
require_once $_SESSION['settings']['cpassman_dir'].'/sources/SplClassLoader.php';
// Connect to database
$db = new SplClassLoader('Database\Core', '../includes/libraries');
$db->register();
$db = new Database\Core\DbCore($server, $user, $pass, $database, $pre);
$db->connect();
// Check if setting is already in DB. If NO then insert, if YES then update.
$data = $db->fetchRow("SELECT COUNT(*) FROM ".$pre."misc WHERE type='".$type."' AND intitule = '".$setting."'");
if ($data[0] == 0) {
$db->queryInsert(
"misc",
array(
'valeur' => $val,
'type' => $type,
'intitule' => $setting
)
);
// in case of stats enabled, add the actual time
if ($setting == 'send_stats') {
$db->queryInsert(
"misc",
array(
'valeur' => time(),
'type' => $type,
'intitule' => $setting.'_time'
)
);
}
} else {
$db->queryUpdate(
"misc",
array(
'valeur' => $val
),
"type='".$type."' AND intitule = '".$setting."'"
);
// in case of stats enabled, update the actual time
if ($setting == 'send_stats') {
// Check if previous time exists, if not them insert this value in DB
$data_time = $db->fetchRow("SELECT COUNT(*) FROM ".$pre."misc WHERE type='".$type."' AND intitule = '".$setting."_time'");
if ($data_time[0] == 0) {
$db->queryInsert(
"misc",
array(
'valeur' => 0,
'type' => $type,
'intitule' => $setting.'_time'
)
);
} else {
$db->queryUpdate(
"misc",
array(
'valeur' => 0
),
"type='".$type."' AND intitule = '".$setting."_time'"
);
}
}
}
// save in variable
/*if ($type == "admin") {
$_SESSION['settings'][$setting] = $val;
} elseif ($type == "settings") {
$settings[$setting] = $val;
}*/
$_SESSION['settings'][$setting] = $val;
}
// SAVE CHANGES
if (isset($_POST['save_button'])) {
// Update last seen items
if (isset($_SESSION['settings']['max_latest_items']) && $_SESSION['settings']['max_latest_items'] != $_POST['max_last_items']) {
updateSettings('max_latest_items', $_POST['max_last_items']);
}
// Update delay_item_edition
if (isset($_SESSION['settings']['delay_item_edition']) && $_SESSION['settings']['delay_item_edition'] != $_POST['delay_item_edition']) {
updateSettings('delay_item_edition', $_POST['delay_item_edition']);
}
// Update favourites
if (isset($_SESSION['settings']['enable_favourites']) && $_SESSION['settings']['enable_favourites'] != $_POST['enable_favourites']) {
updateSettings('enable_favourites', $_POST['enable_favourites']);
}
// Update last shown items
if (isset($_SESSION['settings']['show_last_items']) && $_SESSION['settings']['show_last_items'] != $_POST['show_last_items']) {
updateSettings('show_last_items', $_POST['show_last_items']);
}
// Update personal feature
if (isset($_SESSION['settings']['enable_pf_feature']) && $_SESSION['settings']['enable_pf_feature'] != $_POST['enable_pf_feature']) {
updateSettings('enable_pf_feature', $_POST['enable_pf_feature']);
}
// Update loggin connections setting
if (isset($_SESSION['settings']['log_connections']) && $_SESSION['settings']['log_connections'] != $_POST['log_connections']) {
updateSettings('log_connections', $_POST['log_connections']);
}
// Update log_accessed setting
if ((isset($_SESSION['settings']['log_accessed']) && $_SESSION['settings']['log_accessed'] != $_POST['log_accessed']) || !isset($_SESSION['settings']['log_accessed'])) {
updateSettings('log_accessed', $_POST['log_accessed']);
}
// Update date format setting
if (isset($_SESSION['settings']['date_format']) && $_SESSION['settings']['date_format'] != $_POST['date_format']) {
updateSettings('date_format', $_POST['date_format']);
}
// Update time format setting
if (isset($_SESSION['settings']['time_format']) && $_SESSION['settings']['time_format'] != $_POST['time_format']) {
updateSettings('time_format', $_POST['time_format']);
}
// Update default language setting
if (@$_SESSION['settings']['default_language'] != $_POST['default_language']) {
updateSettings('default_language', $_POST['default_language']);
}
// Update duplicate folder setting
if (isset($_SESSION['settings']['duplicate_folder']) && $_SESSION['settings']['duplicate_folder'] != $_POST['duplicate_folder']) {
updateSettings('duplicate_folder', $_POST['duplicate_folder']);
}
// Update duplicate item setting
if (isset($_SESSION['settings']['duplicate_item']) && $_SESSION['settings']['duplicate_item'] != $_POST['duplicate_item']) {
updateSettings('duplicate_item', $_POST['duplicate_item']);
}
// Update duplicate item setting
if (isset($_SESSION['settings']['pwd_maximum_length']) && $_SESSION['settings']['pwd_maximum_length'] != $_POST['pwd_maximum_length']) {
updateSettings('pwd_maximum_length', $_POST['pwd_maximum_length']);
}
// Update number_of_used_pw setting
if (isset($_SESSION['settings']['number_of_used_pw']) && $_SESSION['settings']['number_of_used_pw'] != $_POST['number_of_used_pw']) {
updateSettings('number_of_used_pw', $_POST['number_of_used_pw']);
}
// Update duplicate Manager edit
if (isset($_SESSION['settings']['manager_edit']) && $_SESSION['settings']['manager_edit'] != $_POST['manager_edit']) {
updateSettings('manager_edit', $_POST['manager_edit']);
}
// Update cpassman_dir
if (isset($_SESSION['settings']['cpassman_dir']) && $_SESSION['settings']['cpassman_dir'] != $_POST['cpassman_dir']) {
updateSettings('cpassman_dir', $_POST['cpassman_dir']);
}
// Update cpassman_url
if (isset($_SESSION['settings']['cpassman_url']) && $_SESSION['settings']['cpassman_url'] != $_POST['cpassman_url']) {
updateSettings('cpassman_url', $_POST['cpassman_url']);
}
// Update path_to_upload_folder
if ((isset($_SESSION['settings']['path_to_upload_folder']) && $_SESSION['settings']['path_to_upload_folder'] != $_POST['path_to_upload_folder']) || (!isset($_SESSION['settings']['path_to_upload_folder']))) {
updateSettings('path_to_upload_folder', $_POST['path_to_upload_folder']);
}
// Update url_to_upload_folder
if ((isset($_SESSION['settings']['url_to_upload_folder']) && $_SESSION['settings']['url_to_upload_folder'] != $_POST['url_to_upload_folder']) || (!isset($_SESSION['settings']['url_to_upload_folder']))) {
updateSettings('url_to_upload_folder', $_POST['url_to_upload_folder']);
}
// Update path_to_files_folder
if ((isset($_SESSION['settings']['path_to_files_folder']) && $_SESSION['settings']['path_to_files_folder'] != $_POST['path_to_files_folder']) || (!isset($_SESSION['settings']['path_to_files_folder']))) {
updateSettings('path_to_files_folder', $_POST['path_to_files_folder']);
}
// Update url_to_upload_folder
if ((isset($_SESSION['settings']['url_to_files_folder']) && $_SESSION['settings']['url_to_files_folder'] != $_POST['url_to_files_folder']) || (!isset($_SESSION['settings']['url_to_files_folder']))) {
updateSettings('url_to_files_folder', $_POST['url_to_files_folder']);
}
// Update pw_life_duration
if (isset($_SESSION['settings']['pw_life_duration']) && $_SESSION['settings']['pw_life_duration'] != $_POST['pw_life_duration']) {
updateSettings('pw_life_duration', $_POST['pw_life_duration']);
}
// Update favicon
if (isset($_SESSION['settings']['favicon']) && $_SESSION['settings']['favicon'] != $_POST['favicon']) {
updateSettings('favicon', $_POST['favicon']);
}
// Update activate_expiration setting
if (isset($_SESSION['settings']['activate_expiration']) && $_SESSION['settings']['activate_expiration'] != $_POST['activate_expiration']) {
updateSettings('activate_expiration', $_POST['activate_expiration']);
}
// Update maintenance mode
if (@$_SESSION['settings']['maintenance_mode'] != $_POST['maintenance_mode']) {
updateSettings('maintenance_mode', $_POST['maintenance_mode']);
}
// Update sts mode
if ( @$_SESSION['settings']['enable_sts'] != $_POST['enable_sts'] ) {
updateSettings('enable_sts', $_POST['enable_sts']);
}
// Update send_stats
if (@$_SESSION['settings']['send_stats'] != $_POST['send_stats']) {
updateSettings('send_stats', $_POST['send_stats']);
}
// Update allow_print
if (@$_SESSION['settings']['allow_print'] != $_POST['allow_print']) {
updateSettings('allow_print', $_POST['allow_print']);
}
// Update allow_import
if (@$_SESSION['settings']['allow_import'] != $_POST['allow_import']) {
updateSettings('allow_import', $_POST['allow_import']);
}
// Update show_description
if (@$_SESSION['settings']['show_description'] != $_POST['show_description']) {
updateSettings('show_description', $_POST['show_description']);
}
// Update LDAP mode
if (isset($_POST['ldap_mode']) && $_SESSION['settings']['ldap_mode'] != $_POST['ldap_mode']) {
updateSettings('ldap_mode', $_POST['ldap_mode']);
}
// Update LDAP ldap_suffix
if (@$_SESSION['settings']['ldap_suffix'] != $_POST['ldap_suffix']) {
updateSettings('ldap_suffix', $_POST['ldap_suffix']);
}
// Update LDAP ldap_domain_dn
if (@$_SESSION['settings']['ldap_domain_dn'] != $_POST['ldap_domain_dn']) {
updateSettings('ldap_domain_dn', $_POST['ldap_domain_dn']);
}
// Update LDAP ldap_domain_controler
if (@$_SESSION['settings']['ldap_domain_controler'] != $_POST['ldap_domain_controler']) {
updateSettings('ldap_domain_controler', $_POST['ldap_domain_controler']);
}
// Update LDAP ssl
if (@$_SESSION['settings']['ldap_ssl'] != $_POST['ldap_ssl']) {
updateSettings('ldap_ssl', $_POST['ldap_ssl']);
}
// Update LDAP tls
if (@$_SESSION['settings']['ldap_tls'] != $_POST['ldap_tls']) {
updateSettings('ldap_tls', $_POST['ldap_tls']);
}
// Update LDAP ldap_elusers
if (@$_SESSION['settings']['ldap_elusers'] != $_POST['ldap_elusers']) {
updateSettings('ldap_elusers', $_POST['ldap_elusers']);
}
// Update anyone_can_modify
if (@$_SESSION['settings']['anyone_can_modify'] != $_POST['anyone_can_modify']) {
updateSettings('anyone_can_modify', $_POST['anyone_can_modify']);
}
// Update anyone_can_modify_bydefault
if (@$_SESSION['settings']['anyone_can_modify_bydefault'] != $_POST['anyone_can_modify_bydefault']) {
updateSettings('anyone_can_modify_bydefault', $_POST['anyone_can_modify_bydefault']);
}
// Update enable_kb
if (@$_SESSION['settings']['enable_kb'] != $_POST['enable_kb']) {
updateSettings('enable_kb', $_POST['enable_kb']);
}
// Update nb_bad_identification
if (@$_SESSION['settings']['nb_bad_authentication'] != $_POST['nb_bad_authentication']) {
updateSettings('nb_bad_authentication', $_POST['nb_bad_authentication']);
}
// Update restricted_to(if restricted_to is FALSE then restricted_to_roles needs to be FALSE
if (@$_SESSION['settings']['restricted_to'] != $_POST['restricted_to']) {
updateSettings('restricted_to', $_POST['restricted_to']);
if ($_POST['restricted_to'] == 0) {
updateSettings('restricted_to_roles', 0);
}
}
// Update restricted_to_roles
if (@$_SESSION['settings']['restricted_to_roles'] != $_POST['restricted_to_roles'] && (@$_SESSION['settings']['restricted_to'] == 1 OR $_POST['restricted_to'] == 1)) {
updateSettings('restricted_to_roles', $_POST['restricted_to_roles']);
}
// Update copy_to_clipboard_small_icons
if (@$_SESSION['settings']['copy_to_clipboard_small_icons'] != $_POST['copy_to_clipboard_small_icons']) {
updateSettings('copy_to_clipboard_small_icons', $_POST['copy_to_clipboard_small_icons']);
}
// Update timezone_selection
if (@$_SESSION['settings']['timezone'] != $_POST['timezone']) {
updateSettings('timezone', $_POST['timezone']);
}
// Update enable_user_can_create_folders
if (@$_SESSION['settings']['enable_user_can_create_folders'] != $_POST['enable_user_can_create_folders']) {
updateSettings('enable_user_can_create_folders', $_POST['enable_user_can_create_folders']);
}
// Update enable_send_email_on_user_login
if (@$_SESSION['settings']['enable_send_email_on_user_login'] != $_POST['enable_send_email_on_user_login']) {
updateSettings('enable_send_email_on_user_login', $_POST['enable_send_email_on_user_login']);
}
// Update enable_email_notification_on_item_shown
if (@$_SESSION['settings']['enable_email_notification_on_item_shown'] != $_POST['enable_email_notification_on_item_shown']) {
updateSettings('enable_email_notification_on_item_shown', $_POST['enable_email_notification_on_item_shown']);
}
// Update custom_logo
if (@$_SESSION['settings']['custom_logo'] != $_POST['custom_logo']) {
updateSettings('custom_logo', $_POST['custom_logo']);
}
// Update custom_login_text
if (@$_SESSION['settings']['custom_login_text'] != $_POST['custom_login_text']) {
updateSettings('custom_login_text', htmlentities($_POST['custom_login_text'], ENT_QUOTES, "UTF-8"));
}
// Update nb of items to get in one query iterration
if (@$_SESSION['settings']['nb_items_by_query'] != $_POST['nb_items_by_query']) {
updateSettings('nb_items_by_query', $_POST['nb_items_by_query']);
}
// Update enable_delete_after_consultation
if (@$_SESSION['settings']['enable_delete_after_consultation'] != $_POST['enable_delete_after_consultation']) {
updateSettings('enable_delete_after_consultation', $_POST['enable_delete_after_consultation']);
}
// Update enable_personal_saltkey_cookie
if (@$_SESSION['settings']['enable_personal_saltkey_cookie'] != $_POST['enable_personal_saltkey_cookie']) {
updateSettings('enable_personal_saltkey_cookie', $_POST['enable_personal_saltkey_cookie']);
}
// Update personal_saltkey_cookie_duration
if (@$_SESSION['settings']['personal_saltkey_cookie_duration'] != $_POST['personal_saltkey_cookie_duration']) {
updateSettings('personal_saltkey_cookie_duration', $_POST['personal_saltkey_cookie_duration']);
}
// Update email_smtp_server
if (@$_SESSION['settings']['email_smtp_server'] != $_POST['email_smtp_server']) {
updateSettings('email_smtp_server', $_POST['email_smtp_server']);
}
// Update email_auth
if (@$_SESSION['settings']['email_smtp_auth'] != $_POST['email_smtp_auth']) {
updateSettings('email_smtp_auth', $_POST['email_smtp_auth']);
}
// Update email_auth_username
if (@$_SESSION['settings']['email_auth_username'] != $_POST['email_auth_username']) {
updateSettings('email_auth_username', $_POST['email_auth_username']);
}
// Update email_auth_pwd
if (@$_SESSION['settings']['email_auth_pwd'] != $_POST['email_auth_pwd']) {
updateSettings('email_auth_pwd', $_POST['email_auth_pwd']);
}
// Update email_from
if (@$_SESSION['settings']['email_from'] != $_POST['email_from']) {
updateSettings('email_from', $_POST['email_from']);
}
// Update email_from_name
if (@$_SESSION['settings']['email_from_name'] != $_POST['email_from_name']) {
updateSettings('email_from_name', $_POST['email_from_name']);
}
// Update email_port
if (@$_SESSION['settings']['email_port'] != $_POST['email_port']) {
updateSettings('email_port', $_POST['email_port']);
}
// store backups settings
if (@$_SESSION['settings']['bck_script_filename'] != $_POST['bck_script_filename']) {
updateSettings('bck_script_filename', $_POST['bck_script_filename'], 'settings');
}
if (@$_SESSION['settings']['bck_script_path'] != $_POST['bck_script_path']) {
updateSettings('bck_script_path', $_POST['bck_script_path'], 'settings');
}
if (@$_SESSION['settings']['bck_script_key'] != $_POST['bck_script_key']) {
updateSettings('bck_script_key', $_POST['bck_script_key'], 'settings');
}
// Update insert_manual_entry_item_history
if (@$_SESSION['settings']['insert_manual_entry_item_history'] != $_POST['insert_manual_entry_item_history']) {
updateSettings('insert_manual_entry_item_history', $_POST['insert_manual_entry_item_history']);
}
//2factors_authentication
if (isset($_POST['2factors_authentication'])) {
updateSettings('2factors_authentication', $_POST['2factors_authentication']);
}
// Update proxy_ip setting
if (@$_SESSION['settings']['proxy_ip'] != $_POST['proxy_ip']) {
updateSettings('proxy_ip', $_POST['proxy_ip']);
}
// Update proxy_port setting
if (@$_SESSION['settings']['proxy_port'] != $_POST['proxy_port']) {
updateSettings('proxy_port', $_POST['proxy_port']);
}
// Update settings_upload_maxfilesize
if (@$_SESSION['settings']['upload_maxfilesize'] != $_POST['upload_maxfilesize']) {
updateSettings('upload_maxfilesize', $_POST['upload_maxfilesize']);
}
// Update upload_docext
if (@$_SESSION['settings']['upload_docext'] != $_POST['upload_docext']) {
updateSettings('upload_docext', $_POST['upload_docext']);
}
// Update upload_imagesext
if (@$_SESSION['settings']['upload_imagesext'] != $_POST['upload_imagesext']) {
updateSettings('upload_imagesext', $_POST['upload_imagesext']);
}
// Update upload_pkgext
if (@$_SESSION['settings']['upload_pkgext'] != $_POST['upload_pkgext']) {
updateSettings('upload_pkgext', $_POST['upload_pkgext']);
}
// Update upload_othext
if (@$_SESSION['settings']['upload_otherext'] != $_POST['upload_otherext']) {
updateSettings('upload_otherext', $_POST['upload_otherext']);
}
// Update upload_imageresize_options
if (@$_SESSION['settings']['upload_imageresize_options'] != $_POST['upload_imageresize_options']) {
updateSettings('upload_imageresize_options', $_POST['upload_imageresize_options']);
}
// Update upload_imageresize_width
if (@$_SESSION['settings']['upload_imageresize_width'] != @$_POST['upload_imageresize_width']) {
@updateSettings('upload_imageresize_width', $_POST['upload_imageresize_width']);
}
// Update upload_imageresize_height
if (@$_SESSION['settings']['upload_imageresize_height'] != @$_POST['upload_imageresize_height']) {
@updateSettings('upload_imageresize_height', $_POST['upload_imageresize_height']);
}
// Update upload_imageresize_quality
if (@$_SESSION['settings']['upload_imageresize_quality'] != @$_POST['upload_imageresize_quality']) {
@updateSettings('upload_imageresize_quality', $_POST['upload_imageresize_quality']);
}
// Update can_create_root_folder
if (@$_SESSION['settings']['can_create_root_folder'] != $_POST['can_create_root_folder']) {
updateSettings('can_create_root_folder', $_POST['can_create_root_folder']);
}
}
echo '
<div style="margin-top:10px;">
<form name="form_settings" method="post" action="">';
// Main div for TABS
echo '
<div style="width:900px;margin:auto; line-height:20px; padding:10px;" id="tabs">';
// Tabs menu
echo '
<ul>
<li><a href="#tabs-1">'.$txt['admin_settings_title'].'</a></li>
<li><a href="#tabs-3">'.$txt['admin_misc_title'].'</a></li>
<li><a href="#tabs-7">'.$txt['admin_upload_title'].'</a></li>
<li><a href="#tabs-2">'.$txt['admin_actions_title'].'</a></li>
<li><a href="#tabs-4">'.$txt['admin_ldap_menu'].'</a></li>
<li><a href="#tabs-5">'.$txt['admin_backups'].'</a></li>
<li><a href="#tabs-6">'.$txt['admin_emails'].'</a></li>
</ul>';
// --------------------------------------------------------------------------------
// TAB Né1
echo '
<div id="tabs-1">
<table border="0">';
// cpassman_dir
echo '
<tr style="margin-bottom:3px">
<td>
<span class="ui-icon ui-icon-disk" style="float: left; margin-right: .3em;"> </span>
<label for="cpassman_dir">'.$txt['admin_misc_cpassman_dir'].'</label>
</td>
<td>
<input type="text" size="80" id="cpassman_dir" name="cpassman_dir" value="', isset($_SESSION['settings']['cpassman_dir']) ? $_SESSION['settings']['cpassman_dir'] : '', '" class="text ui-widget-content" />
<td>
</tr>';
// cpassman_url
echo '
<tr style="margin-bottom:3px">
<td>
<span class="ui-icon ui-icon-disk" style="float: left; margin-right: .3em;"> </span>
<label for="cpassman_url">'.$txt['admin_misc_cpassman_url'].'</label>
</td>
<td>
<input type="text" size="80" id="cpassman_url" name="cpassman_url" value="', isset($_SESSION['settings']['cpassman_url']) ? $_SESSION['settings']['cpassman_url'] : '', '" class="text ui-widget-content" />
<td>
</tr>';
// path_to_upload_folder
echo '
<tr style="margin-bottom:3px">
<td>
<span class="ui-icon ui-icon-disk" style="float: left; margin-right: .3em;"> </span>
<label for="path_to_upload_folder">'.$txt['admin_path_to_upload_folder'].'</label>
<img src="includes/images/question-small-white.png" class="tip" alt="" title="'.$txt['admin_path_to_upload_folder_tip'].'" />
</td>
<td>
<input type="text" size="80" id="path_to_upload_folder" name="path_to_upload_folder" value="', isset($_SESSION['settings']['path_to_upload_folder']) ? $_SESSION['settings']['path_to_upload_folder'] : $_SESSION['settings']['cpassman_dir'].'/upload', '" class="text ui-widget-content" />
<td>
</tr>';
// url_to_upload_folder
echo '
<tr style="margin-bottom:3px">
<td>
<span class="ui-icon ui-icon-disk" style="float: left; margin-right: .3em;"> </span>
<label for="url_to_upload_folder">'.$txt['admin_url_to_upload_folder'].'</label>
</td>
<td>
<input type="text" size="80" id="url_to_upload_folder" name="url_to_upload_folder" value="', isset($_SESSION['settings']['url_to_upload_folder']) ? $_SESSION['settings']['url_to_upload_folder'] : $_SESSION['settings']['cpassman_url'].'/upload', '" class="text ui-widget-content" />
<td>
</tr>';
// path_to_files_folder
echo '
<tr style="margin-bottom:3px">
<td>
<span class="ui-icon ui-icon-disk" style="float: left; margin-right: .3em;"> </span>
<label for="path_to_files_folder">'.$txt['admin_path_to_files_folder'].'</label>
<img src="includes/images/question-small-white.png" class="tip" alt="" title="'.$txt['admin_path_to_files_folder_tip'].'" />
</td>
<td>
<input type="text" size="80" id="path_to_files_folder" name="path_to_files_folder" value="', isset($_SESSION['settings']['path_to_files_folder']) ? $_SESSION['settings']['path_to_files_folder'] : $_SESSION['settings']['cpassman_dir'].'/files', '" class="text ui-widget-content" />
<td>
</tr>';
// url_to_files_folder
echo '
<tr style="margin-bottom:3px">
<td>
<span class="ui-icon ui-icon-disk" style="float: left; margin-right: .3em;"> </span>
<label for="url_to_files_folder">'.$txt['admin_url_to_files_folder'].'</label>
</td>
<td>
<input type="text" size="80" id="url_to_files_folder" name="url_to_files_folder" value="', isset($_SESSION['settings']['url_to_files_folder']) ? $_SESSION['settings']['url_to_files_folder'] : $_SESSION['settings']['cpassman_url'].'/files', '" class="text ui-widget-content" />
<td>
</tr>';
// Favicon
echo '
<tr style="margin-bottom:3px">
<td>
<span class="ui-icon ui-icon-disk" style="float: left; margin-right: .3em;"> </span>
<label for="favicon">'.$txt['admin_misc_favicon'].'</label>
</td>
<td>
<input type="text" size="80" id="favicon" name="favicon" value="', isset($_SESSION['settings']['favicon']) ? $_SESSION['settings']['favicon'] : '', '" class="text ui-widget-content" />
<td>
</tr>';
// custom_logo
echo '
<tr style="margin-bottom:3px">
<td>
<span class="ui-icon ui-icon-disk" style="float: left; margin-right: .3em;"> </span>
<label for="cpassman_dir">'.$txt['admin_misc_custom_logo'].'</label>
</td>
<td>
<input type="text" size="80" id="custom_logo" name="custom_logo" value="', isset($_SESSION['settings']['custom_logo']) ? $_SESSION['settings']['custom_logo'] : '', '" class="text ui-widget-content" />
<td>
</tr>';
// custom_login_text
echo '
<tr style="margin-bottom:3px">
<td>
<span class="ui-icon ui-icon-disk" style="float: left; margin-right: .3em;"> </span>
<label for="cpassman_dir">'.$txt['admin_misc_custom_login_text'].'</label>
</td>
<td>
<input type="text" size="80" id="custom_login_text" name="custom_login_text" value="', isset($_SESSION['settings']['custom_login_text']) ? $_SESSION['settings']['custom_login_text'] : '', '" class="text ui-widget-content" />
<td>
</tr>';
echo '
</table>';
echo '
<table>';
echo '<tr><td colspan="3"><hr></td></tr>';
// Maintenance mode
echo '
<tr style="margin-bottom:3px">
<td>
<span class="ui-icon ui-icon-disk" style="float: left; margin-right: .3em;"> </span>
<label>' .
$txt['settings_maintenance_mode'].'
<img src="includes/images/question-small-white.png" class="tip" alt="" title="'.$txt['settings_maintenance_mode_tip'].'" />
</label>
</td>
<td>
<div class="div_radio">
<input type="radio" id="maintenance_mode_radio1" name="maintenance_mode" onclick="changeSettingStatus($(this).attr(\'name\'), 1) " value="1"', isset($_SESSION['settings']['maintenance_mode']) && $_SESSION['settings']['maintenance_mode'] == 1 ? ' checked="checked"' : '', ' /><label for="maintenance_mode_radio1">'.$txt['yes'].'</label>
<input type="radio" id="maintenance_mode_radio2" name="maintenance_mode" onclick="changeSettingStatus($(this).attr(\'name\'), 0) " value="0"', isset($_SESSION['settings']['maintenance_mode']) && $_SESSION['settings']['maintenance_mode'] != 1 ? ' checked="checked"' : (!isset($_SESSION['settings']['maintenance_mode']) ? ' checked="checked"':''), ' /><label for="maintenance_mode_radio2">'.$txt['no'].'</label>
<span class="setting_flag" id="flag_maintenance_mode"><img src="includes/images/status', isset($_SESSION['settings']['maintenance_mode']) && $_SESSION['settings']['maintenance_mode'] == 1 ? '' : '-busy', '.png" /></span>
</div>
<td>
</tr>';
echo '<tr><td colspan="3"><hr></td></tr>';
//Enable SSL STS
echo '
<tr style="margin-bottom:3px">
<td>
<span class="ui-icon ui-icon-disk" style="float: left; margin-right: .3em;"> </span>
<label>' .
$txt['settings_enable_sts'] . '
<img src="includes/images/question-small-white.png" class="tip" alt="" title="' . $txt['settings_enable_sts_tip'] . '" />
</label>
</td>
<td>
<div class="div_radio">
<input type="radio" id="enable_sts_radio1" name="enable_sts" value="1"', isset( $_SESSION['settings']['enable_sts'] ) && $_SESSION['settings']['enable_sts'] == 1 ? ' checked="checked"' : '', ' /><label for="enable_sts_radio1">' . $txt['yes'] . '</label>
<input type="radio" id="enable_sts_radio2" name="enable_sts" value="0"', isset( $_SESSION['settings']['enable_sts'] ) && $_SESSION['settings']['enable_sts'] != 1 ? ' checked="checked"' : ( !isset( $_SESSION['settings']['enable_sts'] ) ? ' checked="checked"':'' ), ' /><label for="enable_sts_radio2">' . $txt['no'] . '</label>
<span class="setting_flag" id="flag_enable_sts"><img src="includes/images/status', isset($_SESSION['settings']['enable_sts']) && $_SESSION['settings']['enable_sts'] == 1 ? '' : '-busy', '.png" /></span>
</div>
<td>
</tr>';
echo '<tr><td colspan="3"><hr></td></tr>';
//Proxy
echo '
<tr style="margin-bottom:3px">
<td>
<span class="ui-icon ui-icon-disk" style="float: left; margin-right: .3em;"> </span>
<label for="proxy_ip">'.$txt['admin_proxy_ip'].'</label>
<img src="includes/images/question-small-white.png" class="tip" alt="" title="'.$txt['admin_proxy_ip_tip'].'" />
</td>
<td>
<input type="text" size="15" id="proxy_ip" name="proxy_ip" value="', isset($_SESSION['settings']['proxy_ip']) ? $_SESSION['settings']['proxy_ip'] : "", '" class="text ui-widget-content" />
<td>
</tr>
<tr style="margin-bottom:3px">
<td>
<span class="ui-icon ui-icon-disk" style="float: left; margin-right: .3em;"> </span>
<label for="proxy_port">'.$txt['admin_proxy_port'].'</label>
<img src="includes/images/question-small-white.png" class="tip" alt="" title="'.$txt['admin_proxy_port_tip'].'" />
</td>
<td>
<input type="text" size="10" id="proxy_port" name="proxy_port" value="', isset($_SESSION['settings']['proxy_port']) ? $_SESSION['settings']['proxy_port'] : "", '" class="text ui-widget-content" />
<td>
</tr>';
echo '<tr><td colspan="3"><hr></td></tr>';
// pwd_maximum_length
echo '
<tr style="margin-bottom:3px">
<td>
<span class="ui-icon ui-icon-disk" style="float: left; margin-right: .3em;"> </span>
<label for="pwd_maximum_length">'.$txt['admin_pwd_maximum_length'].'</label>
<img src="includes/images/question-small-white.png" class="tip" alt="" title="'.$txt['admin_pwd_maximum_length_tip'].'" />
</td>
<td>
<input type="text" size="10" id="pwd_maximum_length" name="pwd_maximum_length" value="', isset($_SESSION['settings']['pwd_maximum_length']) ? $_SESSION['settings']['pwd_maximum_length'] : 40, '" class="text ui-widget-content" />
<td>
</tr>';
// 2factors_code
echo '
<tr style="margin-bottom:3px">
<td>
<span class="ui-icon ui-icon-disk" style="float: left; margin-right: .3em;"> </span>
<label>'.$txt['admin_2factors_authentication_setting'].'
<img src="includes/images/question-small-white.png" class="tip" alt="" title="'.$txt['admin_2factors_authentication_setting_tip'].'" />
</label>
</td>
<td>
<div class="div_radio">
<input type="radio" id="2factors_authentication_radio1" name="2factors_authentication" onclick="changeSettingStatus($(this).attr(\'name\'), 1) " value="1"', isset($_SESSION['settings']['2factors_authentication']) && $_SESSION['settings']['2factors_authentication'] == 1 ? ' checked="checked"' : '', ' /><label for="2factors_authentication_radio1">'.$txt['yes'].'</label>
<input type="radio" id="2factors_authentication_radio2" name="2factors_authentication" onclick="changeSettingStatus($(this).attr(\'name\'), 0) " value="0"', isset($_SESSION['settings']['2factors_authentication']) && $_SESSION['settings']['2factors_authentication'] != 1 ? ' checked="checked"' : (!isset($_SESSION['settings']['2factors_authentication']) ? ' checked="checked"':''), ' /><label for="2factors_authentication_radio2">'.$txt['no'].'</label>
<span class="setting_flag" id="flag_2factors_authentication"><img src="includes/images/status', isset($_SESSION['settings']['2factors_authentication']) && $_SESSION['settings']['2factors_authentication'] == 1 ? '' : '-busy', '.png" /></span>
</div>
<td>
</tr>';
echo '<tr><td colspan="3"><hr></td></tr>';
// TIMEZONE
// get list of all timezones
$zones = timezone_identifiers_list();
echo '
<tr style="margin-bottom:3px">
<td>
<span class="ui-icon ui-icon-disk" style="float: left; margin-right: .3em;"> </span>
<label for="timezone">'.$txt['timezone_selection'].'</label>
</td>
<td>
<select id="timezone" name="timezone" class="text ui-widget-content">
<option value="">-- '.$txt['select'].' --</option>';
foreach ($zones as $zone) {
echo '
<option value="'.$zone.'"', isset($_SESSION['settings']['timezone']) && $_SESSION['settings']['timezone'] == $zone ? ' selected="selected"' : '', '>'.$zone.'</option>';
}
echo '
</select>
<td>
</tr>';
// DATE format
echo '
<tr style="margin-bottom:3px">
<td>
<span class="ui-icon ui-icon-disk" style="float: left; margin-right: .3em;"> </span>
<label for="date_format">'.$txt['date_format'].'</label>
</td>
<td>
<select id="date_format" name="date_format" class="text ui-widget-content">
<option value="d/m/Y"', !isset($_SESSION['settings']['date_format']) || $_SESSION['settings']['date_format'] == "d/m/Y" ? ' selected="selected"':"", '>d/m/Y</option>
<option value="m/d/Y"', $_SESSION['settings']['date_format'] == "m/d/Y" ? ' selected="selected"':"", '>m/d/Y</option>
<option value="d-M-Y"', $_SESSION['settings']['date_format'] == "d-M-Y" ? ' selected="selected"':"", '>d-M-Y</option>
<option value="d/m/y"', $_SESSION['settings']['date_format'] == "d/m/y" ? ' selected="selected"':"", '>d/m/y</option>
<option value="m/d/y"', $_SESSION['settings']['date_format'] == "m/d/y" ? ' selected="selected"':"", '>m/d/y</option>
<option value="d-M-y"', $_SESSION['settings']['date_format'] == "d-M-y" ? ' selected="selected"':"", '>d-M-y</option>
<option value="d-m-y"', $_SESSION['settings']['date_format'] == "d-m-y" ? ' selected="selected"':"", '>d-m-y</option>
<option value="Y-m-d"', $_SESSION['settings']['date_format'] == "Y-m-d" ? ' selected="selected"':"", '>Y-m-d</option>
</select>
<td>
</tr>';
// TIME format
echo '
<tr style="margin-bottom:3px">
<td>
<span class="ui-icon ui-icon-disk" style="float: left; margin-right: .3em;"> </span>
<label for="time_format">'.$txt['time_format'].'</label>
</td>
<td>
<select id="time_format" name="time_format" class="text ui-widget-content">
<option value="H:i:s"', !isset($_SESSION['settings']['time_format']) || $_SESSION['settings']['time_format'] == "H:i:s" ? ' selected="selected"':"", '>H:i:s</option>
<option value="h:m:s a"', $_SESSION['settings']['time_format'] == "h:m:s a" ? ' selected="selected"':"", '>h:m:s a</option>
<option value="g:i:s a"', $_SESSION['settings']['time_format'] == "g:i:s a" ? ' selected="selected"':"", '>g:i:s a</option>
<option value="G:i:s"', $_SESSION['settings']['time_format'] == "G:i:s" ? ' selected="selected"':"", '>G:i:s</option>
</select>
<td>
</tr>';
echo '<tr><td colspan="3"><hr></td></tr>';
// LANGUAGES
$zones = timezone_identifiers_list();
echo '
<tr style="margin-bottom:3px">
<td>
<span class="ui-icon ui-icon-disk" style="float: left; margin-right: .3em;"> </span>
<label for="default_language">'.$txt['settings_default_language'].'</label>
</td>
<td>
<select id="default_language" name="default_language" class="text ui-widget-content">
<option value="">-- '.$txt['select'].' --</option>';
foreach ($languagesList as $lang) {
echo '
<option value="'.$lang.'"', isset($_SESSION['settings']['default_language']) && $_SESSION['settings']['default_language'] == $lang ? ' selected="selected"' : '', '>'.$lang.'</option>';
}
echo '
</select>
<td>
</tr>';
echo '<tr><td colspan="3"><hr></td></tr>';
// Number of used pw
echo '
<tr style="margin-bottom:3px">
<td>
<span class="ui-icon ui-icon-disk" style="float: left; margin-right: .3em;"> </span>
<label for="number_of_used_pw">'.$txt['number_of_used_pw'].'</label>
</td>
<td>
<input type="text" size="10" id="number_of_used_pw" name="number_of_used_pw" value="', isset($_SESSION['settings']['number_of_used_pw']) ? $_SESSION['settings']['number_of_used_pw'] : '5', '" class="text ui-widget-content" />
<td>
</tr>';
// Number days before changing pw
echo '
<tr style="margin-bottom:3px">
<td>
<span class="ui-icon ui-icon-disk" style="float: left; margin-right: .3em;"> </span>
<label for="pw_life_duration">'.$txt['pw_life_duration'].'</label>
</td>
<td>
<input type="text" size="10" id="pw_life_duration" name="pw_life_duration" value="', isset($_SESSION['settings']['pw_life_duration']) ? $_SESSION['settings']['pw_life_duration'] : '5', '" class="text ui-widget-content" />
<td>
</tr>';
// Number of bad authentication tentations before disabling user
echo '
<tr style="margin-bottom:3px">
<td>
<span class="ui-icon ui-icon-disk" style="float: left; margin-right: .3em;"> </span>
<label for="nb_bad_authentication">'.$txt['nb_false_login_attempts'].'</label>
</td>
<td>
<input type="text" size="10" id="nb_bad_authentication" name="nb_bad_authentication" value="', isset($_SESSION['settings']['nb_bad_authentication']) ? $_SESSION['settings']['nb_bad_authentication'] : '0', '" class="text ui-widget-content" />
<td>
</tr>';
echo '<tr><td colspan="3"><hr></td></tr>';
// Enable log connections
echo '
<tr><td>
<span class="ui-icon ui-icon-disk" style="float: left; margin-right: .3em;"> </span>
<label>'.$txt['settings_log_connections'].'</label>
</td><td>
<div class="div_radio">
<input type="radio" id="log_connections_radio1" name="log_connections" onclick="changeSettingStatus($(this).attr(\'name\'), 1) " value="1"', isset($_SESSION['settings']['log_connections']) && $_SESSION['settings']['log_connections'] == 1 ? ' checked="checked"' : '', ' /><label for="log_connections_radio1">'.$txt['yes'].'</label>
<input type="radio" id="log_connections_radio2" name="log_connections" onclick="changeSettingStatus($(this).attr(\'name\'), 0) " value="0"', isset($_SESSION['settings']['log_connections']) && $_SESSION['settings']['log_connections'] != 1 ? ' checked="checked"' : (!isset($_SESSION['settings']['log_connections']) ? ' checked="checked"':''), ' /><label for="log_connections_radio2">'.$txt['no'].'</label>
<span class="setting_flag" id="flag_log_connections"><img src="includes/images/status', isset($_SESSION['settings']['log_connections']) && $_SESSION['settings']['log_connections'] == 1 ? '' : '-busy', '.png" /></span>
</div>
</td</tr>';
// Enable log accessed
echo '
<tr><td>
<span class="ui-icon ui-icon-disk" style="float: left; margin-right: .3em;"> </span>
<label>'.$txt['settings_log_accessed'].'</label>
</td><td>
<div class="div_radio">
<input type="radio" id="log_accessed_radio1" name="log_accessed" onclick="changeSettingStatus($(this).attr(\'name\'), 1) " value="1"', isset($_SESSION['settings']['log_accessed']) && $_SESSION['settings']['log_accessed'] == 1 ? ' checked="checked"' : '', ' /><label for="log_accessed_radio1">'.$txt['yes'].'</label>
<input type="radio" id="log_accessed_radio2" name="log_accessed" onclick="changeSettingStatus($(this).attr(\'name\'), 0) " value="0"', isset($_SESSION['settings']['log_accessed']) && $_SESSION['settings']['log_accessed'] != 1 ? ' checked="checked"' : (!isset($_SESSION['settings']['log_accessed']) ? ' checked="checked"':''), ' /><label for="log_accessed_radio2">'.$txt['no'].'</label>
<span class="setting_flag" id="flag_log_accessed"><img src="includes/images/status', isset($_SESSION['settings']['log_accessed']) && $_SESSION['settings']['log_accessed'] == 1 ? '' : '-busy', '.png" /></span>
</div>
</td</tr>';
echo '<tr><td colspan="3"><hr></td></tr>';
// enable PF
echo '
<tr><td>
<span class="ui-icon ui-icon-disk" style="float: left; margin-right: .3em;"> </span>
<label>'.$txt['enable_personal_folder_feature'].'</label>
</td><td>
<div class="div_radio">
<input type="radio" id="enable_pf_feature_radio1" name="enable_pf_feature" onclick="changeSettingStatus($(this).attr(\'name\'), 1) " value="1"', isset($_SESSION['settings']['enable_pf_feature']) && $_SESSION['settings']['enable_pf_feature'] == 1 ? ' checked="checked"' : '', ' /><label for="enable_pf_feature_radio1">'.$txt['yes'].'</label>
<input type="radio" id="enable_pf_feature_radio2" name="enable_pf_feature" onclick="changeSettingStatus($(this).attr(\'name\'), 0) " value="0"', isset($_SESSION['settings']['enable_pf_feature']) && $_SESSION['settings']['enable_pf_feature'] != 1 ? ' checked="checked"' : (!isset($_SESSION['settings']['enable_pf_feature']) ? ' checked="checked"':''), ' /><label for="enable_pf_feature_radio2">'.$txt['no'].'</label>
<span class="setting_flag" id="flag_enable_pf_feature"><img src="includes/images/status', isset($_SESSION['settings']['enable_pf_feature']) && $_SESSION['settings']['enable_pf_feature'] == 1 ? '' : '-busy', '.png" /></span>
</div>
</td</tr>';
// enable PF cookie for Personal SALTKEY
echo '
<tr><td>
<span class="ui-icon ui-icon-disk" style="float: left; margin-right: .3em;"> </span>
<label>'.$txt['enable_personal_saltkey_cookie'].'</label>
</td><td>
<div class="div_radio">
<input type="radio" id="enable_personal_saltkey_cookie_radio1" name="enable_personal_saltkey_cookie" onclick="changeSettingStatus($(this).attr(\'name\'), 1) " value="1"', isset($_SESSION['settings']['enable_personal_saltkey_cookie']) && $_SESSION['settings']['enable_personal_saltkey_cookie'] == 1 ? ' checked="checked"' : '', ' /><label for="enable_personal_saltkey_cookie_radio1">'.$txt['yes'].'</label>
<input type="radio" id="enable_personal_saltkey_cookie_radio2" name="enable_personal_saltkey_cookie" onclick="changeSettingStatus($(this).attr(\'name\'), 0) " value="0"', isset($_SESSION['settings']['enable_personal_saltkey_cookie']) && $_SESSION['settings']['enable_personal_saltkey_cookie'] != 1 ? ' checked="checked"' : (!isset($_SESSION['settings']['enable_personal_saltkey_cookie']) ? ' checked="checked"':''), ' /><label for="enable_personal_saltkey_cookie_radio2">'.$txt['no'].'</label>
<span class="setting_flag" id="flag_enable_personal_saltkey_cookie"><img src="includes/images/status', isset($_SESSION['settings']['enable_personal_saltkey_cookie']) && $_SESSION['settings']['enable_personal_saltkey_cookie'] == 1 ? '' : '-busy', '.png" /></span>
</div>
</td</tr>';
// PF cookie for Personal SALTKEY duration
echo '
<tr><td>
<span class="ui-icon ui-icon-disk" style="float: left; margin-right: .3em;"> </span>
<label>'.$txt['personal_saltkey_cookie_duration'].'</label>
</td><td>
<div class="div_radio">
<input type="text" size="10" id="personal_saltkey_cookie_duration" name="personal_saltkey_cookie_duration" value="', isset($_SESSION['settings']['personal_saltkey_cookie_duration']) ? $_SESSION['settings']['personal_saltkey_cookie_duration'] : '31', '" class="text ui-widget-content" />
</div>
</td</tr>';
echo '<tr><td colspan="3"><hr></td></tr>';
// Enable KB
echo '
<tr><td>
<span class="ui-icon ui-icon-disk" style="float: left; margin-right: .3em;"> </span>
<label>
'.$txt['settings_kb'].'
<span style="margin-left:0px;"><img src="includes/images/question-small-white.png" class="tip" alt="" title="'.$txt['settings_kb_tip'].'" /></span>
</label>
</td><td>
<div class="div_radio">
<input type="radio" id="enable_kb_radio1" name="enable_kb" onclick="changeSettingStatus($(this).attr(\'name\'), 1) " value="1"', isset($_SESSION['settings']['enable_kb']) && $_SESSION['settings']['enable_kb'] == 1 ? ' checked="checked"' : '', ' /><label for="enable_kb_radio1">'.$txt['yes'].'</label>
<input type="radio" id="enable_kb_radio2" name="enable_kb" onclick="changeSettingStatus($(this).attr(\'name\'), 1) " value="0"', isset($_SESSION['settings']['enable_kb']) && $_SESSION['settings']['enable_kb'] != 1 ? ' checked="checked"' : (!isset($_SESSION['settings']['enable_kb']) ? ' checked="checked"':''), ' /><label for="enable_kb_radio2">'.$txt['no'].'</label>
<span class="setting_flag" id="flag_enable_kb"><img src="includes/images/status', isset($_SESSION['settings']['enable_kb']) && $_SESSION['settings']['enable_kb'] == 1 ? '' : '-busy', '.png" /></span>
</div>
</td></tr>';
echo '<tr><td colspan="3"><hr></td></tr>';
// Enable send_stats
echo '
<tr style="margin-bottom:3px">
<td>
<span class="ui-icon ui-icon-disk" style="float: left; margin-right: .3em;"> </span>
<label>' .
$txt['settings_send_stats'].'
<img src="includes/images/question-small-white.png" class="tip" alt="" title="'.$txt['settings_send_stats_tip'].'" />
</label>
</td>
<td>
<div class="div_radio">
<input type="radio" id="send_stats_radio1" name="send_stats" onclick="changeSettingStatus($(this).attr(\'name\'), 1) " value="1"', isset($_SESSION['settings']['send_stats']) && $_SESSION['settings']['send_stats'] == 1 ? ' checked="checked"' : '', ' /><label for="send_stats_radio1">'.$txt['yes'].'</label>
<input type="radio" id="send_stats_radio2" name="send_stats" onclick="changeSettingStatus($(this).attr(\'name\'), 1) " value="0"', isset($_SESSION['settings']['send_stats']) && $_SESSION['settings']['send_stats'] != 1 ? ' checked="checked"' : (!isset($_SESSION['settings']['send_stats']) ? ' checked="checked"':''), ' /><label for="send_stats_radio2">'.$txt['no'].'</label>
<span class="setting_flag" id="flag_send_stats"><img src="includes/images/status', isset($_SESSION['settings']['send_stats']) && $_SESSION['settings']['send_stats'] == 1 ? '' : '-busy', '.png" /></span>
</div>
<td>
</tr>
<tr><td colspan="3"><hr></td></tr>
</table>
</div>';
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
// TAB Né2
echo '
<div id="tabs-2">';
// Update Personal folders for users
echo '
<div style="margin-bottom:3px">
<span class="ui-icon ui-icon-gear" style="float: left; margin-right: .3em;"> </span>
<a href="#" onclick="LaunchAdminActions(\'admin_action_check_pf\')" style="cursor:pointer;">'.$txt['admin_action_check_pf'].'</a>
<span id="result_admin_action_check_pf" style="margin-left:10px;display:none;"><img src="includes/images/tick.png" alt="" /></span>
</div>';
// Clean DB with orphan items
echo '
<div style="margin-bottom:3px">
<span class="ui-icon ui-icon-gear" style="float: left; margin-right: .3em;"> </span>
<a href="#" onclick="LaunchAdminActions(\'admin_action_db_clean_items\')" style="cursor:pointer;">'.$txt['admin_action_db_clean_items'].'</a>
<span style="margin-left:0px;"><img src="includes/images/question-small-white.png" class="tip" alt="" title="'.$txt['admin_action_db_clean_items_tip'].'" /></span>
<span id="result_admin_action_db_clean_items" style="margin-left:10px;"></span>
</div>';
// Optimize the DB
echo '
<div style="margin-bottom:3px">
<span class="ui-icon ui-icon-gear" style="float: left; margin-right: .3em;"> </span>
<a href="#" onclick="LaunchAdminActions(\'admin_action_db_optimize\')" style="cursor:pointer;">'.$txt['admin_action_db_optimize'].'</a>
<span id="result_admin_action_db_optimize" style="margin-left:10px;"></span>
</div>';
// Purge old files
echo '
<div style="margin-bottom:3px">
<span class="ui-icon ui-icon-gear" style="float: left; margin-right: .3em;"> </span>
<a href="#" onclick="LaunchAdminActions(\'admin_action_purge_old_files\')" style="cursor:pointer;">'.$txt['admin_action_purge_old_files'].'</a>
<span style="margin-left:0px;"><img src="includes/images/question-small-white.png" class="tip" alt="" title="'.$txt['admin_action_purge_old_files_tip'].'" /></span>
<span id="result_admin_action_purge_old_files" style="margin-left:10px;"></span>
</div>';
// Reload Cache Table
echo '
<div style="margin-bottom:3px">
<span class="ui-icon ui-icon-gear" style="float: left; margin-right: .3em;"> </span>
<a href="#" onclick="LaunchAdminActions(\'admin_action_reload_cache_table\')" style="cursor:pointer;">'.$txt['admin_action_reload_cache_table'].'</a>
<span style="margin-left:0px;"><img src="includes/images/question-small-white.png" class="tip" alt="" title="'.$txt['admin_action_reload_cache_table_tip'].'" /></span>
<span id="result_admin_action_reload_cache_table" style="margin-left:10px;"></span>
</div>';
// Change main SALT key
echo '
<div style="margin-bottom:3px">
<span class="ui-icon ui-icon-gear" style="float: left; margin-right: .3em;"> </span>
<a href="#" onclick="$(\'#div_change_salt_key\').show()" style="cursor:pointer;">'.$txt['admin_action_change_salt_key'].'</a>
<span style="margin-left:0px;"><img src="includes/images/question-small-white.png" class="tip" alt="" title="'.$txt['admin_action_change_salt_key_tip'].'" /></span>
<span id="div_change_salt_key" style="margin-left:10px;display:none;">
<input type="text" id="new_salt_key" size="50" value="'.SALT.'" /><img src="includes/images/cross.png" id="change_salt_key_image">
<img src="includes/images/asterisk.png" alt="" style="cursor:pointer;display:none;" onclick="LaunchAdminActions(\'admin_action_change_salt_key\')" id="change_salt_key_but" />
</span>
</div>';
// ReGenerate the Keys encryption file
echo '
<div style="margin-bottom:3px">
<span class="ui-icon ui-icon-gear" style="float: left; margin-right: .3em;"> </span>
<a href="#" onclick="LaunchAdminActions(\'admin_action_generate_encrypt_keys\')" style="cursor:pointer;">'.$txt['admin_action_generate_encrypt_keys'].'</a>
<span style="margin-left:0px;"><img src="includes/images/question-small-white.png" class="tip" alt="" title="'.$txt['admin_action_generate_encrypt_keys_tip'].'" /></span>
<span id="result_admin_action_generate_encrypt_keys" style="margin-left:10px;"></span>
</div>';
echo '
</div>';
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
// TAB N°3
echo '
<div id="tabs-3">
<table width="100%">';
// After how long, edition is considered as failed or finished
echo '
<tr><td>
<span class="ui-icon ui-icon-wrench" style="float: left; margin-right: .3em;"> </span>
<label>'.$txt['settings_delay_for_item_edition'].
'<span style="margin-left:0px;"><img src="includes/images/question-small-white.png" class="tip" alt="" title="'.$txt['settings_delay_for_item_edition_tip'].'" /></span>
</label>
</td><td>
<input type="text" size="5" id="delay_item_edition" name="delay_item_edition" value="', isset($_SESSION['settings']['delay_item_edition']) ? $_SESSION['settings']['delay_item_edition'] : '0', '" class="text ui-widget-content" /></div>
</td</tr>';
echo '<tr><td colspan="3"><hr></td></tr>';
// Managers can edit & delete items they are allowed to see
echo '
<tr><td>
<span class="ui-icon ui-icon-wrench" style="float: left; margin-right: .3em;"> </span>
<label>'.$txt['settings_manager_edit'].'</label>
</td><td>
<div class="div_radio">
<input type="radio" id="manager_edit_radio1" name="manager_edit" onclick="changeSettingStatus($(this).attr(\'name\'), 1) " value="1"', isset($_SESSION['settings']['manager_edit']) && $_SESSION['settings']['manager_edit'] == 1 ? ' checked="checked"' : '', ' /><label for="manager_edit_radio1">'.$txt['yes'].'</label>
<input type="radio" id="manager_edit_radio2" name="manager_edit" onclick="changeSettingStatus($(this).attr(\'name\'), 0) " value="0"', isset($_SESSION['settings']['manager_edit']) && $_SESSION['settings']['manager_edit'] != 1 ? ' checked="checked"' : (!isset($_SESSION['settings']['manager_edit']) ? ' checked="checked"':''), ' /><label for="manager_edit_radio2">'.$txt['no'].'</label>
<span class="setting_flag" id="flag_manager_edit"><img src="includes/images/status', isset($_SESSION['settings']['manager_edit']) && $_SESSION['settings']['manager_edit'] == 1 ? '' : '-busy', '.png" /></span>
</div>
</td</tr>';
echo '<tr><td colspan="3"><hr></td></tr>';
// max items
echo '
<tr><td>
<span class="ui-icon ui-icon-wrench" style="float: left; margin-right: .3em;"> </span>
<label for="max_last_items">'.$txt['max_last_items'].'</label>
</td><td>
<input type="text" size="4" id="max_last_items" name="max_last_items" value="', isset($_SESSION['settings']['max_latest_items']) ? $_SESSION['settings']['max_latest_items'] : '', '" class="text ui-widget-content" />
<tr><td>';
// Show last items
echo '
<tr><td>
<span class="ui-icon ui-icon-wrench" style="float: left; margin-right: .3em;"> </span>
<label>'.$txt['show_last_items'].'</label>
</td><td>
<div class="div_radio">
<input type="radio" id="show_last_items_radio1" name="show_last_items" onclick="changeSettingStatus($(this).attr(\'name\'), 1) " value="1"', isset($_SESSION['settings']['show_last_items']) && $_SESSION['settings']['show_last_items'] == 1 ? ' checked="checked"' : '', ' /><label for="show_last_items_radio1">'.$txt['yes'].'</label>
<input type="radio" id="show_last_items_radio2" name="show_last_items" onclick="changeSettingStatus($(this).attr(\'name\'), 0) " value="0"', isset($_SESSION['settings']['show_last_items']) && $_SESSION['settings']['show_last_items'] != 1 ? ' checked="checked"' : (!isset($_SESSION['settings']['show_last_items']) ? ' checked="checked"':''), ' /><label for="show_last_items_radio2">'.$txt['no'].'</label>
<span class="setting_flag" id="flag_show_last_items"><img src="includes/images/status', isset($_SESSION['settings']['show_last_items']) && $_SESSION['settings']['show_last_items'] == 1 ? '' : '-busy', '.png" /></span>
</div>
</td</tr>';
echo '<tr><td colspan="3"><hr></td></tr>';
// Duplicate folder
echo '
<tr><td>
<span class="ui-icon ui-icon-wrench" style="float: left; margin-right: .3em;"> </span>
<label>'.$txt['duplicate_folder'].'</label>
</td><td>
<div class="div_radio">
<input type="radio" id="duplicate_folder_radio1" name="duplicate_folder" onclick="changeSettingStatus($(this).attr(\'name\'), 1) " value="1"', isset($_SESSION['settings']['duplicate_folder']) && $_SESSION['settings']['duplicate_folder'] == 1 ? ' checked="checked"' : '', ' /><label for="duplicate_folder_radio1">'.$txt['yes'].'</label>
<input type="radio" id="duplicate_folder_radio2" name="duplicate_folder" onclick="changeSettingStatus($(this).attr(\'name\'), 0) " value="0"', isset($_SESSION['settings']['duplicate_folder']) && $_SESSION['settings']['duplicate_folder'] != 1 ? ' checked="checked"' : (!isset($_SESSION['settings']['duplicate_folder']) ? ' checked="checked"':''), ' /><label for="duplicate_folder_radio2">'.$txt['no'].'</label>
<span class="setting_flag" id="flag_duplicate_folder"><img src="includes/images/status', isset($_SESSION['settings']['duplicate_folder']) && $_SESSION['settings']['duplicate_folder'] == 1 ? '' : '-busy', '.png" /></span>
</div>
</td</tr>';
// Duplicate item name
echo '
<tr><td>
<span class="ui-icon ui-icon-wrench" style="float: left; margin-right: .3em;"> </span>
<label>'.$txt['duplicate_item'].'</label>
</td><td>
<div class="div_radio">
<input type="radio" id="duplicate_item_radio1" name="duplicate_item" onclick="changeSettingStatus($(this).attr(\'name\'), 1) " value="1"', isset($_SESSION['settings']['duplicate_item']) && $_SESSION['settings']['duplicate_item'] == 1 ? ' checked="checked"' : '', ' /><label for="duplicate_item_radio1">'.$txt['yes'].'</label>
<input type="radio" id="duplicate_item_radio2" name="duplicate_item" onclick="changeSettingStatus($(this).attr(\'name\'), 0) " value="0"', isset($_SESSION['settings']['duplicate_item']) && $_SESSION['settings']['duplicate_item'] != 1 ? ' checked="checked"' : (!isset($_SESSION['settings']['duplicate_item']) ? ' checked="checked"':''), ' /><label for="duplicate_item_radio2">'.$txt['no'].'</label>
<span class="setting_flag" id="flag_duplicate_item"><img src="includes/images/status', isset($_SESSION['settings']['duplicate_item']) && $_SESSION['settings']['duplicate_item'] == 1 ? '' : '-busy', '.png" /></span>