forked from nilsteampassnet/TeamPass
-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin.settings.php
1076 lines (961 loc) · 57.2 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
* @copyright (c) 2009-2011 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';
//Connect to database
require_once("sources/class.database.php");
$db = new Database($server, $user, $pass, $database, $pre);
$db->connect();
//Check if setting is already in DB. If NO then insert, if YES then update.
$data = $db->fetch_row("SELECT COUNT(*) FROM ".$pre."misc WHERE type='".$type."' AND intitule = '".$setting."'");
if ( $data[0] == 0 ){
$db->query_insert(
"misc",
array(
'valeur' => $val,
'type' => $type,
'intitule' => $setting
)
);
//in case of stats enabled, add the actual time
if ( $setting == 'send_stats' )
$db->query_insert(
"misc",
array(
'valeur' => time(),
'type' => $type,
'intitule' => $setting.'_time'
)
);
}else{
$db->query_update(
"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->fetch_row("SELECT COUNT(*) FROM ".$pre."misc WHERE type='".$type."' AND intitule = '".$setting."_time'");
if ( $data_time[0] == 0 ){
$db->query_insert(
"misc",
array(
'valeur' => 0,
'type' => $type,
'intitule' => $setting.'_time'
)
);
}else {
$db->query_update(
"misc",
array(
'valeur' => 0
),
"type='".$type."' AND intitule = '".$setting."_time'"
);
}
}
}
//save in variable
if ( $type == "admin" ) $_SESSION['settings'][$setting] = $val;
else if ( $type == "settings" ) $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 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 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 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 richtext
if ( @$_SESSION['settings']['richtext'] != $_POST['richtext'] ){
UpdateSettings('richtext',$_POST['richtext']);
}
*/
//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 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 anyone_can_modify
if ( @$_SESSION['settings']['anyone_can_modify'] != $_POST['anyone_can_modify'] ){
UpdateSettings('anyone_can_modify',$_POST['anyone_can_modify']);
}
//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 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"));
}
//store backups settings
if(isset($_POST['bck_script_filename'])) UpdateSettings('bck_script_filename', $_POST['bck_script_filename'], 'settings');
if(isset($_POST['bck_script_path'])) UpdateSettings('bck_script_path', $_POST['bck_script_path'], 'settings');
if(isset($_POST['bck_script_key'])) UpdateSettings('bck_script_key', $_POST['bck_script_key'], 'settings');
}
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-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>
</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 ui-corner-all" />
<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 ui-corner-all" />
<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 ui-corner-all" />
<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 ui-corner-all" />
<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 ui-corner-all" />
<td>
</tr>';
echo '
</table>';
echo '
<table>';
//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" 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" 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>
</div>
<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 ui-corner-all">
<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 ui-corner-all">
<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="F d, Y"', $_SESSION['settings']['date_format'] == "F d, Y" ? ' selected="selected"':"",'>F d, Y</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 ui-corner-all">
<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>';
//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 ui-corner-all">
<option value="">-- '.$txt['select'].' --</option>';
foreach ($languages_list as $lang){
echo '
<option value="'.$lang.'"', isset($_SESSION['settings']['default_language']) && $_SESSION['settings']['default_language'] == $lang ? ' selected="selected"' : '', '>'.$lang.'</option>';
}
echo '
</select>
<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 ui-corner-all" />
<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 ui-corner-all" />
<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 ui-corner-all" />
<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" 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" 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>
</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" 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" 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>
</div>
</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" 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" 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>
</div>
</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" 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" 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>
</div>
</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" 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" 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>
</div>
<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>';
echo '
</div>';
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
// TAB N�3
echo '
<div id="tabs-3">
<table widht="100%">';
//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" 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" 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>
</div>
</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 ui-corner-all" />
<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" 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" 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>
</div>
</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" 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" 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>
</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" 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" 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>
</div>
</td</tr>';
//enable FAVOURITES
echo '
<tr><td>
<span class="ui-icon ui-icon-wrench" style="float: left; margin-right: .3em;"> </span>
<label>'.$txt['enable_favourites'].'</label>
</td><td>
<div class="div_radio">
<input type="radio" id="enable_favourites_radio1" name="enable_favourites" value="1"', isset($_SESSION['settings']['enable_favourites']) && $_SESSION['settings']['enable_favourites'] == 1 ? ' checked="checked"' : '', ' /><label for="enable_favourites_radio1">'.$txt['yes'].'</label>
<input type="radio" id="enable_favourites_radio2" name="enable_favourites" value="0"', isset($_SESSION['settings']['enable_favourites']) && $_SESSION['settings']['enable_favourites'] != 1 ? ' checked="checked"' : (!isset($_SESSION['settings']['enable_favourites']) ? ' checked="checked"':''), ' /><label for="enable_favourites_radio2">'.$txt['no'].'</label>
</div>
</td</tr>';
//Enable activate_expiration
echo '
<tr><td>
<span class="ui-icon ui-icon-wrench" style="float: left; margin-right: .3em;"> </span>
<label>
'.$txt['admin_setting_activate_expiration'].'
<span style="margin-left:0px;"><img src="includes/images/question-small-white.png" class="tip" alt="" title="'.$txt['admin_setting_activate_expiration_tip'].'" /></span>
</label>
</td><td>
<div class="div_radio">
<input type="radio" id="activate_expiration_radio1" name="activate_expiration" value="1"', isset($_SESSION['settings']['activate_expiration']) && $_SESSION['settings']['activate_expiration'] == 1 ? ' checked="checked"' : '', ' /><label for="activate_expiration_radio1">'.$txt['yes'].'</label>
<input type="radio" id="activate_expiration_radio2" name="activate_expiration" value="0"', isset($_SESSION['settings']['activate_expiration']) && $_SESSION['settings']['activate_expiration'] != 1 ? ' checked="checked"' : (!isset($_SESSION['settings']['activate_expiration']) ? ' checked="checked"':''), ' /><label for="activate_expiration_radio2">'.$txt['no'].'</label>
</div>
</td</tr>';
//Enable Printing
echo '
<tr><td>
<span class="ui-icon ui-icon-wrench" style="float: left; margin-right: .3em;"> </span>
<label>
'.$txt['settings_printing'].'
<span style="margin-left:0px;"><img src="includes/images/question-small-white.png" class="tip" alt="" title="'.$txt['settings_printing_tip'].'" /></span>
</label>
</td><td>
<div class="div_radio">
<input type="radio" id="allow_print_radio1" name="allow_print" value="1"', isset($_SESSION['settings']['allow_print']) && $_SESSION['settings']['allow_print'] == 1 ? ' checked="checked"' : '', ' /><label for="allow_print_radio1">'.$txt['yes'].'</label>
<input type="radio" id="allow_print_radio2" name="allow_print" value="0"', isset($_SESSION['settings']['allow_print']) && $_SESSION['settings']['allow_print'] != 1 ? ' checked="checked"' : (!isset($_SESSION['settings']['allow_print']) ? ' checked="checked"':''), ' /><label for="allow_print_radio2">'.$txt['no'].'</label>
</div>
</td></tr>';
//Enable Item modification by anyone
echo '
<tr><td>
<span class="ui-icon ui-icon-wrench" style="float: left; margin-right: .3em;"> </span>
<label>
'.$txt['settings_anyone_can_modify'].'
<span style="margin-left:0px;"><img src="includes/images/question-small-white.png" class="tip" alt="" title="'.$txt['settings_anyone_can_modify_tip'].'" /></span>
</label>
</td><td>
<div class="div_radio">
<input type="radio" id="anyone_can_modify_radio1" name="anyone_can_modify" value="1"', isset($_SESSION['settings']['anyone_can_modify']) && $_SESSION['settings']['anyone_can_modify'] == 1 ? ' checked="checked"' : '', ' /><label for="anyone_can_modify_radio1">'.$txt['yes'].'</label>
<input type="radio" id="anyone_can_modify_radio2" name="anyone_can_modify" value="0"', isset($_SESSION['settings']['anyone_can_modify']) && $_SESSION['settings']['anyone_can_modify'] != 1 ? ' checked="checked"' : (!isset($_SESSION['settings']['anyone_can_modify']) ? ' checked="checked"':''), ' /><label for="anyone_can_modify_radio2">'.$txt['no'].'</label>
</div>
</td></tr>';
//enable restricted_to option
echo '
<tr><td>
<span class="ui-icon ui-icon-wrench" style="float: left; margin-right: .3em;"> </span>
<label>'.$txt['settings_restricted_to'].'</label>
</td><td>
<div class="div_radio">
<input type="radio" id="restricted_to_radio1" name="restricted_to" value="1"', isset($_SESSION['settings']['restricted_to']) && $_SESSION['settings']['restricted_to'] == 1 ? ' checked="checked"' : '', ' /><label for="restricted_to_radio1">'.$txt['yes'].'</label>
<input type="radio" id="restricted_to_radio2" name="restricted_to" value="0"', isset($_SESSION['settings']['restricted_to']) && $_SESSION['settings']['restricted_to'] != 1 ? ' checked="checked"' : (!isset($_SESSION['settings']['restricted_to']) ? ' checked="checked"':''), ' /><label for="restricted_to_radio2">'.$txt['no'].'</label>
</div>
</td</tr>';
//enable restricted_to_roles
echo '
<tr><td>
<span class="ui-icon ui-icon-wrench" style="float: left; margin-right: .3em;"> </span>
<label>'.$txt['restricted_to_roles'].'</label>
</td><td>
<div class="div_radio">
<input type="radio" id="restricted_to_roles_radio1" name="restricted_to_roles" value="1"', isset($_SESSION['settings']['restricted_to_roles']) && $_SESSION['settings']['restricted_to_roles'] == 1 ? ' checked="checked"' : '', ' /><label for="restricted_to_roles_radio1">'.$txt['yes'].'</label>
<input type="radio" id="restricted_to_roles_radio2" name="restricted_to_roles" value="0"', isset($_SESSION['settings']['restricted_to_roles']) && $_SESSION['settings']['restricted_to_roles'] != 1 ? ' checked="checked"' : (!isset($_SESSION['settings']['restricted_to_roles']) ? ' checked="checked"':''), ' /><label for="restricted_to_roles_radio2">'.$txt['no'].'</label>
</div>
</td</tr>';
//enable show copy to clipboard small icons
echo '
<tr><td>
<span class="ui-icon ui-icon-wrench" style="float: left; margin-right: .3em;"> </span>
<label>
'.$txt['copy_to_clipboard_small_icons'].'
<span style="margin-left:0px;"><img src="includes/images/question-small-white.png" class="tip" alt="" title="'.$txt['copy_to_clipboard_small_icons_tip'].'" /></span>
</label>
</td><td>
<div class="div_radio">
<input type="radio" id="copy_to_clipboard_small_icons_radio1" name="copy_to_clipboard_small_icons" value="1"', isset($_SESSION['settings']['copy_to_clipboard_small_icons']) && $_SESSION['settings']['copy_to_clipboard_small_icons'] == 1 ? ' checked="checked"' : '', ' /><label for="copy_to_clipboard_small_icons_radio1">'.$txt['yes'].'</label>
<input type="radio" id="copy_to_clipboard_small_icons_radio2" name="copy_to_clipboard_small_icons" value="0"', isset($_SESSION['settings']['copy_to_clipboard_small_icons']) && $_SESSION['settings']['copy_to_clipboard_small_icons'] != 1 ? ' checked="checked"' : (!isset($_SESSION['settings']['copy_to_clipboard_small_icons']) ? ' checked="checked"':''), ' /><label for="copy_to_clipboard_small_icons_radio2">'.$txt['no'].'</label>
</div>
</td</tr>';
//Enable Show description in items list
echo '
<tr><td>
<span class="ui-icon ui-icon-wrench" style="float: left; margin-right: .3em;"> </span>
<label>
'.$txt['settings_show_description'].'
</label>
</td><td>
<div class="div_radio">
<input type="radio" id="show_description_radio1" name="show_description" value="1"', isset($_SESSION['settings']['show_description']) && $_SESSION['settings']['show_description'] == 1 ? ' checked="checked"' : '', ' /><label for="show_description_radio1">'.$txt['yes'].'</label>
<input type="radio" id="show_description_radio2" name="show_description" value="0"', isset($_SESSION['settings']['show_description']) && $_SESSION['settings']['show_description'] != 1 ? ' checked="checked"' : (!isset($_SESSION['settings']['show_description']) ? ' checked="checked"':''), ' /><label for="show_description_radio2">'.$txt['no'].'</label>
</div>
</td></tr>';
//enable USER can create folders
echo '
<tr><td>
<span class="ui-icon ui-icon-wrench" style="float: left; margin-right: .3em;"> </span>
<label>'.$txt['enable_user_can_create_folders'].'</label>
</td><td>
<div class="div_radio">
<input type="radio" id="enable_user_can_create_folders_radio1" name="enable_user_can_create_folders" value="1"', isset($_SESSION['settings']['enable_user_can_create_folders']) && $_SESSION['settings']['enable_user_can_create_folders'] == 1 ? ' checked="checked"' : '', ' /><label for="enable_user_can_create_folders_radio1">'.$txt['yes'].'</label>
<input type="radio" id="enable_user_can_create_folders_radio2" name="enable_user_can_create_folders" value="0"', isset($_SESSION['settings']['enable_user_can_create_folders']) && $_SESSION['settings']['enable_user_can_create_folders'] != 1 ? ' checked="checked"' : (!isset($_SESSION['settings']['enable_user_can_create_folders']) ? ' checked="checked"':''), ' /><label for="enable_user_can_create_folders_radio2">'.$txt['no'].'</label>
</div>
</td</tr>';
//enable sending email on USER login
echo '
<tr><td>
<span class="ui-icon ui-icon-wrench" style="float: left; margin-right: .3em;"> </span>
<label>'.$txt['enable_send_email_on_user_login'].'</label>
</td><td>
<div class="div_radio">
<input type="radio" id="enable_send_email_on_user_login_radio1" name="enable_send_email_on_user_login" value="1"', isset($_SESSION['settings']['enable_send_email_on_user_login']) && $_SESSION['settings']['enable_send_email_on_user_login'] == 1 ? ' checked="checked"' : '', ' /><label for="enable_send_email_on_user_login_radio1">'.$txt['yes'].'</label>
<input type="radio" id="enable_send_email_on_user_login_radio2" name="enable_send_email_on_user_login" value="0"', isset($_SESSION['settings']['enable_send_email_on_user_login']) && $_SESSION['settings']['enable_send_email_on_user_login'] != 1 ? ' checked="checked"' : (!isset($_SESSION['settings']['enable_send_email_on_user_login']) ? ' checked="checked"':''), ' /><label for="enable_send_email_on_user_login_radio2">'.$txt['no'].'</label>
</div>
</td</tr>';
echo '
</table>
</div>';
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
// TAB N�4
echo '
<div id="tabs-4">';
//Check if LDAP extension is loaded
if (!extension_loaded('ldap')) {
echo '
<div style="margin-bottom:3px;">
<div class="ui-widget-content ui-corner-all" style="padding:10px;">
<img src="includes/images/error.png" alt=""> '.$txt['ldap_extension_not_loaded'].'
</div>
</div>';
}
else
{
//Enable LDAP mode
echo '
<div style="margin-bottom:3px;">
<label for="ldap_mode">'.
$txt['settings_ldap_mode'].'
<img src="includes/images/question-small-white.png" class="tip" alt="" title="'.$txt['settings_ldap_mode_tip'].'" />
</label>
<span class="div_radio">
<input type="radio" id="ldap_mode_radio1" name="ldap_mode" value="1"', isset($_SESSION['settings']['ldap_mode']) && $_SESSION['settings']['ldap_mode'] == 1 ? ' checked="checked"' : '', ' onclick="javascript:$(\'#div_ldap_configuration\').show();" /><label for="ldap_mode_radio1">'.$txt['yes'].'</label>
<input type="radio" id="ldap_mode_radio2" name="ldap_mode" value="0"', isset($_SESSION['settings']['ldap_mode']) && $_SESSION['settings']['ldap_mode'] != 1 ? ' checked="checked"' : (!isset($_SESSION['settings']['ldap_mode']) ? ' checked="checked"':''), ' onclick="javascript:$(\'#div_ldap_configuration\').hide();" /><label for="ldap_mode_radio2">'.$txt['no'].'</label>
</span>
</div>';
}
// AD inputs
echo '
<div id="div_ldap_configuration" ', (isset($_SESSION['settings']['ldap_mode']) && $_SESSION['settings']['ldap_mode'] == 1) ? '':' style="display:none;"' ,'>
<div style="font-weight:bold;font-size:14px;margin:15px 0px 8px 0px;">'.$txt['admin_ldap_configuration'].'</div>
<table>';
// Domain
echo '
<tr>
<td><label for="ldap_suffix">'.$txt['settings_ldap_domain'].'</label></td>
<td><input type="text" size="50" id="ldap_suffix" name="ldap_suffix" class="text ui-widget-content ui-corner-all" title="@dc=example,dc=com" value="', isset($_SESSION['settings']['ldap_suffix']) ? $_SESSION['settings']['ldap_suffix'] : '', '" /></td>
</tr>';
// Domain DN
echo '
<tr>
<td><label for="ldap_domain_dn">'.$txt['settings_ldap_domain_dn'].'</label></td>
<td><input type="text" size="50" id="ldap_domain_dn" name="ldap_domain_dn" class="text ui-widget-content ui-corner-all" title="dc=example,dc=com" value="', isset($_SESSION['settings']['ldap_domain_dn']) ? $_SESSION['settings']['ldap_domain_dn'] : '', '" /></td>
</tr>';
// Domain controler
echo '
<tr>
<td><label for="ldap_domain_controler">'.$txt['settings_ldap_domain_controler'].' <img src="includes/images/question-small-white.png" class="tip" alt="" title="'.$txt['settings_ldap_domain_controler_tip'].'" /></label></td>
<td><input type="text" size="50" id="ldap_domain_controler" name="ldap_domain_controler" class="text ui-widget-content ui-corner-all" title="dc01.mydomain.local,dc02.mydomain.local" value="', isset($_SESSION['settings']['ldap_domain_controler']) ? $_SESSION['settings']['ldap_domain_controler'] : '', '" /></td>
</tr>';
// AD SSL
echo '
<tr>
<td><label>'.$txt['settings_ldap_ssl'].'</label></td>
<td>
<div class="div_radio">
<input type="radio" id="ldap_ssl_radio1" name="ldap_ssl" value="1"', isset($_SESSION['settings']['ldap_ssl']) && $_SESSION['settings']['ldap_ssl'] == 1 ? ' checked="checked"' : '', ' /><label for="ldap_ssl_radio1">'.$txt['yes'].'</label>
<input type="radio" id="ldap_ssl_radio2" name="ldap_ssl" value="0"', isset($_SESSION['settings']['ldap_ssl']) && $_SESSION['settings']['ldap_ssl'] != 1 ? ' checked="checked"' : (!isset($_SESSION['settings']['ldap_ssl']) ? ' checked="checked"':''), ' /><label for="ldap_ssl_radio2">'.$txt['no'].'</label>
</div>
</td>
</tr>';
// AD TLS
echo '
<tr>
<td><label>'.$txt['settings_ldap_tls'].'</label></td>
<td>
<div class="div_radio">
<input type="radio" id="ldap_tls_radio1" name="ldap_tls" value="1"', isset($_SESSION['settings']['ldap_tls']) && $_SESSION['settings']['ldap_tls'] == 1 ? ' checked="checked"' : '', ' /><label for="ldap_tls_radio1">'.$txt['yes'].'</label>
<input type="radio" id="ldap_tls_radio2" name="ldap_tls" value="0"', isset($_SESSION['settings']['ldap_ssl']) && $_SESSION['settings']['ldap_tls'] != 1 ? ' checked="checked"' : (!isset($_SESSION['settings']['ldap_tls']) ? ' checked="checked"':''), ' /><label for="ldap_tls_radio2">'.$txt['no'].'</label>
</div>
</td>
</tr>';
echo '
</table>
</div>';
echo '
</div>';
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
// TAB N�5
echo '
<div id="tabs-5">
<div class="" style="padding: 0 .7em;">
<span class="ui-icon ui-icon-transferthick-e-w" style="float: left; margin-right: .3em;"> </span>
<b>'.$txt['admin_one_shot_backup'].'</b>
</div>
<div style="margin:0 0 5px 20px;">
<table>';
//Backup the DB
echo '
<tr style="margin-bottom:3px">
<td>
<span class="ui-icon ui-icon-gear" style="float: left; margin-right: .3em;"> </span>
'.$txt['admin_action_db_backup'].'
<span style="margin-left:0px;"><img src="includes/images/question-small-white.png" class="tip" alt="" title="'.$txt['admin_action_db_backup_tip'].'" /></span>
</td>
<td>
<span id="result_admin_action_db_backup" style="margin-left:10px;"></span>
<span id="result_admin_action_db_backup_get_key" style="margin-left:10px;">
'.$txt['encrypt_key'].'<input type="text" size="20" id="result_admin_action_db_backup_key" />
<img src="includes/images/question-small-white.png" class="tip" alt="" title="'.$txt['admin_action_db_backup_key_tip'].'" />
<img src="includes/images/asterisk.png" class="tip" alt="" title="'.$txt['admin_action_db_backup_start_tip'].'" onclick="LaunchAdminActions(\'admin_action_db_backup\')" style="cursor:pointer;" />
</span>
</td>
</tr>';
//Restore the DB
echo '
<tr style="margin-bottom:3px">
<td>
<span class="ui-icon ui-icon-gear" style="float: left; margin-right: .3em;"> </span>
'.$txt['admin_action_db_restore'].'
<span style="margin-left:0px;"><img src="includes/images/question-small-white.png" class="tip" alt="" title="'.$txt['admin_action_db_restore_tip'].'" /></span>
</td>
<td>
<span id="result_admin_action_db_restore" style="margin-left:10px;"></span>
<span id="result_admin_action_db_restore_get_file" style="margin-left:10px;"><input id="fileInput_restore_sql" name="fileInput_restore_sql" type="file" /></span>
</td>
</tr>';
echo '
</table>
</div>';
echo '
<div class="" style="0padding: 0 .7em;">
<span class="ui-icon ui-icon-transferthick-e-w" style="float: left; margin-right: .3em;"> </span>
<b>'.$txt['admin_script_backups'].'</b>
<span style="margin-left:0px;"><img src="includes/images/question-small-white.png" class="tip" style="font-size:11px;" title="<h2>'.$txt['admin_script_backups_tip'].'</h2>" /></span>
</div>
<div style="margin:0 0 5px 20px;">
<table>';
//Backups script path
echo '
<tr style="margin-bottom:3px">
<td>
<span class="ui-icon ui-icon-gear" style="float: left; margin-right: .3em;"> </span>
'.$txt['admin_script_backup_path'].'
<span style="margin-left:0px;"><img src="includes/images/question-small-white.png" class="tip" style="font-size:11px;" title="<h2>'.$txt['admin_script_backup_path_tip'].'</h2>" /></span>