Passed
Push — teampass_3.0 ( bd2f95...8ec6cf )
by Nils
04:38
created
sources/users.queries.php 1 patch
Spacing   +124 added lines, -124 removed lines patch added patch discarded remove patch
@@ -43,8 +43,8 @@  discard block
 block discarded – undo
43 43
 }
44 44
 
45 45
 /* do checks */
46
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
47
-require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php';
46
+require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php';
47
+require_once $SETTINGS['cpassman_dir'].'/sources/checks.php';
48 48
 $isprofileupdate = filter_input(INPUT_POST, 'isprofileupdate', FILTER_SANITIZE_STRING);
49 49
 if (
50 50
     checkUser($_SESSION['user_id'], $_SESSION['key'], 'profile', $SETTINGS) === false
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
         || $isprofileupdate === false
56 56
     ) {
57 57
         $_SESSION['error']['code'] = ERR_NOT_ALLOWED; //not allowed page
58
-        include $SETTINGS['cpassman_dir'] . '/error.php';
58
+        include $SETTINGS['cpassman_dir'].'/error.php';
59 59
         exit();
60 60
     } else {
61 61
         // Do special check to allow user to change attributes of his profile
@@ -64,20 +64,20 @@  discard block
 block discarded – undo
64 64
             || checkUser($_SESSION['user_id'], $_SESSION['key'], 'profile', $SETTINGS) === false
65 65
         ) {
66 66
             $_SESSION['error']['code'] = ERR_NOT_ALLOWED; //not allowed page
67
-            include $SETTINGS['cpassman_dir'] . '/error.php';
67
+            include $SETTINGS['cpassman_dir'].'/error.php';
68 68
             exit();
69 69
         }
70 70
     }
71 71
 }
72 72
 
73
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
73
+require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
74 74
 header('Content-type: text/html; charset=utf-8');
75
-require_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php';
76
-require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
77
-require_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
75
+require_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php';
76
+require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
77
+require_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
78 78
 
79 79
 // Connect to mysql server
80
-require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
80
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
81 81
 if (defined('DB_PASSWD_CLEAR') === false) {
82 82
     define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
83 83
 }
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
             // Check if user already exists
164 164
             $data = DB::query(
165 165
                 'SELECT id, fonction_id, groupes_interdits, groupes_visibles
166
-                FROM ' . prefixTable('users') . '
166
+                FROM ' . prefixTable('users').'
167 167
                 WHERE login = %s',
168 168
                 $login
169 169
             );
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
                 // Send email to new user
308 308
                 sendEmail(
309 309
                     langHdl('email_subject_new_user'),
310
-                    str_replace(array('#tp_login#', '#tp_pw#', '#tp_link#'), array(' ' . addslashes($login), addslashes($password), $SETTINGS['email_server_url']), langHdl('email_new_user_mail')),
310
+                    str_replace(array('#tp_login#', '#tp_pw#', '#tp_link#'), array(' '.addslashes($login), addslashes($password), $SETTINGS['email_server_url']), langHdl('email_new_user_mail')),
311 311
                     $dataReceived['email'],
312 312
                     $SETTINGS
313 313
                 );
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
 
372 372
             // Get info about user to delete
373 373
             $data_user = DB::queryfirstrow(
374
-                'SELECT admin, isAdministratedByRole FROM ' . prefixTable('users') . '
374
+                'SELECT admin, isAdministratedByRole FROM '.prefixTable('users').'
375 375
                 WHERE id = %i',
376 376
                 $post_id
377 377
             );
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
                 );
391 391
                 // delete personal folder and subfolders
392 392
                 $data = DB::queryfirstrow(
393
-                    'SELECT id FROM ' . prefixTable('nested_tree') . '
393
+                    'SELECT id FROM '.prefixTable('nested_tree').'
394 394
                     WHERE title = %s AND personal_folder = %i',
395 395
                     $post_id,
396 396
                     '1'
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
                         DB::delete(prefixTable('nested_tree'), 'id = %i AND personal_folder = %i', $folder->id, '1');
404 404
                         // delete items & logs
405 405
                         $items = DB::query(
406
-                            'SELECT id FROM ' . prefixTable('items') . '
406
+                            'SELECT id FROM '.prefixTable('items').'
407 407
                             WHERE id_tree=%i AND perso = %i',
408 408
                             $folder->id,
409 409
                             '1'
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
 
461 461
             // Get info about user to delete
462 462
             $data_user = DB::queryfirstrow(
463
-                'SELECT admin, isAdministratedByRole FROM ' . prefixTable('users') . '
463
+                'SELECT admin, isAdministratedByRole FROM '.prefixTable('users').'
464 464
                 WHERE id = %i',
465 465
                 $post_id
466 466
             );
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
 
503 503
             // Get info about user to delete
504 504
             $data_user = DB::queryfirstrow(
505
-                'SELECT admin, isAdministratedByRole FROM ' . prefixTable('users') . '
505
+                'SELECT admin, isAdministratedByRole FROM '.prefixTable('users').'
506 506
                 WHERE id = %i',
507 507
                 $post_id
508 508
             );
@@ -545,7 +545,7 @@  discard block
 block discarded – undo
545 545
             // Get info about user to delete
546 546
             $data_user = DB::queryfirstrow(
547 547
                 'SELECT admin, isAdministratedByRole, can_manage_all_users, gestionnaire
548
-                FROM ' . prefixTable('users') . '
548
+                FROM ' . prefixTable('users').'
549 549
                 WHERE id = %i',
550 550
                 $post_id
551 551
             );
@@ -589,7 +589,7 @@  discard block
 block discarded – undo
589 589
 
590 590
             // Get info about user to delete
591 591
             $data_user = DB::queryfirstrow(
592
-                'SELECT admin, isAdministratedByRole FROM ' . prefixTable('users') . '
592
+                'SELECT admin, isAdministratedByRole FROM '.prefixTable('users').'
593 593
                 WHERE id = %i',
594 594
                 $post_id
595 595
             );
@@ -632,7 +632,7 @@  discard block
 block discarded – undo
632 632
             // Get info about user to delete
633 633
             $data_user = DB::queryfirstrow(
634 634
                 'SELECT admin, isAdministratedByRole, gestionnaire
635
-                FROM ' . prefixTable('users') . '
635
+                FROM ' . prefixTable('users').'
636 636
                 WHERE id = %i',
637 637
                 $post_id
638 638
             );
@@ -675,7 +675,7 @@  discard block
 block discarded – undo
675 675
             // Get info about user to delete
676 676
             $data_user = DB::queryfirstrow(
677 677
                 'SELECT admin, isAdministratedByRole, gestionnaire
678
-                FROM ' . prefixTable('users') . '
678
+                FROM ' . prefixTable('users').'
679 679
                 WHERE id = %i',
680 680
                 $post_id
681 681
             );
@@ -715,7 +715,7 @@  discard block
 block discarded – undo
715 715
             // Get info about user to delete
716 716
             $data_user = DB::queryfirstrow(
717 717
                 'SELECT admin, isAdministratedByRole, gestionnaire
718
-                FROM ' . prefixTable('users') . '
718
+                FROM ' . prefixTable('users').'
719 719
                 WHERE id = %i',
720 720
                 $post_id
721 721
             );
@@ -753,7 +753,7 @@  discard block
 block discarded – undo
753 753
             $return = array();
754 754
             // Check if folder exists
755 755
             $data = DB::query(
756
-                'SELECT * FROM ' . prefixTable('nested_tree') . '
756
+                'SELECT * FROM '.prefixTable('nested_tree').'
757 757
                 WHERE title = %s AND parent_id = %i',
758 758
                 filter_input(INPUT_POST, 'domain', FILTER_SANITIZE_STRING),
759 759
                 '0'
@@ -766,7 +766,7 @@  discard block
 block discarded – undo
766 766
             }
767 767
             // Check if role exists
768 768
             $data = DB::query(
769
-                'SELECT * FROM ' . prefixTable('roles_title') . '
769
+                'SELECT * FROM '.prefixTable('roles_title').'
770 770
                 WHERE title = %s',
771 771
                 filter_input(INPUT_POST, 'domain', FILTER_SANITIZE_STRING)
772 772
             );
@@ -786,7 +786,7 @@  discard block
 block discarded – undo
786 786
         case 'user_log_items':
787 787
             $nb_pages = 1;
788 788
             $logs = $sql_filter = '';
789
-            $pages = '<table style=\'border-top:1px solid #969696;\'><tr><td>' . langHdl('pages') . '&nbsp;:&nbsp;</td>';
789
+            $pages = '<table style=\'border-top:1px solid #969696;\'><tr><td>'.langHdl('pages').'&nbsp;:&nbsp;</td>';
790 790
 
791 791
             // Prepare POST variables
792 792
             $post_nb_items_by_page = filter_input(INPUT_POST, 'nb_items_by_page', FILTER_SANITIZE_NUMBER_INT);
@@ -798,14 +798,14 @@  discard block
 block discarded – undo
798 798
                     && !empty(filter_input(INPUT_POST, 'filter', FILTER_SANITIZE_STRING))
799 799
                     && filter_input(INPUT_POST, 'filter', FILTER_SANITIZE_STRING) !== 'all'
800 800
                 ) {
801
-                    $sql_filter = " AND l.action = '" . filter_input(INPUT_POST, 'filter', FILTER_SANITIZE_STRING) . "'";
801
+                    $sql_filter = " AND l.action = '".filter_input(INPUT_POST, 'filter', FILTER_SANITIZE_STRING)."'";
802 802
                 }
803 803
                 // get number of pages
804 804
                 DB::query(
805 805
                     'SELECT *
806
-                    FROM ' . prefixTable('log_items') . ' as l
807
-                    INNER JOIN ' . prefixTable('items') . ' as i ON (l.id_item=i.id)
808
-                    INNER JOIN ' . prefixTable('users') . ' as u ON (l.id_user=u.id)
806
+                    FROM ' . prefixTable('log_items').' as l
807
+                    INNER JOIN ' . prefixTable('items').' as i ON (l.id_item=i.id)
808
+                    INNER JOIN ' . prefixTable('users').' as u ON (l.id_user=u.id)
809 809
                     WHERE l.id_user = %i ' . $sql_filter,
810 810
                     filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT)
811 811
                 );
@@ -823,19 +823,19 @@  discard block
 block discarded – undo
823 823
                 // launch query
824 824
                 $rows = DB::query(
825 825
                     'SELECT l.date as date, u.login as login, i.label as label, l.action as action
826
-                    FROM ' . prefixTable('log_items') . ' as l
827
-                    INNER JOIN ' . prefixTable('items') . ' as i ON (l.id_item=i.id)
828
-                    INNER JOIN ' . prefixTable('users') . ' as u ON (l.id_user=u.id)
829
-                    WHERE l.id_user = %i ' . $sql_filter . '
826
+                    FROM ' . prefixTable('log_items').' as l
827
+                    INNER JOIN ' . prefixTable('items').' as i ON (l.id_item=i.id)
828
+                    INNER JOIN ' . prefixTable('users').' as u ON (l.id_user=u.id)
829
+                    WHERE l.id_user = %i ' . $sql_filter.'
830 830
                     ORDER BY date DESC
831
-                    LIMIT ' . intval($start) . ',' . intval($post_nb_items_by_page),
831
+                    LIMIT ' . intval($start).','.intval($post_nb_items_by_page),
832 832
                     filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT)
833 833
                 );
834 834
             } else {
835 835
                 // get number of pages
836 836
                 DB::query(
837 837
                     'SELECT *
838
-                    FROM ' . prefixTable('log_system') . '
838
+                    FROM ' . prefixTable('log_system').'
839 839
                     WHERE type = %s AND field_1=%i',
840 840
                     'user_mngt',
841 841
                     filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT)
@@ -854,7 +854,7 @@  discard block
 block discarded – undo
854 854
                 // launch query
855 855
                 $rows = DB::query(
856 856
                     'SELECT *
857
-                    FROM ' . prefixTable('log_system') . '
857
+                    FROM ' . prefixTable('log_system').'
858 858
                     WHERE type = %s AND field_1 = %i
859 859
                     ORDER BY date DESC
860 860
                     LIMIT %i, %i',
@@ -868,7 +868,7 @@  discard block
 block discarded – undo
868 868
             if (isset($counter) && $counter != 0) {
869 869
                 $nb_pages = ceil($counter / intval($post_nb_items_by_page));
870 870
                 for ($i = 1; $i <= $nb_pages; ++$i) {
871
-                    $pages .= '<td onclick=\'displayLogs(' . $i . ',\"' . $post_scope . '\")\'><span style=\'cursor:pointer;' . (filter_input(INPUT_POST, 'page', FILTER_SANITIZE_NUMBER_INT) === $i ? 'font-weight:bold;font-size:18px;\'>' . $i : '\'>' . $i) . '</span></td>';
871
+                    $pages .= '<td onclick=\'displayLogs('.$i.',\"'.$post_scope.'\")\'><span style=\'cursor:pointer;'.(filter_input(INPUT_POST, 'page', FILTER_SANITIZE_NUMBER_INT) === $i ? 'font-weight:bold;font-size:18px;\'>'.$i : '\'>'.$i).'</span></td>';
872 872
                 }
873 873
             }
874 874
             $pages .= '</tr></table>';
@@ -877,13 +877,13 @@  discard block
 block discarded – undo
877 877
                     if ($post_scope === 'user_mngt') {
878 878
                         $user = DB::queryfirstrow(
879 879
                             'SELECT login
880
-                            from ' . prefixTable('users') . '
880
+                            from ' . prefixTable('users').'
881 881
                             WHERE id=%i',
882 882
                             $record['qui']
883 883
                         );
884 884
                         $user_1 = DB::queryfirstrow(
885 885
                             'SELECT login
886
-                            from ' . prefixTable('users') . '
886
+                            from ' . prefixTable('users').'
887 887
                             WHERE id=%i',
888 888
                             filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT)
889 889
                         );
@@ -893,7 +893,7 @@  discard block
 block discarded – undo
893 893
                         if ($tmp[0] == 'at_user_initial_pwd_changed') {
894 894
                             $label = langHdl('log_user_initial_pwd_changed');
895 895
                         } elseif ($tmp[0] == 'at_user_email_changed') {
896
-                            $label = langHdl('log_user_email_changed') . $tmp[1];
896
+                            $label = langHdl('log_user_email_changed').$tmp[1];
897 897
                         } elseif ($tmp[0] == 'at_user_added') {
898 898
                             $label = langHdl('log_user_created');
899 899
                         } elseif ($tmp[0] == 'at_user_locked') {
@@ -904,14 +904,14 @@  discard block
 block discarded – undo
904 904
                             $label = langHdl('log_user_pwd_changed');
905 905
                         }
906 906
                         // prepare log
907
-                        $logs .= '<tr><td>' . date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], $record['date']) . '</td><td align=\"center\">' . $label . '</td><td align=\"center\">' . $user['login'] . '</td><td align=\"center\"></td></tr>';
907
+                        $logs .= '<tr><td>'.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], $record['date']).'</td><td align=\"center\">'.$label.'</td><td align=\"center\">'.$user['login'].'</td><td align=\"center\"></td></tr>';
908 908
                     } else {
909
-                        $logs .= '<tr><td>' . date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], $record['date']) . '</td><td align=\"center\">' . str_replace('"', '\"', $record['label']) . '</td><td align=\"center\">' . $record['login'] . '</td><td align=\"center\">' . langHdl($record['action']) . '</td></tr>';
909
+                        $logs .= '<tr><td>'.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], $record['date']).'</td><td align=\"center\">'.str_replace('"', '\"', $record['label']).'</td><td align=\"center\">'.$record['login'].'</td><td align=\"center\">'.langHdl($record['action']).'</td></tr>';
910 910
                     }
911 911
                 }
912 912
             }
913 913
 
914
-            echo '[ { "table_logs": "' . ($logs) . '", "pages": "' . ($pages) . '", "error" : "no" } ]';
914
+            echo '[ { "table_logs": "'.($logs).'", "pages": "'.($pages).'", "error" : "no" } ]';
915 915
             break;
916 916
 
917 917
             /*
@@ -936,14 +936,14 @@  discard block
 block discarded – undo
936 936
             } else {
937 937
                 // Get folder id for Admin
938 938
                 $admin_folder = DB::queryFirstRow(
939
-                    'SELECT id FROM ' . prefixTable('nested_tree') . '
939
+                    'SELECT id FROM '.prefixTable('nested_tree').'
940 940
                     WHERE title = %i AND personal_folder = %i',
941 941
                     intval($_SESSION['user_id']),
942 942
                     '1'
943 943
                 );
944 944
                 // Get folder id for User
945 945
                 $user_folder = DB::queryFirstRow(
946
-                    'SELECT id FROM ' . prefixTable('nested_tree') . '
946
+                    'SELECT id FROM '.prefixTable('nested_tree').'
947 947
                     WHERE title=%i AND personal_folder = %i',
948 948
                     intval($user_id),
949 949
                     '1'
@@ -953,15 +953,15 @@  discard block
 block discarded – undo
953 953
                     // Get each Items in PF
954 954
                     $rows = DB::query(
955 955
                         'SELECT i.pw, i.label, l.id_user
956
-                        FROM ' . prefixTable('items') . ' as i
957
-                        LEFT JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item=i.id)
956
+                        FROM ' . prefixTable('items').' as i
957
+                        LEFT JOIN ' . prefixTable('log_items').' as l ON (l.id_item=i.id)
958 958
                         WHERE l.action = %s AND i.perso=%i AND i.id_tree=%i',
959 959
                         'at_creation',
960 960
                         '1',
961 961
                         intval($folder->id)
962 962
                     );
963 963
                     foreach ($rows as $record) {
964
-                        echo $record['label'] . ' - ';
964
+                        echo $record['label'].' - ';
965 965
                         // Change user
966 966
                         DB::update(
967 967
                             prefixTable('log_items'),
@@ -996,7 +996,7 @@  discard block
 block discarded – undo
996 996
             // Get info about user to delete
997 997
             $data_user = DB::queryfirstrow(
998 998
                 'SELECT admin, isAdministratedByRole, gestionnaire
999
-                FROM ' . prefixTable('users') . '
999
+                FROM ' . prefixTable('users').'
1000 1000
                 WHERE id = %i',
1001 1001
                 $post_user_id
1002 1002
             );
@@ -1033,7 +1033,7 @@  discard block
 block discarded – undo
1033 1033
 
1034 1034
             // Do
1035 1035
             $rows = DB::query(
1036
-                'SELECT id FROM ' . prefixTable('users') . '
1036
+                'SELECT id FROM '.prefixTable('users').'
1037 1037
                 WHERE timestamp != %s AND admin != %i',
1038 1038
                 '',
1039 1039
                 '1'
@@ -1042,7 +1042,7 @@  discard block
 block discarded – undo
1042 1042
                 // Get info about user to delete
1043 1043
                 $data_user = DB::queryfirstrow(
1044 1044
                     'SELECT admin, isAdministratedByRole, gestionnaire
1045
-                    FROM ' . prefixTable('users') . '
1045
+                    FROM ' . prefixTable('users').'
1046 1046
                     WHERE id = %i',
1047 1047
                     $record['id']
1048 1048
                 );
@@ -1096,7 +1096,7 @@  discard block
 block discarded – undo
1096 1096
             // Get info about user
1097 1097
             $rowUser = DB::queryfirstrow(
1098 1098
                 'SELECT *
1099
-                FROM ' . prefixTable('users') . '
1099
+                FROM ' . prefixTable('users').'
1100 1100
                 WHERE id = %i',
1101 1101
                 $post_id
1102 1102
             );
@@ -1114,7 +1114,7 @@  discard block
 block discarded – undo
1114 1114
                 $arrFldAllowed = array();
1115 1115
 
1116 1116
                 //Build tree
1117
-                $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries');
1117
+                $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries');
1118 1118
                 $tree->register();
1119 1119
                 $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title');
1120 1120
 
@@ -1125,7 +1125,7 @@  discard block
 block discarded – undo
1125 1125
                 // array of roles for actual user
1126 1126
                 $my_functions = explode(';', $_SESSION['fonction_id']);
1127 1127
 
1128
-                $rows = DB::query('SELECT id,title,creator_id FROM ' . prefixTable('roles_title'));
1128
+                $rows = DB::query('SELECT id,title,creator_id FROM '.prefixTable('roles_title'));
1129 1129
                 foreach ($rows as $record) {
1130 1130
                     if (
1131 1131
                         (int) $_SESSION['is_admin'] === 1
@@ -1161,7 +1161,7 @@  discard block
 block discarded – undo
1161 1161
                 $rolesList = array();
1162 1162
                 $managedBy = array();
1163 1163
                 $selected = '';
1164
-                $rows = DB::query('SELECT id,title FROM ' . prefixTable('roles_title') . ' ORDER BY title ASC');
1164
+                $rows = DB::query('SELECT id,title FROM '.prefixTable('roles_title').' ORDER BY title ASC');
1165 1165
                 foreach ($rows as $reccord) {
1166 1166
                     $rolesList[$reccord['id']] = array('id' => $reccord['id'], 'title' => $reccord['title']);
1167 1167
                 }
@@ -1192,7 +1192,7 @@  discard block
 block discarded – undo
1192 1192
                         array_push(
1193 1193
                             $managedBy,
1194 1194
                             array(
1195
-                                'title' => langHdl('managers_of') . ' ' . $fonction['title'],
1195
+                                'title' => langHdl('managers_of').' '.$fonction['title'],
1196 1196
                                 'id' => $fonction['id'],
1197 1197
                                 'selected' => $selected,
1198 1198
                             )
@@ -1274,9 +1274,9 @@  discard block
 block discarded – undo
1274 1274
 
1275 1275
                 // get USER STATUS
1276 1276
                 if ($rowUser['disabled'] == 1) {
1277
-                    $arrData['info'] = langHdl('user_info_locked') . '<br><input type="checkbox" value="unlock" name="1" class="chk">&nbsp;<label for="1">' . langHdl('user_info_unlock_question') . '</label><br><input type="checkbox"  value="delete" id="account_delete" class="chk mr-2" name="2" onclick="confirmDeletion()">label for="2">' . langHdl('user_info_delete_question') . '</label>';
1277
+                    $arrData['info'] = langHdl('user_info_locked').'<br><input type="checkbox" value="unlock" name="1" class="chk">&nbsp;<label for="1">'.langHdl('user_info_unlock_question').'</label><br><input type="checkbox"  value="delete" id="account_delete" class="chk mr-2" name="2" onclick="confirmDeletion()">label for="2">'.langHdl('user_info_delete_question').'</label>';
1278 1278
                 } else {
1279
-                    $arrData['info'] = langHdl('user_info_active') . '<br><input type="checkbox" value="lock" class="chk">&nbsp;' . langHdl('user_info_lock_question');
1279
+                    $arrData['info'] = langHdl('user_info_active').'<br><input type="checkbox" value="lock" class="chk">&nbsp;'.langHdl('user_info_lock_question');
1280 1280
                 }
1281 1281
 
1282 1282
                 $arrData['error'] = false;
@@ -1411,19 +1411,19 @@  discard block
 block discarded – undo
1411 1411
 
1412 1412
             // Empty user
1413 1413
             if (empty($post_login) === true) {
1414
-                echo '[ { "error" : "' . langHdl('error_empty_data') . '" } ]';
1414
+                echo '[ { "error" : "'.langHdl('error_empty_data').'" } ]';
1415 1415
                 break;
1416 1416
             }
1417 1417
 
1418 1418
             // User has email?
1419 1419
             if (empty($post_email) === true) {
1420
-                echo '[ { "error" : "' . langHdl('error_no_email') . '" } ]';
1420
+                echo '[ { "error" : "'.langHdl('error_no_email').'" } ]';
1421 1421
                 break;
1422 1422
             }
1423 1423
 
1424 1424
             // Get info about user to delete
1425 1425
             $data_user = DB::queryfirstrow(
1426
-                'SELECT admin, isAdministratedByRole FROM ' . prefixTable('users') . '
1426
+                'SELECT admin, isAdministratedByRole FROM '.prefixTable('users').'
1427 1427
                 WHERE id = %i',
1428 1428
                 $post_id
1429 1429
             );
@@ -1444,7 +1444,7 @@  discard block
 block discarded – undo
1444 1444
                     );
1445 1445
                     // delete personal folder and subfolders
1446 1446
                     $data = DB::queryfirstrow(
1447
-                        'SELECT id FROM ' . prefixTable('nested_tree') . '
1447
+                        'SELECT id FROM '.prefixTable('nested_tree').'
1448 1448
                         WHERE title = %s AND personal_folder = %i',
1449 1449
                         $post_id,
1450 1450
                         '1'
@@ -1457,7 +1457,7 @@  discard block
 block discarded – undo
1457 1457
                             DB::delete(prefixTable('nested_tree'), 'id = %i AND personal_folder = %i', $folder->id, '1');
1458 1458
                             // delete items & logs
1459 1459
                             $items = DB::query(
1460
-                                'SELECT id FROM ' . prefixTable('items') . '
1460
+                                'SELECT id FROM '.prefixTable('items').'
1461 1461
                                 WHERE id_tree=%i AND perso = %i',
1462 1462
                                 $folder->id,
1463 1463
                                 '1'
@@ -1478,7 +1478,7 @@  discard block
 block discarded – undo
1478 1478
                 } else {
1479 1479
                     // Get old data about user
1480 1480
                     $oldData = DB::queryfirstrow(
1481
-                        'SELECT * FROM ' . prefixTable('users') . '
1481
+                        'SELECT * FROM '.prefixTable('users').'
1482 1482
                         WHERE id = %i',
1483 1483
                         $post_id
1484 1484
                     );
@@ -1507,7 +1507,7 @@  discard block
 block discarded – undo
1507 1507
 
1508 1508
                     // update LOG
1509 1509
                     if ($oldData['email'] !== $post_email) {
1510
-                        logEvents('user_mngt', 'at_user_email_changed:' . $oldData['email'], intval($_SESSION['user_id']), $_SESSION['login'], $post_id);
1510
+                        logEvents('user_mngt', 'at_user_email_changed:'.$oldData['email'], intval($_SESSION['user_id']), $_SESSION['login'], $post_id);
1511 1511
                     }
1512 1512
 
1513 1513
                     if ((int) $oldData['disabled'] !== (int) $post_user_disabled) {
@@ -1566,7 +1566,7 @@  discard block
 block discarded – undo
1566 1566
 
1567 1567
             // Get info about user to delete
1568 1568
             $data_user = DB::queryfirstrow(
1569
-                'SELECT admin, isAdministratedByRole FROM ' . prefixTable('users') . '
1569
+                'SELECT admin, isAdministratedByRole FROM '.prefixTable('users').'
1570 1570
                 WHERE id = %i',
1571 1571
                 $post_id
1572 1572
             );
@@ -1616,7 +1616,7 @@  discard block
 block discarded – undo
1616 1616
             }
1617 1617
 
1618 1618
             DB::queryfirstrow(
1619
-                'SELECT * FROM ' . prefixTable('users') . '
1619
+                'SELECT * FROM '.prefixTable('users').'
1620 1620
                 WHERE login = %s',
1621 1621
                 filter_input(INPUT_POST, 'login', FILTER_SANITIZE_STRING)
1622 1622
             );
@@ -1665,14 +1665,14 @@  discard block
 block discarded – undo
1665 1665
             $arrData = array();
1666 1666
 
1667 1667
             //Build tree
1668
-            $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries');
1668
+            $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries');
1669 1669
             $tree->register();
1670 1670
             $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title');
1671 1671
 
1672 1672
             // get User info
1673 1673
             $rowUser = DB::queryFirstRow(
1674 1674
                 'SELECT login, name, lastname, email, disabled, fonction_id, groupes_interdits, groupes_visibles, isAdministratedByRole, avatar_thumb
1675
-                FROM ' . prefixTable('users') . '
1675
+                FROM ' . prefixTable('users').'
1676 1676
                 WHERE id = %i',
1677 1677
                 $post_id
1678 1678
             );
@@ -1691,7 +1691,7 @@  discard block
 block discarded – undo
1691 1691
                 // refine folders based upon roles
1692 1692
                 $rows = DB::query(
1693 1693
                     'SELECT folder_id, type
1694
-                    FROM ' . prefixTable('roles_values') . '
1694
+                    FROM ' . prefixTable('roles_values').'
1695 1695
                     WHERE role_id IN %ls
1696 1696
                     ORDER BY folder_id ASC',
1697 1697
                     $arrData['functions']
@@ -1720,7 +1720,7 @@  discard block
 block discarded – undo
1720 1720
                             // get folder name
1721 1721
                             $row = DB::queryFirstRow(
1722 1722
                                 'SELECT title, nlevel, id
1723
-                                FROM ' . prefixTable('nested_tree') . '
1723
+                                FROM ' . prefixTable('nested_tree').'
1724 1724
                                 WHERE id = %i',
1725 1725
                                 $fld['id']
1726 1726
                             );
@@ -1733,37 +1733,37 @@  discard block
 block discarded – undo
1733 1733
 
1734 1734
                             // manage right icon
1735 1735
                             if ($fld['type'] == 'W') {
1736
-                                $label = '<i class="fas fa-indent infotip text-success mr-2" title="' . langHdl('write') . '"></i>' .
1737
-                                    '<i class="fas fa-edit infotip text-success mr-2" title="' . langHdl('edit') . '"></i>' .
1738
-                                    '<i class="fas fa-eraser infotip text-success" title="' . langHdl('delete') . '"></i>';
1736
+                                $label = '<i class="fas fa-indent infotip text-success mr-2" title="'.langHdl('write').'"></i>'.
1737
+                                    '<i class="fas fa-edit infotip text-success mr-2" title="'.langHdl('edit').'"></i>'.
1738
+                                    '<i class="fas fa-eraser infotip text-success" title="'.langHdl('delete').'"></i>';
1739 1739
                             } elseif ($fld['type'] == 'ND') {
1740
-                                $label = '<i class="fas fa-indent infotip text-warning mr-2" title="' . langHdl('write') . '"></i>' .
1741
-                                    '<i class="fas fa-edit infotip text-success mr-2" title="' . langHdl('edit') . '"></i>' .
1742
-                                    '<i class="fas fa-eraser infotip text-danger" title="' . langHdl('no_delete') . '"></i>';
1740
+                                $label = '<i class="fas fa-indent infotip text-warning mr-2" title="'.langHdl('write').'"></i>'.
1741
+                                    '<i class="fas fa-edit infotip text-success mr-2" title="'.langHdl('edit').'"></i>'.
1742
+                                    '<i class="fas fa-eraser infotip text-danger" title="'.langHdl('no_delete').'"></i>';
1743 1743
                             } elseif ($fld['type'] == 'NE') {
1744
-                                $label = '<i class="fas fa-indent infotip text-warning mr-2" title="' . langHdl('write') . '"></i>' .
1745
-                                    '<i class="fas fa-edit infotip text-danger mr-2" title="' . langHdl('no_edit') . '"></i>' .
1746
-                                    '<i class="fas fa-eraser infotip text-success" title="' . langHdl('delete') . '"></i>';
1744
+                                $label = '<i class="fas fa-indent infotip text-warning mr-2" title="'.langHdl('write').'"></i>'.
1745
+                                    '<i class="fas fa-edit infotip text-danger mr-2" title="'.langHdl('no_edit').'"></i>'.
1746
+                                    '<i class="fas fa-eraser infotip text-success" title="'.langHdl('delete').'"></i>';
1747 1747
                             } elseif ($fld['type'] == 'NDNE') {
1748
-                                $label = '<i class="fas fa-indent infotip text-warning mr-2" title="' . langHdl('write') . '"></i>' .
1749
-                                    '<i class="fas fa-edit infotip text-danger mr-2" title="' . langHdl('no_edit') . '"></i>' .
1750
-                                    '<i class="fas fa-eraser infotip text-danger" title="' . langHdl('no_delete') . '"></i>';
1748
+                                $label = '<i class="fas fa-indent infotip text-warning mr-2" title="'.langHdl('write').'"></i>'.
1749
+                                    '<i class="fas fa-edit infotip text-danger mr-2" title="'.langHdl('no_edit').'"></i>'.
1750
+                                    '<i class="fas fa-eraser infotip text-danger" title="'.langHdl('no_delete').'"></i>';
1751 1751
                             } else {
1752 1752
                                 $color = '#FEBC11';
1753 1753
                                 $allowed = 'R';
1754 1754
                                 $title = langHdl('read');
1755
-                                $label = '<i class="fas fa-eye infotip text-info mr-2" title="' . langHdl('read') . '"></i>';
1755
+                                $label = '<i class="fas fa-eye infotip text-info mr-2" title="'.langHdl('read').'"></i>';
1756 1756
                             }
1757 1757
 
1758
-                            $html .= '<tr><td>' . $ident . $row['title'] .
1759
-                                ' <small>[' . $row['id'] . ']</small></td><td>' . $label . '</td></tr>';
1758
+                            $html .= '<tr><td>'.$ident.$row['title'].
1759
+                                ' <small>['.$row['id'].']</small></td><td>'.$label.'</td></tr>';
1760 1760
                             break;
1761 1761
                         }
1762 1762
                     }
1763 1763
                 }
1764 1764
 
1765
-                $html_full = '<table id="table-folders" class="table table-bordered table-striped dt-responsive nowrap" style="width:100%"><tbody>' .
1766
-                    $html . '</tbody></table>';
1765
+                $html_full = '<table id="table-folders" class="table table-bordered table-striped dt-responsive nowrap" style="width:100%"><tbody>'.
1766
+                    $html.'</tbody></table>';
1767 1767
             } else {
1768 1768
                 $html_full = '';
1769 1769
             }
@@ -1809,7 +1809,7 @@  discard block
 block discarded – undo
1809 1809
             if (!$_SESSION['is_admin'] && !$_SESSION['user_can_manage_all_users']) {
1810 1810
                 $rows = DB::query(
1811 1811
                     'SELECT *
1812
-                    FROM ' . prefixTable('users') . '
1812
+                    FROM ' . prefixTable('users').'
1813 1813
                     WHERE admin = %i AND isAdministratedByRole IN %ls',
1814 1814
                     '0',
1815 1815
                     array_filter($_SESSION['user_roles'])
@@ -1817,7 +1817,7 @@  discard block
 block discarded – undo
1817 1817
             } else {
1818 1818
                 $rows = DB::query(
1819 1819
                     'SELECT *
1820
-                    FROM ' . prefixTable('users') . '
1820
+                    FROM ' . prefixTable('users').'
1821 1821
                     WHERE admin = %i',
1822 1822
                     '0'
1823 1823
                 );
@@ -1829,7 +1829,7 @@  discard block
 block discarded – undo
1829 1829
                 $groupIds = [];
1830 1830
                 foreach (explode(';', $record['fonction_id']) as $group) {
1831 1831
                     $tmp = DB::queryfirstrow(
1832
-                        'SELECT id, title FROM ' . prefixTable('roles_title') . '
1832
+                        'SELECT id, title FROM '.prefixTable('roles_title').'
1833 1833
                         WHERE id = %i',
1834 1834
                         $group
1835 1835
                     );
@@ -1839,7 +1839,7 @@  discard block
 block discarded – undo
1839 1839
 
1840 1840
                 // Get managed_by
1841 1841
                 $managedBy = DB::queryfirstrow(
1842
-                    'SELECT id, title FROM ' . prefixTable('roles_title') . '
1842
+                    'SELECT id, title FROM '.prefixTable('roles_title').'
1843 1843
                     WHERE id = %i',
1844 1844
                     $record['isAdministratedByRole']
1845 1845
                 );
@@ -1849,7 +1849,7 @@  discard block
 block discarded – undo
1849 1849
                 $foldersAllowedIds = [];
1850 1850
                 foreach (explode(';', $record['groupes_visibles']) as $role) {
1851 1851
                     $tmp = DB::queryfirstrow(
1852
-                        'SELECT id, title FROM ' . prefixTable('nested_tree') . '
1852
+                        'SELECT id, title FROM '.prefixTable('nested_tree').'
1853 1853
                         WHERE id = %i',
1854 1854
                         $role
1855 1855
                     );
@@ -1862,7 +1862,7 @@  discard block
 block discarded – undo
1862 1862
                 $foldersForbiddenIds = [];
1863 1863
                 foreach (explode(';', $record['groupes_interdits']) as $role) {
1864 1864
                     $tmp = DB::queryfirstrow(
1865
-                        'SELECT id, title FROM ' . prefixTable('nested_tree') . '
1865
+                        'SELECT id, title FROM '.prefixTable('nested_tree').'
1866 1866
                         WHERE id = %i',
1867 1867
                         $role
1868 1868
                     );
@@ -1958,7 +1958,7 @@  discard block
 block discarded – undo
1958 1958
 
1959 1959
             // Get info about user
1960 1960
             $data_user = DB::queryfirstrow(
1961
-                'SELECT admin, isAdministratedByRole FROM ' . prefixTable('users') . '
1961
+                'SELECT admin, isAdministratedByRole FROM '.prefixTable('users').'
1962 1962
                 WHERE id = %i',
1963 1963
                 $post_source_id
1964 1964
             );
@@ -2107,14 +2107,14 @@  discard block
 block discarded – undo
2107 2107
             if (empty($post_context) === false && $post_context = 'add_one_role_to_user') {
2108 2108
                 $data_user = DB::queryfirstrow(
2109 2109
                     'SELECT fonction_id
2110
-                    FROM ' . prefixTable('users') . '
2110
+                    FROM ' . prefixTable('users').'
2111 2111
                     WHERE id = %i',
2112 2112
                     $post_user_id
2113 2113
                 );
2114 2114
 
2115 2115
                 if ($data_user) {
2116 2116
                     // Ensure array is unique
2117
-                    $post_new_value = str_replace(',', ';', $data_user['fonction_id']) . ';' . $post_new_value;
2117
+                    $post_new_value = str_replace(',', ';', $data_user['fonction_id']).';'.$post_new_value;
2118 2118
                     $post_new_value = implode(';', array_unique(explode(';', $post_new_value)));
2119 2119
                 } else {
2120 2120
                     // User not found
@@ -2169,7 +2169,7 @@  discard block
 block discarded – undo
2169 2169
             if (filter_input(INPUT_POST, 'step', FILTER_SANITIZE_STRING) === 'refresh') {
2170 2170
                 $record = DB::queryFirstRow(
2171 2171
                     'SELECT user_ip_lastdate
2172
-                    FROM ' . prefixTable('users') . '
2172
+                    FROM ' . prefixTable('users').'
2173 2173
                     WHERE id = %i',
2174 2174
                     $_SESSION['user_id']
2175 2175
                 );
@@ -2247,7 +2247,7 @@  discard block
 block discarded – undo
2247 2247
             $debug_ldap = $ldap_suffix = '';
2248 2248
 
2249 2249
             // Get list of existing Roles in Teampass
2250
-            $rows = DB::query('SELECT id,title FROM ' . prefixTable('roles_title'));
2250
+            $rows = DB::query('SELECT id,title FROM '.prefixTable('roles_title'));
2251 2251
             foreach ($rows as $record) {
2252 2252
                 array_push(
2253 2253
                     $teampassRoles,
@@ -2260,35 +2260,35 @@  discard block
 block discarded – undo
2260 2260
 
2261 2261
             //Multiple Domain Names
2262 2262
             if (strpos(html_entity_decode($dataReceived['username']), '\\') === true) {
2263
-                $ldap_suffix = '@' . substr(html_entity_decode($dataReceived['username']), 0, strpos(html_entity_decode($dataReceived['username']), '\\'));
2263
+                $ldap_suffix = '@'.substr(html_entity_decode($dataReceived['username']), 0, strpos(html_entity_decode($dataReceived['username']), '\\'));
2264 2264
                 $dataReceived['username'] = substr(html_entity_decode($dataReceived['username']), strpos(html_entity_decode($dataReceived['username']), '\\') + 1);
2265 2265
             }
2266 2266
             if ($SETTINGS['ldap_type'] === 'posix-search') {
2267 2267
                 $ldapURIs = '';
2268 2268
                 foreach (explode(',', $SETTINGS['ldap_domain_controler']) as $domainControler) {
2269 2269
                     if ((int) $SETTINGS['ldap_ssl'] === 1) {
2270
-                        $ldapURIs .= 'ldaps://' . $domainControler . ':' . $SETTINGS['ldap_port'] . ' ';
2270
+                        $ldapURIs .= 'ldaps://'.$domainControler.':'.$SETTINGS['ldap_port'].' ';
2271 2271
                     } else {
2272
-                        $ldapURIs .= 'ldap://' . $domainControler . ':' . $SETTINGS['ldap_port'] . ' ';
2272
+                        $ldapURIs .= 'ldap://'.$domainControler.':'.$SETTINGS['ldap_port'].' ';
2273 2273
                     }
2274 2274
                 }
2275 2275
 
2276
-                $debug_ldap .= 'LDAP URIs : ' . $ldapURIs . '<br/>';
2276
+                $debug_ldap .= 'LDAP URIs : '.$ldapURIs.'<br/>';
2277 2277
                 $ldapconn = ldap_connect($ldapURIs);
2278 2278
 
2279 2279
                 if ($SETTINGS['ldap_ssl']) {
2280 2280
                     ldap_start_tls($ldapconn);
2281 2281
                 }
2282 2282
 
2283
-                $debug_ldap .= 'LDAP connection : ' . ($ldapconn ? 'Connected' : 'Failed') . '<br/>';
2283
+                $debug_ldap .= 'LDAP connection : '.($ldapconn ? 'Connected' : 'Failed').'<br/>';
2284 2284
 
2285 2285
                 if ($ldapconn) {
2286
-                    $debug_ldap .= 'DN : ' . $SETTINGS['ldap_bind_dn'] . ' -- ' . $SETTINGS['ldap_bind_passwd'] . '<br/>';
2286
+                    $debug_ldap .= 'DN : '.$SETTINGS['ldap_bind_dn'].' -- '.$SETTINGS['ldap_bind_passwd'].'<br/>';
2287 2287
                     ldap_set_option($ldapconn, LDAP_OPT_PROTOCOL_VERSION, 3);
2288 2288
                     ldap_set_option($ldapconn, LDAP_OPT_REFERRALS, 0);
2289 2289
                     $ldapbind = ldap_bind($ldapconn, $SETTINGS['ldap_bind_dn'], $SETTINGS['ldap_bind_passwd']);
2290 2290
 
2291
-                    $debug_ldap .= 'LDAP bind : ' . ($ldapbind ? 'Bound' : 'Failed') . '<br/>';
2291
+                    $debug_ldap .= 'LDAP bind : '.($ldapbind ? 'Bound' : 'Failed').'<br/>';
2292 2292
 
2293 2293
                     if ($ldapbind) {
2294 2294
                         //$filter = '(&(' . $SETTINGS['ldap_user_attribute'] . '=' . $dataReceived['username'] . ')(objectClass=' . $SETTINGS['ldap_object_class'] . '))';
@@ -2326,7 +2326,7 @@  discard block
 block discarded – undo
2326 2326
                                     // Get his ID
2327 2327
                                     $user = DB::queryfirstrow(
2328 2328
                                         'SELECT id, fonction_id 
2329
-                                        FROM ' . prefixTable('users') . '
2329
+                                        FROM ' . prefixTable('users').'
2330 2330
                                         WHERE login = %s',
2331 2331
                                         $userLogin
2332 2332
                                     );
@@ -2340,7 +2340,7 @@  discard block
 block discarded – undo
2340 2340
                                             foreach (explode(';', $user['fonction_id']) as $group) {
2341 2341
                                                 $entry = DB::queryfirstrow(
2342 2342
                                                     'SELECT title
2343
-                                                    FROM ' . prefixTable('roles_title') . '
2343
+                                                    FROM ' . prefixTable('roles_title').'
2344 2344
                                                     WHERE id = %i',
2345 2345
                                                     $group
2346 2346
                                                 );
@@ -2416,20 +2416,20 @@  discard block
 block discarded – undo
2416 2416
                     $debug_ldap .= 'Error - Could not connect to server!';
2417 2417
                 }
2418 2418
             } else {
2419
-                $debug_ldap .= 'Get all ldap params: <br/>' .
2420
-                    '  - base_dn : ' . $SETTINGS['ldap_domain_dn'] . '<br/>' .
2421
-                    '  - account_suffix : ' . $SETTINGS['ldap_suffix'] . '<br/>' .
2422
-                    '  - domain_controllers : ' . $SETTINGS['ldap_domain_controler'] . '<br/>' .
2423
-                    '  - ad_port : ' . $SETTINGS['ldap_port'] . '<br/>' .
2424
-                    '  - use_ssl : ' . $SETTINGS['ldap_ssl'] . '<br/>' .
2425
-                    '  - use_tls : ' . $SETTINGS['ldap_tls'] . '<br/>*********<br/>';
2419
+                $debug_ldap .= 'Get all ldap params: <br/>'.
2420
+                    '  - base_dn : '.$SETTINGS['ldap_domain_dn'].'<br/>'.
2421
+                    '  - account_suffix : '.$SETTINGS['ldap_suffix'].'<br/>'.
2422
+                    '  - domain_controllers : '.$SETTINGS['ldap_domain_controler'].'<br/>'.
2423
+                    '  - ad_port : '.$SETTINGS['ldap_port'].'<br/>'.
2424
+                    '  - use_ssl : '.$SETTINGS['ldap_ssl'].'<br/>'.
2425
+                    '  - use_tls : '.$SETTINGS['ldap_tls'].'<br/>*********<br/>';
2426 2426
 
2427 2427
                 $adldap = new SplClassLoader('adLDAP', '../includes/libraries/LDAP');
2428 2428
                 $adldap->register();
2429 2429
 
2430 2430
                 // Posix style LDAP handles user searches a bit differently
2431 2431
                 if ($SETTINGS['ldap_type'] === 'posix') {
2432
-                    $ldap_suffix = ',' . $SETTINGS['ldap_suffix'] . ',' . $SETTINGS['ldap_domain_dn'];
2432
+                    $ldap_suffix = ','.$SETTINGS['ldap_suffix'].','.$SETTINGS['ldap_domain_dn'];
2433 2433
                 } elseif ($SETTINGS['ldap_type'] === 'windows' && $ldap_suffix === '') { //Multiple Domain Names
2434 2434
                     $ldap_suffix = $SETTINGS['ldap_suffix'];
2435 2435
                 }
@@ -2444,11 +2444,11 @@  discard block
 block discarded – undo
2444 2444
                     )
2445 2445
                 );
2446 2446
 
2447
-                $debug_ldap .= 'Create new adldap object : ' . $adldap->getLastError() . '<br/><br/>';
2447
+                $debug_ldap .= 'Create new adldap object : '.$adldap->getLastError().'<br/><br/>';
2448 2448
 
2449 2449
                 // openLDAP expects an attribute=value pair
2450 2450
                 if ($SETTINGS['ldap_type'] === 'posix') {
2451
-                    $auth_username = $SETTINGS['ldap_user_attribute'] . '=' . $dataReceived['username'];
2451
+                    $auth_username = $SETTINGS['ldap_user_attribute'].'='.$dataReceived['username'];
2452 2452
                 } else {
2453 2453
                     $auth_username = $dataReceived['username'];
2454 2454
                 }
@@ -2460,8 +2460,8 @@  discard block
 block discarded – undo
2460 2460
                     $ldapConnection = 'Not possible to get connected with this user';
2461 2461
                 }
2462 2462
 
2463
-                $debug_ldap .= 'After authenticate : ' . $adldap->getLastError() . '<br/><br/>' .
2464
-                    'ldap status : ' . $ldapConnection; //Debug
2463
+                $debug_ldap .= 'After authenticate : '.$adldap->getLastError().'<br/><br/>'.
2464
+                    'ldap status : '.$ldapConnection; //Debug
2465 2465
             }
2466 2466
 
2467 2467
             echo prepareExchangedData(
@@ -2518,7 +2518,7 @@  discard block
 block discarded – undo
2518 2518
             // Check if user already exists
2519 2519
             $data = DB::query(
2520 2520
                 'SELECT id, fonction_id, groupes_interdits, groupes_visibles
2521
-                FROM ' . prefixTable('users') . '
2521
+                FROM ' . prefixTable('users').'
2522 2522
                 WHERE login = %s',
2523 2523
                 $post_login
2524 2524
             );
@@ -2617,7 +2617,7 @@  discard block
 block discarded – undo
2617 2617
                 );
2618 2618
 
2619 2619
                 // Rebuild tree
2620
-                $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries');
2620
+                $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries');
2621 2621
                 $tree->register();
2622 2622
                 $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title');
2623 2623
                 $tree->rebuild();
@@ -2641,7 +2641,7 @@  discard block
 block discarded – undo
2641 2641
 
2642 2642
     // Get info about user
2643 2643
     $data_user = DB::queryfirstrow(
2644
-        'SELECT admin, isAdministratedByRole FROM ' . prefixTable('users') . '
2644
+        'SELECT admin, isAdministratedByRole FROM '.prefixTable('users').'
2645 2645
         WHERE id = %i',
2646 2646
         $value[1]
2647 2647
     );
@@ -2673,7 +2673,7 @@  discard block
 block discarded – undo
2673 2673
             // update LOG
2674 2674
             logEvents(
2675 2675
                 'user_mngt',
2676
-                'at_user_new_' . $value[0] . ':' . $value[1],
2676
+                'at_user_new_'.$value[0].':'.$value[1],
2677 2677
                 $_SESSION['user_id'],
2678 2678
                 $_SESSION['login'],
2679 2679
                 filter_input(INPUT_POST, 'id', FILTER_SANITIZE_STRING)
@@ -2705,7 +2705,7 @@  discard block
 block discarded – undo
2705 2705
 
2706 2706
     // Get info about user
2707 2707
     $data_user = DB::queryfirstrow(
2708
-        'SELECT admin, isAdministratedByRole FROM ' . prefixTable('users') . '
2708
+        'SELECT admin, isAdministratedByRole FROM '.prefixTable('users').'
2709 2709
         WHERE id = %i',
2710 2710
         $value[1]
2711 2711
     );
Please login to merge, or discard this patch.
sources/admin.queries.php 1 patch
Spacing   +196 added lines, -196 removed lines patch added patch discarded remove patch
@@ -43,25 +43,25 @@  discard block
 block discarded – undo
43 43
 }
44 44
 
45 45
 /* do checks */
46
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
47
-require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php';
46
+require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php';
47
+require_once $SETTINGS['cpassman_dir'].'/sources/checks.php';
48 48
 if (!checkUser($_SESSION['user_id'], $_SESSION['key'], 'options', $SETTINGS)) {
49 49
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED; //not allowed page
50
-    include $SETTINGS['cpassman_dir'] . '/error.php';
50
+    include $SETTINGS['cpassman_dir'].'/error.php';
51 51
     exit();
52 52
 }
53 53
 
54
-require_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php';
55
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
56
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/tp.config.php';
54
+require_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php';
55
+require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
56
+require_once $SETTINGS['cpassman_dir'].'/includes/config/tp.config.php';
57 57
 
58 58
 header('Content-type: text/html; charset=utf-8');
59 59
 header('Cache-Control: no-cache, no-store, must-revalidate');
60 60
 
61
-require_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
61
+require_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
62 62
 
63 63
 // connect to the server
64
-require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
64
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
65 65
 if (defined('DB_PASSWD_CLEAR') === false) {
66 66
     define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
67 67
 }
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 $aes->register();
85 85
 
86 86
 // Load AntiXSS
87
-require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/AntiXSS/AntiXSS.php';
87
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/AntiXSS/AntiXSS.php';
88 88
 $antiXss = new protect\AntiXSS\AntiXSS();
89 89
 
90 90
 // Prepare POST variables
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
                         array(
122 122
                             'http' => array(
123 123
                                 'ignore_errors' => true,
124
-                                'proxy' => $SETTINGS['proxy_ip'] . ':' . $SETTINGS['proxy_port'],
124
+                                'proxy' => $SETTINGS['proxy_ip'].':'.$SETTINGS['proxy_port'],
125 125
                             ),
126 126
                         )
127 127
                     );
@@ -140,16 +140,16 @@  discard block
 block discarded – undo
140 140
                     $json_array = json_decode($json, true);
141 141
 
142 142
                     // About version
143
-                    $text .= '<li><u>' . $LANG['your_version'] . '</u> : ' . TP_VERSION_FULL;
143
+                    $text .= '<li><u>'.$LANG['your_version'].'</u> : '.TP_VERSION_FULL;
144 144
                     if (floatval(TP_VERSION_FULL) < floatval($json_array['info']['version'])) {
145
-                        $text .= '&nbsp;&nbsp;<b>' . $LANG['please_update'] . '</b>';
145
+                        $text .= '&nbsp;&nbsp;<b>'.$LANG['please_update'].'</b>';
146 146
                     }
147 147
                     $text .= '</li>';
148 148
 
149 149
                     // Libraries
150 150
                     $text .= '<li><u>Libraries</u> :</li>';
151 151
                     foreach ($json_array['libraries'] as $key => $val) {
152
-                        $text .= "<li>&nbsp;<span class='fa fa-caret-right'></span>&nbsp;" . $key . " (<a href='" . $val . "' target='_blank'>" . $val . '</a>)</li>';
152
+                        $text .= "<li>&nbsp;<span class='fa fa-caret-right'></span>&nbsp;".$key." (<a href='".$val."' target='_blank'>".$val.'</a>)</li>';
153 153
                     }
154 154
                 }
155 155
             } else {
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
         }
161 161
         $text .= '</ul>';
162 162
 
163
-        echo '[{"error":"' . $error . '" , "output":"' . str_replace(array("\n", "\t", "\r"), '', $text) . '"}]';
163
+        echo '[{"error":"'.$error.'" , "output":"'.str_replace(array("\n", "\t", "\r"), '', $text).'"}]';
164 164
         break;
165 165
 
166 166
         //##########################################################
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
         //get through all users
193 193
         $rows = DB::query(
194 194
             'SELECT id, login, email
195
-            FROM ' . prefixTable('users') . '
195
+            FROM ' . prefixTable('users').'
196 196
             ORDER BY login ASC'
197 197
         );
198 198
         foreach ($rows as $record) {
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
             //if folder doesn't exist then create it
210 210
             $data = DB::queryfirstrow(
211 211
                 'SELECT id
212
-                FROM ' . prefixTable('nested_tree') . '
212
+                FROM ' . prefixTable('nested_tree').'
213 213
                 WHERE title = %s AND parent_id = %i',
214 214
                 $record['id'],
215 215
                 0
@@ -270,8 +270,8 @@  discard block
 block discarded – undo
270 270
         echo prepareExchangedData(
271 271
             array(
272 272
                 'error' => false,
273
-                'message' => langHdl('last_execution') . ' ' .
274
-                    date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], time()) .
273
+                'message' => langHdl('last_execution').' '.
274
+                    date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], time()).
275 275
                     '<i class="fas fa-check text-success ml-2"></i>',
276 276
             ),
277 277
             'encode'
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
         }
306 306
 
307 307
         //Libraries call
308
-        require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
308
+        require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
309 309
 
310 310
         //init
311 311
         $foldersIds = array();
@@ -320,9 +320,9 @@  discard block
 block discarded – undo
320 320
             }
321 321
         }
322 322
 
323
-        $items = DB::query('SELECT id,label FROM ' . prefixTable('items') . ' WHERE id_tree NOT IN %li', $foldersIds);
323
+        $items = DB::query('SELECT id,label FROM '.prefixTable('items').' WHERE id_tree NOT IN %li', $foldersIds);
324 324
         foreach ($items as $item) {
325
-            $text .= $item['label'] . '[' . $item['id'] . '] - ';
325
+            $text .= $item['label'].'['.$item['id'].'] - ';
326 326
             //Delete item
327 327
             DB::DELETE(prefixTable('items'), 'id = %i', $item['id']);
328 328
 
@@ -342,12 +342,12 @@  discard block
 block discarded – undo
342 342
         // delete orphan items
343 343
         $rows = DB::query(
344 344
             'SELECT id
345
-            FROM ' . prefixTable('items') . '
345
+            FROM ' . prefixTable('items').'
346 346
             ORDER BY id ASC'
347 347
         );
348 348
         foreach ($rows as $item) {
349 349
             DB::query(
350
-                'SELECT * FROM ' . prefixTable('log_items') . ' WHERE id_item = %i AND action = %s',
350
+                'SELECT * FROM '.prefixTable('log_items').' WHERE id_item = %i AND action = %s',
351 351
                 $item['id'],
352 352
                 'at_creation'
353 353
             );
@@ -376,11 +376,11 @@  discard block
 block discarded – undo
376 376
         echo prepareExchangedData(
377 377
             array(
378 378
                 'error' => false,
379
-                'message' => langHdl('last_execution') . ' ' .
380
-                    date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], time()) .
381
-                    '<i class="fas fa-check text-success ml-2 mr-3"></i>' .
382
-                    '<i class="fas fa-chevron-right mr-2"></i>' .
383
-                    $nbItemsDeleted . ' ' . langHdl('deleted_items'),
379
+                'message' => langHdl('last_execution').' '.
380
+                    date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], time()).
381
+                    '<i class="fas fa-check text-success ml-2 mr-3"></i>'.
382
+                    '<i class="fas fa-chevron-right mr-2"></i>'.
383
+                    $nbItemsDeleted.' '.langHdl('deleted_items'),
384 384
             ),
385 385
             'encode'
386 386
         );
@@ -412,21 +412,21 @@  discard block
 block discarded – undo
412 412
             break;
413 413
         }
414 414
 
415
-        require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
415
+        require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
416 416
         $return = '';
417 417
 
418 418
         //Get all tables
419 419
         $tables = array();
420 420
         $result = DB::query('SHOW TABLES');
421 421
         foreach ($result as $row) {
422
-            $tables[] = $row['Tables_in_' . $database];
422
+            $tables[] = $row['Tables_in_'.$database];
423 423
         }
424 424
 
425 425
         //cycle through
426 426
         foreach ($tables as $table) {
427 427
             if (defined('DB_PREFIX') || substr_count($table, DB_PREFIX) > 0) {
428 428
                 // Do query
429
-                $result = DB::queryRaw('SELECT * FROM ' . $table);
429
+                $result = DB::queryRaw('SELECT * FROM '.$table);
430 430
                 $mysqli_result = DB::queryRaw(
431 431
                     'SELECT *
432 432
                     FROM INFORMATION_SCHEMA.COLUMNS
@@ -438,19 +438,19 @@  discard block
 block discarded – undo
438 438
                 $numFields = DB::count();
439 439
 
440 440
                 // prepare a drop table
441
-                $return .= 'DROP TABLE ' . $table . ';';
442
-                $row2 = DB::queryfirstrow('SHOW CREATE TABLE ' . $table);
443
-                $return .= "\n\n" . $row2['Create Table'] . ";\n\n";
441
+                $return .= 'DROP TABLE '.$table.';';
442
+                $row2 = DB::queryfirstrow('SHOW CREATE TABLE '.$table);
443
+                $return .= "\n\n".$row2['Create Table'].";\n\n";
444 444
 
445 445
                 //prepare all fields and datas
446 446
                 for ($i = 0; $i < $numFields; ++$i) {
447 447
                     while ($row = $result->fetch_row()) {
448
-                        $return .= 'INSERT INTO ' . $table . ' VALUES(';
448
+                        $return .= 'INSERT INTO '.$table.' VALUES(';
449 449
                         for ($j = 0; $j < $numFields; ++$j) {
450 450
                             $row[$j] = addslashes($row[$j]);
451 451
                             $row[$j] = preg_replace("/\n/", '\\n', $row[$j]);
452 452
                             if (isset($row[$j])) {
453
-                                $return .= '"' . $row[$j] . '"';
453
+                                $return .= '"'.$row[$j].'"';
454 454
                             } else {
455 455
                                 $return .= 'NULL';
456 456
                             }
@@ -470,8 +470,8 @@  discard block
 block discarded – undo
470 470
             $token = GenerateCryptKey(20, false, true, true, false, true, $SETTINGS);
471 471
 
472 472
             //save file
473
-            $filename = time() . '-' . $token . '.sql';
474
-            $handle = fopen($SETTINGS['path_to_files_folder'] . '/' . $filename, 'w+');
473
+            $filename = time().'-'.$token.'.sql';
474
+            $handle = fopen($SETTINGS['path_to_files_folder'].'/'.$filename, 'w+');
475 475
             if ($handle !== false) {
476 476
                 //write file
477 477
                 fwrite($handle, $return);
@@ -483,17 +483,17 @@  discard block
 block discarded – undo
483 483
                 // Encrypt the file
484 484
                 prepareFileWithDefuse(
485 485
                     'encrypt',
486
-                    $SETTINGS['path_to_files_folder'] . '/' . $filename,
487
-                    $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $filename,
486
+                    $SETTINGS['path_to_files_folder'].'/'.$filename,
487
+                    $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$filename,
488 488
                     $SETTINGS,
489 489
                     $post_option
490 490
                 );
491 491
 
492 492
                 // Do clean
493
-                unlink($SETTINGS['path_to_files_folder'] . '/' . $filename);
493
+                unlink($SETTINGS['path_to_files_folder'].'/'.$filename);
494 494
                 rename(
495
-                    $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $filename,
496
-                    $SETTINGS['path_to_files_folder'] . '/' . $filename
495
+                    $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$filename,
496
+                    $SETTINGS['path_to_files_folder'].'/'.$filename
497 497
                 );
498 498
             }
499 499
 
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
             //update LOG
504 504
             logEvents('admin_action', 'dataBase backup', $_SESSION['user_id'], $_SESSION['login']);
505 505
 
506
-            echo '[{"result":"db_backup" , "href":"sources/downloadFile.php?name=' . urlencode($filename) . '&sub=files&file=' . $filename . '&type=sql&key=' . $_SESSION['key'] . '&key_tmp=' . $_SESSION['key_tmp'] . '&pathIsFiles=1"}]';
506
+            echo '[{"result":"db_backup" , "href":"sources/downloadFile.php?name='.urlencode($filename).'&sub=files&file='.$filename.'&type=sql&key='.$_SESSION['key'].'&key_tmp='.$_SESSION['key_tmp'].'&pathIsFiles=1"}]';
507 507
         }
508 508
         break;
509 509
 
@@ -532,7 +532,7 @@  discard block
 block discarded – undo
532 532
             );
533 533
             break;
534 534
         }
535
-        include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
535
+        include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
536 536
 
537 537
         $dataPost = explode('&', $post_option);
538 538
         $file = htmlspecialchars($dataPost[0]);
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
         // Get filename from database
542 542
         $data = DB::queryFirstRow(
543 543
             'SELECT valeur
544
-            FROM ' . prefixTable('misc') . '
544
+            FROM ' . prefixTable('misc').'
545 545
             WHERE increment_id = %i',
546 546
             $file
547 547
         );
@@ -560,22 +560,22 @@  discard block
 block discarded – undo
560 560
             // Decrypt the file
561 561
             $ret = prepareFileWithDefuse(
562 562
                 'decrypt',
563
-                $SETTINGS['path_to_files_folder'] . '/' . $file,
564
-                $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $file,
563
+                $SETTINGS['path_to_files_folder'].'/'.$file,
564
+                $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$file,
565 565
                 $SETTINGS,
566 566
                 $key
567 567
             );
568 568
 
569 569
             if ($ret !== true) {
570
-                echo '[{"result":"db_restore" , "message":"' . $ret . '"}]';
570
+                echo '[{"result":"db_restore" , "message":"'.$ret.'"}]';
571 571
                 break;
572 572
             }
573 573
 
574 574
             // Do clean
575
-            fileDelete($SETTINGS['path_to_files_folder'] . '/' . $file, $SETTINGS);
576
-            $file = $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $file;
575
+            fileDelete($SETTINGS['path_to_files_folder'].'/'.$file, $SETTINGS);
576
+            $file = $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$file;
577 577
         } else {
578
-            $file = $SETTINGS['path_to_files_folder'] . '/' . $file;
578
+            $file = $SETTINGS['path_to_files_folder'].'/'.$file;
579 579
         }
580 580
 
581 581
         //read sql file
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
         }
594 594
 
595 595
         //delete file
596
-        unlink($SETTINGS['path_to_files_folder'] . '/' . $file);
596
+        unlink($SETTINGS['path_to_files_folder'].'/'.$file);
597 597
 
598 598
         //Show done
599 599
         echo '[{"result":"db_restore" , "message":""}]';
@@ -631,8 +631,8 @@  discard block
 block discarded – undo
631 631
             foreach ($table as $i => $tablename) {
632 632
                 if (substr_count($tablename, DB_PREFIX) > 0) {
633 633
                     // launch optimization quieries
634
-                    DB::query('ANALYZE TABLE `' . $tablename . '`');
635
-                    DB::query('OPTIMIZE TABLE `' . $tablename . '`');
634
+                    DB::query('ANALYZE TABLE `'.$tablename.'`');
635
+                    DB::query('OPTIMIZE TABLE `'.$tablename.'`');
636 636
                 }
637 637
             }
638 638
         }
@@ -640,12 +640,12 @@  discard block
 block discarded – undo
640 640
         //Clean up LOG_ITEMS table
641 641
         $rows = DB::query(
642 642
             'SELECT id
643
-            FROM ' . prefixTable('items') . '
643
+            FROM ' . prefixTable('items').'
644 644
             ORDER BY id ASC'
645 645
         );
646 646
         foreach ($rows as $item) {
647 647
             DB::query(
648
-                'SELECT * FROM ' . prefixTable('log_items') . ' WHERE id_item = %i AND action = %s',
648
+                'SELECT * FROM '.prefixTable('log_items').' WHERE id_item = %i AND action = %s',
649 649
                 $item['id'],
650 650
                 'at_creation'
651 651
             );
@@ -653,7 +653,7 @@  discard block
 block discarded – undo
653 653
             if ($counter == 0) {
654 654
                 //Create new at_creation entry
655 655
                 $rowTmp = DB::queryFirstRow(
656
-                    'SELECT date, id_user FROM ' . prefixTable('log_items') . ' WHERE id_item=%i ORDER BY date ASC',
656
+                    'SELECT date, id_user FROM '.prefixTable('log_items').' WHERE id_item=%i ORDER BY date ASC',
657 657
                     $item['id']
658 658
                 );
659 659
                 DB::insert(
@@ -682,8 +682,8 @@  discard block
 block discarded – undo
682 682
         echo prepareExchangedData(
683 683
             array(
684 684
                 'error' => false,
685
-                'message' => langHdl('last_execution') . ' ' .
686
-                    date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], time()) .
685
+                'message' => langHdl('last_execution').' '.
686
+                    date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], time()).
687 687
                     '<i class="fas fa-check text-success ml-2"></i>',
688 688
             ),
689 689
             'encode'
@@ -717,14 +717,14 @@  discard block
 block discarded – undo
717 717
         }
718 718
 
719 719
         $nbFilesDeleted = 0;
720
-        require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
720
+        require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
721 721
 
722 722
         //read folder
723 723
         if (is_dir($SETTINGS['path_to_files_folder']) === false) {
724 724
             echo prepareExchangedData(
725 725
                 array(
726 726
                     'error' => true,
727
-                    'message' => langHdl('file_folder_not_accessible') . ": " . $SETTINGS['path_to_files_folder'],
727
+                    'message' => langHdl('file_folder_not_accessible').": ".$SETTINGS['path_to_files_folder'],
728 728
                 ),
729 729
                 'encode'
730 730
             );
@@ -736,8 +736,8 @@  discard block
 block discarded – undo
736 736
             //delete file FILES
737 737
             while (false !== ($f = readdir($dir))) {
738 738
                 if ($f != '.' && $f !== '..' && $f !== '.htaccess') {
739
-                    if ((time() - filectime($dir . $f)) > 604800) {
740
-                        fileDelete($SETTINGS['path_to_files_folder'] . '/' . $f, $SETTINGS);
739
+                    if ((time() - filectime($dir.$f)) > 604800) {
740
+                        fileDelete($SETTINGS['path_to_files_folder'].'/'.$f, $SETTINGS);
741 741
                         ++$nbFilesDeleted;
742 742
                     }
743 743
                 }
@@ -752,7 +752,7 @@  discard block
 block discarded – undo
752 752
             echo prepareExchangedData(
753 753
                 array(
754 754
                     'error' => true,
755
-                    'message' => langHdl('file_folder_not_accessible') . ": " . $SETTINGS['path_to_upload_folder'],
755
+                    'message' => langHdl('file_folder_not_accessible').": ".$SETTINGS['path_to_upload_folder'],
756 756
                 ),
757 757
                 'encode'
758 758
             );
@@ -766,7 +766,7 @@  discard block
 block discarded – undo
766 766
             while (false !== ($f = readdir($dir))) {
767 767
                 if ($f != '.' && $f !== '..') {
768 768
                     if (strpos($f, '_delete.') > 0) {
769
-                        fileDelete($SETTINGS['path_to_upload_folder'] . '/' . $f, $SETTINGS);
769
+                        fileDelete($SETTINGS['path_to_upload_folder'].'/'.$f, $SETTINGS);
770 770
                         ++$nbFilesDeleted;
771 771
                     }
772 772
                 }
@@ -788,11 +788,11 @@  discard block
 block discarded – undo
788 788
         echo prepareExchangedData(
789 789
             array(
790 790
                 'error' => false,
791
-                'message' => langHdl('last_execution') . ' ' .
792
-                    date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], time()) .
793
-                    '<i class="fas fa-check text-success ml-2 mr-3"></i>' .
794
-                    '<i class="fas fa-chevron-right mr-2"></i>' .
795
-                    $nbItemsDeleted . ' ' . langHdl('deleted_items'),
791
+                'message' => langHdl('last_execution').' '.
792
+                    date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], time()).
793
+                    '<i class="fas fa-check text-success ml-2 mr-3"></i>'.
794
+                    '<i class="fas fa-chevron-right mr-2"></i>'.
795
+                    $nbItemsDeleted.' '.langHdl('deleted_items'),
796 796
             ),
797 797
             'encode'
798 798
         );
@@ -825,7 +825,7 @@  discard block
 block discarded – undo
825 825
             break;
826 826
         }
827 827
 
828
-        require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
828
+        require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
829 829
         updateCacheTable('reload', $SETTINGS, '');
830 830
 
831 831
         // Log
@@ -840,8 +840,8 @@  discard block
 block discarded – undo
840 840
         echo prepareExchangedData(
841 841
             array(
842 842
                 'error' => false,
843
-                'message' => langHdl('last_execution') . ' ' .
844
-                    date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], time()) .
843
+                'message' => langHdl('last_execution').' '.
844
+                    date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], time()).
845 845
                     '<i class="fas fa-check text-success mr-2"></i>',
846 846
             ),
847 847
             'encode'
@@ -876,7 +876,7 @@  discard block
 block discarded – undo
876 876
         }
877 877
 
878 878
         // Perform
879
-        include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
879
+        include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
880 880
         $ret = handleConfigFile('rebuild', $SETTINGS);
881 881
 
882 882
         // Log
@@ -902,8 +902,8 @@  discard block
 block discarded – undo
902 902
         echo prepareExchangedData(
903 903
             array(
904 904
                 'error' => false,
905
-                'message' => langHdl('last_execution') . ' ' .
906
-                    date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], time()) .
905
+                'message' => langHdl('last_execution').' '.
906
+                    date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], time()).
907 907
                     '<i class="fas fa-check text-success ml-2"></i>',
908 908
             ),
909 909
             'encode'
@@ -942,33 +942,33 @@  discard block
 block discarded – undo
942 942
         $result = '';
943 943
         $filename = $post_option;
944 944
         //get backups infos
945
-        $rows = DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s', 'admin');
945
+        $rows = DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s', 'admin');
946 946
         foreach ($rows as $record) {
947 947
             $tp_settings[$record['intitule']] = $record['valeur'];
948 948
         }
949 949
 
950 950
         // check if backup file is in DB.
951 951
         // If YES then it is encrypted with DEFUSE
952
-        $bck = DB::queryFirstRow('SELECT valeur FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'backup', 'filename');
952
+        $bck = DB::queryFirstRow('SELECT valeur FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'backup', 'filename');
953 953
 
954 954
         //read file
955 955
         $return = '';
956
-        $Fnm = $tp_settings['bck_script_path'] . '/' . $filename . '.sql';
956
+        $Fnm = $tp_settings['bck_script_path'].'/'.$filename.'.sql';
957 957
         if (file_exists($Fnm)) {
958 958
             if (!empty($bck) && $bck['valeur'] === $filename) {
959 959
                 $err = '';
960 960
 
961 961
                 // it means that file is DEFUSE encrypted
962
-                include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/Encryption/Crypto.php';
963
-                include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/Encryption/DerivedKeys.php';
964
-                include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/Encryption/KeyOrPassword.php';
965
-                include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/Encryption/File.php';
966
-                include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/Encryption/Core.php';
962
+                include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/Crypto.php';
963
+                include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/DerivedKeys.php';
964
+                include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/KeyOrPassword.php';
965
+                include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/File.php';
966
+                include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/Core.php';
967 967
 
968 968
                 try {
969 969
                     \Defuse\Crypto\File::decryptFileWithPassword(
970
-                        $SETTINGS['bck_script_path'] . '/' . $post_option . '.sql',
971
-                        $SETTINGS['bck_script_path'] . '/' . str_replace('encrypted', 'clear', $filename) . '.sql',
970
+                        $SETTINGS['bck_script_path'].'/'.$post_option.'.sql',
971
+                        $SETTINGS['bck_script_path'].'/'.str_replace('encrypted', 'clear', $filename).'.sql',
972 972
                         base64_decode($SETTINGS['bck_script_key'])
973 973
                     );
974 974
                 } catch (Defuse\Crypto\Exception\WrongKeyOrModifiedCiphertextException $ex) {
@@ -976,7 +976,7 @@  discard block
 block discarded – undo
976 976
                 }
977 977
 
978 978
                 if (!empty($err)) {
979
-                    echo '[{ "result":"backup_decrypt_fails" , "msg":"' . $err . '"}]';
979
+                    echo '[{ "result":"backup_decrypt_fails" , "msg":"'.$err.'"}]';
980 980
                     break;
981 981
                 }
982 982
             } else {
@@ -998,19 +998,19 @@  discard block
 block discarded – undo
998 998
                 );
999 999
 
1000 1000
                 //save the file
1001
-                $handle = fopen($tp_settings['bck_script_path'] . '/' . $filename . '.clear' . '.sql', 'w+');
1001
+                $handle = fopen($tp_settings['bck_script_path'].'/'.$filename.'.clear'.'.sql', 'w+');
1002 1002
                 if ($handle !== false) {
1003 1003
                     fwrite($handle, $return);
1004 1004
                     fclose($handle);
1005 1005
                 }
1006 1006
             }
1007 1007
             $result = 'backup_decrypt_success';
1008
-            $msg = $tp_settings['bck_script_path'] . '/' . $filename . '.clear' . '.sql';
1008
+            $msg = $tp_settings['bck_script_path'].'/'.$filename.'.clear'.'.sql';
1009 1009
         } else {
1010 1010
             $result = 'backup_decrypt_fails';
1011
-            $msg = 'File not found: ' . $Fnm;
1011
+            $msg = 'File not found: '.$Fnm;
1012 1012
         }
1013
-        echo '[{ "result":"' . $result . '" , "msg":"' . $msg . '"}]';
1013
+        echo '[{ "result":"'.$result.'" , "msg":"'.$msg.'"}]';
1014 1014
         break;
1015 1015
 
1016 1016
         /*
@@ -1044,22 +1044,22 @@  discard block
 block discarded – undo
1044 1044
         require_once 'main.functions.php';
1045 1045
 
1046 1046
         // store old sk
1047
-        $_SESSION['reencrypt_old_salt'] = file_get_contents(SECUREPATH . '/teampass-seckey.txt');
1047
+        $_SESSION['reencrypt_old_salt'] = file_get_contents(SECUREPATH.'/teampass-seckey.txt');
1048 1048
 
1049 1049
         // generate new saltkey
1050
-        $old_sk_filename = SECUREPATH . '/teampass-seckey.txt' . '.' . date('Y_m_d', mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y'))) . '.' . time();
1050
+        $old_sk_filename = SECUREPATH.'/teampass-seckey.txt'.'.'.date('Y_m_d', mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y'))).'.'.time();
1051 1051
         copy(
1052
-            SECUREPATH . '/teampass-seckey.txt',
1052
+            SECUREPATH.'/teampass-seckey.txt',
1053 1053
             $old_sk_filename
1054 1054
         );
1055 1055
         $new_key = defuse_generate_key();
1056 1056
         file_put_contents(
1057
-            SECUREPATH . '/teampass-seckey.txt',
1057
+            SECUREPATH.'/teampass-seckey.txt',
1058 1058
             $new_key
1059 1059
         );
1060 1060
 
1061 1061
         // store new sk
1062
-        $_SESSION['reencrypt_new_salt'] = file_get_contents(SECUREPATH . '/teampass-seckey.txt');
1062
+        $_SESSION['reencrypt_new_salt'] = file_get_contents(SECUREPATH.'/teampass-seckey.txt');
1063 1063
 
1064 1064
         //put tool in maintenance.
1065 1065
         DB::update(
@@ -1075,13 +1075,13 @@  discard block
 block discarded – undo
1075 1075
         logEvents('system', 'change_salt_key', $_SESSION['user_id'], $_SESSION['login']);
1076 1076
 
1077 1077
         // get number of items to change
1078
-        DB::query('SELECT id FROM ' . prefixTable('items') . ' WHERE perso = %i', 0);
1078
+        DB::query('SELECT id FROM '.prefixTable('items').' WHERE perso = %i', 0);
1079 1079
         $nb_of_items = DB::count();
1080 1080
 
1081 1081
         // create backup table
1082
-        DB::query('DROP TABLE IF EXISTS ' . prefixTable('sk_reencrypt_backup'));
1082
+        DB::query('DROP TABLE IF EXISTS '.prefixTable('sk_reencrypt_backup'));
1083 1083
         DB::query(
1084
-            'CREATE TABLE `' . prefixTable('sk_reencrypt_backup') . '` (
1084
+            'CREATE TABLE `'.prefixTable('sk_reencrypt_backup').'` (
1085 1085
             `id` int(12) NOT null AUTO_INCREMENT,
1086 1086
             `current_table` varchar(100) NOT NULL,
1087 1087
             `current_field` varchar(500) NOT NULL,
@@ -1109,7 +1109,7 @@  discard block
 block discarded – undo
1109 1109
         );
1110 1110
 
1111 1111
         // delete previous backup files
1112
-        $files = glob($SETTINGS['path_to_upload_folder'] . '/*'); // get all file names
1112
+        $files = glob($SETTINGS['path_to_upload_folder'].'/*'); // get all file names
1113 1113
         foreach ($files as $file) { // iterate files
1114 1114
             if (is_file($file)) {
1115 1115
                 $file_parts = pathinfo($file);
@@ -1191,7 +1191,7 @@  discard block
 block discarded – undo
1191 1191
                 echo prepareExchangedData(
1192 1192
                     array(
1193 1193
                         'error' => true,
1194
-                        'message' => 'Input `' . $objects[0] . '` is not allowed',
1194
+                        'message' => 'Input `'.$objects[0].'` is not allowed',
1195 1195
                         'nbOfItems' => '',
1196 1196
                         'nextAction' => '',
1197 1197
                     ),
@@ -1204,9 +1204,9 @@  discard block
 block discarded – undo
1204 1204
                 //change all encrypted data in Items (passwords)
1205 1205
                 $rows = DB::query(
1206 1206
                     'SELECT id, pw, pw_iv
1207
-                    FROM ' . prefixTable('items') . '
1207
+                    FROM ' . prefixTable('items').'
1208 1208
                     WHERE perso = %s
1209
-                    LIMIT ' . $post_start . ', ' . $post_length,
1209
+                    LIMIT ' . $post_start.', '.$post_length,
1210 1210
                     '0'
1211 1211
                 );
1212 1212
                 foreach ($rows as $record) {
@@ -1218,7 +1218,7 @@  discard block
 block discarded – undo
1218 1218
                             'current_field' => 'pw',
1219 1219
                             'value_id' => $record['id'],
1220 1220
                             'value' => $record['pw'],
1221
-                            'current_sql' => 'UPDATE ' . prefixTable('items') . " SET pw = '" . $record['pw'] . "' WHERE id = '" . $record['id'] . "';",
1221
+                            'current_sql' => 'UPDATE '.prefixTable('items')." SET pw = '".$record['pw']."' WHERE id = '".$record['id']."';",
1222 1222
                             'value2' => 'none',
1223 1223
                             'result' => 'none',
1224 1224
                         )
@@ -1267,9 +1267,9 @@  discard block
 block discarded – undo
1267 1267
                 //change all encrypted data in Logs (passwords)
1268 1268
                 $rows = DB::query(
1269 1269
                     'SELECT raison, increment_id
1270
-                    FROM ' . prefixTable('log_items') . "
1270
+                    FROM ' . prefixTable('log_items')."
1271 1271
                     WHERE action = %s AND raison LIKE 'at_pw :%'
1272
-                    LIMIT " . $post_start . ', ' . $post_length,
1272
+                    LIMIT " . $post_start.', '.$post_length,
1273 1273
                     'at_modification'
1274 1274
                 );
1275 1275
                 foreach ($rows as $record) {
@@ -1281,7 +1281,7 @@  discard block
 block discarded – undo
1281 1281
                             'current_field' => 'raison',
1282 1282
                             'value_id' => $record['increment_id'],
1283 1283
                             'value' => $record['raison'],
1284
-                            'current_sql' => 'UPDATE ' . prefixTable('log_items') . " SET raison = '" . $record['raison'] . "' WHERE increment_id = '" . $record['increment_id'] . "';",
1284
+                            'current_sql' => 'UPDATE '.prefixTable('log_items')." SET raison = '".$record['raison']."' WHERE increment_id = '".$record['increment_id']."';",
1285 1285
                             'value2' => 'none',
1286 1286
                             'result' => 'none',
1287 1287
                         )
@@ -1309,7 +1309,7 @@  discard block
 block discarded – undo
1309 1309
                         DB::update(
1310 1310
                             prefixTable('log_items'),
1311 1311
                             array(
1312
-                                'raison' => 'at_pw :' . $encrypt['string'],
1312
+                                'raison' => 'at_pw :'.$encrypt['string'],
1313 1313
                                 'encryption_type' => 'defuse',
1314 1314
                             ),
1315 1315
                             'increment_id = %i',
@@ -1334,8 +1334,8 @@  discard block
 block discarded – undo
1334 1334
                 //change all encrypted data in CATEGORIES (passwords)
1335 1335
                 $rows = DB::query(
1336 1336
                     'SELECT id, data
1337
-                    FROM ' . prefixTable('categories_items') . '
1338
-                    LIMIT ' . $post_start . ', ' . $post_length
1337
+                    FROM ' . prefixTable('categories_items').'
1338
+                    LIMIT ' . $post_start.', '.$post_length
1339 1339
                 );
1340 1340
                 foreach ($rows as $record) {
1341 1341
                     // backup data
@@ -1346,7 +1346,7 @@  discard block
 block discarded – undo
1346 1346
                             'current_field' => 'data',
1347 1347
                             'value_id' => $record['id'],
1348 1348
                             'value' => $record['data'],
1349
-                            'current_sql' => 'UPDATE ' . prefixTable('categories_items') . " SET data = '" . $record['data'] . "' WHERE id = '" . $record['id'] . "';",
1349
+                            'current_sql' => 'UPDATE '.prefixTable('categories_items')." SET data = '".$record['data']."' WHERE id = '".$record['id']."';",
1350 1350
                             'value2' => 'none',
1351 1351
                             'result' => 'none',
1352 1352
                         )
@@ -1394,9 +1394,9 @@  discard block
 block discarded – undo
1394 1394
                 // Change all encrypted data in FILES (passwords)
1395 1395
                 $rows = DB::query(
1396 1396
                     'SELECT id, file, status
1397
-                    FROM ' . prefixTable('files') . "
1397
+                    FROM ' . prefixTable('files')."
1398 1398
                     WHERE status = 'encrypted'
1399
-                    LIMIT " . $post_start . ', ' . $post_length
1399
+                    LIMIT " . $post_start.', '.$post_length
1400 1400
                 );
1401 1401
                 foreach ($rows as $record) {
1402 1402
                     // backup data
@@ -1414,20 +1414,20 @@  discard block
 block discarded – undo
1414 1414
                     );
1415 1415
                     $newID = DB::insertId();
1416 1416
 
1417
-                    if (file_exists($SETTINGS['path_to_upload_folder'] . '/' . $record['file'])) {
1417
+                    if (file_exists($SETTINGS['path_to_upload_folder'].'/'.$record['file'])) {
1418 1418
                         // make a copy of file
1419 1419
                         if (!copy(
1420
-                            $SETTINGS['path_to_upload_folder'] . '/' . $record['file'],
1421
-                            $SETTINGS['path_to_upload_folder'] . '/' . $record['file'] . '.copy'
1420
+                            $SETTINGS['path_to_upload_folder'].'/'.$record['file'],
1421
+                            $SETTINGS['path_to_upload_folder'].'/'.$record['file'].'.copy'
1422 1422
                         )) {
1423 1423
                             $error = 'Copy not possible';
1424 1424
                             exit;
1425 1425
                         } else {
1426 1426
                             // prepare a bck of file (that will not be deleted)
1427
-                            $backup_filename = $record['file'] . '.bck-change-sk.' . time();
1427
+                            $backup_filename = $record['file'].'.bck-change-sk.'.time();
1428 1428
                             copy(
1429
-                                $SETTINGS['path_to_upload_folder'] . '/' . $record['file'],
1430
-                                $SETTINGS['path_to_upload_folder'] . '/' . $backup_filename
1429
+                                $SETTINGS['path_to_upload_folder'].'/'.$record['file'],
1430
+                                $SETTINGS['path_to_upload_folder'].'/'.$backup_filename
1431 1431
                             );
1432 1432
                         }
1433 1433
 
@@ -1435,24 +1435,24 @@  discard block
 block discarded – undo
1435 1435
                         // STEP1 - Do decryption
1436 1436
                         prepareFileWithDefuse(
1437 1437
                             'decrypt',
1438
-                            $SETTINGS['path_to_upload_folder'] . '/' . $record['file'],
1439
-                            $SETTINGS['path_to_upload_folder'] . '/' . $record['file'] . '_encrypted',
1438
+                            $SETTINGS['path_to_upload_folder'].'/'.$record['file'],
1439
+                            $SETTINGS['path_to_upload_folder'].'/'.$record['file'].'_encrypted',
1440 1440
                             $SETTINGS
1441 1441
                         );
1442 1442
 
1443 1443
                         // Do cleanup of files
1444
-                        unlink($SETTINGS['path_to_upload_folder'] . '/' . $record['file']);
1444
+                        unlink($SETTINGS['path_to_upload_folder'].'/'.$record['file']);
1445 1445
 
1446 1446
                         // STEP2 - Do encryption
1447 1447
                         prepareFileWithDefuse(
1448 1448
                             'encryp',
1449
-                            $SETTINGS['path_to_upload_folder'] . '/' . $record['file'] . '_encrypted',
1450
-                            $SETTINGS['path_to_upload_folder'] . '/' . $record['file'],
1449
+                            $SETTINGS['path_to_upload_folder'].'/'.$record['file'].'_encrypted',
1450
+                            $SETTINGS['path_to_upload_folder'].'/'.$record['file'],
1451 1451
                             $SETTINGS
1452 1452
                         );
1453 1453
 
1454 1454
                         // Do cleanup of files
1455
-                        unlink($SETTINGS['path_to_upload_folder'] . '/' . $record['file'] . '_encrypted');
1455
+                        unlink($SETTINGS['path_to_upload_folder'].'/'.$record['file'].'_encrypted');
1456 1456
 
1457 1457
                         // Update backup table
1458 1458
                         DB::update(
@@ -1478,13 +1478,13 @@  discard block
 block discarded – undo
1478 1478
                 // do some things for new object
1479 1479
                 if (isset($objects[0])) {
1480 1480
                     if ($objects[0] === 'logs') {
1481
-                        DB::query('SELECT increment_id FROM ' . prefixTable('log_items') . " WHERE action = %s AND raison LIKE 'at_pw :%'", 'at_modification');
1481
+                        DB::query('SELECT increment_id FROM '.prefixTable('log_items')." WHERE action = %s AND raison LIKE 'at_pw :%'", 'at_modification');
1482 1482
                     } elseif ($objects[0] === 'files') {
1483
-                        DB::query('SELECT id FROM ' . prefixTable('files'));
1483
+                        DB::query('SELECT id FROM '.prefixTable('files'));
1484 1484
                     } elseif ($objects[0] === 'categories') {
1485
-                        DB::query('SELECT id FROM ' . prefixTable('categories_items'));
1485
+                        DB::query('SELECT id FROM '.prefixTable('categories_items'));
1486 1486
                     } elseif ($objects[0] === 'custfields') {
1487
-                        DB::query('SELECT raison FROM ' . prefixTable('log_items') . " WHERE action = %s AND raison LIKE 'at_pw :%'", 'at_modification');
1487
+                        DB::query('SELECT raison FROM '.prefixTable('log_items')." WHERE action = %s AND raison LIKE 'at_pw :%'", 'at_modification');
1488 1488
                     }
1489 1489
                     $nb_of_items = DB::count();
1490 1490
                 } else {
@@ -1603,12 +1603,12 @@  discard block
 block discarded – undo
1603 1603
                 );
1604 1604
             } elseif ($record['current_table'] === 'files') {
1605 1605
                 // restore backup file
1606
-                if (file_exists($SETTINGS['path_to_upload_folder'] . '/' . $record['value'])) {
1607
-                    unlink($SETTINGS['path_to_upload_folder'] . '/' . $record['value']);
1608
-                    if (file_exists($SETTINGS['path_to_upload_folder'] . '/' . $record['value2'])) {
1606
+                if (file_exists($SETTINGS['path_to_upload_folder'].'/'.$record['value'])) {
1607
+                    unlink($SETTINGS['path_to_upload_folder'].'/'.$record['value']);
1608
+                    if (file_exists($SETTINGS['path_to_upload_folder'].'/'.$record['value2'])) {
1609 1609
                         rename(
1610
-                            $SETTINGS['path_to_upload_folder'] . '/' . $record['value2'],
1611
-                            $SETTINGS['path_to_upload_folder'] . '/' . $record['value']
1610
+                            $SETTINGS['path_to_upload_folder'].'/'.$record['value2'],
1611
+                            $SETTINGS['path_to_upload_folder'].'/'.$record['value']
1612 1612
                         );
1613 1613
                     }
1614 1614
                 }
@@ -1619,15 +1619,15 @@  discard block
 block discarded – undo
1619 1619
 
1620 1620
         // restore saltkey file
1621 1621
         if (file_exists($previous_saltkey_filename)) {
1622
-            unlink(SECUREPATH . '/teampass-seckey.txt');
1622
+            unlink(SECUREPATH.'/teampass-seckey.txt');
1623 1623
             rename(
1624 1624
                 $previous_saltkey_filename,
1625
-                SECUREPATH . '/teampass-seckey.txt'
1625
+                SECUREPATH.'/teampass-seckey.txt'
1626 1626
             );
1627 1627
         }
1628 1628
 
1629 1629
         // drop table
1630
-        DB::query('DROP TABLE IF EXISTS ' . prefixTable('sk_reencrypt_backup'));
1630
+        DB::query('DROP TABLE IF EXISTS '.prefixTable('sk_reencrypt_backup'));
1631 1631
 
1632 1632
         // Send back
1633 1633
         echo prepareExchangedData(
@@ -1670,17 +1670,17 @@  discard block
 block discarded – undo
1670 1670
         // delete files
1671 1671
         $rows = DB::query(
1672 1672
             'SELECT value, value2
1673
-            FROM ' . prefixTable('sk_reencrypt_backup') . "
1673
+            FROM ' . prefixTable('sk_reencrypt_backup')."
1674 1674
             WHERE current_table = 'files'"
1675 1675
         );
1676 1676
         foreach ($rows as $record) {
1677
-            if (file_exists($SETTINGS['path_to_upload_folder'] . '/' . $record['value2'])) {
1678
-                unlink($SETTINGS['path_to_upload_folder'] . '/' . $record['value2']);
1677
+            if (file_exists($SETTINGS['path_to_upload_folder'].'/'.$record['value2'])) {
1678
+                unlink($SETTINGS['path_to_upload_folder'].'/'.$record['value2']);
1679 1679
             }
1680 1680
         }
1681 1681
 
1682 1682
         // drop table
1683
-        DB::query('DROP TABLE IF EXISTS ' . prefixTable('sk_reencrypt_backup'));
1683
+        DB::query('DROP TABLE IF EXISTS '.prefixTable('sk_reencrypt_backup'));
1684 1684
 
1685 1685
         echo '[{"status":"done"}]';
1686 1686
         break;
@@ -1712,7 +1712,7 @@  discard block
 block discarded – undo
1712 1712
             );
1713 1713
             break;
1714 1714
         } else {
1715
-            require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
1715
+            require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
1716 1716
 
1717 1717
             //send email
1718 1718
             $ret = json_decode(
@@ -1751,11 +1751,11 @@  discard block
 block discarded – undo
1751 1751
             break;
1752 1752
         }
1753 1753
 
1754
-        include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
1754
+        include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
1755 1755
 
1756 1756
         $rows = DB::query(
1757 1757
             'SELECT *
1758
-            FROM ' . prefixTable('emails') . '
1758
+            FROM ' . prefixTable('emails').'
1759 1759
             WHERE status = %s OR status = %s',
1760 1760
             'not_sent',
1761 1761
             ''
@@ -1839,9 +1839,9 @@  discard block
 block discarded – undo
1839 1839
             break;
1840 1840
         }
1841 1841
 
1842
-        include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
1842
+        include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
1843 1843
 
1844
-        $rows = DB::query('SELECT * FROM ' . prefixTable('emails') . ' WHERE status = %s OR status = %s', 'not_sent', '');
1844
+        $rows = DB::query('SELECT * FROM '.prefixTable('emails').' WHERE status = %s OR status = %s', 'not_sent', '');
1845 1845
         foreach ($rows as $record) {
1846 1846
             //send email
1847 1847
             $ret = json_decode(
@@ -1909,7 +1909,7 @@  discard block
 block discarded – undo
1909 1909
             break;
1910 1910
         }
1911 1911
 
1912
-        require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
1912
+        require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
1913 1913
 
1914 1914
         // init
1915 1915
         $filesList = array();
@@ -1922,7 +1922,7 @@  discard block
 block discarded – undo
1922 1922
                 FROM ' . prefixTable('files')
1923 1923
             );
1924 1924
             foreach ($rows as $record) {
1925
-                if (is_file($SETTINGS['path_to_upload_folder'] . '/' . $record['file'])) {
1925
+                if (is_file($SETTINGS['path_to_upload_folder'].'/'.$record['file'])) {
1926 1926
                     $addFile = false;
1927 1927
                     if (($post_option === 'attachments-decrypt' && $record['status'] === 'encrypted')
1928 1928
                         || ($post_option === 'attachments-encrypt' && $record['status'] === 'clear')
@@ -1987,8 +1987,8 @@  discard block
 block discarded – undo
1987 1987
         $post_list = filter_var_array($post_list, FILTER_SANITIZE_STRING);
1988 1988
         $post_counter = filter_var($post_counter, FILTER_SANITIZE_NUMBER_INT);
1989 1989
 
1990
-        include $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
1991
-        include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
1990
+        include $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
1991
+        include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
1992 1992
 
1993 1993
         $cpt = 0;
1994 1994
         $continu = true;
@@ -1997,18 +1997,18 @@  discard block
 block discarded – undo
1997 1997
         $message = '';
1998 1998
 
1999 1999
         // load PhpEncryption library
2000
-        include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/Encryption/' . 'Crypto.php';
2001
-        include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/Encryption/' . 'Encoding.php';
2002
-        include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/Encryption/' . 'DerivedKeys.php';
2003
-        include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/Encryption/' . 'Key.php';
2004
-        include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/Encryption/' . 'KeyOrPassword.php';
2005
-        include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/Encryption/' . 'File.php';
2006
-        include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/Encryption/' . 'RuntimeTests.php';
2007
-        include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/Encryption/' . 'KeyProtectedByPassword.php';
2008
-        include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/Encryption/' . 'Core.php';
2000
+        include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/'.'Crypto.php';
2001
+        include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/'.'Encoding.php';
2002
+        include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/'.'DerivedKeys.php';
2003
+        include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/'.'Key.php';
2004
+        include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/'.'KeyOrPassword.php';
2005
+        include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/'.'File.php';
2006
+        include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/'.'RuntimeTests.php';
2007
+        include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/'.'KeyProtectedByPassword.php';
2008
+        include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/'.'Core.php';
2009 2009
 
2010 2010
         // Get KEY
2011
-        $ascii_key = file_get_contents(SECUREPATH . '/teampass-seckey.txt');
2011
+        $ascii_key = file_get_contents(SECUREPATH.'/teampass-seckey.txt');
2012 2012
 
2013 2013
         // treat 10 files
2014 2014
         foreach ($post_list as $file) {
@@ -2016,35 +2016,35 @@  discard block
 block discarded – undo
2016 2016
                 // Get file name
2017 2017
                 $file_info = DB::queryfirstrow(
2018 2018
                     'SELECT file
2019
-                    FROM ' . prefixTable('files') . '
2019
+                    FROM ' . prefixTable('files').'
2020 2020
                     WHERE id = %i',
2021 2021
                     $file
2022 2022
                 );
2023 2023
 
2024 2024
                 // skip file is Coherancey not respected
2025
-                if (is_file($SETTINGS['path_to_upload_folder'] . '/' . $file_info['file'])) {
2025
+                if (is_file($SETTINGS['path_to_upload_folder'].'/'.$file_info['file'])) {
2026 2026
                     // Case where we want to decrypt
2027 2027
                     if ($post_option === 'decrypt') {
2028 2028
                         prepareFileWithDefuse(
2029 2029
                             'decrypt',
2030
-                            $SETTINGS['path_to_upload_folder'] . '/' . $file_info['file'],
2031
-                            $SETTINGS['path_to_upload_folder'] . '/defuse_temp_' . $file_info['file'],
2030
+                            $SETTINGS['path_to_upload_folder'].'/'.$file_info['file'],
2031
+                            $SETTINGS['path_to_upload_folder'].'/defuse_temp_'.$file_info['file'],
2032 2032
                             $SETTINGS
2033 2033
                         );
2034 2034
                         // Case where we want to encrypt
2035 2035
                     } elseif ($post_option === 'encrypt') {
2036 2036
                         prepareFileWithDefuse(
2037 2037
                             'encrypt',
2038
-                            $SETTINGS['path_to_upload_folder'] . '/' . $file_info['file'],
2039
-                            $SETTINGS['path_to_upload_folder'] . '/defuse_temp_' . $file_info['file'],
2038
+                            $SETTINGS['path_to_upload_folder'].'/'.$file_info['file'],
2039
+                            $SETTINGS['path_to_upload_folder'].'/defuse_temp_'.$file_info['file'],
2040 2040
                             $SETTINGS
2041 2041
                         );
2042 2042
                     }
2043 2043
                     // Do file cleanup
2044
-                    fileDelete($SETTINGS['path_to_upload_folder'] . '/' . $file_info['file'], $SETTINGS);
2044
+                    fileDelete($SETTINGS['path_to_upload_folder'].'/'.$file_info['file'], $SETTINGS);
2045 2045
                     rename(
2046
-                        $SETTINGS['path_to_upload_folder'] . '/defuse_temp_' . $file_info['file'],
2047
-                        $SETTINGS['path_to_upload_folder'] . '/' . $file_info['file']
2046
+                        $SETTINGS['path_to_upload_folder'].'/defuse_temp_'.$file_info['file'],
2047
+                        $SETTINGS['path_to_upload_folder'].'/'.$file_info['file']
2048 2048
                     );
2049 2049
 
2050 2050
                     // store in DB
@@ -2078,8 +2078,8 @@  discard block
 block discarded – undo
2078 2078
                 $post_option === 'attachments-decrypt' ? 'clear' : 'encrypted'
2079 2079
             );
2080 2080
 
2081
-            $message = langHdl('last_execution') . ' ' .
2082
-                date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], time()) .
2081
+            $message = langHdl('last_execution').' '.
2082
+                date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], time()).
2083 2083
                 '<i class="fas fa-check text-success ml-2 mr-3"></i>';
2084 2084
         }
2085 2085
 
@@ -2166,7 +2166,7 @@  discard block
 block discarded – undo
2166 2166
             $post_id = filter_var($dataReceived['id'], FILTER_SANITIZE_STRING);
2167 2167
 
2168 2168
             DB::query(
2169
-                'DELETE FROM ' . prefixTable('api') . ' WHERE id = %i',
2169
+                'DELETE FROM '.prefixTable('api').' WHERE id = %i',
2170 2170
                 $post_id
2171 2171
             );
2172 2172
         }
@@ -2258,7 +2258,7 @@  discard block
 block discarded – undo
2258 2258
             // Delete existing key
2259 2259
         } elseif (null !== $post_action && $post_action === 'delete') {
2260 2260
             $post_id = filter_var($dataReceived['id'], FILTER_SANITIZE_STRING);
2261
-            DB::query('DELETE FROM ' . prefixTable('api') . ' WHERE id=%i', $post_id);
2261
+            DB::query('DELETE FROM '.prefixTable('api').' WHERE id=%i', $post_id);
2262 2262
         }
2263 2263
 
2264 2264
         echo prepareExchangedData(
@@ -2273,7 +2273,7 @@  discard block
 block discarded – undo
2273 2273
 
2274 2274
     case 'save_api_status':
2275 2275
         // Do query
2276
-        DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'api');
2276
+        DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'api');
2277 2277
         $counter = DB::count();
2278 2278
         if ($counter == 0) {
2279 2279
             DB::insert(
@@ -2299,7 +2299,7 @@  discard block
 block discarded – undo
2299 2299
         break;
2300 2300
 
2301 2301
     case 'save_duo_status':
2302
-        DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'duo');
2302
+        DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'duo');
2303 2303
         $counter = DB::count();
2304 2304
         if ($counter == 0) {
2305 2305
             DB::insert(
@@ -2342,7 +2342,7 @@  discard block
 block discarded – undo
2342 2342
         foreach ($dataReceived as $key => $value) {
2343 2343
             DB::query(
2344 2344
                 'SELECT * 
2345
-                FROM ' . prefixTable('misc') . '
2345
+                FROM ' . prefixTable('misc').'
2346 2346
                 WHERE type = %s AND intitule = %s',
2347 2347
                 'admin',
2348 2348
                 $key
@@ -2410,7 +2410,7 @@  discard block
 block discarded – undo
2410 2410
         } else {
2411 2411
             $tmp = 1;
2412 2412
         }
2413
-        DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'google_authentication');
2413
+        DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'google_authentication');
2414 2414
         $counter = DB::count();
2415 2415
         if ($counter == 0) {
2416 2416
             DB::insert(
@@ -2436,7 +2436,7 @@  discard block
 block discarded – undo
2436 2436
 
2437 2437
         // ga_website_name
2438 2438
         if (is_null($dataReceived['ga_website_name']) === false) {
2439
-            DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'ga_website_name');
2439
+            DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'ga_website_name');
2440 2440
             $counter = DB::count();
2441 2441
             if ($counter == 0) {
2442 2442
                 DB::insert(
@@ -2467,7 +2467,7 @@  discard block
 block discarded – undo
2467 2467
         }
2468 2468
 
2469 2469
         // send data
2470
-        echo '[{"result" : "' . addslashes($LANG['done']) . '" , "error" : ""}]';
2470
+        echo '[{"result" : "'.addslashes($LANG['done']).'" , "error" : ""}]';
2471 2471
         break;
2472 2472
 
2473 2473
     case 'save_agses_options':
@@ -2490,7 +2490,7 @@  discard block
 block discarded – undo
2490 2490
 
2491 2491
         // agses_hosted_url
2492 2492
         if (!is_null($dataReceived['agses_hosted_url'])) {
2493
-            DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_url');
2493
+            DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_url');
2494 2494
             $counter = DB::count();
2495 2495
             if ($counter == 0) {
2496 2496
                 DB::insert(
@@ -2519,7 +2519,7 @@  discard block
 block discarded – undo
2519 2519
 
2520 2520
         // agses_hosted_id
2521 2521
         if (!is_null($dataReceived['agses_hosted_id'])) {
2522
-            DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_id');
2522
+            DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_id');
2523 2523
             $counter = DB::count();
2524 2524
             if ($counter == 0) {
2525 2525
                 DB::insert(
@@ -2548,7 +2548,7 @@  discard block
 block discarded – undo
2548 2548
 
2549 2549
         // agses_hosted_apikey
2550 2550
         if (!is_null($dataReceived['agses_hosted_apikey'])) {
2551
-            DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_apikey');
2551
+            DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_apikey');
2552 2552
             $counter = DB::count();
2553 2553
             if ($counter == 0) {
2554 2554
                 DB::insert(
@@ -2576,7 +2576,7 @@  discard block
 block discarded – undo
2576 2576
         }
2577 2577
 
2578 2578
         // send data
2579
-        echo '[{"result" : "' . addslashes($LANG['done']) . '" , "error" : ""}]';
2579
+        echo '[{"result" : "'.addslashes($LANG['done']).'" , "error" : ""}]';
2580 2580
         break;
2581 2581
 
2582 2582
     case 'save_option_change':
@@ -2612,7 +2612,7 @@  discard block
 block discarded – undo
2612 2612
 
2613 2613
         // Check if setting is already in DB. If NO then insert, if YES then update.
2614 2614
         $data = DB::query(
2615
-            'SELECT * FROM ' . prefixTable('misc') . '
2615
+            'SELECT * FROM '.prefixTable('misc').'
2616 2616
             WHERE type = %s AND intitule = %s',
2617 2617
             $type,
2618 2618
             $dataReceived['field']
@@ -2634,7 +2634,7 @@  discard block
 block discarded – undo
2634 2634
                     array(
2635 2635
                         'valeur' => time(),
2636 2636
                         'type' => $type,
2637
-                        'intitule' => $dataReceived['field'] . '_time',
2637
+                        'intitule' => $dataReceived['field'].'_time',
2638 2638
                     )
2639 2639
                 );
2640 2640
             }
@@ -2652,10 +2652,10 @@  discard block
 block discarded – undo
2652 2652
             if ($dataReceived['field'] === 'send_stats') {
2653 2653
                 // Check if previous time exists, if not them insert this value in DB
2654 2654
                 $data_time = DB::query(
2655
-                    'SELECT * FROM ' . prefixTable('misc') . '
2655
+                    'SELECT * FROM '.prefixTable('misc').'
2656 2656
                     WHERE type = %s AND intitule = %s',
2657 2657
                     $type,
2658
-                    $dataReceived['field'] . '_time'
2658
+                    $dataReceived['field'].'_time'
2659 2659
                 );
2660 2660
                 $counter = DB::count();
2661 2661
                 if ($counter === 0) {
@@ -2664,7 +2664,7 @@  discard block
 block discarded – undo
2664 2664
                         array(
2665 2665
                             'valeur' => 0,
2666 2666
                             'type' => $type,
2667
-                            'intitule' => $dataReceived['field'] . '_time',
2667
+                            'intitule' => $dataReceived['field'].'_time',
2668 2668
                         )
2669 2669
                     );
2670 2670
                 } else {
@@ -2684,13 +2684,13 @@  discard block
 block discarded – undo
2684 2684
         // special Cases
2685 2685
         if ($dataReceived['field'] === 'cpassman_url') {
2686 2686
             // update also jsUrl for CSFP protection
2687
-            $jsUrl = $dataReceived['value'] . '/includes/libraries/csrfp/js/csrfprotector.js';
2687
+            $jsUrl = $dataReceived['value'].'/includes/libraries/csrfp/js/csrfprotector.js';
2688 2688
             $csrfp_file = '../includes/libraries/csrfp/libs/csrfp.config.php';
2689 2689
             $data = file_get_contents($csrfp_file);
2690 2690
             $posJsUrl = strpos($data, '"jsUrl" => "');
2691 2691
             $posEndLine = strpos($data, '",', $posJsUrl);
2692 2692
             $line = substr($data, $posJsUrl, ($posEndLine - $posJsUrl + 2));
2693
-            $newdata = str_replace($line, '"jsUrl" => "' . filter_var($jsUrl, FILTER_SANITIZE_STRING) . '",', $data);
2693
+            $newdata = str_replace($line, '"jsUrl" => "'.filter_var($jsUrl, FILTER_SANITIZE_STRING).'",', $data);
2694 2694
             file_put_contents($csrfp_file, $newdata);
2695 2695
         } elseif ($dataReceived['field'] === 'restricted_to_input' && $dataReceived['value'] === '0') {
2696 2696
             DB::update(
@@ -2714,7 +2714,7 @@  discard block
 block discarded – undo
2714 2714
         echo prepareExchangedData(
2715 2715
             array(
2716 2716
                 'error' => false,
2717
-                'misc' => $counter . ' ; ' . $SETTINGS[$dataReceived['field']],
2717
+                'misc' => $counter.' ; '.$SETTINGS[$dataReceived['field']],
2718 2718
             ),
2719 2719
             'encode'
2720 2720
         );
@@ -2756,7 +2756,7 @@  discard block
 block discarded – undo
2756 2756
 
2757 2757
         // send statistics
2758 2758
         if (null !== $post_status) {
2759
-            DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'send_stats');
2759
+            DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'send_stats');
2760 2760
             $counter = DB::count();
2761 2761
             if ($counter == 0) {
2762 2762
                 DB::insert(
@@ -2788,7 +2788,7 @@  discard block
 block discarded – undo
2788 2788
 
2789 2789
         // send statistics items
2790 2790
         if (null !== $post_list) {
2791
-            DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'send_statistics_items');
2791
+            DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'send_statistics_items');
2792 2792
             $counter = DB::count();
2793 2793
             if ($counter == 0) {
2794 2794
                 DB::insert(
@@ -2835,7 +2835,7 @@  discard block
 block discarded – undo
2835 2835
             break;
2836 2836
         }
2837 2837
 
2838
-        if ($result = DB::query("SHOW TABLES LIKE '" . prefixTable('sk_reencrypt_backup') . "'")) {
2838
+        if ($result = DB::query("SHOW TABLES LIKE '".prefixTable('sk_reencrypt_backup')."'")) {
2839 2839
             if (DB::count() === 1) {
2840 2840
                 echo '1';
2841 2841
             } else {
@@ -2873,7 +2873,7 @@  discard block
 block discarded – undo
2873 2873
 
2874 2874
         $rows = DB::query(
2875 2875
             'SELECT id, title
2876
-                FROM ' . prefixTable('roles_title') . '
2876
+                FROM ' . prefixTable('roles_title').'
2877 2877
                 ORDER BY title ASC'
2878 2878
         );
2879 2879
         foreach ($rows as $record) {
Please login to merge, or discard this patch.
sources/main.functions.php 1 patch
Spacing   +190 added lines, -190 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
     $var_dk = ''; // Derived key
86 86
 
87 87
     for ($block = 1; $block <= $var_kb; ++$block) { // Create key
88
-        $var_ib = $var_h = hash_hmac($var_a, $var_s . pack('N', $block), $var_p, true); // Initial hash for this block
88
+        $var_ib = $var_h = hash_hmac($var_a, $var_s.pack('N', $block), $var_p, true); // Initial hash for this block
89 89
         for ($var_i = 1; $var_i < $var_c; ++$var_i) { // Perform block iterations
90 90
             $var_ib ^= ($var_h = hash_hmac($var_a, $var_h, $var_p, true)); // XOR each iterate
91 91
         }
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
     if (!isset($SETTINGS['cpassman_dir']) || empty($SETTINGS['cpassman_dir'])) {
200 200
         require_once '../includes/libraries/Encryption/PBKDF2/PasswordHash.php';
201 201
     } else {
202
-        require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/PBKDF2/PasswordHash.php';
202
+        require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/PBKDF2/PasswordHash.php';
203 203
     }
204 204
 
205 205
     if (!empty($personalSalt)) {
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
     // MAC the encrypted text
227 227
     $mac = hash_hmac('sha256', $encrypted, $staticSalt);
228 228
     // We're done!
229
-    return base64_encode($ivBase64 . $encrypted . $mac . $pbkdf2Salt);
229
+    return base64_encode($ivBase64.$encrypted.$mac.$pbkdf2Salt);
230 230
 }
231 231
 
232 232
 /**
@@ -241,13 +241,13 @@  discard block
 block discarded – undo
241 241
     if (!isset($SETTINGS['cpassman_dir']) || empty($SETTINGS['cpassman_dir'])) {
242 242
         include_once '../includes/libraries/Encryption/PBKDF2/PasswordHash.php';
243 243
     } else {
244
-        include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/PBKDF2/PasswordHash.php';
244
+        include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/PBKDF2/PasswordHash.php';
245 245
     }
246 246
 
247 247
     if (!empty($personalSalt)) {
248 248
         $staticSalt = $personalSalt;
249 249
     } else {
250
-        $staticSalt = file_get_contents(SECUREPATH . '/teampass-seckey.txt');
250
+        $staticSalt = file_get_contents(SECUREPATH.'/teampass-seckey.txt');
251 251
     }
252 252
     //base64 decode the entire payload
253 253
     $encrypted = base64_decode($encrypted);
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
     $encrypted = substr($encrypted, 0, -64);
258 258
     $key = substr(pbkdf2('sha256', $staticSalt, $pbkdf2Salt, ITCOUNT, 16 + 32, true), 32, 16);
259 259
     // Retrieve $init_vect which is the first 22 characters plus ==, base64_decoded.
260
-    $init_vect = base64_decode(substr($encrypted, 0, 43) . '==');
260
+    $init_vect = base64_decode(substr($encrypted, 0, 43).'==');
261 261
     // Remove $init_vect from $encrypted.
262 262
     $encrypted = substr($encrypted, 43);
263 263
     // Retrieve $mac which is the last 64 characters of $encrypted.
@@ -321,23 +321,23 @@  discard block
 block discarded – undo
321 321
     if (isset($SETTINGS['cpassman_dir']) === false || empty($SETTINGS['cpassman_dir']) === true) {
322 322
         $path = '../includes/libraries/Encryption/Encryption/';
323 323
     } else {
324
-        $path = $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/Encryption/';
324
+        $path = $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/';
325 325
     }
326 326
 
327
-    include_once $path . 'Crypto.php';
328
-    include_once $path . 'Encoding.php';
329
-    include_once $path . 'DerivedKeys.php';
330
-    include_once $path . 'Key.php';
331
-    include_once $path . 'KeyOrPassword.php';
332
-    include_once $path . 'File.php';
333
-    include_once $path . 'RuntimeTests.php';
334
-    include_once $path . 'KeyProtectedByPassword.php';
335
-    include_once $path . 'Core.php';
327
+    include_once $path.'Crypto.php';
328
+    include_once $path.'Encoding.php';
329
+    include_once $path.'DerivedKeys.php';
330
+    include_once $path.'Key.php';
331
+    include_once $path.'KeyOrPassword.php';
332
+    include_once $path.'File.php';
333
+    include_once $path.'RuntimeTests.php';
334
+    include_once $path.'KeyProtectedByPassword.php';
335
+    include_once $path.'Core.php';
336 336
 
337 337
     // init
338 338
     $err = '';
339 339
     if (empty($ascii_key) === true) {
340
-        $ascii_key = file_get_contents(SECUREPATH . '/teampass-seckey.txt');
340
+        $ascii_key = file_get_contents(SECUREPATH.'/teampass-seckey.txt');
341 341
     }
342 342
 
343 343
     //echo $path.' -- '.$message.' ;; '.$ascii_key.' --- ';
@@ -385,15 +385,15 @@  discard block
 block discarded – undo
385 385
         $path = '../includes/libraries/Encryption/Encryption/';
386 386
     }
387 387
 
388
-    include_once $path . 'Crypto.php';
389
-    include_once $path . 'Encoding.php';
390
-    include_once $path . 'DerivedKeys.php';
391
-    include_once $path . 'Key.php';
392
-    include_once $path . 'KeyOrPassword.php';
393
-    include_once $path . 'File.php';
394
-    include_once $path . 'RuntimeTests.php';
395
-    include_once $path . 'KeyProtectedByPassword.php';
396
-    include_once $path . 'Core.php';
388
+    include_once $path.'Crypto.php';
389
+    include_once $path.'Encoding.php';
390
+    include_once $path.'DerivedKeys.php';
391
+    include_once $path.'Key.php';
392
+    include_once $path.'KeyOrPassword.php';
393
+    include_once $path.'File.php';
394
+    include_once $path.'RuntimeTests.php';
395
+    include_once $path.'KeyProtectedByPassword.php';
396
+    include_once $path.'Core.php';
397 397
 
398 398
     $key = \Defuse\Crypto\Key::createNewRandomKey();
399 399
     $key = $key->saveToAsciiSafeString();
@@ -419,15 +419,15 @@  discard block
 block discarded – undo
419 419
         $path = '../includes/libraries/Encryption/Encryption/';
420 420
     }
421 421
 
422
-    include_once $path . 'Crypto.php';
423
-    include_once $path . 'Encoding.php';
424
-    include_once $path . 'DerivedKeys.php';
425
-    include_once $path . 'Key.php';
426
-    include_once $path . 'KeyOrPassword.php';
427
-    include_once $path . 'File.php';
428
-    include_once $path . 'RuntimeTests.php';
429
-    include_once $path . 'KeyProtectedByPassword.php';
430
-    include_once $path . 'Core.php';
422
+    include_once $path.'Crypto.php';
423
+    include_once $path.'Encoding.php';
424
+    include_once $path.'DerivedKeys.php';
425
+    include_once $path.'Key.php';
426
+    include_once $path.'KeyOrPassword.php';
427
+    include_once $path.'File.php';
428
+    include_once $path.'RuntimeTests.php';
429
+    include_once $path.'KeyProtectedByPassword.php';
430
+    include_once $path.'Core.php';
431 431
 
432 432
     $protected_key = \Defuse\Crypto\KeyProtectedByPassword::createRandomPasswordProtectedKey($psk);
433 433
     $protected_key_encoded = $protected_key->saveToAsciiSafeString();
@@ -454,15 +454,15 @@  discard block
 block discarded – undo
454 454
         $path = '../includes/libraries/Encryption/Encryption/';
455 455
     }
456 456
 
457
-    include_once $path . 'Crypto.php';
458
-    include_once $path . 'Encoding.php';
459
-    include_once $path . 'DerivedKeys.php';
460
-    include_once $path . 'Key.php';
461
-    include_once $path . 'KeyOrPassword.php';
462
-    include_once $path . 'File.php';
463
-    include_once $path . 'RuntimeTests.php';
464
-    include_once $path . 'KeyProtectedByPassword.php';
465
-    include_once $path . 'Core.php';
457
+    include_once $path.'Crypto.php';
458
+    include_once $path.'Encoding.php';
459
+    include_once $path.'DerivedKeys.php';
460
+    include_once $path.'Key.php';
461
+    include_once $path.'KeyOrPassword.php';
462
+    include_once $path.'File.php';
463
+    include_once $path.'RuntimeTests.php';
464
+    include_once $path.'KeyProtectedByPassword.php';
465
+    include_once $path.'Core.php';
466 466
 
467 467
     try {
468 468
         $protected_key = \Defuse\Crypto\KeyProtectedByPassword::loadFromAsciiSafeString($protected_key_encoded);
@@ -549,8 +549,8 @@  discard block
 block discarded – undo
549 549
  */
550 550
 function db_error_handler($params)
551 551
 {
552
-    echo 'Error: ' . $params['error'] . "<br>\n";
553
-    echo 'Query: ' . $params['query'] . "<br>\n";
552
+    echo 'Error: '.$params['error']."<br>\n";
553
+    echo 'Query: '.$params['query']."<br>\n";
554 554
     throw new Exception('Error - Query', 1);
555 555
 }
556 556
 
@@ -572,10 +572,10 @@  discard block
 block discarded – undo
572 572
     $SETTINGS
573 573
 ) {
574 574
     //load ClassLoader
575
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
575
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
576 576
 
577 577
     //Connect to DB
578
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
578
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
579 579
     if (defined('DB_PASSWD_CLEAR') === false) {
580 580
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
581 581
     }
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
     DB::$encoding = DB_ENCODING;
588 588
 
589 589
     //Build tree
590
-    $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries');
590
+    $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries');
591 591
     $tree->register();
592 592
     $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title');
593 593
 
@@ -640,7 +640,7 @@  discard block
 block discarded – undo
640 640
     $_SESSION['no_access_folders'] = array();
641 641
 
642 642
     // Get list of Folders
643
-    $rows = DB::query('SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE personal_folder = %i', 0);
643
+    $rows = DB::query('SELECT id FROM '.prefixTable('nested_tree').' WHERE personal_folder = %i', 0);
644 644
     foreach ($rows as $record) {
645 645
         array_push($groupesVisibles, $record['id']);
646 646
     }
@@ -659,7 +659,7 @@  discard block
 block discarded – undo
659 659
     }
660 660
     // Get ID of personal folder
661 661
     $persfld = DB::queryfirstrow(
662
-        'SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE title = %s',
662
+        'SELECT id FROM '.prefixTable('nested_tree').' WHERE title = %s',
663 663
         $_SESSION['user_id']
664 664
     );
665 665
     if (empty($persfld['id']) === false) {
@@ -680,7 +680,7 @@  discard block
 block discarded – undo
680 680
     // get complete list of ROLES
681 681
     $tmp = explode(';', $idFonctions);
682 682
     $rows = DB::query(
683
-        'SELECT * FROM ' . prefixTable('roles_title') . '
683
+        'SELECT * FROM '.prefixTable('roles_title').'
684 684
         ORDER BY title ASC'
685 685
     );
686 686
     foreach ($rows as $record) {
@@ -692,9 +692,9 @@  discard block
 block discarded – undo
692 692
 
693 693
     $_SESSION['is_admin'] = 1;
694 694
     // Check if admin has created Folders and Roles
695
-    DB::query('SELECT * FROM ' . prefixTable('nested_tree') . '');
695
+    DB::query('SELECT * FROM '.prefixTable('nested_tree').'');
696 696
     $_SESSION['nb_folders'] = DB::count();
697
-    DB::query('SELECT * FROM ' . prefixTable('roles_title'));
697
+    DB::query('SELECT * FROM '.prefixTable('roles_title'));
698 698
     $_SESSION['nb_roles'] = DB::count();
699 699
 }
700 700
 
@@ -761,7 +761,7 @@  discard block
 block discarded – undo
761 761
     // Get list of folders depending on Roles
762 762
     $rows = DB::query(
763 763
         'SELECT *
764
-        FROM ' . prefixTable('roles_values') . '
764
+        FROM ' . prefixTable('roles_values').'
765 765
         WHERE role_id IN %li AND type IN %ls',
766 766
         $userRoles,
767 767
         array('W', 'ND', 'NE', 'NDNE', 'R')
@@ -786,9 +786,9 @@  discard block
 block discarded – undo
786 786
     // Does this user is allowed to see other items
787 787
     $inc = 0;
788 788
     $rows = DB::query(
789
-        'SELECT id, id_tree FROM ' . prefixTable('items') . '
789
+        'SELECT id, id_tree FROM '.prefixTable('items').'
790 790
         WHERE restricted_to LIKE %ss AND inactif = %s',
791
-        $_SESSION['user_id'] . ';',
791
+        $_SESSION['user_id'].';',
792 792
         '0'
793 793
     );
794 794
     foreach ($rows as $record) {
@@ -802,8 +802,8 @@  discard block
 block discarded – undo
802 802
     // Check for the users roles if some specific rights exist on items
803 803
     $rows = DB::query(
804 804
         'SELECT i.id_tree, r.item_id
805
-        FROM ' . prefixTable('items') . ' as i
806
-        INNER JOIN ' . prefixTable('restriction_to_roles') . ' as r ON (r.item_id=i.id)
805
+        FROM ' . prefixTable('items').' as i
806
+        INNER JOIN ' . prefixTable('restriction_to_roles').' as r ON (r.item_id=i.id)
807 807
         WHERE r.role_id IN %li
808 808
         ORDER BY i.id_tree ASC',
809 809
         $userRoles
@@ -824,7 +824,7 @@  discard block
 block discarded – undo
824 824
     ) {
825 825
         $persoFld = DB::queryfirstrow(
826 826
             'SELECT id
827
-            FROM ' . prefixTable('nested_tree') . '
827
+            FROM ' . prefixTable('nested_tree').'
828 828
             WHERE title = %s AND personal_folder = %i',
829 829
             $_SESSION['user_id'],
830 830
             1
@@ -859,7 +859,7 @@  discard block
 block discarded – undo
859 859
     }
860 860
     $persoFlds = DB::query(
861 861
         'SELECT id
862
-        FROM ' . prefixTable('nested_tree') . '
862
+        FROM ' . prefixTable('nested_tree').'
863 863
         WHERE %l',
864 864
         $where
865 865
     );
@@ -898,17 +898,17 @@  discard block
 block discarded – undo
898 898
     );
899 899
 
900 900
     // Folders and Roles numbers
901
-    DB::queryfirstrow('SELECT id FROM ' . prefixTable('nested_tree') . '');
901
+    DB::queryfirstrow('SELECT id FROM '.prefixTable('nested_tree').'');
902 902
     $_SESSION['nb_folders'] = DB::count();
903
-    DB::queryfirstrow('SELECT id FROM ' . prefixTable('roles_title'));
903
+    DB::queryfirstrow('SELECT id FROM '.prefixTable('roles_title'));
904 904
     $_SESSION['nb_roles'] = DB::count();
905 905
 
906 906
     // check if change proposals on User's items
907 907
     if (isset($SETTINGS['enable_suggestion']) === true && (int) $SETTINGS['enable_suggestion'] === 1) {
908 908
         DB::query(
909 909
             'SELECT *
910
-            FROM ' . prefixTable('items_change') . ' AS c
911
-            LEFT JOIN ' . prefixTable('log_items') . ' AS i ON (c.item_id = i.id_item)
910
+            FROM ' . prefixTable('items_change').' AS c
911
+            LEFT JOIN ' . prefixTable('log_items').' AS i ON (c.item_id = i.id_item)
912 912
             WHERE i.action = %s AND i.id_user = %i',
913 913
             'at_creation',
914 914
             $_SESSION['user_id']
@@ -952,10 +952,10 @@  discard block
 block discarded – undo
952 952
  */
953 953
 function cacheTableRefresh($SETTINGS)
954 954
 {
955
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
955
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
956 956
 
957 957
     //Connect to DB
958
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
958
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
959 959
     if (defined('DB_PASSWD_CLEAR') === false) {
960 960
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
961 961
     }
@@ -972,13 +972,13 @@  discard block
 block discarded – undo
972 972
     $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title');
973 973
 
974 974
     // truncate table
975
-    DB::query('TRUNCATE TABLE ' . prefixTable('cache'));
975
+    DB::query('TRUNCATE TABLE '.prefixTable('cache'));
976 976
 
977 977
     // reload date
978 978
     $rows = DB::query(
979 979
         'SELECT *
980
-        FROM ' . prefixTable('items') . ' as i
981
-        INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id)
980
+        FROM ' . prefixTable('items').' as i
981
+        INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id)
982 982
         AND l.action = %s
983 983
         AND i.inactif = %i',
984 984
         'at_creation',
@@ -990,18 +990,18 @@  discard block
 block discarded – undo
990 990
             $tags = '';
991 991
             $itemTags = DB::query(
992 992
                 'SELECT tag
993
-                FROM ' . prefixTable('tags') . '
993
+                FROM ' . prefixTable('tags').'
994 994
                 WHERE item_id = %i AND tag != ""',
995 995
                 $record['id']
996 996
             );
997 997
             foreach ($itemTags as $itemTag) {
998
-                $tags .= $itemTag['tag'] . ' ';
998
+                $tags .= $itemTag['tag'].' ';
999 999
             }
1000 1000
 
1001 1001
             // Get renewal period
1002 1002
             $resNT = DB::queryfirstrow(
1003 1003
                 'SELECT renewal_period
1004
-                FROM ' . prefixTable('nested_tree') . '
1004
+                FROM ' . prefixTable('nested_tree').'
1005 1005
                 WHERE id = %i',
1006 1006
                 $record['id_tree']
1007 1007
             );
@@ -1015,7 +1015,7 @@  discard block
 block discarded – undo
1015 1015
                     // Is this a User id?
1016 1016
                     $user = DB::queryfirstrow(
1017 1017
                         'SELECT id, login
1018
-                        FROM ' . prefixTable('users') . '
1018
+                        FROM ' . prefixTable('users').'
1019 1019
                         WHERE id = %i',
1020 1020
                         $elem->title
1021 1021
                     );
@@ -1057,10 +1057,10 @@  discard block
 block discarded – undo
1057 1057
  */
1058 1058
 function cacheTableUpdate($SETTINGS, $ident = null)
1059 1059
 {
1060
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
1060
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
1061 1061
 
1062 1062
     //Connect to DB
1063
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
1063
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
1064 1064
     if (defined('DB_PASSWD_CLEAR') === false) {
1065 1065
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
1066 1066
     }
@@ -1079,7 +1079,7 @@  discard block
 block discarded – undo
1079 1079
     // get new value from db
1080 1080
     $data = DB::queryfirstrow(
1081 1081
         'SELECT label, description, id_tree, perso, restricted_to, login, url
1082
-        FROM ' . prefixTable('items') . '
1082
+        FROM ' . prefixTable('items').'
1083 1083
         WHERE id=%i',
1084 1084
         $ident
1085 1085
     );
@@ -1087,12 +1087,12 @@  discard block
 block discarded – undo
1087 1087
     $tags = '';
1088 1088
     $itemTags = DB::query(
1089 1089
         'SELECT tag
1090
-        FROM ' . prefixTable('tags') . '
1090
+        FROM ' . prefixTable('tags').'
1091 1091
         WHERE item_id = %i AND tag != ""',
1092 1092
         $ident
1093 1093
     );
1094 1094
     foreach ($itemTags as $itemTag) {
1095
-        $tags .= $itemTag['tag'] . ' ';
1095
+        $tags .= $itemTag['tag'].' ';
1096 1096
     }
1097 1097
     // form id_tree to full foldername
1098 1098
     $folder = array();
@@ -1103,7 +1103,7 @@  discard block
 block discarded – undo
1103 1103
             // Is this a User id?
1104 1104
             $user = DB::queryfirstrow(
1105 1105
                 'SELECT id, login
1106
-                FROM ' . prefixTable('users') . '
1106
+                FROM ' . prefixTable('users').'
1107 1107
                 WHERE id = %i',
1108 1108
                 $elem->title
1109 1109
             );
@@ -1142,10 +1142,10 @@  discard block
 block discarded – undo
1142 1142
  */
1143 1143
 function cacheTableAdd($SETTINGS, $ident = null)
1144 1144
 {
1145
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
1145
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
1146 1146
 
1147 1147
     //Connect to DB
1148
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
1148
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
1149 1149
     if (defined('DB_PASSWD_CLEAR') === false) {
1150 1150
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
1151 1151
     }
@@ -1164,8 +1164,8 @@  discard block
 block discarded – undo
1164 1164
     // get new value from db
1165 1165
     $data = DB::queryFirstRow(
1166 1166
         'SELECT i.label, i.description, i.id_tree as id_tree, i.perso, i.restricted_to, i.id, i.login, i.url, l.date
1167
-        FROM ' . prefixTable('items') . ' as i
1168
-        INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id)
1167
+        FROM ' . prefixTable('items').' as i
1168
+        INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id)
1169 1169
         WHERE i.id = %i
1170 1170
         AND l.action = %s',
1171 1171
         $ident,
@@ -1175,12 +1175,12 @@  discard block
 block discarded – undo
1175 1175
     $tags = '';
1176 1176
     $itemTags = DB::query(
1177 1177
         'SELECT tag
1178
-        FROM ' . prefixTable('tags') . '
1178
+        FROM ' . prefixTable('tags').'
1179 1179
         WHERE item_id = %i AND tag != ""',
1180 1180
         $ident
1181 1181
     );
1182 1182
     foreach ($itemTags as $itemTag) {
1183
-        $tags .= $itemTag['tag'] . ' ';
1183
+        $tags .= $itemTag['tag'].' ';
1184 1184
     }
1185 1185
     // form id_tree to full foldername
1186 1186
     $folder = array();
@@ -1191,7 +1191,7 @@  discard block
 block discarded – undo
1191 1191
             // Is this a User id?
1192 1192
             $user = DB::queryfirstrow(
1193 1193
                 'SELECT id, login
1194
-                FROM ' . prefixTable('users') . '
1194
+                FROM ' . prefixTable('users').'
1195 1195
                 WHERE id = %i',
1196 1196
                 $elem->title
1197 1197
             );
@@ -1232,48 +1232,48 @@  discard block
 block discarded – undo
1232 1232
 function getStatisticsData($SETTINGS)
1233 1233
 {
1234 1234
     DB::query(
1235
-        'SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE personal_folder = %i',
1235
+        'SELECT id FROM '.prefixTable('nested_tree').' WHERE personal_folder = %i',
1236 1236
         0
1237 1237
     );
1238 1238
     $counter_folders = DB::count();
1239 1239
 
1240 1240
     DB::query(
1241
-        'SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE personal_folder = %i',
1241
+        'SELECT id FROM '.prefixTable('nested_tree').' WHERE personal_folder = %i',
1242 1242
         1
1243 1243
     );
1244 1244
     $counter_folders_perso = DB::count();
1245 1245
 
1246 1246
     DB::query(
1247
-        'SELECT id FROM ' . prefixTable('items') . ' WHERE perso = %i',
1247
+        'SELECT id FROM '.prefixTable('items').' WHERE perso = %i',
1248 1248
         0
1249 1249
     );
1250 1250
     $counter_items = DB::count();
1251 1251
 
1252 1252
     DB::query(
1253
-        'SELECT id FROM ' . prefixTable('items') . ' WHERE perso = %i',
1253
+        'SELECT id FROM '.prefixTable('items').' WHERE perso = %i',
1254 1254
         1
1255 1255
     );
1256 1256
     $counter_items_perso = DB::count();
1257 1257
 
1258 1258
     DB::query(
1259
-        'SELECT id FROM ' . prefixTable('users') . ''
1259
+        'SELECT id FROM '.prefixTable('users').''
1260 1260
     );
1261 1261
     $counter_users = DB::count();
1262 1262
 
1263 1263
     DB::query(
1264
-        'SELECT id FROM ' . prefixTable('users') . ' WHERE admin = %i',
1264
+        'SELECT id FROM '.prefixTable('users').' WHERE admin = %i',
1265 1265
         1
1266 1266
     );
1267 1267
     $admins = DB::count();
1268 1268
 
1269 1269
     DB::query(
1270
-        'SELECT id FROM ' . prefixTable('users') . ' WHERE gestionnaire = %i',
1270
+        'SELECT id FROM '.prefixTable('users').' WHERE gestionnaire = %i',
1271 1271
         1
1272 1272
     );
1273 1273
     $managers = DB::count();
1274 1274
 
1275 1275
     DB::query(
1276
-        'SELECT id FROM ' . prefixTable('users') . ' WHERE read_only = %i',
1276
+        'SELECT id FROM '.prefixTable('users').' WHERE read_only = %i',
1277 1277
         1
1278 1278
     );
1279 1279
     $readOnly = DB::count();
@@ -1281,11 +1281,11 @@  discard block
 block discarded – undo
1281 1281
     // list the languages
1282 1282
     $usedLang = [];
1283 1283
     $tp_languages = DB::query(
1284
-        'SELECT name FROM ' . prefixTable('languages')
1284
+        'SELECT name FROM '.prefixTable('languages')
1285 1285
     );
1286 1286
     foreach ($tp_languages as $tp_language) {
1287 1287
         DB::query(
1288
-            'SELECT * FROM ' . prefixTable('users') . ' WHERE user_language = %s',
1288
+            'SELECT * FROM '.prefixTable('users').' WHERE user_language = %s',
1289 1289
             $tp_language['name']
1290 1290
         );
1291 1291
         $usedLang[$tp_language['name']] = round((DB::count() * 100 / $counter_users), 0);
@@ -1294,7 +1294,7 @@  discard block
 block discarded – undo
1294 1294
     // get list of ips
1295 1295
     $usedIp = [];
1296 1296
     $tp_ips = DB::query(
1297
-        'SELECT user_ip FROM ' . prefixTable('users')
1297
+        'SELECT user_ip FROM '.prefixTable('users')
1298 1298
     );
1299 1299
     foreach ($tp_ips as $ip) {
1300 1300
         if (array_key_exists($ip['user_ip'], $usedIp)) {
@@ -1356,23 +1356,23 @@  discard block
 block discarded – undo
1356 1356
 ) {
1357 1357
     // CAse where email not defined
1358 1358
     if ($email === 'none') {
1359
-        return '"error":"" , "message":"' . langHdl('forgot_my_pw_email_sent') . '"';
1359
+        return '"error":"" , "message":"'.langHdl('forgot_my_pw_email_sent').'"';
1360 1360
     }
1361 1361
 
1362 1362
     // Load settings
1363
-    include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
1363
+    include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
1364 1364
 
1365 1365
     // Load superglobal
1366
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1366
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1367 1367
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
1368 1368
 
1369 1369
     // Get user language
1370 1370
     $session_user_language = $superGlobal->get('user_language', 'SESSION');
1371 1371
     $user_language = isset($session_user_language) ? $session_user_language : 'english';
1372
-    include_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $user_language . '.php';
1372
+    include_once $SETTINGS['cpassman_dir'].'/includes/language/'.$user_language.'.php';
1373 1373
 
1374 1374
     // Load library
1375
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
1375
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
1376 1376
 
1377 1377
     // load PHPMailer
1378 1378
     $mail = new SplClassLoader('Email\PHPMailer', '../includes/libraries');
@@ -1380,7 +1380,7 @@  discard block
 block discarded – undo
1380 1380
     $mail = new Email\PHPMailer\PHPMailer(true);
1381 1381
     try {
1382 1382
         // send to user
1383
-        $mail->setLanguage('en', $SETTINGS['cpassman_dir'] . '/includes/libraries/Email/PHPMailer/language/');
1383
+        $mail->setLanguage('en', $SETTINGS['cpassman_dir'].'/includes/libraries/Email/PHPMailer/language/');
1384 1384
         $mail->SMTPDebug = 0; //value 1 can be used to debug - 4 for debuging connections
1385 1385
         $mail->Port = $SETTINGS['email_port']; //COULD BE USED
1386 1386
         $mail->CharSet = 'utf-8';
@@ -1474,7 +1474,7 @@  discard block
 block discarded – undo
1474 1474
         <table width="600" cellpadding="0" cellspacing="0" border="0" class="container" bgcolor="#ffffff" style="border-spacing: 0; border-bottom: 1px solid #e0e0e0; box-shadow: 0 0 3px #ddd; color: #434343; font-family: Helvetica, Verdana, sans-serif;">
1475 1475
         <tr><td class="container-padding" bgcolor="#ffffff" style="border-collapse: collapse; border-left: 1px solid #e0e0e0; background-color: #ffffff; padding-left: 30px; padding-right: 30px;">
1476 1476
         <br><div style="float:right;">' .
1477
-        $textMail .
1477
+        $textMail.
1478 1478
         '<br><br></td></tr></table>
1479 1479
     </td></tr></table>
1480 1480
     <br></body></html>';
@@ -1487,7 +1487,7 @@  discard block
 block discarded – undo
1487 1487
  */
1488 1488
 function generateKey()
1489 1489
 {
1490
-    return substr(md5(rand() . rand()), 0, 15);
1490
+    return substr(md5(rand().rand()), 0, 15);
1491 1491
 }
1492 1492
 
1493 1493
 /**
@@ -1557,7 +1557,7 @@  discard block
 block discarded – undo
1557 1557
 {
1558 1558
     array_walk_recursive(
1559 1559
         $array,
1560
-        function (&$item) {
1560
+        function(&$item) {
1561 1561
             if (mb_detect_encoding($item, 'utf-8', true) === false) {
1562 1562
                 $item = utf8_encode($item);
1563 1563
             }
@@ -1591,9 +1591,9 @@  discard block
 block discarded – undo
1591 1591
     }
1592 1592
 
1593 1593
     //load ClassLoader
1594
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
1594
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
1595 1595
     //Load AES
1596
-    $aes = new SplClassLoader('Encryption\Crypt', $SETTINGS['cpassman_dir'] . '/includes/libraries');
1596
+    $aes = new SplClassLoader('Encryption\Crypt', $SETTINGS['cpassman_dir'].'/includes/libraries');
1597 1597
     $aes->register();
1598 1598
 
1599 1599
     if ($key !== null) {
@@ -1680,7 +1680,7 @@  discard block
 block discarded – undo
1680 1680
  */
1681 1681
 function prefixTable($table)
1682 1682
 {
1683
-    $safeTable = htmlspecialchars(DB_PREFIX . $table);
1683
+    $safeTable = htmlspecialchars(DB_PREFIX.$table);
1684 1684
     if (!empty($safeTable)) {
1685 1685
         // sanitize string
1686 1686
         return $safeTable;
@@ -1712,14 +1712,14 @@  discard block
 block discarded – undo
1712 1712
     $lowercase = false,
1713 1713
     $SETTINGS
1714 1714
 ) {
1715
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
1716
-    $generator = new SplClassLoader('PasswordGenerator\Generator', $SETTINGS['cpassman_dir'] . '/includes/libraries');
1715
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
1716
+    $generator = new SplClassLoader('PasswordGenerator\Generator', $SETTINGS['cpassman_dir'].'/includes/libraries');
1717 1717
     $generator->register();
1718 1718
     $generator = new PasswordGenerator\Generator\ComputerPasswordGenerator();
1719 1719
 
1720 1720
     // Is PHP7 being used?
1721 1721
     if (version_compare(PHP_VERSION, '7.0.0', '>=')) {
1722
-        $php7generator = new SplClassLoader('PasswordGenerator\RandomGenerator', $SETTINGS['cpassman_dir'] . '/includes/libraries');
1722
+        $php7generator = new SplClassLoader('PasswordGenerator\RandomGenerator', $SETTINGS['cpassman_dir'].'/includes/libraries');
1723 1723
         $php7generator->register();
1724 1724
         $generator->setRandomGenerator(new PasswordGenerator\RandomGenerator\Php7RandomGenerator());
1725 1725
     }
@@ -1750,7 +1750,7 @@  discard block
 block discarded – undo
1750 1750
 function send_syslog($message, $host, $port, $component = 'teampass')
1751 1751
 {
1752 1752
     $sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
1753
-    $syslog_message = '<123>' . date('M d H:i:s ') . $component . ': ' . $message;
1753
+    $syslog_message = '<123>'.date('M d H:i:s ').$component.': '.$message;
1754 1754
     socket_sendto($sock, $syslog_message, strlen($syslog_message), 0, $host, $port);
1755 1755
     socket_close($sock);
1756 1756
 }
@@ -1774,7 +1774,7 @@  discard block
 block discarded – undo
1774 1774
     }
1775 1775
 
1776 1776
     // include librairies & connect to DB
1777
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
1777
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
1778 1778
     if (defined('DB_PASSWD_CLEAR') === false) {
1779 1779
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
1780 1780
     }
@@ -1802,14 +1802,14 @@  discard block
 block discarded – undo
1802 1802
     if (isset($SETTINGS['syslog_enable']) === true && (int) $SETTINGS['syslog_enable'] === 1) {
1803 1803
         if ($type === 'user_mngt') {
1804 1804
             send_syslog(
1805
-                'action=' . str_replace('at_', '', $label) . ' attribute=user user=' . $who . ' userid="' . $login . '" change="' . $field_1 . '" ',
1805
+                'action='.str_replace('at_', '', $label).' attribute=user user='.$who.' userid="'.$login.'" change="'.$field_1.'" ',
1806 1806
                 $SETTINGS['syslog_host'],
1807 1807
                 $SETTINGS['syslog_port'],
1808 1808
                 'teampass'
1809 1809
             );
1810 1810
         } else {
1811 1811
             send_syslog(
1812
-                'action=' . $type . ' attribute=' . $label . ' user=' . $who . ' userid="' . $login . '" ',
1812
+                'action='.$type.' attribute='.$label.' user='.$who.' userid="'.$login.'" ',
1813 1813
                 $SETTINGS['syslog_host'],
1814 1814
                 $SETTINGS['syslog_port'],
1815 1815
                 'teampass'
@@ -1841,7 +1841,7 @@  discard block
 block discarded – undo
1841 1841
     $encryption_type = null
1842 1842
 ) {
1843 1843
     // include librairies & connect to DB
1844
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
1844
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
1845 1845
     if (defined('DB_PASSWD_CLEAR') === false) {
1846 1846
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
1847 1847
     }
@@ -1887,7 +1887,7 @@  discard block
 block discarded – undo
1887 1887
         if (empty($item_label) === true) {
1888 1888
             $dataItem = DB::queryfirstrow(
1889 1889
                 'SELECT id, id_tree, label
1890
-                FROM ' . prefixTable('items') . '
1890
+                FROM ' . prefixTable('items').'
1891 1891
                 WHERE id = %i',
1892 1892
                 $item_id
1893 1893
             );
@@ -1896,7 +1896,7 @@  discard block
 block discarded – undo
1896 1896
         }
1897 1897
 
1898 1898
         send_syslog(
1899
-            'action=' . str_replace('at_', '', $action) . ' attribute=' . str_replace('at_', '', $attribute[0]) . ' itemno=' . $item_id . ' user=' . addslashes($login) . ' itemname="' . addslashes($item_label) . '"',
1899
+            'action='.str_replace('at_', '', $action).' attribute='.str_replace('at_', '', $attribute[0]).' itemno='.$item_id.' user='.addslashes($login).' itemname="'.addslashes($item_label).'"',
1900 1900
             $SETTINGS['syslog_host'],
1901 1901
             $SETTINGS['syslog_port'],
1902 1902
             'teampass'
@@ -1924,7 +1924,7 @@  discard block
 block discarded – undo
1924 1924
         // Get info about item
1925 1925
         $dataItem = DB::queryfirstrow(
1926 1926
             'SELECT id, id_tree, label
1927
-            FROM ' . prefixTable('items') . '
1927
+            FROM ' . prefixTable('items').'
1928 1928
             WHERE id = %i',
1929 1929
             $item_id
1930 1930
         );
@@ -1939,9 +1939,9 @@  discard block
 block discarded – undo
1939 1939
                 'body' => str_replace(
1940 1940
                     array('#tp_user#', '#tp_item#', '#tp_link#'),
1941 1941
                     array(
1942
-                        addslashes($_SESSION['name'] . ' ' . $_SESSION['lastname']),
1942
+                        addslashes($_SESSION['name'].' '.$_SESSION['lastname']),
1943 1943
                         addslashes($item_label),
1944
-                        $SETTINGS['cpassman_url'] . '/index.php?page=items&group=' . $dataItem['id_tree'] . '&id=' . $item_id,
1944
+                        $SETTINGS['cpassman_url'].'/index.php?page=items&group='.$dataItem['id_tree'].'&id='.$item_id,
1945 1945
                     ),
1946 1946
                     langHdl('email_on_open_notification_mail')
1947 1947
                 ),
@@ -1966,8 +1966,8 @@  discard block
 block discarded – undo
1966 1966
     $notification = DB::queryOneColumn(
1967 1967
         'email',
1968 1968
         'SELECT *
1969
-        FROM ' . prefixTable('notification') . ' AS n
1970
-        INNER JOIN ' . prefixTable('users') . ' AS u ON (n.user_id = u.id)
1969
+        FROM ' . prefixTable('notification').' AS n
1970
+        INNER JOIN ' . prefixTable('users').' AS u ON (n.user_id = u.id)
1971 1971
         WHERE n.item_id = %i AND n.user_id != %i',
1972 1972
         $item_id,
1973 1973
         $_SESSION['user_id']
@@ -1980,7 +1980,7 @@  discard block
 block discarded – undo
1980 1980
         // Get list of changes
1981 1981
         $htmlChanges = '<ul>';
1982 1982
         foreach ($changes as $change) {
1983
-            $htmlChanges .= '<li>' . $change . '</li>';
1983
+            $htmlChanges .= '<li>'.$change.'</li>';
1984 1984
         }
1985 1985
         $htmlChanges .= '</ul>';
1986 1986
 
@@ -2014,7 +2014,7 @@  discard block
 block discarded – undo
2014 2014
 function geItemReadablePath($id_tree, $label, $SETTINGS)
2015 2015
 {
2016 2016
     // Class loader
2017
-    require_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
2017
+    require_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
2018 2018
 
2019 2019
     //Load Tree
2020 2020
     $tree = new SplClassLoader('Tree\NestedTree', '../includes/libraries');
@@ -2025,15 +2025,15 @@  discard block
 block discarded – undo
2025 2025
     $path = '';
2026 2026
     foreach ($arbo as $elem) {
2027 2027
         if (empty($path) === true) {
2028
-            $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES) . ' ';
2028
+            $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES).' ';
2029 2029
         } else {
2030
-            $path .= '&#8594; ' . htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
2030
+            $path .= '&#8594; '.htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
2031 2031
         }
2032 2032
     }
2033 2033
 
2034 2034
     // Build text to show user
2035 2035
     if (empty($label) === false) {
2036
-        return empty($path) === true ? addslashes($label) : addslashes($label) . ' (' . $path . ')';
2036
+        return empty($path) === true ? addslashes($label) : addslashes($label).' ('.$path.')';
2037 2037
     } else {
2038 2038
         return empty($path) === true ? '' : $path;
2039 2039
     }
@@ -2091,10 +2091,10 @@  discard block
 block discarded – undo
2091 2091
  */
2092 2092
 function handleConfigFile($action, $SETTINGS, $field = null, $value = null)
2093 2093
 {
2094
-    $tp_config_file = $SETTINGS['cpassman_dir'] . '/includes/config/tp.config.php';
2094
+    $tp_config_file = $SETTINGS['cpassman_dir'].'/includes/config/tp.config.php';
2095 2095
 
2096 2096
     // include librairies & connect to DB
2097
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
2097
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
2098 2098
     if (defined('DB_PASSWD_CLEAR') === false) {
2099 2099
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
2100 2100
     }
@@ -2110,8 +2110,8 @@  discard block
 block discarded – undo
2110 2110
     if (file_exists($tp_config_file) === false || $action === 'rebuild') {
2111 2111
         // perform a copy
2112 2112
         if (file_exists($tp_config_file)) {
2113
-            if (!copy($tp_config_file, $tp_config_file . '.' . date('Y_m_d_His', time()))) {
2114
-                return "ERROR: Could not copy file '" . $tp_config_file . "'";
2113
+            if (!copy($tp_config_file, $tp_config_file.'.'.date('Y_m_d_His', time()))) {
2114
+                return "ERROR: Could not copy file '".$tp_config_file."'";
2115 2115
             }
2116 2116
         }
2117 2117
 
@@ -2122,11 +2122,11 @@  discard block
 block discarded – undo
2122 2122
         $data[1] = "global \$SETTINGS;\n";
2123 2123
         $data[2] = "\$SETTINGS = array (\n";
2124 2124
         $rows = DB::query(
2125
-            'SELECT * FROM ' . prefixTable('misc') . ' WHERE type=%s',
2125
+            'SELECT * FROM '.prefixTable('misc').' WHERE type=%s',
2126 2126
             'admin'
2127 2127
         );
2128 2128
         foreach ($rows as $record) {
2129
-            array_push($data, "    '" . $record['intitule'] . "' => '" . $record['valeur'] . "',\n");
2129
+            array_push($data, "    '".$record['intitule']."' => '".$record['valeur']."',\n");
2130 2130
         }
2131 2131
         array_push($data, ");\n");
2132 2132
         $data = array_unique($data);
@@ -2139,15 +2139,15 @@  discard block
 block discarded – undo
2139 2139
                 break;
2140 2140
             }
2141 2141
 
2142
-            if (stristr($line, "'" . $field . "' => '")) {
2143
-                $data[$inc] = "    '" . $field . "' => '" . filter_var($value, FILTER_SANITIZE_STRING) . "',\n";
2142
+            if (stristr($line, "'".$field."' => '")) {
2143
+                $data[$inc] = "    '".$field."' => '".filter_var($value, FILTER_SANITIZE_STRING)."',\n";
2144 2144
                 $bFound = true;
2145 2145
                 break;
2146 2146
             }
2147 2147
             ++$inc;
2148 2148
         }
2149 2149
         if ($bFound === false) {
2150
-            $data[($inc)] = "    '" . $field . "' => '" . filter_var($value, FILTER_SANITIZE_STRING) . "',\n);\n";
2150
+            $data[($inc)] = "    '".$field."' => '".filter_var($value, FILTER_SANITIZE_STRING)."',\n);\n";
2151 2151
         }
2152 2152
     }
2153 2153
 
@@ -2183,7 +2183,7 @@  discard block
 block discarded – undo
2183 2183
         $settings = array();
2184 2184
 
2185 2185
         $rows = DB::query(
2186
-            'SELECT * FROM ' . prefixTable('misc') . ' WHERE type=%s_type OR type=%s_type2',
2186
+            'SELECT * FROM '.prefixTable('misc').' WHERE type=%s_type OR type=%s_type2',
2187 2187
             array(
2188 2188
                 'type' => 'admin',
2189 2189
                 'type2' => 'settings',
@@ -2210,7 +2210,7 @@  discard block
 block discarded – undo
2210 2210
     $source_cf = array();
2211 2211
     $rows = DB::QUERY(
2212 2212
         'SELECT id_category
2213
-        FROM ' . prefixTable('categories_folders') . '
2213
+        FROM ' . prefixTable('categories_folders').'
2214 2214
         WHERE id_folder = %i',
2215 2215
         $source_id
2216 2216
     );
@@ -2221,7 +2221,7 @@  discard block
 block discarded – undo
2221 2221
     $target_cf = array();
2222 2222
     $rows = DB::QUERY(
2223 2223
         'SELECT id_category
2224
-        FROM ' . prefixTable('categories_folders') . '
2224
+        FROM ' . prefixTable('categories_folders').'
2225 2225
         WHERE id_folder = %i',
2226 2226
         $target_id
2227 2227
     );
@@ -2256,7 +2256,7 @@  discard block
 block discarded – undo
2256 2256
     $password = null
2257 2257
 ) {
2258 2258
     // Load AntiXSS
2259
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/AntiXSS/AntiXSS.php';
2259
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/AntiXSS/AntiXSS.php';
2260 2260
     $antiXss = new protect\AntiXSS\AntiXSS();
2261 2261
 
2262 2262
     // Protect against bad inputs
@@ -2274,7 +2274,7 @@  discard block
 block discarded – undo
2274 2274
          */
2275 2275
 
2276 2276
         // get KEY
2277
-        $ascii_key = file_get_contents(SECUREPATH . '/teampass-seckey.txt');
2277
+        $ascii_key = file_get_contents(SECUREPATH.'/teampass-seckey.txt');
2278 2278
 
2279 2279
         // Now perform action on the file
2280 2280
         $err = '';
@@ -2344,15 +2344,15 @@  discard block
 block discarded – undo
2344 2344
 ) {
2345 2345
     // load PhpEncryption library
2346 2346
     $path_to_encryption = '/includes/libraries/Encryption/Encryption/';
2347
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Crypto.php';
2348
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Encoding.php';
2349
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'DerivedKeys.php';
2350
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Key.php';
2351
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'KeyOrPassword.php';
2352
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'File.php';
2353
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'RuntimeTests.php';
2354
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'KeyProtectedByPassword.php';
2355
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Core.php';
2347
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Crypto.php';
2348
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Encoding.php';
2349
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'DerivedKeys.php';
2350
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Key.php';
2351
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'KeyOrPassword.php';
2352
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'File.php';
2353
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'RuntimeTests.php';
2354
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'KeyProtectedByPassword.php';
2355
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Core.php';
2356 2356
 
2357 2357
     try {
2358 2358
         \Defuse\Crypto\File::encryptFileWithPassword(
@@ -2390,15 +2390,15 @@  discard block
 block discarded – undo
2390 2390
 ) {
2391 2391
     // load PhpEncryption library
2392 2392
     $path_to_encryption = '/includes/libraries/Encryption/Encryption/';
2393
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Crypto.php';
2394
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Encoding.php';
2395
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'DerivedKeys.php';
2396
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Key.php';
2397
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'KeyOrPassword.php';
2398
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'File.php';
2399
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'RuntimeTests.php';
2400
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'KeyProtectedByPassword.php';
2401
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Core.php';
2393
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Crypto.php';
2394
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Encoding.php';
2395
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'DerivedKeys.php';
2396
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Key.php';
2397
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'KeyOrPassword.php';
2398
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'File.php';
2399
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'RuntimeTests.php';
2400
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'KeyProtectedByPassword.php';
2401
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Core.php';
2402 2402
 
2403 2403
     try {
2404 2404
         \Defuse\Crypto\File::decryptFileWithPassword(
@@ -2442,7 +2442,7 @@  discard block
 block discarded – undo
2442 2442
 function fileDelete($file, $SETTINGS)
2443 2443
 {
2444 2444
     // Load AntiXSS
2445
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/AntiXSS/AntiXSS.php';
2445
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/AntiXSS/AntiXSS.php';
2446 2446
     $antiXss = new protect\AntiXSS\AntiXSS();
2447 2447
 
2448 2448
     $file = $antiXss->xss_clean($file);
@@ -2485,7 +2485,7 @@  discard block
 block discarded – undo
2485 2485
             continue;
2486 2486
         }
2487 2487
 
2488
-        $fullPath = $dir . '/' . $file;
2488
+        $fullPath = $dir.'/'.$file;
2489 2489
 
2490 2490
         if (is_dir($fullPath)) {
2491 2491
             if ($res = @chmod($fullPath, $dirPermissions)) {
@@ -2517,7 +2517,7 @@  discard block
 block discarded – undo
2517 2517
 {
2518 2518
     global $SETTINGS;
2519 2519
 
2520
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
2520
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
2521 2521
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
2522 2522
 
2523 2523
     // Prepare superGlobal variables
@@ -2527,7 +2527,7 @@  discard block
 block discarded – undo
2527 2527
     // Load item data
2528 2528
     $data = DB::queryFirstRow(
2529 2529
         'SELECT id_tree
2530
-        FROM ' . prefixTable('items') . '
2530
+        FROM ' . prefixTable('items').'
2531 2531
         WHERE id = %i',
2532 2532
         $item_id
2533 2533
     );
@@ -2649,9 +2649,9 @@  discard block
 block discarded – undo
2649 2649
 
2650 2650
     foreach (explode(',', $SETTINGS['ldap_domain_controler']) as $domainControler) {
2651 2651
         if ($SETTINGS['ldap_ssl'] == 1) {
2652
-            $ldapURIs .= 'ldaps://' . $domainControler . ':' . $SETTINGS['ldap_port'] . ' ';
2652
+            $ldapURIs .= 'ldaps://'.$domainControler.':'.$SETTINGS['ldap_port'].' ';
2653 2653
         } else {
2654
-            $ldapURIs .= 'ldap://' . $domainControler . ':' . $SETTINGS['ldap_port'] . ' ';
2654
+            $ldapURIs .= 'ldap://'.$domainControler.':'.$SETTINGS['ldap_port'].' ';
2655 2655
         }
2656 2656
     }
2657 2657
     $ldapconn = ldap_connect($ldapURIs);
@@ -2676,7 +2676,7 @@  discard block
 block discarded – undo
2676 2676
         if ((empty($SETTINGS['ldap_bind_dn']) === true && empty($SETTINGS['ldap_bind_passwd']) === true)
2677 2677
             || $ldapbind === true
2678 2678
         ) {
2679
-            $filter = '(&(' . $SETTINGS['ldap_user_attribute'] . '=' . $username . ')(objectClass=' . $SETTINGS['ldap_object_class'] . '))';
2679
+            $filter = '(&('.$SETTINGS['ldap_user_attribute'].'='.$username.')(objectClass='.$SETTINGS['ldap_object_class'].'))';
2680 2680
             $result = ldap_search(
2681 2681
                 $ldapconn,
2682 2682
                 $SETTINGS['ldap_search_base'],
@@ -2701,7 +2701,7 @@  discard block
 block discarded – undo
2701 2701
                     && empty($SETTINGS['ldap_usergroup']) === false
2702 2702
                 ) {
2703 2703
                     // New way to check User's group membership
2704
-                    $filter_group = 'memberUid=' . $username;
2704
+                    $filter_group = 'memberUid='.$username;
2705 2705
                     $result_group = ldap_search(
2706 2706
                         $ldapconn,
2707 2707
                         $SETTINGS['ldap_search_base'],
@@ -2780,18 +2780,18 @@  discard block
 block discarded – undo
2780 2780
 
2781 2781
     //Multiple Domain Names
2782 2782
     if (strpos(html_entity_decode($username), '\\') === true) {
2783
-        $ldap_suffix = '@' . substr(html_entity_decode($username), 0, strpos(html_entity_decode($username), '\\'));
2783
+        $ldap_suffix = '@'.substr(html_entity_decode($username), 0, strpos(html_entity_decode($username), '\\'));
2784 2784
         $username = substr(html_entity_decode($username), strpos(html_entity_decode($username), '\\') + 1);
2785 2785
     }
2786 2786
     //load ClassLoader
2787
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
2787
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
2788 2788
 
2789 2789
     $adldap = new SplClassLoader('adLDAP', '../includes/libraries/LDAP');
2790 2790
     $adldap->register();
2791 2791
 
2792 2792
     // Posix style LDAP handles user searches a bit differently
2793 2793
     if ($SETTINGS['ldap_type'] === 'posix') {
2794
-        $ldap_suffix = ',' . $SETTINGS['ldap_suffix'] . ',' . $SETTINGS['ldap_domain_dn'];
2794
+        $ldap_suffix = ','.$SETTINGS['ldap_suffix'].','.$SETTINGS['ldap_domain_dn'];
2795 2795
     } else {
2796 2796
         // case where $SETTINGS['ldap_type'] equals 'windows'
2797 2797
         //Multiple Domain Names
@@ -2815,7 +2815,7 @@  discard block
 block discarded – undo
2815 2815
 
2816 2816
     // OpenLDAP expects an attribute=value pair
2817 2817
     if ($SETTINGS['ldap_type'] === 'posix') {
2818
-        $auth_username = $SETTINGS['ldap_user_attribute'] . '=' . $username;
2818
+        $auth_username = $SETTINGS['ldap_user_attribute'].'='.$username;
2819 2819
     } else {
2820 2820
         $auth_username = $username;
2821 2821
     }
@@ -2868,8 +2868,8 @@  discard block
 block discarded – undo
2868 2868
 function performDBQuery($SETTINGS, $fields, $table)
2869 2869
 {
2870 2870
     // include librairies & connect to DB
2871
-    include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
2872
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
2871
+    include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
2872
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
2873 2873
     if (defined('DB_PASSWD_CLEAR') === false) {
2874 2874
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
2875 2875
     }
@@ -2884,7 +2884,7 @@  discard block
 block discarded – undo
2884 2884
 
2885 2885
     // Insert log in DB
2886 2886
     return DB::query(
2887
-        'SELECT ' . $fields . '
2887
+        'SELECT '.$fields.'
2888 2888
         FROM ' . prefixTable($table)
2889 2889
     );
2890 2890
 }
@@ -2899,15 +2899,15 @@  discard block
 block discarded – undo
2899 2899
 function formatSizeUnits($bytes)
2900 2900
 {
2901 2901
     if ($bytes >= 1073741824) {
2902
-        $bytes = number_format($bytes / 1073741824, 2) . ' GB';
2902
+        $bytes = number_format($bytes / 1073741824, 2).' GB';
2903 2903
     } elseif ($bytes >= 1048576) {
2904
-        $bytes = number_format($bytes / 1048576, 2) . ' MB';
2904
+        $bytes = number_format($bytes / 1048576, 2).' MB';
2905 2905
     } elseif ($bytes >= 1024) {
2906
-        $bytes = number_format($bytes / 1024, 2) . ' KB';
2906
+        $bytes = number_format($bytes / 1024, 2).' KB';
2907 2907
     } elseif ($bytes > 1) {
2908
-        $bytes = $bytes . ' bytes';
2908
+        $bytes = $bytes.' bytes';
2909 2909
     } elseif ($bytes == 1) {
2910
-        $bytes = $bytes . ' byte';
2910
+        $bytes = $bytes.' byte';
2911 2911
     } else {
2912 2912
         $bytes = '0 bytes';
2913 2913
     }
@@ -3122,15 +3122,15 @@  discard block
 block discarded – undo
3122 3122
 
3123 3123
     // Encrypt the file content
3124 3124
     $plaintext = file_get_contents(
3125
-        filter_var($fileInPath . '/' . $fileInName, FILTER_SANITIZE_URL)
3125
+        filter_var($fileInPath.'/'.$fileInName, FILTER_SANITIZE_URL)
3126 3126
     );
3127 3127
     $ciphertext = $cipher->encrypt($plaintext);
3128 3128
 
3129 3129
     // Save new file
3130 3130
     $hash = md5($plaintext);
3131
-    $fileOut = $fileInPath . '/' . TP_FILE_PREFIX . $hash;
3131
+    $fileOut = $fileInPath.'/'.TP_FILE_PREFIX.$hash;
3132 3132
     file_put_contents($fileOut, $ciphertext);
3133
-    unlink($fileInPath . '/' . $fileInName);
3133
+    unlink($fileInPath.'/'.$fileInName);
3134 3134
 
3135 3135
     return array(
3136 3136
         'fileHash' => base64_encode($hash),
@@ -3173,7 +3173,7 @@  discard block
 block discarded – undo
3173 3173
     $cipher->disablePadding();
3174 3174
 
3175 3175
     // Get file content
3176
-    $ciphertext = file_get_contents($filePath . '/' . TP_FILE_PREFIX . $fileName);
3176
+    $ciphertext = file_get_contents($filePath.'/'.TP_FILE_PREFIX.$fileName);
3177 3177
 
3178 3178
     // Decrypt file content and return
3179 3179
     return base64_encode($cipher->decrypt($ciphertext));
@@ -3226,8 +3226,8 @@  discard block
 block discarded – undo
3226 3226
     $SETTINGS
3227 3227
 ) {
3228 3228
     // include librairies & connect to DB
3229
-    include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
3230
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
3229
+    include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
3230
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
3231 3231
     if (defined('DB_PASSWD_CLEAR') === false) {
3232 3232
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
3233 3233
     }
@@ -3264,8 +3264,8 @@  discard block
 block discarded – undo
3264 3264
         // Create sharekey for each user
3265 3265
         $users = DB::query(
3266 3266
             'SELECT id, public_key
3267
-            FROM ' . prefixTable('users') . '
3268
-            WHERE id NOT IN ("' . OTV_USER_ID . '","' . SSH_USER_ID . '","' . API_USER_ID . '")
3267
+            FROM ' . prefixTable('users').'
3268
+            WHERE id NOT IN ("' . OTV_USER_ID.'","'.SSH_USER_ID.'","'.API_USER_ID.'")
3269 3269
             AND public_key != ""'
3270 3270
         );
3271 3271
         foreach ($users as $user) {
Please login to merge, or discard this patch.
sources/identify.php 1 patch
Spacing   +103 added lines, -103 removed lines patch added patch discarded remove patch
@@ -36,12 +36,12 @@  discard block
 block discarded – undo
36 36
 }
37 37
 
38 38
 // Load AntiXSS
39
-require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/AntiXSS/AntiXSS.php';
39
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/AntiXSS/AntiXSS.php';
40 40
 $antiXss = new protect\AntiXSS\AntiXSS();
41 41
 
42
-require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
43
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
44
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
42
+require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
43
+require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php';
44
+require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
45 45
 
46 46
 // init
47 47
 $ldap_suffix = '';
@@ -50,12 +50,12 @@  discard block
 block discarded – undo
50 50
 
51 51
 // If Debug then clean the files
52 52
 if (DEBUGLDAP === true) {
53
-    define('DEBUGLDAPFILE', $SETTINGS['path_to_files_folder'] . '/ldap.debug.txt');
53
+    define('DEBUGLDAPFILE', $SETTINGS['path_to_files_folder'].'/ldap.debug.txt');
54 54
     $fp = fopen(DEBUGLDAPFILE, 'w');
55 55
     fclose($fp);
56 56
 }
57 57
 if (DEBUGDUO === true) {
58
-    define('DEBUGDUOFILE', $SETTINGS['path_to_files_folder'] . '/duo.debug.txt');
58
+    define('DEBUGDUOFILE', $SETTINGS['path_to_files_folder'].'/duo.debug.txt');
59 59
     $fp = fopen(DEBUGDUOFILE, 'w');
60 60
     fclose($fp);
61 61
 }
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 if (defined('DB_PASSWD_CLEAR') === false) {
73 73
     define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
74 74
 }
75
-require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
75
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
76 76
 if (defined('DB_PASSWD_CLEAR') === false) {
77 77
     define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
78 78
 }
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
     // Get DUO keys
93 93
     $duoData = DB::query(
94 94
         'SELECT intitule, valeur
95
-        FROM ' . prefixTable('misc') . '
95
+        FROM ' . prefixTable('misc').'
96 96
         WHERE type = %s',
97 97
         'duoSecurity'
98 98
     );
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
     }
102 102
 
103 103
     // load library
104
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/DuoSecurity/Duo.php';
104
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/DuoSecurity/Duo.php';
105 105
     $sig_request = Duo::signRequest(
106 106
         $_GLOBALS['IKEY'],
107 107
         $_GLOBALS['SKEY'],
@@ -113,17 +113,17 @@  discard block
 block discarded – undo
113 113
         debugIdentify(
114 114
             DEBUGDUO,
115 115
             DEBUGDUOFILE,
116
-            "\n\n-----\n\n" .
117
-                'sig request : ' . $post_login . "\n" .
118
-                'resp : ' . $sig_request . "\n"
116
+            "\n\n-----\n\n".
117
+                'sig request : '.$post_login."\n".
118
+                'resp : '.$sig_request."\n"
119 119
         );
120 120
     }
121 121
 
122 122
     // load csrfprotector
123
-    $csrfp_config = include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/csrfp/libs/csrfp.config.php';
123
+    $csrfp_config = include_once $SETTINGS['cpassman_dir'].'/includes/libraries/csrfp/libs/csrfp.config.php';
124 124
 
125 125
     // return result
126
-    echo '[{"sig_request" : "' . $sig_request . '" , "csrfp_token" : "' . $csrfp_config['CSRFP_TOKEN'] . '" , "csrfp_key" : "' . filter_var($_COOKIE[$csrfp_config['CSRFP_TOKEN']], FILTER_SANITIZE_STRING) . '"}]';
126
+    echo '[{"sig_request" : "'.$sig_request.'" , "csrfp_token" : "'.$csrfp_config['CSRFP_TOKEN'].'" , "csrfp_key" : "'.filter_var($_COOKIE[$csrfp_config['CSRFP_TOKEN']], FILTER_SANITIZE_STRING).'"}]';
127 127
     // ---
128 128
     // ---
129 129
 } elseif ($post_type === 'identify_duo_user_check') {
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
     //--------
134 134
 
135 135
     // load library
136
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/DuoSecurity/Duo.php';
136
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/DuoSecurity/Duo.php';
137 137
     $resp = Duo::verifyResponse(
138 138
         $_GLOBALS['IKEY'],
139 139
         $_GLOBALS['SKEY'],
@@ -144,9 +144,9 @@  discard block
 block discarded – undo
144 144
     debugIdentify(
145 145
         DEBUGDUO,
146 146
         DEBUGDUOFILE,
147
-        "\n\n-----\n\n" .
148
-            'sig response : ' . $post_sig_response . "\n" .
149
-            'resp : ' . $resp . "\n"
147
+        "\n\n-----\n\n".
148
+            'sig response : '.$post_sig_response."\n".
149
+            'resp : '.$resp."\n"
150 150
     );
151 151
 
152 152
     // return the response (which should be the user name)
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
             // is user in Teampass?
157 157
             $userInfo = DB::queryfirstrow(
158 158
                 'SELECT id
159
-                FROM ' . prefixTable('users') . '
159
+                FROM ' . prefixTable('users').'
160 160
                 WHERE login = %s',
161 161
                 $post_login
162 162
             );
@@ -167,8 +167,8 @@  discard block
 block discarded – undo
167 167
 
168 168
                 if ($ldap_info_user->{'user_found'} === true && $ldap_info_user->{'auth_success'} === true) {
169 169
                     // load passwordLib library
170
-                    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
171
-                    $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'] . '/includes/libraries');
170
+                    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
171
+                    $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'].'/includes/libraries');
172 172
                     $pwdlib->register();
173 173
                     $pwdlib = new PasswordLib\PasswordLib();
174 174
 
@@ -217,9 +217,9 @@  discard block
 block discarded – undo
217 217
             }
218 218
         }
219 219
 
220
-        echo '[{"resp" : "' . $resp . '"}]';
220
+        echo '[{"resp" : "'.$resp.'"}]';
221 221
     } else {
222
-        echo '[{"resp" : "' . $resp . '"}]';
222
+        echo '[{"resp" : "'.$resp.'"}]';
223 223
     }
224 224
     // ---
225 225
     // ---
@@ -316,19 +316,19 @@  discard block
 block discarded – undo
316 316
     } else {
317 317
         throw new Exception("Error file '/includes/config/tp.config.php' not exists", 1);
318 318
     }
319
-    include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
319
+    include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
320 320
 
321 321
     header('Content-type: text/html; charset=utf-8');
322 322
     error_reporting(E_ERROR);
323
-    include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
324
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
323
+    include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
324
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
325 325
 
326 326
     // Load AntiXSS
327
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/AntiXSS/AntiXSS.php';
327
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/AntiXSS/AntiXSS.php';
328 328
     $antiXss = new protect\AntiXSS\AntiXSS();
329 329
 
330 330
     // Load superGlobals
331
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
331
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
332 332
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
333 333
 
334 334
     // Prepare GET variables
@@ -338,11 +338,11 @@  discard block
 block discarded – undo
338 338
     debugIdentify(
339 339
         DEBUGDUO,
340 340
         DEBUGDUOFILE,
341
-        "Content of data sent '" . filter_var($sentData, FILTER_SANITIZE_STRING) . "'\n"
341
+        "Content of data sent '".filter_var($sentData, FILTER_SANITIZE_STRING)."'\n"
342 342
     );
343 343
 
344 344
     // connect to the server
345
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
345
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
346 346
     if (defined('DB_PASSWD_CLEAR') === false) {
347 347
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
348 348
     }
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
     DB::$encoding = DB_ENCODING;
355 355
 
356 356
     // User's language loading
357
-    include_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $session_user_language . '.php';
357
+    include_once $SETTINGS['cpassman_dir'].'/includes/language/'.$session_user_language.'.php';
358 358
 
359 359
     // decrypt and retreive data in JSON format
360 360
     $dataReceived = prepareExchangedData($sentData, 'decode', $_SESSION['key']);
@@ -414,31 +414,31 @@  discard block
 block discarded – undo
414 414
     debugIdentify(
415 415
         DEBUGDUO,
416 416
         DEBUGDUOFILE,
417
-        "Starting authentication of '" . $username . "'\n" .
418
-            'LDAP status: ' . $SETTINGS['ldap_mode'] . "\n"
417
+        "Starting authentication of '".$username."'\n".
418
+            'LDAP status: '.$SETTINGS['ldap_mode']."\n"
419 419
     );
420 420
     debugIdentify(
421 421
         DEBUGLDAP,
422 422
         DEBUGLDAPFILE,
423
-        "Get all LDAP params : \n" .
424
-            'mode : ' . $SETTINGS['ldap_mode'] . "\n" .
425
-            'type : ' . $SETTINGS['ldap_type'] . "\n" .
426
-            'base_dn : ' . $SETTINGS['ldap_domain_dn'] . "\n" .
427
-            'search_base : ' . $SETTINGS['ldap_search_base'] . "\n" .
428
-            'bind_dn : ' . $SETTINGS['ldap_bind_dn'] . "\n" .
429
-            'bind_passwd : ' . $SETTINGS['ldap_bind_passwd'] . "\n" .
430
-            'user_attribute : ' . $SETTINGS['ldap_user_attribute'] . "\n" .
431
-            'account_suffix : ' . $SETTINGS['ldap_suffix'] . "\n" .
432
-            'domain_controllers : ' . $SETTINGS['ldap_domain_controler'] . "\n" .
433
-            'ad_port : ' . $SETTINGS['ldap_port'] . "\n" .
434
-            'use_ssl : ' . $SETTINGS['ldap_ssl'] . "\n" .
435
-            'use_tls : ' . $SETTINGS['ldap_tls'] . "\n*********\n\n"
423
+        "Get all LDAP params : \n".
424
+            'mode : '.$SETTINGS['ldap_mode']."\n".
425
+            'type : '.$SETTINGS['ldap_type']."\n".
426
+            'base_dn : '.$SETTINGS['ldap_domain_dn']."\n".
427
+            'search_base : '.$SETTINGS['ldap_search_base']."\n".
428
+            'bind_dn : '.$SETTINGS['ldap_bind_dn']."\n".
429
+            'bind_passwd : '.$SETTINGS['ldap_bind_passwd']."\n".
430
+            'user_attribute : '.$SETTINGS['ldap_user_attribute']."\n".
431
+            'account_suffix : '.$SETTINGS['ldap_suffix']."\n".
432
+            'domain_controllers : '.$SETTINGS['ldap_domain_controler']."\n".
433
+            'ad_port : '.$SETTINGS['ldap_port']."\n".
434
+            'use_ssl : '.$SETTINGS['ldap_ssl']."\n".
435
+            'use_tls : '.$SETTINGS['ldap_tls']."\n*********\n\n"
436 436
     );
437 437
 
438 438
     // Check if user exists
439 439
     $userInfo = DB::queryFirstRow(
440 440
         'SELECT *
441
-        FROM ' . prefixTable('users') . '
441
+        FROM ' . prefixTable('users').'
442 442
         WHERE login=%s',
443 443
         $username
444 444
     );
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
     debugIdentify(
466 466
         DEBUGDUO,
467 467
         DEBUGDUOFILE,
468
-        'USer exists: ' . $counter . "\n"
468
+        'USer exists: '.$counter."\n"
469 469
     );
470 470
 
471 471
     $user_initial_creation_through_ldap = false;
@@ -483,7 +483,7 @@  discard block
 block discarded – undo
483 483
     ) {
484 484
         //Multiple Domain Names
485 485
         if (strpos(html_entity_decode($username), '\\') === true) {
486
-            $ldap_suffix = '@' . substr(html_entity_decode($username), 0, strpos(html_entity_decode($username), '\\'));
486
+            $ldap_suffix = '@'.substr(html_entity_decode($username), 0, strpos(html_entity_decode($username), '\\'));
487 487
             $username = substr(html_entity_decode($username), strpos(html_entity_decode($username), '\\') + 1);
488 488
         }
489 489
         if ($SETTINGS['ldap_type'] === 'posix-search') {
@@ -616,7 +616,7 @@  discard block
 block discarded – undo
616 616
     debugIdentify(
617 617
         DEBUGDUO,
618 618
         DEBUGDUOFILE,
619
-        'Proceed with Ident: ' . $proceedIdentification . "\n"
619
+        'Proceed with Ident: '.$proceedIdentification."\n"
620 620
     );
621 621
 
622 622
     // If admin user then check if folder install exists
@@ -646,7 +646,7 @@  discard block
 block discarded – undo
646 646
                     'user_admin' => isset($_SESSION['user_admin']) ? (int) $_SESSION['user_admin'] : '',
647 647
                     'initial_url' => isset($_SESSION['initial_url']) === true ? $_SESSION['initial_url'] : '',
648 648
                     'pwd_attempts' => (int) $_SESSION['pwd_attempts'],
649
-                    'error' => 'user_not_exists2 ' . $passwordClear,
649
+                    'error' => 'user_not_exists2 '.$passwordClear,
650 650
                     'message' => langHdl('error_bad_credentials'),
651 651
                 ),
652 652
                 'encode'
@@ -661,7 +661,7 @@  discard block
 block discarded – undo
661 661
         debugIdentify(
662 662
             DEBUGDUO,
663 663
             DEBUGDUOFILE,
664
-            "User's password verified: " . $userPasswordVerified . "\n"
664
+            "User's password verified: ".$userPasswordVerified."\n"
665 665
         );
666 666
 
667 667
         // Manage Maintenance mode
@@ -715,7 +715,7 @@  discard block
 block discarded – undo
715 715
             $arrAttempts = array();
716 716
             $rows = DB::query(
717 717
                 'SELECT date
718
-                FROM ' . prefixTable('log_system') . "
718
+                FROM ' . prefixTable('log_system')."
719 719
                 WHERE field_1 = %s
720 720
                 AND type = 'failed_auth'
721 721
                 AND label = 'user_password_not_correct'
@@ -731,7 +731,7 @@  discard block
 block discarded – undo
731 731
                 foreach ($rows as $record) {
732 732
                     array_push(
733 733
                         $arrAttempts['attempts'],
734
-                        date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], $record['date'])
734
+                        date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], $record['date'])
735 735
                     );
736 736
                 }
737 737
             }
@@ -816,7 +816,7 @@  discard block
 block discarded – undo
816 816
                 $tmp = encrypt($_SESSION['user_settings']['clear_psk'], '');
817 817
                 if ($tmp !== false) {
818 818
                     setcookie(
819
-                        'TeamPass_PFSK_' . md5($_SESSION['user_id']),
819
+                        'TeamPass_PFSK_'.md5($_SESSION['user_id']),
820 820
                         $tmp,
821 821
                         time() + 60 * 60 * 24 * $SETTINGS['personal_saltkey_cookie_duration'],
822 822
                         '/'
@@ -873,7 +873,7 @@  discard block
 block discarded – undo
873 873
             foreach ($_SESSION['user_roles'] as $role) {
874 874
                 $resRoles = DB::queryFirstRow(
875 875
                     'SELECT title, complexity
876
-                    FROM ' . prefixTable('roles_title') . '
876
+                    FROM ' . prefixTable('roles_title').'
877 877
                     WHERE id=%i',
878 878
                     $role
879 879
                 );
@@ -889,7 +889,7 @@  discard block
 block discarded – undo
889 889
 
890 890
             // build complete array of roles
891 891
             $_SESSION['arr_roles_full'] = array();
892
-            $rows = DB::query('SELECT id, title FROM ' . prefixTable('roles_title') . ' ORDER BY title ASC');
892
+            $rows = DB::query('SELECT id, title FROM '.prefixTable('roles_title').' ORDER BY title ASC');
893 893
             foreach ($rows as $record) {
894 894
                 $_SESSION['arr_roles_full'][$record['id']] = array(
895 895
                     'id' => $record['id'],
@@ -979,14 +979,14 @@  discard block
 block discarded – undo
979 979
                 if (!empty($item)) {
980 980
                     $dataLastItems = DB::queryFirstRow(
981 981
                         'SELECT id,label,id_tree
982
-                        FROM ' . prefixTable('items') . '
982
+                        FROM ' . prefixTable('items').'
983 983
                         WHERE id=%i',
984 984
                         $item
985 985
                     );
986 986
                     $_SESSION['latest_items_tab'][$item] = array(
987 987
                         'id' => $item,
988 988
                         'label' => $dataLastItems['label'],
989
-                        'url' => 'index.php?page=items&amp;group=' . $dataLastItems['id_tree'] . '&amp;id=' . $item,
989
+                        'url' => 'index.php?page=items&amp;group='.$dataLastItems['id_tree'].'&amp;id='.$item,
990 990
                     );
991 991
                 }
992 992
             }
@@ -1000,12 +1000,12 @@  discard block
 block discarded – undo
1000 1000
             ) {
1001 1001
                 // get all Admin users
1002 1002
                 $receivers = '';
1003
-                $rows = DB::query('SELECT email FROM ' . prefixTable('users') . " WHERE admin = %i and email != ''", 1);
1003
+                $rows = DB::query('SELECT email FROM '.prefixTable('users')." WHERE admin = %i and email != ''", 1);
1004 1004
                 foreach ($rows as $record) {
1005 1005
                     if (empty($receivers)) {
1006 1006
                         $receivers = $record['email'];
1007 1007
                     } else {
1008
-                        $receivers = ',' . $record['email'];
1008
+                        $receivers = ','.$record['email'];
1009 1009
                     }
1010 1010
                 }
1011 1011
                 // Add email to table
@@ -1021,7 +1021,7 @@  discard block
 block discarded – undo
1021 1021
                                 '#tp_time#',
1022 1022
                             ),
1023 1023
                             array(
1024
-                                ' ' . $_SESSION['login'] . ' (IP: ' . getClientIpServer() . ')',
1024
+                                ' '.$_SESSION['login'].' (IP: '.getClientIpServer().')',
1025 1025
                                 date($SETTINGS['date_format'], $_SESSION['last_connection']),
1026 1026
                                 date($SETTINGS['time_format'], $_SESSION['last_connection']),
1027 1027
                             ),
@@ -1227,8 +1227,8 @@  discard block
 block discarded – undo
1227 1227
     debugIdentify(
1228 1228
         DEBUGDUO,
1229 1229
         DEBUGDUOFILE,
1230
-        "\n\n----\n" .
1231
-            'Identified : ' . filter_var($return, FILTER_SANITIZE_STRING) . "\n\n"
1230
+        "\n\n----\n".
1231
+            'Identified : '.filter_var($return, FILTER_SANITIZE_STRING)."\n\n"
1232 1232
     );
1233 1233
 
1234 1234
     echo prepareExchangedData(
@@ -1271,11 +1271,11 @@  discard block
 block discarded – undo
1271 1271
 function identifyViaLDAPPosixSearch($username, $userInfo, $passwordClear, $counter, $SETTINGS)
1272 1272
 {
1273 1273
     // Load AntiXSS
1274
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/AntiXSS/AntiXSS.php';
1274
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/AntiXSS/AntiXSS.php';
1275 1275
     $antiXss = new protect\AntiXSS\AntiXSS();
1276 1276
 
1277 1277
     // load passwordLib library
1278
-    $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'] . '/includes/libraries');
1278
+    $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'].'/includes/libraries');
1279 1279
     $pwdlib->register();
1280 1280
     $pwdlib = new PasswordLib\PasswordLib();
1281 1281
 
@@ -1283,9 +1283,9 @@  discard block
 block discarded – undo
1283 1283
     $ldapURIs = '';
1284 1284
     foreach (explode(',', $SETTINGS['ldap_domain_controler']) as $domainControler) {
1285 1285
         if ($SETTINGS['ldap_ssl'] == 1) {
1286
-            $ldapURIs .= 'ldaps://' . $domainControler . ':' . $SETTINGS['ldap_port'] . ' ';
1286
+            $ldapURIs .= 'ldaps://'.$domainControler.':'.$SETTINGS['ldap_port'].' ';
1287 1287
         } else {
1288
-            $ldapURIs .= 'ldap://' . $domainControler . ':' . $SETTINGS['ldap_port'] . ' ';
1288
+            $ldapURIs .= 'ldap://'.$domainControler.':'.$SETTINGS['ldap_port'].' ';
1289 1289
         }
1290 1290
     }
1291 1291
 
@@ -1296,7 +1296,7 @@  discard block
 block discarded – undo
1296 1296
     debugIdentify(
1297 1297
         DEBUGLDAP,
1298 1298
         DEBUGLDAPFILE,
1299
-        'LDAP URIs : ' . $ldapURIs . "\n\n"
1299
+        'LDAP URIs : '.$ldapURIs."\n\n"
1300 1300
     );
1301 1301
 
1302 1302
     // Connect
@@ -1311,7 +1311,7 @@  discard block
 block discarded – undo
1311 1311
     debugIdentify(
1312 1312
         DEBUGLDAP,
1313 1313
         DEBUGLDAPFILE,
1314
-        'LDAP connection : ' . ($ldapconn ? 'Connected' : 'Failed') . "\n\n"
1314
+        'LDAP connection : '.($ldapconn ? 'Connected' : 'Failed')."\n\n"
1315 1315
     );
1316 1316
 
1317 1317
     // Set options
@@ -1328,13 +1328,13 @@  discard block
 block discarded – undo
1328 1328
             debugIdentify(
1329 1329
                 DEBUGLDAP,
1330 1330
                 DEBUGLDAPFILE,
1331
-                'LDAP bind : ' . ($ldapbind ? 'Bound' : 'Failed') . "\n\n"
1331
+                'LDAP bind : '.($ldapbind ? 'Bound' : 'Failed')."\n\n"
1332 1332
             );
1333 1333
         } else {
1334 1334
             $ldapbind = false;
1335 1335
         }
1336 1336
         if (($SETTINGS['ldap_bind_dn'] === '' && $SETTINGS['ldap_bind_passwd'] === '') || $ldapbind === true) {
1337
-            $filter = '(&(' . $SETTINGS['ldap_user_attribute'] . '=' . $userInfo['login'] . ')(objectClass=' . $SETTINGS['ldap_object_class'] . '))';
1337
+            $filter = '(&('.$SETTINGS['ldap_user_attribute'].'='.$userInfo['login'].')(objectClass='.$SETTINGS['ldap_object_class'].'))';
1338 1338
             $result = ldap_search(
1339 1339
                 $ldapconn,
1340 1340
                 $SETTINGS['ldap_search_base'],
@@ -1346,8 +1346,8 @@  discard block
 block discarded – undo
1346 1346
             debugIdentify(
1347 1347
                 DEBUGLDAP,
1348 1348
                 DEBUGLDAPFILE,
1349
-                'Search filter : ' . $filter . "\n" .
1350
-                    'Results : ' . print_r(ldap_get_entries($ldapconn, $result), true) . "\n\n"
1349
+                'Search filter : '.$filter."\n".
1350
+                    'Results : '.print_r(ldap_get_entries($ldapconn, $result), true)."\n\n"
1351 1351
             );
1352 1352
 
1353 1353
             // Check if user was found in AD
@@ -1360,7 +1360,7 @@  discard block
 block discarded – undo
1360 1360
                 debugIdentify(
1361 1361
                     DEBUGLDAP,
1362 1362
                     DEBUGLDAPFILE,
1363
-                    'User was found. ' . $user_dn . '\n'
1363
+                    'User was found. '.$user_dn.'\n'
1364 1364
                 );
1365 1365
 
1366 1366
                 // Check shadowexpire attribute - if === 1 then user disabled
@@ -1384,7 +1384,7 @@  discard block
 block discarded – undo
1384 1384
                 $result['commonGroupsLdapVsTeampass'] = array();
1385 1385
                 if (isset($SETTINGS['ldap_usergroup']) === true && empty($SETTINGS['ldap_usergroup']) === false) {
1386 1386
                     // New way to check User's group membership
1387
-                    $filter_group = 'memberUid=' . $userInfo['login'];
1387
+                    $filter_group = 'memberUid='.$userInfo['login'];
1388 1388
                     $result_group = ldap_search(
1389 1389
                         $ldapconn,
1390 1390
                         $SETTINGS['ldap_search_base'],
@@ -1399,15 +1399,15 @@  discard block
 block discarded – undo
1399 1399
                         debugIdentify(
1400 1400
                             DEBUGLDAP,
1401 1401
                             DEBUGLDAPFILE,
1402
-                            'Search groups appartenance : ' . $SETTINGS['ldap_search_base'] . "\n" .
1403
-                                'Results : ' . print_r($ldapUserGroups, true) . "\n"
1402
+                            'Search groups appartenance : '.$SETTINGS['ldap_search_base']."\n".
1403
+                                'Results : '.print_r($ldapUserGroups, true)."\n"
1404 1404
                         );
1405 1405
 
1406 1406
                         if ($ldapUserGroups['count'] > 0) {
1407 1407
                             // Get list of roles in Teampass
1408 1408
                             $rowsTeampassRoles = DB::query(
1409 1409
                                 'SELECT id, title
1410
-                                FROM ' . prefixTable('roles_title') . '
1410
+                                FROM ' . prefixTable('roles_title').'
1411 1411
                                 ORDER BY title ASC'
1412 1412
                             );
1413 1413
 
@@ -1435,7 +1435,7 @@  discard block
 block discarded – undo
1435 1435
                     debugIdentify(
1436 1436
                         DEBUGLDAP,
1437 1437
                         DEBUGLDAPFILE,
1438
-                        'Group was found : ' . var_export($GroupRestrictionEnabled, true) . ' -- \n' . var_export($result, true) . "\n"
1438
+                        'Group was found : '.var_export($GroupRestrictionEnabled, true).' -- \n'.var_export($result, true)."\n"
1439 1439
                     );
1440 1440
                 }
1441 1441
 
@@ -1556,11 +1556,11 @@  discard block
 block discarded – undo
1556 1556
 function identifyViaLDAPPosix($userInfo, $ldap_suffix, $passwordClear, $counter, $SETTINGS)
1557 1557
 {
1558 1558
     // Load AntiXSS
1559
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/AntiXSS/AntiXSS.php';
1559
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/AntiXSS/AntiXSS.php';
1560 1560
     $antiXss = new protect\AntiXSS\AntiXSS();
1561 1561
 
1562 1562
     // load passwordLib library
1563
-    $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'] . '/includes/libraries');
1563
+    $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'].'/includes/libraries');
1564 1564
     $pwdlib->register();
1565 1565
     $pwdlib = new PasswordLib\PasswordLib();
1566 1566
 
@@ -1568,13 +1568,13 @@  discard block
 block discarded – undo
1568 1568
     debugIdentify(
1569 1569
         DEBUGLDAP,
1570 1570
         DEBUGLDAPFILE,
1571
-        "Get all ldap params : \n" .
1572
-            'base_dn : ' . $SETTINGS['ldap_domain_dn'] . "\n" .
1573
-            'account_suffix : ' . $SETTINGS['ldap_suffix'] . "\n" .
1574
-            'domain_controllers : ' . $SETTINGS['ldap_domain_controler'] . "\n" .
1575
-            'ad_port : ' . $SETTINGS['ldap_port'] . "\n" .
1576
-            'use_ssl : ' . $SETTINGS['ldap_ssl'] . "\n" .
1577
-            'use_tls : ' . $SETTINGS['ldap_tls'] . "\n*********\n\n"
1571
+        "Get all ldap params : \n".
1572
+            'base_dn : '.$SETTINGS['ldap_domain_dn']."\n".
1573
+            'account_suffix : '.$SETTINGS['ldap_suffix']."\n".
1574
+            'domain_controllers : '.$SETTINGS['ldap_domain_controler']."\n".
1575
+            'ad_port : '.$SETTINGS['ldap_port']."\n".
1576
+            'use_ssl : '.$SETTINGS['ldap_ssl']."\n".
1577
+            'use_tls : '.$SETTINGS['ldap_tls']."\n*********\n\n"
1578 1578
     );
1579 1579
 
1580 1580
     $adldap = new SplClassLoader('adLDAP', '../includes/libraries/LDAP');
@@ -1584,7 +1584,7 @@  discard block
 block discarded – undo
1584 1584
 
1585 1585
     // Posix style LDAP handles user searches a bit differently
1586 1586
     if ($SETTINGS['ldap_type'] === 'posix') {
1587
-        $ldap_suffix = ',' . $SETTINGS['ldap_suffix'] . ',' . $SETTINGS['ldap_domain_dn'];
1587
+        $ldap_suffix = ','.$SETTINGS['ldap_suffix'].','.$SETTINGS['ldap_domain_dn'];
1588 1588
     } elseif ($SETTINGS['ldap_type'] === 'windows') {
1589 1589
         //Multiple Domain Names
1590 1590
         $ldap_suffix = $SETTINGS['ldap_suffix'];
@@ -1609,12 +1609,12 @@  discard block
 block discarded – undo
1609 1609
     debugIdentify(
1610 1610
         DEBUGLDAP,
1611 1611
         DEBUGLDAPFILE,
1612
-        'Create new adldap object : ' . $adldap->getLastError() . "\n\n\n"
1612
+        'Create new adldap object : '.$adldap->getLastError()."\n\n\n"
1613 1613
     );
1614 1614
 
1615 1615
     // OpenLDAP expects an attribute=value pair
1616 1616
     if ($SETTINGS['ldap_type'] === 'posix') {
1617
-        $auth_username = $SETTINGS['ldap_user_attribute'] . '=' . $userInfo['login'];
1617
+        $auth_username = $SETTINGS['ldap_user_attribute'].'='.$userInfo['login'];
1618 1618
     } else {
1619 1619
         $auth_username = $userInfo['login'];
1620 1620
     }
@@ -1695,8 +1695,8 @@  discard block
 block discarded – undo
1695 1695
     debugIdentify(
1696 1696
         DEBUGLDAP,
1697 1697
         DEBUGLDAPFILE,
1698
-        'After authenticate : ' . $adldap->getLastError() . "\n\n\n" .
1699
-            'ldap status : ' . $ldapConnection . "\n\n\n"
1698
+        'After authenticate : '.$adldap->getLastError()."\n\n\n".
1699
+            'ldap status : '.$ldapConnection."\n\n\n"
1700 1700
     );
1701 1701
 
1702 1702
     return array(
@@ -1721,7 +1721,7 @@  discard block
 block discarded – undo
1721 1721
 function yubicoMFACheck($dataReceived, $userInfo, $SETTINGS)
1722 1722
 {
1723 1723
     // Load AntiXSS
1724
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/AntiXSS/AntiXSS.php';
1724
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/AntiXSS/AntiXSS.php';
1725 1725
     $antiXss = new protect\AntiXSS\AntiXSS();
1726 1726
 
1727 1727
     $yubico_key = htmlspecialchars_decode($dataReceived['yubico_key']);
@@ -1758,7 +1758,7 @@  discard block
 block discarded – undo
1758 1758
     }
1759 1759
 
1760 1760
     // Now check yubico validity
1761
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/Yubico/Yubico.php';
1761
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/Yubico/Yubico.php';
1762 1762
     $yubi = new Auth_Yubico($yubico_user_id, $yubico_user_key);
1763 1763
     $auth = $yubi->verify($yubico_key); //, null, null, null, 60
1764 1764
 
@@ -1813,7 +1813,7 @@  discard block
 block discarded – undo
1813 1813
             'gestionnaire' => '0',
1814 1814
             'can_manage_all_users' => '0',
1815 1815
             'personal_folder' => $SETTINGS['enable_pf_feature'] === '1' ? '1' : '0',
1816
-            'fonction_id' => (empty($retLDAP['user_info_from_ad'][0]['commonGroupsLdapVsTeampass']) === false ? $retLDAP['user_info_from_ad'][0]['commonGroupsLdapVsTeampass'] . ';' : '') . (isset($SETTINGS['ldap_new_user_role']) === true ? $SETTINGS['ldap_new_user_role'] : '0'),
1816
+            'fonction_id' => (empty($retLDAP['user_info_from_ad'][0]['commonGroupsLdapVsTeampass']) === false ? $retLDAP['user_info_from_ad'][0]['commonGroupsLdapVsTeampass'].';' : '').(isset($SETTINGS['ldap_new_user_role']) === true ? $SETTINGS['ldap_new_user_role'] : '0'),
1817 1817
             'groupes_interdits' => '',
1818 1818
             'groupes_visibles' => '',
1819 1819
             'last_pw_change' => time(),
@@ -1839,7 +1839,7 @@  discard block
 block discarded – undo
1839 1839
         );
1840 1840
 
1841 1841
         // Rebuild tree
1842
-        $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries');
1842
+        $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries');
1843 1843
         $tree->register();
1844 1844
         $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title');
1845 1845
         $tree->rebuild();
@@ -1870,7 +1870,7 @@  discard block
 block discarded – undo
1870 1870
         && empty($dataReceived['GACode']) === false
1871 1871
     ) {
1872 1872
         // load library
1873
-        include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/TwoFactorAuth/TwoFactorAuth.php';
1873
+        include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/TwoFactorAuth/TwoFactorAuth.php';
1874 1874
 
1875 1875
         // create new instance
1876 1876
         $tfa = new Authentication\TwoFactorAuth\TwoFactorAuth($SETTINGS['ga_website_name']);
@@ -1896,7 +1896,7 @@  discard block
 block discarded – undo
1896 1896
 
1897 1897
             // generate new QR
1898 1898
             $new_2fa_qr = $tfa->getQRCodeImageAsDataUri(
1899
-                'Teampass - ' . $username,
1899
+                'Teampass - '.$username,
1900 1900
                 $userInfo['ga']
1901 1901
             );
1902 1902
 
@@ -1911,7 +1911,7 @@  discard block
 block discarded – undo
1911 1911
             );
1912 1912
 
1913 1913
             $firstTime = array(
1914
-                'value' => '<img src="' . $new_2fa_qr . '">',
1914
+                'value' => '<img src="'.$new_2fa_qr.'">',
1915 1915
                 'user_admin' => isset($_SESSION['user_admin']) ? (int) $_SESSION['user_admin'] : 0,
1916 1916
                 'initial_url' => @$_SESSION['initial_url'],
1917 1917
                 'pwd_attempts' => (int) $_SESSION['pwd_attempts'],
@@ -1964,8 +1964,8 @@  discard block
 block discarded – undo
1964 1964
     $userPasswordVerified = false;
1965 1965
 
1966 1966
     // load passwordLib library
1967
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
1968
-    $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'] . '/includes/libraries');
1967
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
1968
+    $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'].'/includes/libraries');
1969 1969
     $pwdlib->register();
1970 1970
     $pwdlib = new PasswordLib\PasswordLib();
1971 1971
 
Please login to merge, or discard this patch.
sources/export.queries.php 1 patch
Spacing   +76 added lines, -76 removed lines patch added patch discarded remove patch
@@ -41,26 +41,26 @@  discard block
 block discarded – undo
41 41
 }
42 42
 
43 43
 // Do checks
44
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
45
-require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php';
44
+require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php';
45
+require_once $SETTINGS['cpassman_dir'].'/sources/checks.php';
46 46
 if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'items', $SETTINGS) === false) {
47 47
     // Not allowed page
48 48
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
49
-    include $SETTINGS['cpassman_dir'] . '/error.php';
49
+    include $SETTINGS['cpassman_dir'].'/error.php';
50 50
     exit();
51 51
 }
52 52
 
53 53
 // No time limit
54 54
 set_time_limit(0);
55 55
 
56
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
56
+require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
57 57
 header('Content-type: text/html; charset=utf-8');
58 58
 error_reporting(E_ERROR);
59
-require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
60
-require_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
59
+require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
60
+require_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
61 61
 
62 62
 // Connect to mysql server
63
-require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
63
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
64 64
 if (defined('DB_PASSWD_CLEAR') === false) {
65 65
     define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
66 66
 }
@@ -72,12 +72,12 @@  discard block
 block discarded – undo
72 72
 DB::$encoding = DB_ENCODING;
73 73
 
74 74
 // Build tree
75
-$tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries');
75
+$tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries');
76 76
 $tree->register();
77
-$tree = new Tree\NestedTree\NestedTree($pre . 'nested_tree', 'id', 'parent_id', 'title');
77
+$tree = new Tree\NestedTree\NestedTree($pre.'nested_tree', 'id', 'parent_id', 'title');
78 78
 
79 79
 // User's language loading
80
-require_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php';
80
+require_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php';
81 81
 
82 82
 // Prepare POST variables
83 83
 $id = filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT);
@@ -128,9 +128,9 @@  discard block
 block discarded – undo
128 128
                         'SELECT i.id as id, i.id_tree as id_tree, i.restricted_to as restricted_to, i.perso as perso,
129 129
                             i.label as label, i.description as description, i.pw as pw, i.login as login, i.url as url,
130 130
                             i.email as email,l.date as date, i.pw_iv as pw_iv,n.renewal_period as renewal_period
131
-                        FROM ' . prefixTable('items') . ' as i
132
-                        INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree = n.id)
133
-                        INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id = l.id_item)
131
+                        FROM ' . prefixTable('items').' as i
132
+                        INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree = n.id)
133
+                        INNER JOIN ' . prefixTable('log_items').' as l ON (i.id = l.id_item)
134 134
                         WHERE i.inactif = %i
135 135
                         AND i.id_tree= %i
136 136
                         AND (l.action = %s OR (l.action = %s AND l.raison LIKE %s))
@@ -153,8 +153,8 @@  discard block
 block discarded – undo
153 153
                                 // Run query
154 154
                                 $dataItem = DB::queryfirstrow(
155 155
                                     'SELECT i.pw AS pw, s.share_key AS share_key
156
-                                    FROM ' . prefixTable('items') . ' AS i
157
-                                    INNER JOIN ' . prefixTable('sharekeys_items') . ' AS s ON (s.object_id = i.id)
156
+                                    FROM ' . prefixTable('items').' AS i
157
+                                    INNER JOIN ' . prefixTable('sharekeys_items').' AS s ON (s.object_id = i.id)
158 158
                                     WHERE user_id = %i AND i.id = %i',
159 159
                                     $_SESSION['user_id'],
160 160
                                     $record['id']
@@ -178,8 +178,8 @@  discard block
 block discarded – undo
178 178
                                 $arr_kbs = [];
179 179
                                 $rows_kb = DB::query(
180 180
                                     'SELECT b.label, b.id
181
-                                    FROM ' . prefixTable('kb_items') . ' AS a
182
-                                    INNER JOIN ' . prefixTable('kb') . ' AS b ON (a.kb_id = b.id)
181
+                                    FROM ' . prefixTable('kb_items').' AS a
182
+                                    INNER JOIN ' . prefixTable('kb').' AS b ON (a.kb_id = b.id)
183 183
                                     WHERE a.item_id = %i',
184 184
                                     $record['id']
185 185
                                 );
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
                                 $arr_tags = [];
192 192
                                 $rows_tag = DB::query(
193 193
                                     'SELECT tag
194
-                                    FROM ' . prefixTable('tags') . '
194
+                                    FROM ' . prefixTable('tags').'
195 195
                                     WHERE item_id = %i',
196 196
                                     $record['id']
197 197
                                 );
@@ -238,14 +238,14 @@  discard block
 block discarded – undo
238 238
                 $tmp .= array2csv($value);
239 239
             }
240 240
 
241
-            echo '[{"content":"' . base64_encode($tmp) . '"}]';
241
+            echo '[{"content":"'.base64_encode($tmp).'"}]';
242 242
             break;
243 243
 
244 244
             /*
245 245
          * PDF - step 1 - Prepare database
246 246
          */
247 247
         case 'initialize_export_table':
248
-            DB::query('TRUNCATE TABLE ' . prefixTable('export'));
248
+            DB::query('TRUNCATE TABLE '.prefixTable('export'));
249 249
             break;
250 250
 
251 251
             /*
@@ -289,9 +289,9 @@  discard block
 block discarded – undo
289 289
                     'SELECT i.id as id, i.restricted_to as restricted_to, i.perso as perso, i.label as label, i.description as description, i.pw as pw, i.login as login, i.url as url, i.email as email,
290 290
                         l.date as date, i.pw_iv as pw_iv,
291 291
                         n.renewal_period as renewal_period
292
-                        FROM ' . prefixTable('items') . ' as i
293
-                        INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree = n.id)
294
-                        INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id = l.id_item)
292
+                        FROM ' . prefixTable('items').' as i
293
+                        INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree = n.id)
294
+                        INNER JOIN ' . prefixTable('log_items').' as l ON (i.id = l.id_item)
295 295
                         WHERE i.inactif = %i
296 296
                         AND i.id_tree= %i
297 297
                         AND (l.action = %s OR (l.action = %s AND l.raison LIKE %s))
@@ -318,8 +318,8 @@  discard block
 block discarded – undo
318 318
                             // Run query
319 319
                             $dataItem = DB::queryfirstrow(
320 320
                                 'SELECT i.pw AS pw, s.share_key AS share_key
321
-                                FROM ' . prefixTable('items') . ' AS i
322
-                                INNER JOIN ' . prefixTable('sharekeys_items') . ' AS s ON (s.object_id = i.id)
321
+                                FROM ' . prefixTable('items').' AS i
322
+                                INNER JOIN ' . prefixTable('sharekeys_items').' AS s ON (s.object_id = i.id)
323 323
                                 WHERE user_id = %i AND i.id = %i',
324 324
                                 $_SESSION['user_id'],
325 325
                                 $record['id']
@@ -343,8 +343,8 @@  discard block
 block discarded – undo
343 343
                             $arr_kbs = '';
344 344
                             $rows_kb = DB::query(
345 345
                                 'SELECT b.label, b.id
346
-                                FROM ' . prefixTable('kb_items') . ' AS a
347
-                                INNER JOIN ' . prefixTable('kb') . ' AS b ON (a.kb_id = b.id)
346
+                                FROM ' . prefixTable('kb_items').' AS a
347
+                                INNER JOIN ' . prefixTable('kb').' AS b ON (a.kb_id = b.id)
348 348
                                 WHERE a.item_id = %i',
349 349
                                 $record['id']
350 350
                             );
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
                                 if (empty($arr_kbs)) {
353 353
                                     $arr_kbs = $rec_kb['label'];
354 354
                                 } else {
355
-                                    $arr_kbs .= ' | ' . $rec_kb['label'];
355
+                                    $arr_kbs .= ' | '.$rec_kb['label'];
356 356
                                 }
357 357
                             }
358 358
 
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
                             $arr_tags = '';
361 361
                             $rows_tag = DB::query(
362 362
                                 'SELECT tag
363
-                                FROM ' . prefixTable('tags') . '
363
+                                FROM ' . prefixTable('tags').'
364 364
                                 WHERE item_id = %i',
365 365
                                 $record['id']
366 366
                             );
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
                                 if (empty($arr_tags)) {
369 369
                                     $arr_tags = $rec_tag['tag'];
370 370
                                 } else {
371
-                                    $arr_tags .= ' ' . $rec_tag['tag'];
371
+                                    $arr_tags .= ' '.$rec_tag['tag'];
372 372
                                 }
373 373
                             }
374 374
 
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
             header('Content-type: application/pdf');
436 436
 
437 437
             // query
438
-            $rows = DB::query('SELECT * FROM ' . prefixTable('export'));
438
+            $rows = DB::query('SELECT * FROM '.prefixTable('export'));
439 439
             $counter = DB::count();
440 440
             if ($counter > 0) {
441 441
                 // print
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
                 $prev_path = '';
447 447
 
448 448
                 //Prepare the PDF file
449
-                include $SETTINGS['cpassman_dir'] . '/includes/libraries/Pdf/Tfpdf/fpdf.php';
449
+                include $SETTINGS['cpassman_dir'].'/includes/libraries/Pdf/Tfpdf/fpdf.php';
450 450
 
451 451
                 $pdf = new FPDF_Protection('P', 'mm', 'A4', 'ma page');
452 452
                 $pdf->SetProtection(array('print'), $dataReceived['pdf_password'], null, 3);
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
                 logEvents('pdf_export', '', $_SESSION['user_id'], $_SESSION['login']);
528 528
 
529 529
                 //clean table
530
-                DB::query('TRUNCATE TABLE ' . prefixTable('export'));
530
+                DB::query('TRUNCATE TABLE '.prefixTable('export'));
531 531
 
532 532
                 // Send back the file in Blob
533 533
                 echo $pdf->Output(null, 'I');
@@ -539,8 +539,8 @@  discard block
 block discarded – undo
539 539
             // step 1:
540 540
             // - prepare export file
541 541
             // - get full list of objects id to export
542
-            include $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
543
-            include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/GibberishAES/GibberishAES.php';
542
+            include $SETTINGS['cpassman_dir'].'/includes/config/include.php';
543
+            include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/GibberishAES/GibberishAES.php';
544 544
             $idsList = array();
545 545
             $objNumber = 0;
546 546
 
@@ -553,9 +553,9 @@  discard block
 block discarded – undo
553 553
                     // count elements to display
554 554
                     $result = DB::query(
555 555
                         'SELECT i.id AS id, i.label AS label, i.restricted_to AS restricted_to, i.perso AS perso
556
-                    FROM ' . prefixTable('items') . ' as i
557
-                    INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree = n.id)
558
-                    INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id = l.id_item)
556
+                    FROM ' . prefixTable('items').' as i
557
+                    INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree = n.id)
558
+                    INNER JOIN ' . prefixTable('log_items').' as l ON (i.id = l.id_item)
559 559
                     WHERE i.inactif = %i
560 560
                     AND i.id_tree= %i
561 561
                     AND (l.action = %s OR (l.action = %s AND l.raison LIKE %s))
@@ -584,9 +584,9 @@  discard block
 block discarded – undo
584 584
 
585 585
             // prepare export file
586 586
             //save the file
587
-            $html_file = '/teampass_export_' . time() . '_' . generateKey() . '.html';
587
+            $html_file = '/teampass_export_'.time().'_'.generateKey().'.html';
588 588
             //print_r($full_listing);
589
-            $outstream = fopen($SETTINGS['path_to_files_folder'] . $html_file, 'w');
589
+            $outstream = fopen($SETTINGS['path_to_files_folder'].$html_file, 'w');
590 590
             fwrite(
591 591
                 $outstream,
592 592
                 '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
@@ -606,12 +606,12 @@  discard block
 block discarded – undo
606 606
     </style>
607 607
     </head>
608 608
     <body>
609
-    <input type="hidden" id="generation_date" value="' . GibberishAES::enc(time(), $post_pdf_password) . '" />
609
+    <input type="hidden" id="generation_date" value="' . GibberishAES::enc(time(), $post_pdf_password).'" />
610 610
     <div id="header">
611
-    ' . TP_TOOL_NAME . ' - Off Line mode
611
+    ' . TP_TOOL_NAME.' - Off Line mode
612 612
     </div>
613 613
     <div style="margin:10px; font-size:9px;">
614
-    <i>This page was generated by <b>' . $_SESSION['name'] . ' ' . $_SESSION['lastname'] . '</b>, the ' . date('Y/m/d H:i:s') . '.</i>
614
+    <i>This page was generated by <b>' . $_SESSION['name'].' '.$_SESSION['lastname'].'</b>, the '.date('Y/m/d H:i:s').'.</i>
615 615
     <span id="info_page" style="margin-left:20px; font-weight:bold; font-size: 14px; color:red;"></span>
616 616
     </div>
617 617
     <div id="information"></div>
@@ -622,11 +622,11 @@  discard block
 block discarded – undo
622 622
     <div>
623 623
     <table id="itemsTable">
624 624
         <thead><tr>
625
-            <th style="width:15%;">' . $LANG['label'] . '</th>
626
-            <th style="width:10%;">' . $LANG['pw'] . '</th>
627
-            <th style="width:30%;">' . $LANG['description'] . '</th>
628
-            <th style="width:5%;">' . $LANG['user_login'] . '</th>
629
-            <th style="width:20%;">' . $LANG['url'] . '</th>
625
+            <th style="width:15%;">' . $LANG['label'].'</th>
626
+            <th style="width:10%;">' . $LANG['pw'].'</th>
627
+            <th style="width:30%;">' . $LANG['description'].'</th>
628
+            <th style="width:5%;">' . $LANG['user_login'].'</th>
629
+            <th style="width:20%;">' . $LANG['url'].'</th>
630 630
         </tr></thead>
631 631
         <tbody id="itemsTable_tbody">'
632 632
             );
@@ -651,22 +651,22 @@  discard block
 block discarded – undo
651 651
                 || in_array($post_idTree, $_SESSION['groupes_visibles']) === false
652 652
                 || (in_array($post_idTree, $_SESSION['no_access_folders']) === true)
653 653
             ) {
654
-                echo '[{"loop":"true", "number":"' . $post_number . '", "cpt":"' . $post_cpt . '", "file":"' . $post_file . '", "idsList":"' . $post_idsList . '" , "file_link":"' . $post_file_link . '"}]';
654
+                echo '[{"loop":"true", "number":"'.$post_number.'", "cpt":"'.$post_cpt.'", "file":"'.$post_file.'", "idsList":"'.$post_idsList.'" , "file_link":"'.$post_file_link.'"}]';
655 655
                 break;
656 656
             }
657 657
 
658 658
             $full_listing = array();
659 659
             $items_id_list = array();
660
-            include $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
661
-            include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/GibberishAES/GibberishAES.php';
660
+            include $SETTINGS['cpassman_dir'].'/includes/config/include.php';
661
+            include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/GibberishAES/GibberishAES.php';
662 662
 
663 663
             $rows = DB::query(
664 664
                 'SELECT i.id as id, i.url as url, i.perso as perso, i.label as label, i.description as description, i.pw as pw, i.login as login, i.id_tree as id_tree,
665 665
                 l.date as date, i.pw_iv as pw_iv,
666 666
                 n.renewal_period as renewal_period
667
-            FROM ' . prefixTable('items') . ' as i
668
-            INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree = n.id)
669
-            INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id = l.id_item)
667
+            FROM ' . prefixTable('items').' as i
668
+            INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree = n.id)
669
+            INNER JOIN ' . prefixTable('log_items').' as l ON (i.id = l.id_item)
670 670
             WHERE i.inactif = %i
671 671
             AND i.id_tree= %i
672 672
             AND (l.action = %s OR (l.action = %s AND l.raison LIKE %s))
@@ -725,7 +725,7 @@  discard block
 block discarded – undo
725 725
             }
726 726
 
727 727
             //save in export file
728
-            $outstream = fopen($post_file . '.txt', 'a');
728
+            $outstream = fopen($post_file.'.txt', 'a');
729 729
 
730 730
             $lineType = 'line1';
731 731
             $idTree = '';
@@ -759,13 +759,13 @@  discard block
 block discarded – undo
759 759
                         if (empty($arboHtml)) {
760 760
                             $arboHtml = $arboHtml_tmp;
761 761
                         } else {
762
-                            $arboHtml .= ' » ' . $arboHtml_tmp;
762
+                            $arboHtml .= ' » '.$arboHtml_tmp;
763 763
                         }
764 764
                     }
765 765
                     fputs(
766 766
                         $outstream,
767 767
                         '
768
-        <tr class="path"><td colspan="5">' . $arboHtml . '</td></tr>'
768
+        <tr class="path"><td colspan="5">' . $arboHtml.'</td></tr>'
769 769
                     );
770 770
                     $idTree = $elem['id_tree'];
771 771
                 }
@@ -774,12 +774,12 @@  discard block
 block discarded – undo
774 774
                 fputs(
775 775
                     $outstream,
776 776
                     '
777
-        <tr class="' . $lineType . '">
778
-            <td>' . addslashes($elem['label']) . '</td>
779
-            <td align="center"><span class="span_pw" id="span_' . $elem['id'] . '"><a href="#" onclick="decryptme(' . $elem['id'] . ', \'' . $encPw . '\');return false;">Decrypt </a></span><input type="hidden" id="hide_' . $elem['id'] . '" value="' . $encPw . '" /></td>
780
-            <td>' . $desc . '</td>
781
-            <td align="center">' . $login . '</td>
782
-            <td align="center">' . $url . '</td>
777
+        <tr class="' . $lineType.'">
778
+            <td>' . addslashes($elem['label']).'</td>
779
+            <td align="center"><span class="span_pw" id="span_' . $elem['id'].'"><a href="#" onclick="decryptme('.$elem['id'].', \''.$encPw.'\');return false;">Decrypt </a></span><input type="hidden" id="hide_'.$elem['id'].'" value="'.$encPw.'" /></td>
780
+            <td>' . $desc.'</td>
781
+            <td align="center">' . $login.'</td>
782
+            <td align="center">' . $url.'</td>
783 783
             </tr>'
784 784
                 );
785 785
             }
@@ -787,21 +787,21 @@  discard block
 block discarded – undo
787 787
             fclose($outstream);
788 788
 
789 789
             // send back and continue
790
-            echo '[{"loop":"true", "number":"' . $post_number . '", "cpt":"' . $post_cpt . '", "file":"' . $post_file . '", "idsList":"' . $post_idsList . '" , "file_link":"' . $post_file_link . '"}]';
790
+            echo '[{"loop":"true", "number":"'.$post_number.'", "cpt":"'.$post_cpt.'", "file":"'.$post_file.'", "idsList":"'.$post_idsList.'" , "file_link":"'.$post_file_link.'"}]';
791 791
             break;
792 792
 
793 793
             //CASE export in HTML format - Iteration loop
794 794
         case 'export_to_html_format_finalize':
795 795
             // Load includes
796
-            include $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
797
-            require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/GibberishAES/GibberishAES.php';
796
+            include $SETTINGS['cpassman_dir'].'/includes/config/include.php';
797
+            require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/GibberishAES/GibberishAES.php';
798 798
 
799 799
             // read the content of the temporary file
800
-            $handle = fopen($post_file . '.txt', 'r');
801
-            $contents = fread($handle, filesize($post_file . '.txt'));
800
+            $handle = fopen($post_file.'.txt', 'r');
801
+            $contents = fread($handle, filesize($post_file.'.txt'));
802 802
             fclose($handle);
803
-            if (is_file($post_file . '.txt')) {
804
-                unlink($post_file . '.txt');
803
+            if (is_file($post_file.'.txt')) {
804
+                unlink($post_file.'.txt');
805 805
             }
806 806
 
807 807
             // Encrypt its content
@@ -812,7 +812,7 @@  discard block
 block discarded – undo
812 812
                 if (empty($encrypted_text) === true) {
813 813
                     $encrypted_text = GibberishAES::enc($chunk, $post_pdf_password);
814 814
                 } else {
815
-                    $encrypted_text .= '|#|#|' . GibberishAES::enc($chunk, $post_pdf_password);
815
+                    $encrypted_text .= '|#|#|'.GibberishAES::enc($chunk, $post_pdf_password);
816 816
                 }
817 817
             }
818 818
 
@@ -825,9 +825,9 @@  discard block
 block discarded – undo
825 825
         </table></div>
826 826
         <input type="button" value="Hide all" onclick="hideAll()" />
827 827
         <div id="footer" style="text-align:center;">
828
-            <a href="https://teampass.net/about/" target="_blank" style="">' . TP_TOOL_NAME . '&nbsp;' . TP_VERSION_FULL . '&nbsp;' . TP_COPYRIGHT . '</a>
828
+            <a href="https://teampass.net/about/" target="_blank" style="">' . TP_TOOL_NAME.'&nbsp;'.TP_VERSION_FULL.'&nbsp;'.TP_COPYRIGHT.'</a>
829 829
         </div>
830
-        <div id="enc_html" style="display:none;">' . $encrypted_text . '</div>
830
+        <div id="enc_html" style="display:none;">' . $encrypted_text.'</div>
831 831
         </body>
832 832
     </html>
833 833
     <script type="text/javascript">
@@ -933,9 +933,9 @@  discard block
 block discarded – undo
933 933
 
934 934
             fclose($outstream);
935 935
 
936
-            echo '[{"text":"<a href=\'' .
937
-                $post_file_link .
938
-                '\' target=\'_blank\'>' . $LANG['pdf_download'] . '</a>"}]';
936
+            echo '[{"text":"<a href=\''.
937
+                $post_file_link.
938
+                '\' target=\'_blank\'>'.$LANG['pdf_download'].'</a>"}]';
939 939
             break;
940 940
     }
941 941
 }
Please login to merge, or discard this patch.
sources/core.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -44,22 +44,22 @@  discard block
 block discarded – undo
44 44
     $antiXss = new protect\AntiXSS\AntiXSS();
45 45
 
46 46
     if (!headers_sent()) {    //If headers not sent yet... then do php redirect
47
-        header('Location: ' . $antiXss->xss_clean($url));
47
+        header('Location: '.$antiXss->xss_clean($url));
48 48
 
49 49
         return;
50 50
     }
51 51
 
52 52
     //If headers are sent... do java redirect... if java disabled, do html redirect.
53 53
     echo '<script type="text/javascript">';
54
-    echo 'window.location.href="' . $antiXss->xss_clean($url) . '";';
54
+    echo 'window.location.href="'.$antiXss->xss_clean($url).'";';
55 55
     echo '</script>';
56 56
     echo '<noscript>';
57
-    echo '<meta http-equiv="refresh" content="0;url=' . $antiXss->xss_clean($url) . '" />';
57
+    echo '<meta http-equiv="refresh" content="0;url='.$antiXss->xss_clean($url).'" />';
58 58
     echo '</noscript>';
59 59
 }
60 60
 
61 61
 // Include files
62
-require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
62
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
63 63
 $superGlobal = new protect\SuperGlobal\SuperGlobal();
64 64
 
65 65
 // Prepare GET variables
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     && isset($SETTINGS['enable_sts']) === true
73 73
     && (int) $SETTINGS['enable_sts'] === 1
74 74
 ) {
75
-    redirect('https://' . $superGlobal->get('HTTP_HOST', 'SERVER') . $superGlobal->get('REQUEST_URI', 'SERVER'));
75
+    redirect('https://'.$superGlobal->get('HTTP_HOST', 'SERVER').$superGlobal->get('REQUEST_URI', 'SERVER'));
76 76
 }
77 77
 
78 78
 // Load pwComplexity
@@ -97,11 +97,11 @@  discard block
 block discarded – undo
97 97
 // LOAD CPASSMAN SETTINGS
98 98
 if (
99 99
     isset($SETTINGS['cpassman_dir']) === true
100
-    && is_dir($SETTINGS['cpassman_dir'] . '/install') === true
100
+    && is_dir($SETTINGS['cpassman_dir'].'/install') === true
101 101
 ) {
102 102
     // Should we delete folder INSTALL?
103 103
     $row = DB::queryFirstRow(
104
-        'SELECT valeur FROM ' . prefixTable('misc') . ' WHERE type=%s AND intitule=%s',
104
+        'SELECT valeur FROM '.prefixTable('misc').' WHERE type=%s AND intitule=%s',
105 105
         'install',
106 106
         'clear_install_folder'
107 107
     );
@@ -116,11 +116,11 @@  discard block
 block discarded – undo
116 116
                 $files = array_diff($directories, array('.', '..'));
117 117
 
118 118
                 foreach ($files as $file) {
119
-                    if (is_dir($dir . '/' . $file)) {
120
-                        delTree($dir . '/' . $file);
119
+                    if (is_dir($dir.'/'.$file)) {
120
+                        delTree($dir.'/'.$file);
121 121
                     } else {
122 122
                         try {
123
-                            unlink($dir . '/' . $file);
123
+                            unlink($dir.'/'.$file);
124 124
                         } catch (Exception $e) {
125 125
                             // do nothing... php will ignore and continue
126 126
                         }
@@ -133,13 +133,13 @@  discard block
 block discarded – undo
133 133
             }
134 134
         }
135 135
 
136
-        if (is_dir($SETTINGS['cpassman_dir'] . '/install')) {
136
+        if (is_dir($SETTINGS['cpassman_dir'].'/install')) {
137 137
             // Set the permissions on the install directory and delete
138 138
             // is server Windows or Linux?
139 139
             if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
140
-                chmodRecursive($SETTINGS['cpassman_dir'] . '/install', 0755, 0440);
140
+                chmodRecursive($SETTINGS['cpassman_dir'].'/install', 0755, 0440);
141 141
             }
142
-            delTree($SETTINGS['cpassman_dir'] . '/install');
142
+            delTree($SETTINGS['cpassman_dir'].'/install');
143 143
         }
144 144
 
145 145
         // Delete temporary install table
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 // Load Languages stuff
159 159
 if (isset($languagesList) === false) {
160 160
     $languagesList = array();
161
-    $rows = DB::query('SELECT * FROM ' . prefixTable('languages') . ' GROUP BY name, label, code, flag, id ORDER BY name ASC');
161
+    $rows = DB::query('SELECT * FROM '.prefixTable('languages').' GROUP BY name, label, code, flag, id ORDER BY name ASC');
162 162
     foreach ($rows as $record) {
163 163
         array_push($languagesList, $record['name']);
164 164
         if (isset($_SESSION['user_language']) && $record['name'] == $_SESSION['user_language']) {
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 // CHECK IF SESSION EXISTS AND IF SESSION IS VALID
217 217
 if (empty($_SESSION['sessionDuration']) === false) {
218 218
     $dataSession = DB::queryFirstRow(
219
-        'SELECT key_tempo FROM ' . prefixTable('users') . ' WHERE id=%i',
219
+        'SELECT key_tempo FROM '.prefixTable('users').' WHERE id=%i',
220 220
         $_SESSION['user_id']
221 221
     );
222 222
 } else {
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
     && (isset($_SESSION['user_admin']) === true && $_SESSION['user_admin'] == 1)
283 283
 ) {
284 284
     $row = DB::queryFirstRow(
285
-        'SELECT valeur FROM ' . prefixTable('misc') . ' WHERE type=%s_type AND intitule=%s_intitule',
285
+        'SELECT valeur FROM '.prefixTable('misc').' WHERE type=%s_type AND intitule=%s_intitule',
286 286
         array(
287 287
             'type' => 'admin',
288 288
             'intitule' => 'cpassman_version',
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
 
343 343
         syslog(
344 344
             LOG_WARNING,
345
-            'Unlog user: ' . date('Y/m/d H:i:s') . " {$_SERVER['REMOTE_ADDR']} ({$_SERVER['HTTP_USER_AGENT']})"
345
+            'Unlog user: '.date('Y/m/d H:i:s')." {$_SERVER['REMOTE_ADDR']} ({$_SERVER['HTTP_USER_AGENT']})"
346 346
         );
347 347
 
348 348
         // erase session table
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
 if (isset($_SESSION['user_id']) === true && empty($_SESSION['user_id']) === false) {
397 397
     // query on user
398 398
     $data = DB::queryfirstrow(
399
-        'SELECT login, admin, gestionnaire, can_manage_all_users, groupes_visibles, groupes_interdits, fonction_id, last_connexion FROM ' . prefixTable('users') . ' WHERE id=%i',
399
+        'SELECT login, admin, gestionnaire, can_manage_all_users, groupes_visibles, groupes_interdits, fonction_id, last_connexion FROM '.prefixTable('users').' WHERE id=%i',
400 400
         $_SESSION['user_id']
401 401
     );
402 402
 
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
     $_SESSION['item_fields'] = array();
482 482
     $rows = DB::query(
483 483
         'SELECT *
484
-        FROM ' . prefixTable('categories') . '
484
+        FROM ' . prefixTable('categories').'
485 485
         WHERE level=%i',
486 486
         '0'
487 487
     );
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
         // get each field
492 492
         $rows2 = DB::query(
493 493
             'SELECT *
494
-            FROM ' . prefixTable('categories') . '
494
+            FROM ' . prefixTable('categories').'
495 495
             WHERE parent_id=%i
496 496
             ORDER BY `order` ASC',
497 497
             $record['id']
@@ -581,5 +581,5 @@  discard block
 block discarded – undo
581 581
 }
582 582
 
583 583
 /* CHECK NUMBER OF USER ONLINE */
584
-DB::query('SELECT * FROM ' . prefixTable('users') . ' WHERE timestamp>=%i', time() - 600);
584
+DB::query('SELECT * FROM '.prefixTable('users').' WHERE timestamp>=%i', time() - 600);
585 585
 $_SESSION['nb_users_online'] = DB::count();
Please login to merge, or discard this patch.
sources/tree.php 1 patch
Spacing   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -39,11 +39,11 @@  discard block
 block discarded – undo
39 39
 }
40 40
 
41 41
 // includes
42
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
43
-require_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
44
-require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
45
-require_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php';
46
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
42
+require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php';
43
+require_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
44
+require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
45
+require_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php';
46
+require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
47 47
 
48 48
 // header
49 49
 header('Content-type: text/html; charset=utf-8');
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 }
58 58
 
59 59
 // Connect to mysql server
60
-require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
60
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
61 61
 if (defined('DB_PASSWD_CLEAR') === false) {
62 62
     define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
63 63
 }
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 DB::$encoding = DB_ENCODING;
70 70
 
71 71
 // Superglobal load
72
-require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
72
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
73 73
 $superGlobal = new protect\SuperGlobal\SuperGlobal();
74 74
 
75 75
 $session_user_admin = $superGlobal->get('user_admin', 'GET');
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 
79 79
 
80 80
 $lastFolderChange = DB::query(
81
-    'SELECT * FROM ' . prefixTable('misc') . '
81
+    'SELECT * FROM '.prefixTable('misc').'
82 82
     WHERE type = %s AND intitule = %s',
83 83
     'timestamp',
84 84
     'last_folder_change'
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
     || (isset($_GET['force_refresh']) === true && (int) $_GET['force_refresh'] === 1)
90 90
 ) {
91 91
     // Build tree
92
-    $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries');
92
+    $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries');
93 93
     $tree->register();
94 94
     $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title');
95 95
 
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
     $SETTINGS
190 190
 ) {
191 191
     // Load library
192
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
192
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
193 193
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
194 194
 
195 195
     // Prepare superGlobal variables
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 
242 242
                 // get count of Items in this folder
243 243
                 DB::query(
244
-                    'SELECT * FROM ' . prefixTable('items') . '
244
+                    'SELECT * FROM '.prefixTable('items').'
245 245
                     WHERE inactif=%i AND id_tree = %i',
246 246
                     0,
247 247
                     $node->id
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
 
251 251
                 // get info about current folder
252 252
                 DB::query(
253
-                    'SELECT * FROM ' . prefixTable('nested_tree') . '
253
+                    'SELECT * FROM '.prefixTable('nested_tree').'
254 254
                     WHERE parent_id = %i',
255 255
                     $node->id
256 256
                 );
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
                 if ($node->parent_id == 0) {
269 269
                     $parent = '#';
270 270
                 } else {
271
-                    $parent = 'li_' . $node->parent_id;
271
+                    $parent = 'li_'.$node->parent_id;
272 272
                 }
273 273
 
274 274
                 // special case for READ-ONLY folder
@@ -281,31 +281,31 @@  discard block
 block discarded – undo
281 281
 
282 282
                 if (in_array($node->id, $session_groupes_visibles)) {
283 283
                     if (in_array($node->id, $session_read_only_folders)) {
284
-                        $text = "<i class='far fa-eye fa-xs mr-1'></i>" . $text;
284
+                        $text = "<i class='far fa-eye fa-xs mr-1'></i>".$text;
285 285
                         $title = langHdl('read_only_account');
286 286
                         $restricted = 1;
287 287
                         $folderClass = 'folder_not_droppable';
288 288
                     } elseif ($_SESSION['user_read_only'] === true && !in_array($node->id, $session_personal_visible_groups)) {
289
-                        $text = "<i class='far fa-eye fa-xs mr-1'></i>" . $text;
289
+                        $text = "<i class='far fa-eye fa-xs mr-1'></i>".$text;
290 290
                     }
291
-                    $text .= ' (<span class=\'items_count\' id=\'itcount_' . $node->id . '\'>' . $itemsNb . '</span>';
291
+                    $text .= ' (<span class=\'items_count\' id=\'itcount_'.$node->id.'\'>'.$itemsNb.'</span>';
292 292
                     // display tree counters
293 293
                     if (isset($SETTINGS['tree_counters']) && $SETTINGS['tree_counters'] == 1) {
294
-                        $text .= '|' . $nbChildrenItems . '|' . (count($nodeDescendants) - 1);
294
+                        $text .= '|'.$nbChildrenItems.'|'.(count($nodeDescendants) - 1);
295 295
                     }
296 296
                     $text .= ')';
297 297
                 } elseif (in_array($node->id, $listFoldersLimitedKeys)) {
298 298
                     $restricted = '1';
299 299
                     if ($_SESSION['user_read_only'] === true) {
300
-                        $text = "<i class='far fa-eye fa-xs mr-1'></i>" . $text;
300
+                        $text = "<i class='far fa-eye fa-xs mr-1'></i>".$text;
301 301
                     }
302
-                    $text .= ' (<span class=\'items_count\' id=\'itcount_' . $node->id . '\'>' . count($session_list_folders_limited[$node->id]) . '</span>';
302
+                    $text .= ' (<span class=\'items_count\' id=\'itcount_'.$node->id.'\'>'.count($session_list_folders_limited[$node->id]).'</span>';
303 303
                 } elseif (in_array($node->id, $listRestrictedFoldersForItemsKeys)) {
304 304
                     $restricted = '1';
305 305
                     if ($_SESSION['user_read_only'] === true) {
306
-                        $text = "<i class='far fa-eye fa-xs mr-1'></i>" . $text;
306
+                        $text = "<i class='far fa-eye fa-xs mr-1'></i>".$text;
307 307
                     }
308
-                    $text .= ' (<span class=\'items_count\' id=\'itcount_' . $node->id . '\'>' . count($session_list_restricted_folders_for_items[$node->id]) . '</span>';
308
+                    $text .= ' (<span class=\'items_count\' id=\'itcount_'.$node->id.'\'>'.count($session_list_restricted_folders_for_items[$node->id]).'</span>';
309 309
                 } else {
310 310
                     $restricted = '1';
311 311
                     $folderClass = 'folder_not_droppable';
@@ -333,23 +333,23 @@  discard block
 block discarded – undo
333 333
 
334 334
                 // json
335 335
                 if ($hide_node === false && $show_but_block === false) {
336
-                    $ret_json .= '{' .
337
-                        '"id":"li_' . $node->id . '"' .
338
-                        ', "parent":"' . $parent . '"' .
339
-                        ', "label":"' . $parent . '"' .
340
-                        ', "level":"' . $parent . '"' .
341
-                        ', "children":' . ($childrenNb == 0 ? 'false' : 'true') .
342
-                        ', "text":"' . str_replace('"', '&quot;', $text) . '"' .
343
-                        ', "li_attr":{"class":"jstreeopen", "title":"ID [' . $node->id . '] ' . $title . '"}' .
344
-                        ', "a_attr":{"id":"fld_' . $node->id . '", "class":"' . $folderClass . ' nodblclick" , "onclick":"ListerItems(\'' . $node->id . '\', \'' . $restricted . '\', 0, 1)"}' .
336
+                    $ret_json .= '{'.
337
+                        '"id":"li_'.$node->id.'"'.
338
+                        ', "parent":"'.$parent.'"'.
339
+                        ', "label":"'.$parent.'"'.
340
+                        ', "level":"'.$parent.'"'.
341
+                        ', "children":'.($childrenNb == 0 ? 'false' : 'true').
342
+                        ', "text":"'.str_replace('"', '&quot;', $text).'"'.
343
+                        ', "li_attr":{"class":"jstreeopen", "title":"ID ['.$node->id.'] '.$title.'"}'.
344
+                        ', "a_attr":{"id":"fld_'.$node->id.'", "class":"'.$folderClass.' nodblclick" , "onclick":"ListerItems(\''.$node->id.'\', \''.$restricted.'\', 0, 1)"}'.
345 345
                         '}';
346 346
                 } elseif ($show_but_block === true) {
347
-                    $ret_json .= '{' .
348
-                        '"id":"li_' . $node->id . '"' .
349
-                        ', "parent":"' . $parent . '"' .
350
-                        ', "children":' . ($childrenNb == 0 ? 'false' : 'true') .
351
-                        ', "text":"<i class=\'fas fa-times fa-xs text-danger mr-1\'></i>' . $text . '"' .
352
-                        ', "li_attr":{"class":"", "title":"ID [' . $node->id . '] ' . langHdl('no_access') . '"}' .
347
+                    $ret_json .= '{'.
348
+                        '"id":"li_'.$node->id.'"'.
349
+                        ', "parent":"'.$parent.'"'.
350
+                        ', "children":'.($childrenNb == 0 ? 'false' : 'true').
351
+                        ', "text":"<i class=\'fas fa-times fa-xs text-danger mr-1\'></i>'.$text.'"'.
352
+                        ', "li_attr":{"class":"", "title":"ID ['.$node->id.'] '.langHdl('no_access').'"}'.
353 353
                         '}';
354 354
                 }
355 355
             }
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
     }
387 387
 
388 388
     // Load library
389
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
389
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
390 390
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
391 391
 
392 392
     // Prepare superGlobal variables
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
                 ) === true
427 427
             ) {
428 428
                 DB::query(
429
-                    'SELECT * FROM ' . prefixTable('items') . '
429
+                    'SELECT * FROM '.prefixTable('items').'
430 430
                     WHERE inactif=%i AND id_tree = %i',
431 431
                     0,
432 432
                     $node
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
         if ($displayThisNode === true) {
459 459
             // get info about current folder
460 460
             DB::query(
461
-                'SELECT * FROM ' . prefixTable('items') . '
461
+                'SELECT * FROM '.prefixTable('items').'
462 462
                 WHERE inactif=%i AND id_tree = %i',
463 463
                 0,
464 464
                 $completTree[$nodeId]->id
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
 
487 487
             if (in_array($completTree[$nodeId]->id, $session_groupes_visibles) === true) {
488 488
                 if (in_array($completTree[$nodeId]->id, $session_read_only_folders) === true) {
489
-                    $text = "<i class='far fa-eye fa-xs mr-1'></i>" . $text;
489
+                    $text = "<i class='far fa-eye fa-xs mr-1'></i>".$text;
490 490
                     $title = langHdl('read_only_account');
491 491
                     $restricted = 1;
492 492
                     $folderClass = 'folder_not_droppable';
@@ -494,29 +494,29 @@  discard block
 block discarded – undo
494 494
                     $session_user_read_only === true
495 495
                     && in_array($completTree[$nodeId]->id, $_SESSION['personal_visible_groups']) === false
496 496
                 ) {
497
-                    $text = "<i class='far fa-eye fa-xs mr-1'></i>" . $text;
497
+                    $text = "<i class='far fa-eye fa-xs mr-1'></i>".$text;
498 498
                 }
499
-                $text .= ' (<span class=\'items_count\' id=\'itcount_' . $completTree[$nodeId]->id . '\'>' . $itemsNb . '</span>';
499
+                $text .= ' (<span class=\'items_count\' id=\'itcount_'.$completTree[$nodeId]->id.'\'>'.$itemsNb.'</span>';
500 500
                 // display tree counters
501 501
                 if (
502 502
                     isset($SETTINGS['tree_counters']) === true
503 503
                     && $SETTINGS['tree_counters'] == 1
504 504
                 ) {
505
-                    $text .= '|' . $nbChildrenItems . '|' . (count($nodeDescendants) - 1);
505
+                    $text .= '|'.$nbChildrenItems.'|'.(count($nodeDescendants) - 1);
506 506
                 }
507 507
                 $text .= ')';
508 508
             } elseif (in_array($completTree[$nodeId]->id, $listFoldersLimitedKeys) === true) {
509 509
                 $restricted = '1';
510 510
                 if ($session_user_read_only === true) {
511
-                    $text = "<i class='far fa-eye fa-xs mr-1'></i>" . $text;
511
+                    $text = "<i class='far fa-eye fa-xs mr-1'></i>".$text;
512 512
                 }
513
-                $text .= ' (<span class=\'items_count\' id=\'itcount_' . $completTree[$nodeId]->id . '\'>' . count($session_list_folders_limited[$completTree[$nodeId]->id]) . '</span>)';
513
+                $text .= ' (<span class=\'items_count\' id=\'itcount_'.$completTree[$nodeId]->id.'\'>'.count($session_list_folders_limited[$completTree[$nodeId]->id]).'</span>)';
514 514
             } elseif (in_array($completTree[$nodeId]->id, $listRestrictedFoldersForItemsKeys) === true) {
515 515
                 $restricted = '1';
516 516
                 if ($_SESSION['user_read_only'] === true) {
517
-                    $text = "<i class='far fa-eye fa-xs mr-1'></i>" . $text;
517
+                    $text = "<i class='far fa-eye fa-xs mr-1'></i>".$text;
518 518
                 }
519
-                $text .= ' (<span class=\'items_count\' id=\'itcount_' . $completTree[$nodeId]->id . '\'>' . count($_SESSION['list_restricted_folders_for_items'][$completTree[$nodeId]->id]) . '</span>)';
519
+                $text .= ' (<span class=\'items_count\' id=\'itcount_'.$completTree[$nodeId]->id.'\'>'.count($_SESSION['list_restricted_folders_for_items'][$completTree[$nodeId]->id]).'</span>)';
520 520
             } else {
521 521
                 $restricted = '1';
522 522
                 $folderClass = 'folder_not_droppable';
@@ -556,7 +556,7 @@  discard block
 block discarded – undo
556 556
             if ($completTree[$nodeId]->parent_id === '0') {
557 557
                 $parent = '#';
558 558
             } else {
559
-                $parent = 'li_' . $completTree[$nodeId]->parent_id;
559
+                $parent = 'li_'.$completTree[$nodeId]->parent_id;
560 560
             }
561 561
 
562 562
             // handle displaying
@@ -577,17 +577,17 @@  discard block
 block discarded – undo
577 577
                 array_push(
578 578
                     $ret_json,
579 579
                     array(
580
-                        'id' => 'li_' . $completTree[$nodeId]->id,
580
+                        'id' => 'li_'.$completTree[$nodeId]->id,
581 581
                         'parent' => empty($last_visible_parent) === true ? $parent : $last_visible_parent,
582 582
                         'text' => $text,
583 583
                         'li_attr' => array(
584 584
                             'class' => 'jstreeopen',
585
-                            'title' => 'ID [' . $completTree[$nodeId]->id . '] ' . $title,
585
+                            'title' => 'ID ['.$completTree[$nodeId]->id.'] '.$title,
586 586
                         ),
587 587
                         'a_attr' => array(
588
-                            'id' => 'fld_' . $completTree[$nodeId]->id,
588
+                            'id' => 'fld_'.$completTree[$nodeId]->id,
589 589
                             'class' => $folderClass,
590
-                            'onclick' => 'ListerItems(' . $completTree[$nodeId]->id . ', ' . $restricted . ', 0, 1)',
590
+                            'onclick' => 'ListerItems('.$completTree[$nodeId]->id.', '.$restricted.', 0, 1)',
591 591
                             //'ondblclick' => 'LoadTreeNode('.$completTree[$nodeId]->id.')',
592 592
                             'data-title' => $completTree[$nodeId]->title,
593 593
                         ),
@@ -597,12 +597,12 @@  discard block
 block discarded – undo
597 597
                 array_push(
598 598
                     $ret_json,
599 599
                     array(
600
-                        'id' => 'li_' . $completTree[$nodeId]->id,
600
+                        'id' => 'li_'.$completTree[$nodeId]->id,
601 601
                         'parent' => empty($last_visible_parent) === true ? $parent : $last_visible_parent,
602
-                        'text' => '<i class="fas fa-times fa-xs text-danger mr-1"></i>' . $text,
602
+                        'text' => '<i class="fas fa-times fa-xs text-danger mr-1"></i>'.$text,
603 603
                         'li_attr' => array(
604 604
                             'class' => '',
605
-                            'title' => 'ID [' . $completTree[$nodeId]->id . '] ' . langHdl('no_access'),
605
+                            'title' => 'ID ['.$completTree[$nodeId]->id.'] '.langHdl('no_access'),
606 606
                         ),
607 607
                     )
608 608
                 );
Please login to merge, or discard this patch.
includes/core/login.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -39,9 +39,9 @@  discard block
 block discarded – undo
39 39
     (isset($SETTINGS['custom_logo']) === true
40 40
         && empty($SETTINGS['custom_logo']) === false) ?
41 41
         '
42
-        <img src="' . (string) $SETTINGS['custom_logo'] . '" alt="" style="margin-bottom:40px;" />' : '',
42
+        <img src="' . (string) $SETTINGS['custom_logo'].'" alt="" style="margin-bottom:40px;" />' : '',
43 43
     '
44
-        <a href="#"><b>' . TP_TOOL_NAME . '</b></a>
44
+        <a href="#"><b>' . TP_TOOL_NAME.'</b></a>
45 45
     </div>
46 46
 
47 47
     <!-- /.login-logo -->
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
             <input type="text" id="login" class="form-control" placeholder="', filter_var($username, FILTER_SANITIZE_STRING), '" readonly>';
79 79
 } else {
80 80
     echo '
81
-            <input type="text" id="login" class="form-control" placeholder="' . langHdl('index_login') . '">';
81
+            <input type="text" id="login" class="form-control" placeholder="' . langHdl('index_login').'">';
82 82
 }
83 83
 
84 84
 echo '
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
             <div class="input-group-prepend">
94 94
                 <span class="input-group-text"><i class="fas fa-lock fa-fw"></i></span>
95 95
             </div>
96
-          <input type="password" id="pw" class="form-control submit-button" placeholder="' . langHdl('index_password') . '">
96
+          <input type="password" id="pw" class="form-control submit-button" placeholder="' . langHdl('index_password').'">
97 97
         </div>';
98 98
 }
99 99
 
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
             <div class="input-group-prepend">
103 103
                 <span class="input-group-text"><i class="fas fa-clock fa-fw"></i></span>
104 104
             </div>
105
-          <input type="text" id="session_duration" class="form-control submit-button" placeholder="' . langHdl('index_session_duration') . '&nbsp;(' . langHdl('minutes') . ')" value="', isset($SETTINGS['default_session_expiration_time']) === true ? $SETTINGS['default_session_expiration_time'] : '', '">
105
+          <input type="text" id="session_duration" class="form-control submit-button" placeholder="' . langHdl('index_session_duration').'&nbsp;('.langHdl('minutes').')" value="', isset($SETTINGS['default_session_expiration_time']) === true ? $SETTINGS['default_session_expiration_time'] : '', '">
106 106
         </div>';
107 107
 
108 108
 // 2FA auth selector
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
     '" />
116 116
         <div class="row mb-3 hidden" id="2fa_methods_selector">
117 117
             <div class="col-12">
118
-                <h8 class="login-box-msg">' . langHdl('2fa_authentication_selector') . '</h8>
118
+                <h8 class="login-box-msg">' . langHdl('2fa_authentication_selector').'</h8>
119 119
                 <div class="2fa-methods text-center mt-2">',
120 120
     isset($SETTINGS['google_authentication']) === true && (int) $SETTINGS['google_authentication'] === 1 ?
121 121
         '
@@ -158,10 +158,10 @@  discard block
 block discarded – undo
158 158
                     <img src="includes/images/2fa_google_auth.png">
159 159
                 </div>
160 160
                 <div class="col-8">
161
-                    <input type="text" id="ga_code" class="form-control submit-button" placeholder="' . langHdl('ga_identification_code') . '" />
161
+                    <input type="text" id="ga_code" class="form-control submit-button" placeholder="' . langHdl('ga_identification_code').'" />
162 162
                 </div>
163 163
                 <div class="col-1">
164
-                    <span class="fa fa-envelope-o form-control-feedback pointer infotip" title="' . langHdl('i_need_to_generate_new_ga_code') . '" onclick="send_user_new_temporary_ga_code()"></span>
164
+                    <span class="fa fa-envelope-o form-control-feedback pointer infotip" title="' . langHdl('i_need_to_generate_new_ga_code').'" onclick="send_user_new_temporary_ga_code()"></span>
165 165
                 </div>
166 166
             </div>
167 167
             <div id="div-2fa-google-qr" class="row mt-2 "></div>
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 <script>
180 180
 var seconds = 1;
181 181
 function updateLogonButton(timeToGo){
182
-    document.getElementById("but_identify_user").value = "' . langHdl('duration_login_attempt') . ' " + timeToGo;
182
+    document.getElementById("but_identify_user").value = "' . langHdl('duration_login_attempt').' " + timeToGo;
183 183
 }
184 184
 $( window ).on( "load", function() {
185 185
     updateLogonButton(seconds);
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
         if (seconds >= 0) {
189 189
             updateLogonButton(seconds);
190 190
         } else if(seconds === 0) {
191
-            launchIdentify("", "' . $nextUrl . '");
191
+            launchIdentify("", "' . $nextUrl.'");
192 192
         }
193 193
         updateLogonButton(seconds);
194 194
     },
@@ -209,15 +209,15 @@  discard block
 block discarded – undo
209 209
             <div class="col-8">
210 210
                 <div id="yubiko-new-key" class="alert alert-info hidden">
211 211
                     <p>
212
-                        <input type="text" size="10" id="yubico_user_id" class="form-control" placeholder="' . langHdl('yubico_user_id') . '">
212
+                        <input type="text" size="10" id="yubico_user_id" class="form-control" placeholder="' . langHdl('yubico_user_id').'">
213 213
                     </p>
214 214
                     <p>
215
-                    <input type="text" size="10" id="yubico_user_key" class="form-control" placeholder="' . langHdl('yubico_user_key') . '">
215
+                    <input type="text" size="10" id="yubico_user_key" class="form-control" placeholder="' . langHdl('yubico_user_key').'">
216 216
                     </p>
217 217
                 </div>
218
-                <input autocomplete="off" type="text" id="yubico_key" class="form-control submit-button" placeholder="' . langHdl('press_your_yubico_key') . '">
218
+                <input autocomplete="off" type="text" id="yubico_key" class="form-control submit-button" placeholder="' . langHdl('press_your_yubico_key').'">
219 219
                 <div class="row">
220
-                    <span class="ml-2 mt-1 font-weight-light small pointer" id="register-yubiko-key">' . langHdl('register_new_yubiko_key') . '</span>
220
+                    <span class="ml-2 mt-1 font-weight-light small pointer" id="register-yubiko-key">' . langHdl('register_new_yubiko_key').'</span>
221 221
                 </div>
222 222
             </div>
223 223
         </div>';
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 echo '
227 227
         <div class="row mb-3 mt-5">
228 228
             <div class="col-12">
229
-                <button id="but_identify_user" class="btn btn-primary btn-block">' . langHdl('log_in') . '</button>
229
+                <button id="but_identify_user" class="btn btn-primary btn-block">' . langHdl('log_in').'</button>
230 230
             </div>
231 231
         </div>
232 232
     </div>';
@@ -237,10 +237,10 @@  discard block
 block discarded – undo
237 237
     <!-- /.login-card-body -->
238 238
 
239 239
     <div class="card-body confirm-password-card-body hidden">
240
-        <h5 class="login-box-msg">' . langHdl('new_password_required') . '</h5>
240
+        <h5 class="login-box-msg">' . langHdl('new_password_required').'</h5>
241 241
 
242 242
         <div class="alert alert-info">
243
-            <div class="text-center"><i class="icon fa fa-info"></i>' . langHdl('password_strength') . '
243
+            <div class="text-center"><i class="icon fa fa-info"></i>' . langHdl('password_strength').'
244 244
             <span id="confirm-password-level" class="ml-2 font-weight-bold"></span></div>
245 245
         </div>
246 246
 
@@ -250,20 +250,20 @@  discard block
 block discarded – undo
250 250
                     <div class="input-group-prepend">
251 251
                         <span class="input-group-text"><i class="fa fa-key"></i></span>
252 252
                     </div>
253
-                    <input type="password" id="current-user-password" class="form-control" placeholder="' . langHdl('current_password') . '">
253
+                    <input type="password" id="current-user-password" class="form-control" placeholder="' . langHdl('current_password').'">
254 254
                 </div>
255 255
             </div>
256 256
             <div class="input-group has-feedback mb-2 mt-4">
257 257
                 <div class="input-group-prepend">
258 258
                     <span class="input-group-text"><i class="fa fa-key"></i></span>
259 259
                 </div>
260
-                <input type="password" id="new-user-password" class="form-control" placeholder="' . langHdl('index_new_pw') . '">
260
+                <input type="password" id="new-user-password" class="form-control" placeholder="' . langHdl('index_new_pw').'">
261 261
             </div>
262 262
             <div class="input-group has-feedback mb-2">
263 263
                 <div class="input-group-prepend">
264 264
                     <span class="input-group-text"><i class="fa fa-key"></i></span>
265 265
                 </div>
266
-                <input type="password" id="new-user-password-confirm" class="form-control" placeholder="' . langHdl('index_change_pw_confirmation') . '">
266
+                <input type="password" id="new-user-password-confirm" class="form-control" placeholder="' . langHdl('index_change_pw_confirmation').'">
267 267
             </div>
268 268
             <div class="row mb-3">
269 269
                 <div class="col-md-12 offset-sm-4 text-center">
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
             </div>
275 275
             <div class="row mb-3">
276 276
                 <div class="col-12">
277
-                    <button id="but_confirm_new_password" class="btn btn-primary btn-block">' . langHdl('confirm') . '</button>
277
+                    <button id="but_confirm_new_password" class="btn btn-primary btn-block">' . langHdl('confirm').'</button>
278 278
                 </div>
279 279
             </div>
280 280
         </div>
@@ -282,20 +282,20 @@  discard block
 block discarded – undo
282 282
 
283 283
     <div class="card-body hidden" id="card-user-treat-psk">
284 284
         <div class="alert alert-info">
285
-            <div class="text-center"><i class="icon fa fa-info"></i>' . langHdl('user_has_psk_info') . '</div>
285
+            <div class="text-center"><i class="icon fa fa-info"></i>' . langHdl('user_has_psk_info').'</div>
286 286
         </div>
287 287
         <div class="input-group has-feedback mb-2">
288 288
             <div class="input-group-prepend">
289 289
                 <span class="input-group-text"><i class="fa fa-key"></i></span>
290 290
             </div>
291
-            <input type="password" id="user-old-defuse-psk" class="form-control" placeholder="' . langHdl('home_personal_saltkey') . '">
291
+            <input type="password" id="user-old-defuse-psk" class="form-control" placeholder="' . langHdl('home_personal_saltkey').'">
292 292
         </div>
293 293
         <div class="row mb-3 mt-4">
294 294
             <div class="col-12">
295
-                <button id="but_confirm_defuse_psk" class="btn btn-primary btn-block">' . langHdl('launch') . '</button>
295
+                <button id="but_confirm_defuse_psk" class="btn btn-primary btn-block">' . langHdl('launch').'</button>
296 296
             </div>
297 297
             <div class="col-12 mt-3">
298
-                <button id="but_confirm_forgot_defuse_psk" class="btn btn-danger btn-block text-bold">' . langHdl('i_cannot_remember') . '</button>
298
+                <button id="but_confirm_forgot_defuse_psk" class="btn btn-danger btn-block text-bold">' . langHdl('i_cannot_remember').'</button>
299 299
             </div>
300 300
         </div>
301 301
     </div>
Please login to merge, or discard this patch.