Passed
Push — master ( 668057...23b17c )
by Nils
06:25 queued 14s
created
sources/folders.queries.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -137,14 +137,14 @@  discard block
 block discarded – undo
137 137
                     && $t->personal_folder == 0
138 138
                 ) {
139 139
                     // get $t->parent_id
140
-                    $data = DB::queryFirstRow('SELECT title FROM ' . prefixTable('nested_tree') . ' WHERE id = %i', $t->parent_id);
140
+                    $data = DB::queryFirstRow('SELECT title FROM '.prefixTable('nested_tree').' WHERE id = %i', $t->parent_id);
141 141
                     if ($t->nlevel == 1) {
142 142
                         $data['title'] = $lang->get('root');
143 143
                     }
144 144
 
145 145
                     // get rights on this folder
146 146
                     $arrayRights = array();
147
-                    $rows = DB::query('SELECT fonction_id  FROM ' . prefixTable('rights') . ' WHERE authorized=%i AND tree_id = %i', 1, $t->id);
147
+                    $rows = DB::query('SELECT fonction_id  FROM '.prefixTable('rights').' WHERE authorized=%i AND tree_id = %i', 1, $t->id);
148 148
                     foreach ($rows as $record) {
149 149
                         array_push($arrayRights, $record['fonction_id']);
150 150
                     }
@@ -162,8 +162,8 @@  discard block
 block discarded – undo
162 162
                         'SELECT m.valeur AS valeur, n.renewal_period AS renewal_period,
163 163
                         n.bloquer_creation AS bloquer_creation, n.bloquer_modification AS bloquer_modification,
164 164
                         n.fa_icon, n.fa_icon_selected
165
-                        FROM ' . prefixTable('misc') . ' AS m,
166
-                        ' . prefixTable('nested_tree') . ' AS n
165
+                        FROM ' . prefixTable('misc').' AS m,
166
+                        ' . prefixTable('nested_tree').' AS n
167 167
                         WHERE m.type=%s AND m.intitule = n.id AND m.intitule = %i',
168 168
                         'complex',
169 169
                         $t->id
@@ -191,16 +191,16 @@  discard block
 block discarded – undo
191 191
                         $arrayColumns['folderComplexity'] = '';
192 192
                     }
193 193
 
194
-                    if (is_null($node_data)=== false) {
194
+                    if (is_null($node_data) === false) {
195 195
                         $arrayColumns['renewalPeriod'] = (int) $node_data['renewal_period'];
196 196
                     } else {
197
-                        $arrayColumns['renewalPeriod']=0;
197
+                        $arrayColumns['renewalPeriod'] = 0;
198 198
                     }
199 199
 
200 200
                     //col7
201 201
                     $data7 = DB::queryFirstRow(
202 202
                         'SELECT bloquer_creation,bloquer_modification
203
-                        FROM ' . prefixTable('nested_tree') . '
203
+                        FROM ' . prefixTable('nested_tree').'
204 204
                         WHERE id = %i',
205 205
                         intval($t->id)
206 206
                     );
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
             // Get info about this folder
360 360
             $dataFolder = DB::queryfirstrow(
361 361
                 'SELECT *
362
-                FROM ' . prefixTable('nested_tree') . '
362
+                FROM ' . prefixTable('nested_tree').'
363 363
                 WHERE id = %i',
364 364
                 $inputData['id']
365 365
             );
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
             //check if parent folder is personal
396 396
             $dataParent = DB::queryfirstrow(
397 397
                 'SELECT personal_folder, bloquer_creation, bloquer_modification
398
-                FROM ' . prefixTable('nested_tree') . '
398
+                FROM ' . prefixTable('nested_tree').'
399 399
                 WHERE id = %i',
400 400
                 $inputData['parentId']
401 401
             );
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
                     // get complexity level for this folder
425 425
                     $data = DB::queryfirstrow(
426 426
                         'SELECT valeur
427
-                        FROM ' . prefixTable('misc') . '
427
+                        FROM ' . prefixTable('misc').'
428 428
                         WHERE intitule = %i AND type = %s',
429 429
                         $inputData['parentId'],
430 430
                         'complex'
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
                             array(
436 436
                                 'error' => true,
437 437
                                 'message' => $lang->get('error_folder_complexity_lower_than_top_folder')
438
-                                    . ' [<b>' . TP_PW_COMPLEXITY[$data['valeur']][1] . '</b>]',
438
+                                    . ' [<b>'.TP_PW_COMPLEXITY[$data['valeur']][1].'</b>]',
439 439
                             ),
440 440
                             'encode'
441 441
                         );
@@ -596,7 +596,7 @@  discard block
 block discarded – undo
596 596
             // Check if parent folder is personal
597 597
             $dataParent = DB::queryfirstrow(
598 598
                 'SELECT personal_folder
599
-                FROM ' . prefixTable('nested_tree') . '
599
+                FROM ' . prefixTable('nested_tree').'
600 600
                 WHERE id = %i',
601 601
                 $inputData['parentId']
602 602
             );
@@ -636,7 +636,7 @@  discard block
 block discarded – undo
636 636
             echo prepareExchangedData(
637 637
                 array(
638 638
                     'error' => $creationStatus['error'],
639
-                    'message' => $creationStatus['error'] === true ? $lang->get('error_not_allowed_to') : $lang->get('folder_created') ,
639
+                    'message' => $creationStatus['error'] === true ? $lang->get('error_not_allowed_to') : $lang->get('folder_created'),
640 640
                     'newId' => $creationStatus['newId'],
641 641
                 ),
642 642
                 'encode'
@@ -684,7 +684,7 @@  discard block
 block discarded – undo
684 684
                 echo prepareExchangedData(
685 685
                     array(
686 686
                         'error' => true,
687
-                        'message' => $lang->get('error_not_allowed_to'). " (You can't delete the root folder)",
687
+                        'message' => $lang->get('error_not_allowed_to')." (You can't delete the root folder)",
688 688
                     ),
689 689
                     'encode'
690 690
                 );
@@ -694,7 +694,7 @@  discard block
 block discarded – undo
694 694
             // Ensure that user has access to all folders
695 695
             $foldersAccessible = DB::query(
696 696
                 'SELECT id
697
-                FROM ' . prefixTable('nested_tree') . '
697
+                FROM ' . prefixTable('nested_tree').'
698 698
                 WHERE id IN %li AND id IN %li',
699 699
                 $post_folders,
700 700
                 $session->get('user-accessible_folders')
@@ -708,7 +708,7 @@  discard block
 block discarded – undo
708 708
                 echo prepareExchangedData(
709 709
                     array(
710 710
                         'error' => true,
711
-                        'message' => $lang->get('error_not_allowed_to') . ' (The following folders are not accessible or do not exist: ' . implode(', ', $missingFolders) . ')',
711
+                        'message' => $lang->get('error_not_allowed_to').' (The following folders are not accessible or do not exist: '.implode(', ', $missingFolders).')',
712 712
                     ),
713 713
                     'encode'
714 714
                 );
@@ -725,7 +725,7 @@  discard block
 block discarded – undo
725 725
                 // Check if parent folder is personal
726 726
                 $dataParent = DB::queryfirstrow(
727 727
                     'SELECT personal_folder
728
-                    FROM ' . prefixTable('nested_tree') . '
728
+                    FROM ' . prefixTable('nested_tree').'
729 729
                     WHERE id = %i',
730 730
                     $folderId
731 731
                 );
@@ -771,10 +771,10 @@  discard block
 block discarded – undo
771 771
                                 prefixTable('misc'),
772 772
                                 array(
773 773
                                     'type' => 'folder_deleted',
774
-                                    'intitule' => 'f' . $thisSubFolders->id,
775
-                                    'valeur' => $thisSubFolders->id . ', ' . $thisSubFolders->parent_id . ', ' .
776
-                                        $thisSubFolders->title . ', ' . $thisSubFolders->nleft . ', ' . $thisSubFolders->nright . ', ' .
777
-                                        $thisSubFolders->nlevel . ', 0, 0, 0, 0',
774
+                                    'intitule' => 'f'.$thisSubFolders->id,
775
+                                    'valeur' => $thisSubFolders->id.', '.$thisSubFolders->parent_id.', '.
776
+                                        $thisSubFolders->title.', '.$thisSubFolders->nleft.', '.$thisSubFolders->nright.', '.
777
+                                        $thisSubFolders->nlevel.', 0, 0, 0, 0',
778 778
                                     'created_at' => time(),
779 779
                                 )
780 780
                             );
@@ -783,7 +783,7 @@  discard block
 block discarded – undo
783 783
 
784 784
                             //delete items & logs
785 785
                             $itemsInSubFolder = DB::query(
786
-                                'SELECT id FROM ' . prefixTable('items') . ' 
786
+                                'SELECT id FROM '.prefixTable('items').' 
787 787
                                 WHERE id_tree=%i', 
788 788
                                 $thisSubFolders->id
789 789
                             );
@@ -813,7 +813,7 @@  discard block
 block discarded – undo
813 813
                                 }
814 814
 
815 815
                                 //Update CACHE table
816
-                                updateCacheTable('delete_value',(int) $item['id']);
816
+                                updateCacheTable('delete_value', (int) $item['id']);
817 817
                             }
818 818
 
819 819
                             //Actualize the variable
@@ -923,7 +923,7 @@  discard block
 block discarded – undo
923 923
             // Check if target parent folder is personal
924 924
             $dataParent = DB::queryfirstrow(
925 925
                 'SELECT personal_folder
926
-                FROM ' . prefixTable('nested_tree') . '
926
+                FROM ' . prefixTable('nested_tree').'
927 927
                 WHERE id = %i',
928 928
                 $post_target_folder_id
929 929
             );
@@ -977,7 +977,7 @@  discard block
 block discarded – undo
977 977
                 // get complexity of current node
978 978
                 $nodeComplexity = DB::queryfirstrow(
979 979
                     'SELECT valeur
980
-                    FROM ' . prefixTable('misc') . '
980
+                    FROM ' . prefixTable('misc').'
981 981
                     WHERE intitule = %i AND type= %s',
982 982
                     $nodeInfo->id,
983 983
                     'complex'
@@ -1054,7 +1054,7 @@  discard block
 block discarded – undo
1054 1054
                 // If it is a subfolder, then give access to it for all roles that allows the parent folder
1055 1055
                 $rows = DB::query(
1056 1056
                     'SELECT role_id, type
1057
-                    FROM ' . prefixTable('roles_values') . '
1057
+                    FROM ' . prefixTable('roles_values').'
1058 1058
                     WHERE folder_id = %i',
1059 1059
                     $parentId
1060 1060
                 );
@@ -1062,7 +1062,7 @@  discard block
 block discarded – undo
1062 1062
                     // Add access to this subfolder after checking that it is not already set
1063 1063
                     DB::query(
1064 1064
                         'SELECT *
1065
-                        FROM ' . prefixTable('roles_values') . '
1065
+                        FROM ' . prefixTable('roles_values').'
1066 1066
                         WHERE folder_id = %i AND role_id = %i',
1067 1067
                         $newFolderId,
1068 1068
                         $record['role_id']
@@ -1082,7 +1082,7 @@  discard block
 block discarded – undo
1082 1082
                 // if parent folder has Custom Fields Categories then add to this child one too
1083 1083
                 $rows = DB::query(
1084 1084
                     'SELECT id_category
1085
-                    FROM ' . prefixTable('categories_folders') . '
1085
+                    FROM ' . prefixTable('categories_folders').'
1086 1086
                     WHERE id_folder = %i',
1087 1087
                     $nodeInfo->id
1088 1088
                 );
@@ -1101,7 +1101,7 @@  discard block
 block discarded – undo
1101 1101
 
1102 1102
                 $rows = DB::query(
1103 1103
                     'SELECT *
1104
-                    FROM ' . prefixTable('items') . '
1104
+                    FROM ' . prefixTable('items').'
1105 1105
                     WHERE id_tree = %i',
1106 1106
                     $nodeInfo->id
1107 1107
                 );
@@ -1110,7 +1110,7 @@  discard block
 block discarded – undo
1110 1110
                     // if it is then don't copy it
1111 1111
                     $item_deleted = DB::queryFirstRow(
1112 1112
                         'SELECT *
1113
-                        FROM ' . prefixTable('log_items') . '
1113
+                        FROM ' . prefixTable('log_items').'
1114 1114
                         WHERE id_item = %i AND action = %s
1115 1115
                         ORDER BY date DESC
1116 1116
                         LIMIT 0, 1',
@@ -1121,7 +1121,7 @@  discard block
 block discarded – undo
1121 1121
 
1122 1122
                     $item_restored = DB::queryFirstRow(
1123 1123
                         'SELECT *
1124
-                        FROM ' . prefixTable('log_items') . '
1124
+                        FROM ' . prefixTable('log_items').'
1125 1125
                         WHERE id_item = %i AND action = %s
1126 1126
                         ORDER BY date DESC
1127 1127
                         LIMIT 0, 1',
@@ -1136,7 +1136,7 @@  discard block
 block discarded – undo
1136 1136
                         // Get the ITEM object key for the user
1137 1137
                         $userKey = DB::queryFirstRow(
1138 1138
                             'SELECT share_key
1139
-                            FROM ' . prefixTable('sharekeys_items') . '
1139
+                            FROM ' . prefixTable('sharekeys_items').'
1140 1140
                             WHERE user_id = %i AND object_id = %i',
1141 1141
                             $session->get('user-id'),
1142 1142
                             $record['id']
@@ -1209,7 +1209,7 @@  discard block
 block discarded – undo
1209 1209
                         // Manage Custom Fields
1210 1210
                         $categories = DB::query(
1211 1211
                             'SELECT *
1212
-                            FROM ' . prefixTable('categories_items') . '
1212
+                            FROM ' . prefixTable('categories_items').'
1213 1213
                             WHERE item_id = %i',
1214 1214
                             $record['id']
1215 1215
                         );
@@ -1256,15 +1256,15 @@  discard block
 block discarded – undo
1256 1256
                         $files = DB::query(
1257 1257
                             'SELECT f.id AS id, f.file AS file, f.name AS name, f.status AS status, f.extension AS extension,
1258 1258
                             f.size AS size, f.type AS type, s.share_key AS share_key
1259
-                            FROM ' . prefixTable('files') . ' AS f
1260
-                            INNER JOIN ' . prefixTable('sharekeys_files') . ' AS s ON (f.id = s.object_id)
1259
+                            FROM ' . prefixTable('files').' AS f
1260
+                            INNER JOIN ' . prefixTable('sharekeys_files').' AS s ON (f.id = s.object_id)
1261 1261
                             WHERE s.user_id = %i AND f.id_item = %i',
1262 1262
                             $session->get('user-id'),
1263 1263
                             $record['id']
1264 1264
                         );
1265 1265
                         foreach ($files as $file) {
1266 1266
                             // Check if file still exists
1267
-                            if (file_exists($SETTINGS['path_to_upload_folder'] . DIRECTORY_SEPARATOR . TP_FILE_PREFIX . base64_decode($file['file'])) === true) {
1267
+                            if (file_exists($SETTINGS['path_to_upload_folder'].DIRECTORY_SEPARATOR.TP_FILE_PREFIX.base64_decode($file['file'])) === true) {
1268 1268
                                 // Step1 - decrypt the file
1269 1269
                                 $fileContent = decryptFile(
1270 1270
                                     $file['file'],
@@ -1274,9 +1274,9 @@  discard block
 block discarded – undo
1274 1274
 
1275 1275
                                 // Step2 - create file
1276 1276
                                 // deepcode ignore InsecureHash: Is not a password, just a random string for a file name
1277
-                                $newFileName = md5(time() . '_' . $file['id']) . '.' . $file['extension'];
1277
+                                $newFileName = md5(time().'_'.$file['id']).'.'.$file['extension'];
1278 1278
 
1279
-                                $outstream = fopen($SETTINGS['path_to_upload_folder'] . DIRECTORY_SEPARATOR . $newFileName, 'ab');
1279
+                                $outstream = fopen($SETTINGS['path_to_upload_folder'].DIRECTORY_SEPARATOR.$newFileName, 'ab');
1280 1280
                                 if ($outstream === false) {
1281 1281
                                     echo prepareExchangedData(
1282 1282
                                         array(
@@ -1425,7 +1425,7 @@  discard block
 block discarded – undo
1425 1425
                     // Get path
1426 1426
                     $text = '';
1427 1427
                     foreach ($tree->getPath($folder->id, false) as $fld) {
1428
-                        $text .= empty($text) === true ? '     [<i>' . $fld->title : ' > ' . $fld->title;
1428
+                        $text .= empty($text) === true ? '     [<i>'.$fld->title : ' > '.$fld->title;
1429 1429
                     }
1430 1430
 
1431 1431
                     // Save array
@@ -1435,7 +1435,7 @@  discard block
 block discarded – undo
1435 1435
                             'id' => (int) $folder->id,
1436 1436
                             'label' => $folder->title,
1437 1437
                             'level' => $folder->nlevel,
1438
-                            'path' => empty($text) === true ? '' : $text . '</i>]'
1438
+                            'path' => empty($text) === true ? '' : $text.'</i>]'
1439 1439
                         )
1440 1440
                     );
1441 1441
                 }
Please login to merge, or discard this patch.
sources/items.logs.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 ) {
75 75
     // Not allowed page
76 76
     $session->set('system-error_code', ERR_NOT_ALLOWED);
77
-    include $SETTINGS['cpassman_dir'] . '/error.php';
77
+    include $SETTINGS['cpassman_dir'].'/error.php';
78 78
     exit;
79 79
 }
80 80
 
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
             
131 131
             if (
132 132
                 is_array($dataReceived) && // check if the data is an array
133
-                array_diff_key(array_flip($requiredKeys), $dataReceived) === [] &&  // check if all required keys have a valuekeys are present
133
+                array_diff_key(array_flip($requiredKeys), $dataReceived) === [] && // check if all required keys have a valuekeys are present
134 134
                 count(array_filter($dataReceived)) === count($requiredKeys) && // check if all required 
135 135
                 in_array($dataReceived['action'], ['at_password_shown', 'at_password_copied'], true) && // only log these actions
136 136
                 $session->get('user-id') === (int) filter_var($dataReceived['user_id'], FILTER_SANITIZE_NUMBER_INT) // only log actions of the current user
Please login to merge, or discard this patch.
includes/core/load.js.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 
176 176
                             // Show passwords inputs and form
177 177
                             $('#dialog-user-change-password-info')
178
-                                .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('user_has_to_change_password_info');?>')
178
+                                .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('user_has_to_change_password_info'); ?>')
179 179
                                 .removeClass('hidden');
180 180
                             $('#dialog-user-change-password').removeClass('hidden');
181 181
 
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 
189 189
                             // Show passwords inputs and form
190 190
                             $('#dialog-ldap-user-change-password-info')
191
-                                .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('ldap_user_has_changed_his_password');?>')
191
+                                .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('ldap_user_has_changed_his_password'); ?>')
192 192
                                 .removeClass('hidden');
193 193
                             $('#dialog-ldap-user-change-password').removeClass('hidden');
194 194
                             
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 
217 217
                             if (data.queryResults.auth_type === 'oauth2') {
218 218
                                 // LDAP or local account to OAuth2 account
219
-                                var info_message = '<?php echo $lang->get('oauth2_need_user_old_password');?>';
219
+                                var info_message = '<?php echo $lang->get('oauth2_need_user_old_password'); ?>';
220 220
 
221 221
                                 // Hide the "new password" field that users can't fill in manually
222 222
                                 $('#new-password-field').hide();
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
                                 $('#dialog-ldap-user-change-password-current').val(oauth2_encryption_hash);
229 229
                             } else {
230 230
                                 // LDAP password updated
231
-                                var info_message = '<?php echo $lang->get('ldap_user_has_changed_his_password');?>';
231
+                                var info_message = '<?php echo $lang->get('ldap_user_has_changed_his_password'); ?>';
232 232
                             }
233 233
 
234 234
                             // Display info tip
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
         /*console.log('User has to regenerate keys')
340 340
         // HIde
341 341
         $('.content-header, .content').addClass('hidden');
342
-        $('#dialog-user-temporary-code-info').html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('renecyption_expected');?>');
342
+        $('#dialog-user-temporary-code-info').html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('renecyption_expected'); ?>');
343 343
 
344 344
         // Show passwords inputs and form
345 345
         $('#dialog-user-temporary-code').removeClass('hidden');
@@ -421,13 +421,13 @@  discard block
 block discarded – undo
421 421
             {
422 422
                 if (step === 'psk') {
423 423
                     // Inform user
424
-                    $("#user-current-defuse-psk-progress").html('<b><?php echo $lang->get('encryption_keys'); ?> </b> [' + start + ' - ' + (parseInt(start) + <?php echo NUMBER_ITEMS_IN_BATCH;?>) + '] ' +
424
+                    $("#user-current-defuse-psk-progress").html('<b><?php echo $lang->get('encryption_keys'); ?> </b> [' + start + ' - ' + (parseInt(start) + <?php echo NUMBER_ITEMS_IN_BATCH; ?>) + '] ' +
425 425
                         '... <?php echo $lang->get('please_wait'); ?><i class="fa-solid fa-spinner fa-pulse ml-3 text-primary"></i>');
426 426
 
427 427
                     var data = {
428 428
                         'userPsk' : $('#user-current-defuse-psk').val(),
429 429
                         'start': start,
430
-                        'length': <?php echo NUMBER_ITEMS_IN_BATCH;?>,
430
+                        'length': <?php echo NUMBER_ITEMS_IN_BATCH; ?>,
431 431
                         'user_id': userId,
432 432
                         'counterItemsToTreat': counterItemsToTreat
433 433
                     };
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
 
504 504
                 // Show passwords inputs and form
505 505
                 $('#dialog-ldap-user-change-password-info')
506
-                    .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('ldap_user_has_changed_his_password');?>')
506
+                    .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('ldap_user_has_changed_his_password'); ?>')
507 507
                     .removeClass('hidden');
508 508
                 $('#dialog-ldap-user-change-password').removeClass('hidden');
509 509
 
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
                                 '</div>' +
594 594
                             '</div>' +
595 595
                         '</div>' +
596
-                        '<div class="row mt-2<?php echo isset($SETTINGS['enable_pf_feature']) === true && (int) $SETTINGS['enable_pf_feature'] === 1  ? '' : ' hidden'; ?>">' +
596
+                        '<div class="row mt-2<?php echo isset($SETTINGS['enable_pf_feature']) === true && (int) $SETTINGS['enable_pf_feature'] === 1 ? '' : ' hidden'; ?>">' +
597 597
                             '<h6><?php echo $lang->get('provide_recovery_keys'); ?></h6>' +
598 598
                             '<div class="input-group mb-2">' +
599 599
                                 '<div class="input-group-prepend">' +
@@ -608,7 +608,7 @@  discard block
 block discarded – undo
608 608
                                 '<textarea rows="2" id="recovery-private-key" class="form-control form-item-control"></textarea>' +
609 609
                             '</div>' +
610 610
                         '</div>' +
611
-                        '<div class="row mt-2<?php echo isset($SETTINGS['enable_pf_feature']) === true && (int) $SETTINGS['enable_pf_feature'] === 1  ? '' : ' hidden'; ?>">' +
611
+                        '<div class="row mt-2<?php echo isset($SETTINGS['enable_pf_feature']) === true && (int) $SETTINGS['enable_pf_feature'] === 1 ? '' : ' hidden'; ?>">' +
612 612
                             '<div class="alert" id="confirm-no-recovery-keys-div">' +
613 613
                                 '<div class="form-check">' +
614 614
                                     '<input type="checkbox" class="form-check-input" id="confirm-no-recovery-keys">' +
@@ -1172,15 +1172,15 @@  discard block
 block discarded – undo
1172 1172
             // Prepare data
1173 1173
             var data = {
1174 1174
                 'receipt': $('#temp-user-email').val(),
1175
-                'subject': '[Teampass] <?php echo $lang->get('your_new_password');?>',
1176
-                'body': '<?php echo $lang->get('email_body_temporary_login_password');?>',
1175
+                'subject': '[Teampass] <?php echo $lang->get('your_new_password'); ?>',
1176
+                'body': '<?php echo $lang->get('email_body_temporary_login_password'); ?>',
1177 1177
                 'pre_replace' : {
1178 1178
                     '#enc_code#' : $('#temp-user-pwd').val(),
1179 1179
                 }
1180 1180
             }
1181 1181
             if (debugJavascript === true) console.log(data);
1182 1182
             // Prepare form
1183
-            $('#dialog-admin-change-user-password-info').html('<?php echo $lang->get('sending_email_message');?>');
1183
+            $('#dialog-admin-change-user-password-info').html('<?php echo $lang->get('sending_email_message'); ?>');
1184 1184
             toastr.remove();
1185 1185
             toastr.info(
1186 1186
                 '<?php echo $lang->get('in_progress'); ?><i class="fa-solid fa-circle-notch fa-spin fa-2x ml-3"></i>'
@@ -1702,7 +1702,7 @@  discard block
 block discarded – undo
1702 1702
                         '#warningModal',
1703 1703
                         '<i class="fa-solid fa-clock fa-lg warning mr-2"></i><?php echo $lang->get('index_add_one_hour'); ?>',
1704 1704
                         '<div class="form-group">' +
1705
-                        '<label for="warningModal-input" class="col-form-label"><?php echo $lang->get('extend_session_duration_by') . ' (' . $lang->get('minutes') . ')'; ?>:</label>' +
1705
+                        '<label for="warningModal-input" class="col-form-label"><?php echo $lang->get('extend_session_duration_by').' ('.$lang->get('minutes').')'; ?>:</label>' +
1706 1706
                         '<input type="number" max="'+(60*60*24)+'" class="form-control" id="warningModal-input" value="60">' +
1707 1707
                         '</div>' +
1708 1708
                         '<div class="form-text text-muted"><i class=\"fa-solid fa-info-circle mr-2\"></i><?php echo $lang->get('maximum_session_expiration_time'); ?>: '+data.max_session_duration+'</div>',
Please login to merge, or discard this patch.
scripts/background_tasks___userKeysCreation_subtaskHdl.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 DB::update(
112 112
     prefixTable('background_subtasks'),
113 113
     array(
114
-        'sub_task_in_progress' => 0,    // flag sub task is no more in prgoress
114
+        'sub_task_in_progress' => 0, // flag sub task is no more in prgoress
115 115
         'is_in_progress' => 0,
116 116
         'finished_at' => time(),
117 117
         'updated_at' => time(),
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
         // Check if user exists
148 148
         $userInfo = DB::queryFirstRow(
149 149
             'SELECT public_key, private_key
150
-            FROM ' . prefixTable('users') . '
150
+            FROM ' . prefixTable('users').'
151 151
             WHERE id = %i',
152 152
             $post_user_id
153 153
         );
@@ -260,13 +260,13 @@  discard block
 block discarded – undo
260 260
 {
261 261
     $userInfo = DB::queryFirstRow(
262 262
         'SELECT pw, public_key, private_key, login, name
263
-        FROM ' . prefixTable('users') . '
263
+        FROM ' . prefixTable('users').'
264 264
         WHERE id = %i',
265 265
         $owner_id
266 266
     );
267 267
     
268 268
     // decrypt owner password
269
-    $pwd = cryption($owner_pwd, '','decrypt', $SETTINGS)['string'];
269
+    $pwd = cryption($owner_pwd, '', 'decrypt', $SETTINGS)['string'];
270 270
     // decrypt private key and send back
271 271
     return [
272 272
         'private_key' => decryptPrivateKey($pwd, $userInfo['private_key']),
@@ -306,17 +306,17 @@  discard block
 block discarded – undo
306 306
     // Loop on items
307 307
     $rows = DB::query(
308 308
         'SELECT id, pw, perso
309
-        FROM ' . prefixTable('items') . '
309
+        FROM ' . prefixTable('items').'
310 310
         '.(isset($extra_arguments['only_personal_items']) === true && $extra_arguments['only_personal_items'] === 1 ? 'WHERE perso = 1' : '').'
311 311
         ORDER BY id ASC
312
-        LIMIT ' . $post_start . ', ' . $post_length
312
+        LIMIT ' . $post_start.', '.$post_length
313 313
     );
314 314
     //    WHERE perso = 0
315 315
     foreach ($rows as $record) {
316 316
         // Get itemKey from current user
317 317
         $currentUserKey = DB::queryFirstRow(
318 318
             'SELECT share_key, increment_id
319
-            FROM ' . prefixTable('sharekeys_items') . '
319
+            FROM ' . prefixTable('sharekeys_items').'
320 320
             WHERE object_id = %i AND user_id = %i',
321 321
             $record['id'],
322 322
             //$extra_arguments['owner_id']
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
         
346 346
         $currentUserKey = DB::queryFirstRow(
347 347
             'SELECT increment_id
348
-            FROM ' . prefixTable('sharekeys_items') . '
348
+            FROM ' . prefixTable('sharekeys_items').'
349 349
             WHERE object_id = %i AND user_id = %i',
350 350
             $record['id'],
351 351
             $post_user_id
@@ -419,15 +419,15 @@  discard block
 block discarded – undo
419 419
     // Loop on logs
420 420
     $rows = DB::query(
421 421
         'SELECT increment_id
422
-        FROM ' . prefixTable('log_items') . '
422
+        FROM ' . prefixTable('log_items').'
423 423
         WHERE raison LIKE "at_pw :%" AND encryption_type = "teampass_aes"
424
-        LIMIT ' . $post_start . ', ' . $post_length
424
+        LIMIT ' . $post_start.', '.$post_length
425 425
     );
426 426
     foreach ($rows as $record) {
427 427
         // Get itemKey from current user
428 428
         $currentUserKey = DB::queryFirstRow(
429 429
             'SELECT share_key
430
-            FROM ' . prefixTable('sharekeys_logs') . '
430
+            FROM ' . prefixTable('sharekeys_logs').'
431 431
             WHERE object_id = %i AND user_id = %i',
432 432
             $record['increment_id'],
433 433
             $extra_arguments['owner_id']
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
             if ((int) $post_user_id !== (int) $extra_arguments['owner_id']) {
460 460
                 $currentUserKey = DB::queryFirstRow(
461 461
                     'SELECT increment_id
462
-                    FROM ' . prefixTable('sharekeys_items') . '
462
+                    FROM ' . prefixTable('sharekeys_items').'
463 463
                     WHERE object_id = %i AND user_id = %i',
464 464
                     $record['id'],
465 465
                     $post_user_id
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
     // SHould we change step?
482 482
     DB::query(
483 483
         'SELECT increment_id
484
-        FROM ' . prefixTable('log_items') . '
484
+        FROM ' . prefixTable('log_items').'
485 485
         WHERE raison LIKE "at_pw :%" AND encryption_type = "teampass_aes"'
486 486
     );
487 487
 
@@ -521,15 +521,15 @@  discard block
 block discarded – undo
521 521
     // Loop on fields
522 522
     $rows = DB::query(
523 523
         'SELECT id
524
-        FROM ' . prefixTable('categories_items') . '
524
+        FROM ' . prefixTable('categories_items').'
525 525
         WHERE encryption_type = "teampass_aes"
526
-        LIMIT ' . $post_start . ', ' . $post_length
526
+        LIMIT ' . $post_start.', '.$post_length
527 527
     );
528 528
     foreach ($rows as $record) {
529 529
         // Get itemKey from current user
530 530
         $currentUserKey = DB::queryFirstRow(
531 531
             'SELECT share_key
532
-            FROM ' . prefixTable('sharekeys_fields') . '
532
+            FROM ' . prefixTable('sharekeys_fields').'
533 533
             WHERE object_id = %i AND user_id = %i',
534 534
             $record['id'],
535 535
             $extra_arguments['owner_id']
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
                 if ((int) $post_user_id !== (int) $extra_arguments['owner_id']) {
558 558
                     $currentUserKey = DB::queryFirstRow(
559 559
                         'SELECT increment_id
560
-                        FROM ' . prefixTable('sharekeys_items') . '
560
+                        FROM ' . prefixTable('sharekeys_items').'
561 561
                         WHERE object_id = %i AND user_id = %i',
562 562
                         $record['id'],
563 563
                         $post_user_id
@@ -580,7 +580,7 @@  discard block
 block discarded – undo
580 580
     // SHould we change step?
581 581
     DB::query(
582 582
         'SELECT *
583
-        FROM ' . prefixTable('categories_items') . '
583
+        FROM ' . prefixTable('categories_items').'
584 584
         WHERE encryption_type = "teampass_aes"'
585 585
     );
586 586
 
@@ -620,14 +620,14 @@  discard block
 block discarded – undo
620 620
     // Loop on suggestions
621 621
     $rows = DB::query(
622 622
         'SELECT id
623
-        FROM ' . prefixTable('suggestion') . '
624
-        LIMIT ' . $post_start . ', ' . $post_length
623
+        FROM ' . prefixTable('suggestion').'
624
+        LIMIT ' . $post_start.', '.$post_length
625 625
     );
626 626
     foreach ($rows as $record) {
627 627
         // Get itemKey from current user
628 628
         $currentUserKey = DB::queryFirstRow(
629 629
             'SELECT share_key
630
-            FROM ' . prefixTable('sharekeys_suggestions') . '
630
+            FROM ' . prefixTable('sharekeys_suggestions').'
631 631
             WHERE object_id = %i AND user_id = %i',
632 632
             $record['id'],
633 633
             $extra_arguments['owner_id']
@@ -659,7 +659,7 @@  discard block
 block discarded – undo
659 659
             if ((int) $post_user_id !== (int) $extra_arguments['owner_id']) {
660 660
                 $currentUserKey = DB::queryFirstRow(
661 661
                     'SELECT increment_id
662
-                    FROM ' . prefixTable('sharekeys_items') . '
662
+                    FROM ' . prefixTable('sharekeys_items').'
663 663
                     WHERE object_id = %i AND user_id = %i',
664 664
                     $record['id'],
665 665
                     $post_user_id
@@ -719,16 +719,16 @@  discard block
 block discarded – undo
719 719
     // Loop on files
720 720
     $rows = DB::query(
721 721
         'SELECT f.id AS id, i.perso AS perso
722
-        FROM ' . prefixTable('files') . ' AS f
723
-        INNER JOIN ' . prefixTable('items') . ' AS i ON i.id = f.id_item
724
-        WHERE f.status = "' . TP_ENCRYPTION_NAME . '"
725
-        LIMIT ' . $post_start . ', ' . $post_length
722
+        FROM ' . prefixTable('files').' AS f
723
+        INNER JOIN ' . prefixTable('items').' AS i ON i.id = f.id_item
724
+        WHERE f.status = "' . TP_ENCRYPTION_NAME.'"
725
+        LIMIT ' . $post_start.', '.$post_length
726 726
     ); //aes_encryption
727 727
     foreach ($rows as $record) {
728 728
         // Get itemKey from current user
729 729
         $currentUserKey = DB::queryFirstRow(
730 730
             'SELECT share_key, increment_id
731
-            FROM ' . prefixTable('sharekeys_files') . '
731
+            FROM ' . prefixTable('sharekeys_files').'
732 732
             WHERE object_id = %i AND user_id = %i',
733 733
             $record['id'],
734 734
             (int) $record['perso'] === 0 ? $extra_arguments['owner_id'] : $extra_arguments['new_user_id']
@@ -756,7 +756,7 @@  discard block
 block discarded – undo
756 756
 
757 757
         $currentUserKey = DB::queryFirstRow(
758 758
             'SELECT increment_id
759
-            FROM ' . prefixTable('sharekeys_files') . '
759
+            FROM ' . prefixTable('sharekeys_files').'
760 760
             WHERE object_id = %i AND user_id = %i',
761 761
             $record['id'],
762 762
             $post_user_id
@@ -787,8 +787,8 @@  discard block
 block discarded – undo
787 787
     // SHould we change step? Finished ?
788 788
     DB::query(
789 789
         'SELECT *
790
-        FROM ' . prefixTable('files') . '
791
-        WHERE status = "' . TP_ENCRYPTION_NAME . '"'
790
+        FROM ' . prefixTable('files').'
791
+        WHERE status = "' . TP_ENCRYPTION_NAME.'"'
792 792
     );
793 793
     $counter = DB::count();
794 794
     $next_start = (int) $post_start + (int) $post_length;
@@ -854,7 +854,7 @@  discard block
 block discarded – undo
854 854
     // get user info
855 855
     $userInfo = DB::queryFirstRow(
856 856
         'SELECT email, login, auth_type, special, lastname, name
857
-        FROM ' . prefixTable('users') . '
857
+        FROM ' . prefixTable('users').'
858 858
         WHERE id = %i',
859 859
         $extra_arguments['new_user_id']
860 860
     );
@@ -869,10 +869,10 @@  discard block
 block discarded – undo
869 869
             filter_var($userInfo['email'], FILTER_SANITIZE_FULL_SPECIAL_CHARS),
870 870
             // @scrutinizer ignore-type
871 871
             empty($extra_arguments['email_body']) === false ? $extra_arguments['email_body'] : $lang->get('email_body_user_config_1'),
872
-            'TEAMPASS - ' . $lang->get('login_credentials'),
872
+            'TEAMPASS - '.$lang->get('login_credentials'),
873 873
             (array) filter_var_array(
874 874
                 [
875
-                    '#code#' => cryption($extra_arguments['new_user_code'], '','decrypt', $SETTINGS)['string'],
875
+                    '#code#' => cryption($extra_arguments['new_user_code'], '', 'decrypt', $SETTINGS)['string'],
876 876
                     '#lastname#' => isset($userInfo['name']) === true ? $userInfo['name'] : '',
877 877
                     '#login#' => isset($userInfo['login']) === true ? $userInfo['login'] : '',
878 878
                 ],
Please login to merge, or discard this patch.
api/Model/AuthModel.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -239,7 +239,7 @@
 block discarded – undo
239 239
         $configManager = new ConfigManager();
240 240
         $SETTINGS = $configManager->getAllSettings();
241 241
         
242
-		$payload = [
242
+        $payload = [
243 243
             'username' => $login,
244 244
             'id' => $id, 
245 245
             'exp' => (time() + $SETTINGS['api_token_duration'] + 600),
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
     public function getUserAuth(string $login, string $password, string $apikey): array
50 50
     {
51 51
         // Sanitize
52
-        include_once API_ROOT_PATH . '/../sources/main.functions.php';
52
+        include_once API_ROOT_PATH.'/../sources/main.functions.php';
53 53
         $inputData = dataSanitizer(
54 54
             [
55 55
                 'login' => isset($login) === true ? $login : '',
@@ -74,8 +74,8 @@  discard block
 block discarded – undo
74 74
             // Check if user exists
75 75
             $userInfo = DB::queryfirstrow(
76 76
                 "SELECT u.id, u.pw, u.login, u.admin, u.gestionnaire, u.can_manage_all_users, u.fonction_id, u.can_create_root_folder, u.public_key, u.private_key, u.personal_folder, u.fonction_id, u.groupes_visibles, u.groupes_interdits, a.value AS user_api_key, a.allowed_folders as user_api_allowed_folders, a.enabled, a.allowed_to_create, a.allowed_to_read, a.allowed_to_update, a.allowed_to_delete
77
-                FROM " . prefixTable('users') . " AS u
78
-                INNER JOIN " . prefixTable('api') . " AS a ON (a.user_id=u.id)
77
+                FROM " . prefixTable('users')." AS u
78
+                INNER JOIN " . prefixTable('api')." AS a ON (a.user_id=u.id)
79 79
                 WHERE login = %s",
80 80
                 $inputData['login']
81 81
             );
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
         if (count($userFunctionId) > 0) {
252 252
             $rows = DB::query(
253 253
                 'SELECT * 
254
-                FROM ' . prefixTable('roles_values') . '
254
+                FROM ' . prefixTable('roles_values').'
255 255
                 WHERE role_id IN %li  AND type IN ("W", "ND", "NE", "NDNE", "R")',
256 256
                 $userFunctionId
257 257
             );
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
         $inc = 0;
278 278
         $rows = DB::query(
279 279
             'SELECT id, id_tree 
280
-            FROM ' . prefixTable('items') . '
280
+            FROM ' . prefixTable('items').'
281 281
             WHERE restricted_to LIKE %s'.
282 282
             (count($userFunctionId) > 0 ? ' AND id_tree NOT IN %li' : ''),
283 283
             $userInfo['id'],
@@ -292,8 +292,8 @@  discard block
 block discarded – undo
292 292
         // Check for the users roles if some specific rights exist on items
293 293
         $rows = DB::query(
294 294
             'SELECT i.id_tree, r.item_id
295
-            FROM ' . prefixTable('items') . ' AS i
296
-            INNER JOIN ' . prefixTable('restriction_to_roles') . ' AS r ON (r.item_id=i.id)
295
+            FROM ' . prefixTable('items').' AS i
296
+            INNER JOIN ' . prefixTable('restriction_to_roles').' AS r ON (r.item_id=i.id)
297 297
             WHERE '.(count($userFunctionId) > 0 ? ' id_tree NOT IN %li AND ' : '').' i.id_tree != ""
298 298
             ORDER BY i.id_tree ASC',
299 299
             count($userFunctionId) > 0 ? $userFunctionId : DB::sqleval('0')
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
         // Add all personal folders
310 310
         $rows = DB::queryFirstRow(
311 311
             'SELECT id 
312
-            FROM ' . prefixTable('nested_tree') . '
312
+            FROM ' . prefixTable('nested_tree').'
313 313
             WHERE title = %i AND personal_folder = 1'.
314 314
             (count($userFunctionId) > 0 ? ' AND id NOT IN %li' : ''),
315 315
             $userInfo['id'],
Please login to merge, or discard this patch.
api/inc/bootstrap.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -25,18 +25,18 @@  discard block
 block discarded – undo
25 25
 
26 26
 use TeampassClasses\ConfigManager\ConfigManager;
27 27
 
28
-define("API_ROOT_PATH", __DIR__ . "/..");
28
+define("API_ROOT_PATH", __DIR__."/..");
29 29
 
30 30
 // include main configuration file
31
-require API_ROOT_PATH . '/../sources/main.functions.php';
31
+require API_ROOT_PATH.'/../sources/main.functions.php';
32 32
 
33 33
 // include the base controller file
34
-require API_ROOT_PATH . "/Controller/Api/BaseController.php";
34
+require API_ROOT_PATH."/Controller/Api/BaseController.php";
35 35
 
36 36
 // include the use model file
37
-require API_ROOT_PATH . "/Model/UserModel.php";
38
-require API_ROOT_PATH . "/Model/ItemModel.php";
39
-require API_ROOT_PATH . "/Model/FolderModel.php";
37
+require API_ROOT_PATH."/Model/UserModel.php";
38
+require API_ROOT_PATH."/Model/ItemModel.php";
39
+require API_ROOT_PATH."/Model/FolderModel.php";
40 40
 
41 41
 /**
42 42
  * Launch expected action for ITEM
@@ -55,9 +55,9 @@  discard block
 block discarded – undo
55 55
         );
56 56
     }
57 57
     // Perform the action
58
-    require API_ROOT_PATH . "/Controller/Api/ItemController.php";    
58
+    require API_ROOT_PATH."/Controller/Api/ItemController.php";    
59 59
     $objFeedController = new ItemController();
60
-    $strMethodName = $actions[0] . 'Action';
60
+    $strMethodName = $actions[0].'Action';
61 61
     $objFeedController->{$strMethodName}($userData);
62 62
 }
63 63
 
@@ -78,9 +78,9 @@  discard block
 block discarded – undo
78 78
         );
79 79
     }
80 80
     // Perform the action
81
-    require API_ROOT_PATH . "/Controller/Api/FolderController.php";
81
+    require API_ROOT_PATH."/Controller/Api/FolderController.php";
82 82
     $objFeedController = new FolderController();
83
-    $strMethodName = $actions[0] . 'Action';
83
+    $strMethodName = $actions[0].'Action';
84 84
     $objFeedController->{$strMethodName}($userData);
85 85
 }
86 86
 
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
  */
138 138
 function verifyAuth(): string
139 139
 {
140
-    include_once API_ROOT_PATH . '/inc/jwt_utils.php';
140
+    include_once API_ROOT_PATH.'/inc/jwt_utils.php';
141 141
     $bearer_token = get_bearer_token();
142 142
 
143 143
     if (empty($bearer_token) === false && is_jwt_valid($bearer_token) === true) {
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
  */
168 168
 function getDataFromToken(): string
169 169
 {
170
-    include_once API_ROOT_PATH . '/inc/jwt_utils.php';
170
+    include_once API_ROOT_PATH.'/inc/jwt_utils.php';
171 171
     $bearer_token = get_bearer_token();
172 172
 
173 173
     if (empty($bearer_token) === false) {
Please login to merge, or discard this patch.
api/Model/UserModel.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
     {
30 30
         return DB::query(
31 31
             'SELECT * 
32
-            FROM ' . prefixTable('users') . '
32
+            FROM ' . prefixTable('users').'
33 33
             ORDER BY id ASC LIMIT %i',
34 34
             $limit
35 35
         );
Please login to merge, or discard this patch.
api/Model/ItemModel.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -50,18 +50,18 @@  discard block
 block discarded – undo
50 50
         // Get items
51 51
         $rows = DB::query(
52 52
             'SELECT i.id, label, description, i.pw, i.url, i.id_tree, i.login, i.email, i.viewed_no, i.fa_icon, i.inactif, i.perso, t.title as folder_label
53
-            FROM ' . prefixTable('items') . ' AS i
53
+            FROM ' . prefixTable('items').' AS i
54 54
             LEFT JOIN '.prefixTable('nested_tree').' as t ON (t.id = i.id_tree) '.
55
-            $sqlExtra . 
56
-            " ORDER BY i.id ASC" .
57
-            ($limit > 0 ? " LIMIT ". $limit : '')
55
+            $sqlExtra. 
56
+            " ORDER BY i.id ASC".
57
+            ($limit > 0 ? " LIMIT ".$limit : '')
58 58
         );
59 59
 
60 60
         $ret = [];
61 61
         foreach ($rows as $row) {
62 62
             $userKey = DB::queryfirstrow(
63 63
                 'SELECT share_key
64
-                FROM ' . prefixTable('sharekeys_items') . '
64
+                FROM ' . prefixTable('sharekeys_items').'
65 65
                 WHERE user_id = %i AND object_id = %i',
66 66
                 $userId,
67 67
                 $row['id']
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
                 if (empty($path) === true) {
99 99
                     $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
100 100
                 } else {
101
-                    $path .= '/' . htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
101
+                    $path .= '/'.htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
102 102
                 }
103 103
             }
104 104
 
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
     ) : array
149 149
     {
150 150
         try {
151
-            include_once API_ROOT_PATH . '/../sources/main.functions.php';
151
+            include_once API_ROOT_PATH.'/../sources/main.functions.php';
152 152
 
153 153
             // Load config
154 154
             $configManager = new ConfigManager();
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
         }
272 272
 
273 273
         if (strlen($password) > $SETTINGS['pwd_maximum_length']) {
274
-            throw new Exception('Password is too long (max allowed is ' . $SETTINGS['pwd_maximum_length'] . ' characters)');
274
+            throw new Exception('Password is too long (max allowed is '.$SETTINGS['pwd_maximum_length'].' characters)');
275 275
         }
276 276
     }
277 277
 
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
     {
285 285
         $dataFolderSettings = DB::queryFirstRow(
286 286
             'SELECT bloquer_creation, bloquer_modification, personal_folder
287
-            FROM ' . prefixTable('nested_tree') . ' 
287
+            FROM ' . prefixTable('nested_tree').' 
288 288
             WHERE id = %i',
289 289
             $folderId
290 290
         );
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
     {
308 308
         $folderComplexity = DB::queryFirstRow(
309 309
             'SELECT valeur
310
-            FROM ' . prefixTable('misc') . '
310
+            FROM ' . prefixTable('misc').'
311 311
             WHERE type = %s AND intitule = %i',
312 312
             'complex',
313 313
             $itemInfos['folderId']
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
     private function checkForDuplicates(string $label, array $SETTINGS, array $itemInfos) : void
336 336
     {
337 337
         DB::queryFirstRow(
338
-            'SELECT * FROM ' . prefixTable('items') . '
338
+            'SELECT * FROM '.prefixTable('items').'
339 339
             WHERE label = %s AND inactif = %i',
340 340
             $label,
341 341
             0
Please login to merge, or discard this patch.
pages/profile.php 2 patches
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -401,12 +401,13 @@
 block discarded – undo
401 401
                                             <select class="form-control" id="profile-user-timezone">
402 402
                                                 <?php foreach ($zones as $key => $zone): ?>
403 403
                                                     <option value="<?php echo $key; ?>"<?php 
404
-                                                        if ($session->has('user-timezone'))
405
-                                                            if($session->get('user-timezone') === $key)
404
+                                                        if ($session->has('user-timezone')) {
405
+                                                                                                                    if($session->get('user-timezone') === $key)
406 406
                                                                 echo ' selected';
407
-                                                            elseif ($session->get('user-timezone') === 'not_defined')
408
-                                                                if (isset($SETTINGS['timezone']) && $SETTINGS['timezone'] === $key)
407
+                                                        } elseif ($session->get('user-timezone') === 'not_defined') {
408
+                                                                                                                            if (isset($SETTINGS['timezone']) && $SETTINGS['timezone'] === $key)
409 409
                                                                     echo ' selected';
410
+                                                            }
410 411
                                                     ?>><?php echo $zone; ?></option>
411 412
                                                 <?php endforeach; ?>
412 413
                                             </select>
Please login to merge, or discard this patch.
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('profile') === false) {
68 68
     // Not allowed page
69 69
     $session->set('system-error_code', ERR_NOT_ALLOWED);
70
-    include $SETTINGS['cpassman_dir'] . '/error.php';
70
+    include $SETTINGS['cpassman_dir'].'/error.php';
71 71
     exit;
72 72
 }
73 73
 
@@ -100,49 +100,49 @@  discard block
 block discarded – undo
100 100
 $zones = timezone_list();
101 101
 // prepare list of languages
102 102
 $languages = DB::query(
103
-    'SELECT label, name FROM ' . prefixTable('languages') . ' ORDER BY label ASC'
103
+    'SELECT label, name FROM '.prefixTable('languages').' ORDER BY label ASC'
104 104
 );
105 105
 
106 106
 // Do some stats
107 107
 $userItemsNumber = DB::queryFirstField(
108 108
     'SELECT COUNT(id_item) as count
109
-    FROM ' . prefixTable('log_items') . '
109
+    FROM ' . prefixTable('log_items').'
110 110
     WHERE action = "at_creation" AND  id_user = %i',
111 111
     $session->get('user-id')
112 112
 );
113 113
 
114 114
 $userModificationNumber = DB::queryFirstField(
115 115
     'SELECT COUNT(id_item) as count
116
-    FROM ' . prefixTable('log_items') . '
116
+    FROM ' . prefixTable('log_items').'
117 117
     WHERE action = "at_modification" AND  id_user = %i',
118 118
     $session->get('user-id')
119 119
 );
120 120
 
121 121
 $userSeenItemsNumber = DB::queryFirstField(
122 122
     'SELECT COUNT(id_item) as count
123
-    FROM ' . prefixTable('log_items') . '
123
+    FROM ' . prefixTable('log_items').'
124 124
     WHERE action = "at_shown" AND  id_user = %i',
125 125
     $session->get('user-id')
126 126
 );
127 127
 
128 128
 $userSeenPasswordsNumber = DB::queryFirstField(
129 129
     'SELECT COUNT(id_item)
130
-    FROM ' . prefixTable('log_items') . '
130
+    FROM ' . prefixTable('log_items').'
131 131
     WHERE action = "at_password_shown" AND  id_user = %i',
132 132
     $session->get('user-id')
133 133
 );
134 134
 
135 135
 $userInfo = DB::queryFirstRow(
136 136
     'SELECT avatar, last_pw_change
137
-    FROM ' . prefixTable('users') . ' 
137
+    FROM ' . prefixTable('users').' 
138 138
     WHERE id = %i',
139 139
     $session->get('user-id')
140 140
 );
141 141
 
142 142
 if (empty($userInfo['avatar']) === true) {
143
-    $avatar = $SETTINGS['cpassman_url'] . '/includes/images/photo.jpg';
143
+    $avatar = $SETTINGS['cpassman_url'].'/includes/images/photo.jpg';
144 144
 } else {
145
-    $avatar = $SETTINGS['cpassman_url'] . '/includes/avatars/' . $userInfo['avatar'];
145
+    $avatar = $SETTINGS['cpassman_url'].'/includes/avatars/'.$userInfo['avatar'];
146 146
 }
147 147
 
148 148
 // Get Groups name
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 foreach ($session->get('user-roles_array') as $role) {
151 151
     $tmp = DB::queryFirstRow(
152 152
         'SELECT title 
153
-        FROM ' . prefixTable('roles_title') . ' 
153
+        FROM ' . prefixTable('roles_title').' 
154 154
         WHERE id = %i',
155 155
         $role
156 156
     );
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
                         <h3 id="profile-username" class="text-center">
197 197
                             <?php
198 198
                             if (null !== $session->get('user-name') && empty($session->get('user-name')) === false) {
199
-                                echo $session->get('user-name') . ' ' . $session->get('user-lastname');
199
+                                echo $session->get('user-name').' '.$session->get('user-lastname');
200 200
                             } else {
201 201
                                 echo $session->get('user-login');
202 202
                             }
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
                                             } else {
265 265
                                                 echo date('d/m/Y', (int) $session->get('user-last_connection'));
266 266
                                             }
267
-                                            echo ' ' . $lang->get('at') . ' ';
267
+                                            echo ' '.$lang->get('at').' ';
268 268
                                             if (isset($SETTINGS['time_format']) === true) {
269 269
                                                 echo date($SETTINGS['time_format'], (int) $session->get('user-last_connection'));
270 270
                                             } else {
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
                                         </a>
275 275
                                     </li>
276 276
                                     <?php
277
-                                    if (null !== $session->get('user-last_pw_change') && ! empty($session->get('user-last_pw_change') === true)) {
277
+                                    if (null !== $session->get('user-last_pw_change') && !empty($session->get('user-last_pw_change') === true)) {
278 278
                                         // Handle last password change string
279 279
                                         if ($session->has('user-last_pw_change') && null !== $session->get('user-last_pw_change')) {
280 280
                                             if (isset($SETTINGS['date_format']) === true) {
@@ -294,12 +294,12 @@  discard block
 block discarded – undo
294 294
                                         ) {
295 295
                                             $numDaysBeforePwExpiration = '';
296 296
                                         } else {
297
-                                            $numDaysBeforePwExpiration = $LANG['index_pw_expiration'] . ' ' . $session->get('user-num_days_before_exp') . ' ' . $LANG['days'] . '.';
297
+                                            $numDaysBeforePwExpiration = $LANG['index_pw_expiration'].' '.$session->get('user-num_days_before_exp').' '.$LANG['days'].'.';
298 298
                                         }
299 299
                                         echo '
300 300
                                     <li class="list-group-item">
301
-                                        <b><i class="fas fa-calendar-alt fa-fw fa-lg mr-2"></i>' . $lang->get('index_last_pw_change') . '</b>
302
-                                        <a class="float-right">' . $last_pw_change . ' ' . $numDaysBeforePwExpiration . '</a>
301
+                                        <b><i class="fas fa-calendar-alt fa-fw fa-lg mr-2"></i>' . $lang->get('index_last_pw_change').'</b>
302
+                                        <a class="float-right">' . $last_pw_change.' '.$numDaysBeforePwExpiration.'</a>
303 303
                                     </li>';
304 304
                                     }
305 305
                                     ?>
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
                                     if (isset($SETTINGS['api']) === true && (int) $SETTINGS['api'] === 1) {
320 320
                                         echo '
321 321
                                     <li class="list-group-item">
322
-                                        <b><i class="fas fa-paper-plane fa-fw fa-lg mr-2"></i>' . $lang->get('user_profile_api_key') . '</b>
322
+                                        <b><i class="fas fa-paper-plane fa-fw fa-lg mr-2"></i>' . $lang->get('user_profile_api_key').'</b>
323 323
                                         <button class="btn btn-sm btn-primary float-right" id="copy-api-key"><i class="fa-regular fa-copy  pointer"></i></button>
324 324
                                         <a class="float-right mr-2" id="profile-user-api-token">',
325 325
                                             null !== $session->get('user-api_key') ? $session->get('user-api_key') : '',
@@ -337,12 +337,12 @@  discard block
 block discarded – undo
337 337
                                         <?php
338 338
                                         $rows = DB::query(
339 339
                                             'SELECT label AS labelAction, date, null
340
-                                                    FROM ' . prefixTable('log_system') . '
340
+                                                    FROM ' . prefixTable('log_system').'
341 341
                                                     WHERE qui = %i
342 342
                                                     UNION
343 343
                                                     SELECT l.action, l.date, i.label AS itemLabel
344
-                                                    FROM ' . prefixTable('log_items') . ' AS l
345
-                                                    INNER JOIN ' . prefixTable('items') . ' AS i ON (l.id_item = i.id)
344
+                                                    FROM ' . prefixTable('log_items').' AS l
345
+                                                    INNER JOIN ' . prefixTable('items').' AS i ON (l.id_item = i.id)
346 346
                                                     WHERE l.id_user = %i AND l.action IN ("at_access")
347 347
                                                     ORDER BY date DESC
348 348
                                                     LIMIT 0, 40',
@@ -356,9 +356,9 @@  discard block
 block discarded – undo
356 356
                                                 $text = $lang->get($record['labelAction']);
357 357
                                             }
358 358
                                             if (empty($record['NULL']) === false) {
359
-                                                $text .= ' ' . $lang->get('for') . ' <span class="font-weight-light">' . addslashes($record['NULL']) . '</span>';
359
+                                                $text .= ' '.$lang->get('for').' <span class="font-weight-light">'.addslashes($record['NULL']).'</span>';
360 360
                                             }
361
-                                            echo '<li class="list-group-item">' . date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['date']) . ' - ' . $text . '</li>';
361
+                                            echo '<li class="list-group-item">'.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['date']).' - '.$text.'</li>';
362 362
                                         }
363 363
                                         ?>
364 364
                                     </ul>
@@ -392,13 +392,13 @@  discard block
 block discarded – undo
392 392
                                 <?php endif; /* disable_user_edit_profile */
393 393
                                 if (($SETTINGS['disable_user_edit_timezone'] ?? '0') === '0') : ?>
394 394
                                     <div class="form-group">
395
-                                        <label class="col-sm-10 control-label"><?php echo $lang->get('timezone_selection');?></label>
395
+                                        <label class="col-sm-10 control-label"><?php echo $lang->get('timezone_selection'); ?></label>
396 396
                                         <div class="col-sm-10">
397 397
                                             <select class="form-control" id="profile-user-timezone">
398 398
                                                 <?php foreach ($zones as $key => $zone): ?>
399 399
                                                     <option value="<?php echo $key; ?>"<?php 
400 400
                                                         if ($session->has('user-timezone'))
401
-                                                            if($session->get('user-timezone') === $key)
401
+                                                            if ($session->get('user-timezone') === $key)
402 402
                                                                 echo ' selected';
403 403
                                                             elseif ($session->get('user-timezone') === 'not_defined')
404 404
                                                                 if (isset($SETTINGS['timezone']) && $SETTINGS['timezone'] === $key)
@@ -416,10 +416,10 @@  discard block
 block discarded – undo
416 416
                                             <select class="form-control" id="profile-user-language">
417 417
                                                 <?php
418 418
                                                     foreach ($languages as $language) {
419
-                                                        echo '<option value="' . $language['name'] . '"',
419
+                                                        echo '<option value="'.$language['name'].'"',
420 420
                                                         strtolower($session->get('user-language')) === strtolower($language['name']) ?
421 421
                                                         ' selected="selected"' : '',
422
-                                                    '>' . $language['label'] . '</option>';
422
+                                                    '>'.$language['label'].'</option>';
423 423
                                                     }
424 424
                                                 ?>
425 425
                                             </select>
@@ -432,11 +432,11 @@  discard block
 block discarded – undo
432 432
                                         <div class="col-sm-10">
433 433
                                             <select class="form-control" id="profile-user-treeloadstrategy">
434 434
                                                 
435
-                                                <option value="sequential" <?php echo $session->has('user-tree_load_strategy') && $session->get('user-tree_load_strategy') && null !== $session->get('user-tree_load_strategy') && $session->get('user-tree_load_strategy') === 'sequential' ? ' selected' : '';?>>
435
+                                                <option value="sequential" <?php echo $session->has('user-tree_load_strategy') && $session->get('user-tree_load_strategy') && null !== $session->get('user-tree_load_strategy') && $session->get('user-tree_load_strategy') === 'sequential' ? ' selected' : ''; ?>>
436 436
                                                     <?php echo $lang->get('sequential'); ?>
437 437
                                                 </option>
438 438
                                                 
439
-                                                <option value="full" <?php echo $session->has('user-tree_load_strategy') && $session->get('user-tree_load_strategy') && null !== $session->get('user-tree_load_strategy') && $session->get('user-tree_load_strategy') === 'full' ? ' selected' : '';?>>
439
+                                                <option value="full" <?php echo $session->has('user-tree_load_strategy') && $session->get('user-tree_load_strategy') && null !== $session->get('user-tree_load_strategy') && $session->get('user-tree_load_strategy') === 'full' ? ' selected' : ''; ?>>
440 440
                                                     <?php echo $lang->get('full'); ?>
441 441
                                                 </option>
442 442
                                             </select>
@@ -449,11 +449,11 @@  discard block
 block discarded – undo
449 449
                                         <div class="col-sm-10">
450 450
                                             <select class="form-control" id="profile-user-split_view_mode">
451 451
                                                 
452
-                                                <option value="0" <?php echo $session->has('user-split_view_mode') && $session->get('user-split_view_mode') && null !== $session->get('user-split_view_mode') && $session->get('user-split_view_mode') === 0 ? 'selected' : '';?>>
452
+                                                <option value="0" <?php echo $session->has('user-split_view_mode') && $session->get('user-split_view_mode') && null !== $session->get('user-split_view_mode') && $session->get('user-split_view_mode') === 0 ? 'selected' : ''; ?>>
453 453
                                                     <?php echo $lang->get('no'); ?>
454 454
                                                 </option>
455 455
                                                 
456
-                                                <option value="1" <?php echo $session->has('user-split_view_mode') && $session->get('user-split_view_mode') && null !== $session->get('user-split_view_mode') && (int) $session->get('user-split_view_mode') === 1 ? 'selected' : '';?>>
456
+                                                <option value="1" <?php echo $session->has('user-split_view_mode') && $session->get('user-split_view_mode') && null !== $session->get('user-split_view_mode') && (int) $session->get('user-split_view_mode') === 1 ? 'selected' : ''; ?>>
457 457
                                                     <?php echo $lang->get('yes'); ?>
458 458
                                                 </option>
459 459
                                             </select>
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
                                                 <?php 
472 472
                                                 }
473 473
                                                 if (isset($SETTINGS['api']) === true && (int) $SETTINGS['api'] === 1) {
474
-                                                    echo '<button type="button" class="btn btn-warning float-right" id="profile-button-api_token">' . $lang->get('generate_api_token') . '</button>';
474
+                                                    echo '<button type="button" class="btn btn-warning float-right" id="profile-button-api_token">'.$lang->get('generate_api_token').'</button>';
475 475
                                                 }
476 476
                                                 ?>
477 477
                                                 <div id="profile-avatar-file-container" class="hidden"></div>
Please login to merge, or discard this patch.