Passed
Push — master ( 0d33c7...8995ac )
by Nils
05:53
created
sources/import.queries.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 ) {
80 80
     // Not allowed page
81 81
     $session->set('system-error_code', ERR_NOT_ALLOWED);
82
-    include $SETTINGS['cpassman_dir'] . '/error.php';
82
+    include $SETTINGS['cpassman_dir'].'/error.php';
83 83
     exit;
84 84
 }
85 85
 
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
         );
168 168
 
169 169
         // Initialisation
170
-        $file = $SETTINGS['path_to_files_folder'] . '/' . $data['valeur'];
170
+        $file = $SETTINGS['path_to_files_folder'].'/'.$data['valeur'];
171 171
         $importation_possible = true;
172 172
         $valuesToImport = [];
173 173
         $items_number = 0;
@@ -224,26 +224,26 @@  discard block
 block discarded – undo
224 224
                 'ISO-8859-1',
225 225
                 'ISO-8859-15',
226 226
                 'Windows-1252',
227
-                'Windows-1251',  // Cyrillique
228
-                'CP1251',        // Cyrillique alternatif
229
-                'KOI8-R',        // Cyrillique russe
230
-                'Shift_JIS',     // Japonais
231
-                'EUC-JP',        // Japonais
232
-                'ISO-2022-JP',   // Japonais
233
-                'TIS-620',       // ThaĂŻ
234
-                'Windows-874',   // ThaĂŻ Windows
235
-                'Big5',          // Chinois traditionnel
236
-                'GB2312',        // Chinois simplifié
237
-                'GBK',           // Chinois simplifié étendu
238
-                'EUC-KR',        // Coréen
239
-                'ISO-8859-2',    // Europe centrale
240
-                'ISO-8859-5',    // Cyrillique ISO
241
-                'ISO-8859-7',    // Grec
242
-                'Windows-1250',  // Europe centrale
243
-                'Windows-1253',  // Grec
244
-                'Windows-1254',  // Turc
245
-                'Windows-1255',  // Hébreu
246
-                'Windows-1256',  // Arabe
227
+                'Windows-1251', // Cyrillique
228
+                'CP1251', // Cyrillique alternatif
229
+                'KOI8-R', // Cyrillique russe
230
+                'Shift_JIS', // Japonais
231
+                'EUC-JP', // Japonais
232
+                'ISO-2022-JP', // Japonais
233
+                'TIS-620', // ThaĂŻ
234
+                'Windows-874', // ThaĂŻ Windows
235
+                'Big5', // Chinois traditionnel
236
+                'GB2312', // Chinois simplifié
237
+                'GBK', // Chinois simplifié étendu
238
+                'EUC-KR', // Coréen
239
+                'ISO-8859-2', // Europe centrale
240
+                'ISO-8859-5', // Cyrillique ISO
241
+                'ISO-8859-7', // Grec
242
+                'Windows-1250', // Europe centrale
243
+                'Windows-1253', // Grec
244
+                'Windows-1254', // Turc
245
+                'Windows-1255', // Hébreu
246
+                'Windows-1256', // Arabe
247 247
             ];
248 248
 
249 249
             // Get the list of encodings supported by the system
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
 
287 287
         // Get the data and ensure columns are correctly mapped
288 288
         $interpreter = new Interpreter();
289
-        $interpreter->addObserver(function (array $row) use (&$valuesToImport, $header) {
289
+        $interpreter->addObserver(function(array $row) use (&$valuesToImport, $header) {
290 290
             $rowData = array_combine($header, $row);
291 291
 
292 292
             if ($rowData !== false) {
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
             // Handle multiple lignes description
340 340
             if (strpos($comments, '<br>') !== false || strpos($label, '<br>') !== false) {
341 341
                 $continue_on_next_line = true;
342
-                $comment .= " " . $label . " " . $comments;
342
+                $comment .= " ".$label." ".$comments;
343 343
             } else {
344 344
                 // Insert previous line if changing line
345 345
                 if (!empty($label)) {
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
                     // Insert in batch
349 349
                     $batchInsert[] = array(
350 350
                         'label'        => $label,
351
-                        'description'  => $comment . $comments,
351
+                        'description'  => $comment.$comments,
352 352
                         'pwd'          => $pwd,
353 353
                         'url'          => $url,
354 354
                         'folder'       => ((int) $session->get('user-admin') === 1 || (int) $session->get('user-manager') === 1 || (int) $session->get('user-can_manage_all_users') === 1) ? $folder : '',
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
             // Insert in batch
380 380
             $batchInsert[] = array(
381 381
                 'label'        => $label,
382
-                'description'  => $comment . $comments,
382
+                'description'  => $comment.$comments,
383 383
                 'pwd'          => $pwd,
384 384
                 'url'          => $url,
385 385
                 'folder'       => ((int) $session->get('user-admin') === 1 || (int) $session->get('user-manager') === 1 || (int) $session->get('user-can_manage_all_users') === 1) ? $folder : '',
@@ -403,10 +403,10 @@  discard block
 block discarded – undo
403 403
             $values = [];
404 404
 
405 405
             foreach ($batchInsert as $data) {
406
-                $values[] = "('" . implode("','", array_map('addslashes', $data)) . "')";
406
+                $values[] = "('".implode("','", array_map('addslashes', $data))."')";
407 407
             }
408 408
 
409
-            $sql = "INSERT INTO `$tableName` (`label`, `description`, `pwd`, `url`, `folder`, `login`, `operation_id`) VALUES " . implode(',', $values);
409
+            $sql = "INSERT INTO `$tableName` (`label`, `description`, `pwd`, `url`, `folder`, `login`, `operation_id`) VALUES ".implode(',', $values);
410 410
 
411 411
             DB::query($sql);
412 412
         }
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
             $parentId = $dataReceived['folderId']; // Strating with provided folder
490 490
 
491 491
             foreach ($parts as $part) {
492
-                $currentPath = trim($currentPath . "/" . $part, "/");
492
+                $currentPath = trim($currentPath."/".$part, "/");
493 493
                 $currentFolder = $part;
494 494
 
495 495
                 // Check if this folder has already been created
@@ -550,7 +550,7 @@  discard block
 block discarded – undo
550 550
                         // Get ID of existing folder
551 551
                         $ret = DB::queryFirstRow(
552 552
                             'SELECT *
553
-                            FROM ' . prefixTable('nested_tree') . '
553
+                            FROM ' . prefixTable('nested_tree').'
554 554
                             WHERE title = %s',
555 555
                             $currentFolder
556 556
                         );
@@ -760,9 +760,9 @@  discard block
 block discarded – undo
760 760
                 ];
761 761
 
762 762
                 error_log(
763
-                    'SQL Error during import | increment_id: ' . $item['increment_id'] .
764
-                    ' | Message: ' . $e->getMessage() .
765
-                    ' | StackTrace: ' . $e->getTraceAsString()
763
+                    'SQL Error during import | increment_id: '.$item['increment_id'].
764
+                    ' | Message: '.$e->getMessage().
765
+                    ' | StackTrace: '.$e->getTraceAsString()
766 766
                 );
767 767
             }
768 768
         }
@@ -1071,7 +1071,7 @@  discard block
 block discarded – undo
1071 1071
         ];
1072 1072
         $startPathLevel = 1;
1073 1073
 
1074
-        foreach($post_folders as $folder) {
1074
+        foreach ($post_folders as $folder) {
1075 1075
             // get parent id
1076 1076
             if (!isset($arrFolders[$folder['parentFolderId']])) {
1077 1077
                 // If parent folder is not in the array, it means it is the destination folder
@@ -1147,7 +1147,7 @@  discard block
 block discarded – undo
1147 1147
         DB::startTransaction();
1148 1148
 
1149 1149
         // Import all items
1150
-        foreach($post_items as $item) {
1150
+        foreach ($post_items as $item) {
1151 1151
             // get info about this folder
1152 1152
             $destinationFolderMore = DB::queryFirstRow(
1153 1153
                 'SELECT title FROM '.prefixTable('nested_tree').' WHERE id = %i',
@@ -1178,7 +1178,7 @@  discard block
 block discarded – undo
1178 1178
                     'pw' => $cryptedStuff['encrypted'],
1179 1179
                     'pw_iv' => '',
1180 1180
                     'url' => substr($item['URL'], 0, 500),
1181
-                    'id_tree' => isset($post_folders[$item['parentFolderId']]['id']) ? (int)$post_folders[$item['parentFolderId']]['id'] : 0,
1181
+                    'id_tree' => isset($post_folders[$item['parentFolderId']]['id']) ? (int) $post_folders[$item['parentFolderId']]['id'] : 0,
1182 1182
                     'login' => substr($item['UserName'], 0, 500),
1183 1183
                     'anyone_can_modify' => $$inputData['editAll'],
1184 1184
                     'encryption_type' => 'teampass_aes',
@@ -1313,7 +1313,7 @@  discard block
 block discarded – undo
1313 1313
 
1314 1314
         //For each role to which the user depends on, add the folder just created.
1315 1315
         // (if not personal, otherwise, add to user-personal_folders)
1316
-        if ( $isPersonalFolder ) {
1316
+        if ($isPersonalFolder) {
1317 1317
             SessionManager::addRemoveFromSessionArray('user-personal_folders', [$id], 'add');
1318 1318
         } else {
1319 1319
             foreach ($session->get('system-array_roles') as $role) {
@@ -1384,7 +1384,7 @@  discard block
 block discarded – undo
1384 1384
     ];
1385 1385
 }
1386 1386
 
1387
-spl_autoload_register(function ($class) {
1387
+spl_autoload_register(function($class) {
1388 1388
     $prefix = 'League\\Csv\\';
1389 1389
     $base_dir = __DIR__.'/src/';
1390 1390
     $len = strlen($prefix);
Please login to merge, or discard this patch.
sources/upload.attachments.php 1 patch
Spacing   +21 added lines, -21 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
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 $post_isNewItem = $request->request->filter('isNewItem', null, FILTER_SANITIZE_NUMBER_INT);
108 108
 $post_randomId = $request->request->filter('randomId', null, FILTER_SANITIZE_NUMBER_INT);
109 109
 $post_isPersonal = $request->request->filter('isPersonal', null, FILTER_SANITIZE_NUMBER_INT);
110
-$post_fileSize= $request->request->filter('file_size', null, FILTER_SANITIZE_NUMBER_INT);
110
+$post_fileSize = $request->request->filter('file_size', null, FILTER_SANITIZE_NUMBER_INT);
111 111
 $chunk = $request->request->filter('chunk', 0, FILTER_SANITIZE_NUMBER_INT);
112 112
 $chunks = $request->request->filter('chunks', 0, FILTER_SANITIZE_NUMBER_INT);
113 113
 $fileName = $request->request->filter('name', '', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
@@ -122,10 +122,10 @@  discard block
 block discarded – undo
122 122
     $unit = strtoupper(substr(trim($POST_MAX_SIZE), -1)); // Assurez-vous de bien gérer les espaces éventuels
123 123
     $units = ['G' => 1073741824, 'M' => 1048576, 'K' => 1024];
124 124
     $multiplier = $units[$unit] ?? 1; // Vérifie si l'unité est dans le tableau, sinon 1
125
-    $maxSize = (int)$POST_MAX_SIZE * $multiplier;
125
+    $maxSize = (int) $POST_MAX_SIZE * $multiplier;
126 126
     
127 127
     // CHeck if the POST is too big
128
-    if (!empty($_SERVER['CONTENT_LENGTH']) && (int)$_SERVER['CONTENT_LENGTH'] > $maxSize && $maxSize > 0) {
128
+    if (!empty($_SERVER['CONTENT_LENGTH']) && (int) $_SERVER['CONTENT_LENGTH'] > $maxSize && $maxSize > 0) {
129 129
         handleAttachmentError('POST exceeded maximum allowed size.', 111, 413);
130 130
     }
131 131
 
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
         handleAttachmentError('File exceeds the maximum allowed size', 120, 413);
135 135
         die();
136 136
     }
137
-    if (WIP === true) error_log('POST_MAX_SIZE: ' . $POST_MAX_SIZE." - CONTENT_LENGTH: ".$_SERVER['CONTENT_LENGTH']." - UNIT: ".$unit." - MAX: ".$maxSize." - MULTIPLIER: ".$multiplier." - FILE_SIZE: ".$post_fileSize);
137
+    if (WIP === true) error_log('POST_MAX_SIZE: '.$POST_MAX_SIZE." - CONTENT_LENGTH: ".$_SERVER['CONTENT_LENGTH']." - UNIT: ".$unit." - MAX: ".$maxSize." - MULTIPLIER: ".$multiplier." - FILE_SIZE: ".$post_fileSize);
138 138
     
139 139
     // delete expired tokens
140 140
     DB::delete(prefixTable('tokens'), 'end_timestamp < %i', time());
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
         // check if token is expired
186 186
         $data = DB::queryFirstRow(
187 187
             'SELECT end_timestamp
188
-            FROM ' . prefixTable('tokens') . '
188
+            FROM ' . prefixTable('tokens').'
189 189
             WHERE user_id = %i AND token = %s',
190 190
             $session->get('user-id'),
191 191
             $post_user_token
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 
219 219
 // HTTP headers for no cache etc
220 220
 header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
221
-header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
221
+header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
222 222
 header('Cache-Control: no-store, no-cache, must-revalidate');
223 223
 header('Cache-Control: post-check=0, pre-check=0', false);
224 224
 
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 // Validate file name (for our purposes we'll just remove invalid characters)
257 257
 $file_name = preg_replace('[^A-Za-z0-9]', '', strtolower(basename($_FILES['file']['name'])));
258 258
 if (strlen($file_name) == 0 || strlen($file_name) > $MAX_FILENAME_LENGTH) {
259
-    handleAttachmentError('Invalid file name: ' . $file_name . '.', 114);
259
+    handleAttachmentError('Invalid file name: '.$file_name.'.', 114);
260 260
 }
261 261
 
262 262
 // Validate file extension
@@ -269,8 +269,8 @@  discard block
 block discarded – undo
269 269
             $ext,
270 270
             explode(
271 271
                 ',',
272
-                $SETTINGS['upload_docext'] . ',' . $SETTINGS['upload_imagesext'] .
273
-                    ',' . $SETTINGS['upload_pkgext'] . ',' . $SETTINGS['upload_otherext']
272
+                $SETTINGS['upload_docext'].','.$SETTINGS['upload_imagesext'].
273
+                    ','.$SETTINGS['upload_pkgext'].','.$SETTINGS['upload_otherext']
274 274
             )
275 275
         ) === false
276 276
     ) {
@@ -283,24 +283,24 @@  discard block
 block discarded – undo
283 283
 
284 284
 // Clean the fileName for security reasons
285 285
 $fileInfo = pathinfo($fileName);
286
-$fileName = base64_encode($fileInfo['filename']) . '.' . $fileInfo['extension'];
286
+$fileName = base64_encode($fileInfo['filename']).'.'.$fileInfo['extension'];
287 287
 $fileFullSize = 0;
288 288
 
289 289
 // Make sure the fileName is unique but only if chunking is disabled
290
-if ($chunks < 2 && file_exists($targetDir . DIRECTORY_SEPARATOR . $fileName)) {
290
+if ($chunks < 2 && file_exists($targetDir.DIRECTORY_SEPARATOR.$fileName)) {
291 291
     $ext = strrpos($fileName, '.');
292 292
     $fileNameA = substr($fileName, 0, $ext);
293 293
     $fileNameB = substr($fileName, $ext);
294 294
 
295 295
     $count = 1;
296
-    while (file_exists($targetDir . DIRECTORY_SEPARATOR . $fileNameA . '_' . $count . $fileNameB)) {
296
+    while (file_exists($targetDir.DIRECTORY_SEPARATOR.$fileNameA.'_'.$count.$fileNameB)) {
297 297
         ++$count;
298 298
     }
299 299
 
300
-    $fileName = $fileNameA . '_' . $count . $fileNameB;
300
+    $fileName = $fileNameA.'_'.$count.$fileNameB;
301 301
 }
302 302
 
303
-$filePath = $targetDir . DIRECTORY_SEPARATOR . $fileName;
303
+$filePath = $targetDir.DIRECTORY_SEPARATOR.$fileName;
304 304
 
305 305
 // Create target dir
306 306
 if (file_exists($targetDir) === false) {
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
 // Remove old temp files
315 315
 if ($cleanupTargetDir && is_dir($targetDir) && ($dir = opendir($targetDir))) {
316 316
     while (($file = readdir($dir)) !== false) {
317
-        $tmpfilePath = $targetDir . DIRECTORY_SEPARATOR . $file;
317
+        $tmpfilePath = $targetDir.DIRECTORY_SEPARATOR.$file;
318 318
 
319 319
         // Remove temp file if it is older than the max age and is not the current file
320 320
         if (
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
         prefixTable('files'),
417 417
         array(
418 418
             'id_item' => $post_itemId,
419
-            'name' => 'b64:' . $fileName,   // add "b64:" prefix to indicate that the file name is base64 encoded
419
+            'name' => 'b64:'.$fileName, // add "b64:" prefix to indicate that the file name is base64 encoded
420 420
             'size' => $post_fileSize,
421 421
             'extension' => $fileInfo['extension'],
422 422
             'type' => $_FILES['file']['type'],
@@ -433,8 +433,8 @@  discard block
 block discarded – undo
433 433
         // This is a public object
434 434
         $users = DB::query(
435 435
             'SELECT id, public_key
436
-            FROM ' . prefixTable('users') . '
437
-            WHERE id NOT IN ("' . OTV_USER_ID . '","' . SSH_USER_ID . '","' . API_USER_ID . '")
436
+            FROM ' . prefixTable('users').'
437
+            WHERE id NOT IN ("' . OTV_USER_ID.'","'.SSH_USER_ID.'","'.API_USER_ID.'")
438 438
             AND public_key != ""'
439 439
         );
440 440
         foreach ($users as $user) {
@@ -468,14 +468,14 @@  discard block
 block discarded – undo
468 468
                 'date' => time(),
469 469
                 'id_user' => $session->get('user-id'),
470 470
                 'action' => 'at_modification',
471
-                'raison' => 'at_add_file : ' . $fileName . ':' . $newID,
471
+                'raison' => 'at_add_file : '.$fileName.':'.$newID,
472 472
             )
473 473
         );
474 474
     }
475 475
 }
476 476
 
477 477
 // Return JSON-RPC response
478
-die('{"jsonrpc" : "2.0", "result" : null, "id" : "' . $newID . '"}');
478
+die('{"jsonrpc" : "2.0", "result" : null, "id" : "'.$newID.'"}');
479 479
 
480 480
 /**
481 481
  * Handle errors and kill script.
Please login to merge, or discard this patch.
sources/upload.files.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 ) {
77 77
     // Not allowed page
78 78
     $session->set('system-error_code', ERR_NOT_ALLOWED);
79
-    include $SETTINGS['cpassman_dir'] . '/error.php';
79
+    include $SETTINGS['cpassman_dir'].'/error.php';
80 80
     exit;
81 81
 }
82 82
 
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
     } else {
131 131
         // check if token is expired
132 132
         $data = DB::queryFirstRow(
133
-            'SELECT end_timestamp FROM ' . prefixTable('tokens') . ' WHERE user_id = %i AND token = %s',
133
+            'SELECT end_timestamp FROM '.prefixTable('tokens').' WHERE user_id = %i AND token = %s',
134 134
             $session->get('user-id'),
135 135
             $post_user_token
136 136
         );
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 
155 155
 // HTTP headers for no cache etc
156 156
 header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
157
-header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
157
+header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
158 158
 header('Cache-Control: no-store, no-cache, must-revalidate');
159 159
 header('Cache-Control: post-check=0, pre-check=0', false);
160 160
 
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
     }
167 167
 
168 168
     // Set directory used to store file
169
-    $targetDir = realpath($SETTINGS['cpassman_dir'] . '/includes/avatars');
169
+    $targetDir = realpath($SETTINGS['cpassman_dir'].'/includes/avatars');
170 170
 } else {
171 171
     $targetDir = realpath($SETTINGS['path_to_files_folder']);
172 172
 }
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
     $file_name = preg_replace('/[^a-zA-Z0-9-_\.]/', '', strtolower(basename($file->getClientOriginalName())));
220 220
     
221 221
     if (strlen($file_name) == 0 || strlen($file_name) > $MAX_FILENAME_LENGTH) {
222
-        error_log('Invalid file name: ' . $file_name . '.');
222
+        error_log('Invalid file name: '.$file_name.'.');
223 223
         echo handleUploadError('Invalid file name provided.');
224 224
         return false;
225 225
     }
@@ -233,13 +233,13 @@  discard block
 block discarded – undo
233 233
             $ext = strtolower($ext);
234 234
         } else {
235 235
             // Case where the file extension is not a string
236
-            error_log('Invalid file name: ' . $file_name . '.');
236
+            error_log('Invalid file name: '.$file_name.'.');
237 237
             echo handleUploadError('Invalid file extension.');
238 238
             return false;
239 239
         }
240 240
     } else {
241 241
         // Case where the file name is not a string
242
-        error_log('Invalid file name: ' . $file_name . '.');
242
+        error_log('Invalid file name: '.$file_name.'.');
243 243
         echo handleUploadError('Invalid file.');
244 244
         return false;
245 245
     }
@@ -247,8 +247,8 @@  discard block
 block discarded – undo
247 247
     // Validate against a list of allowed extensions
248 248
     $allowed_extensions = explode(
249 249
         ',',
250
-        $SETTINGS['upload_docext'] . ',' . $SETTINGS['upload_imagesext'] .
251
-            ',' . $SETTINGS['upload_pkgext'] . ',' . $SETTINGS['upload_otherext']
250
+        $SETTINGS['upload_docext'].','.$SETTINGS['upload_imagesext'].
251
+            ','.$SETTINGS['upload_pkgext'].','.$SETTINGS['upload_otherext']
252 252
     );
253 253
 
254 254
     // Check if we should enforce extensions
@@ -271,25 +271,25 @@  discard block
 block discarded – undo
271 271
 
272 272
 // is destination folder writable
273 273
 if (is_writable($SETTINGS['path_to_files_folder']) === false) {
274
-    echo handleUploadError('Not enough permissions on folder ' . $SETTINGS['path_to_files_folder'] . '.');
274
+    echo handleUploadError('Not enough permissions on folder '.$SETTINGS['path_to_files_folder'].'.');
275 275
     return false;
276 276
 }
277 277
 
278 278
 // Make sure the fileName is unique but only if chunking is disabled
279
-if ($chunks < 2 && file_exists($targetDir . DIRECTORY_SEPARATOR . $fileName)) {
279
+if ($chunks < 2 && file_exists($targetDir.DIRECTORY_SEPARATOR.$fileName)) {
280 280
     // $ext is guaranteed to be a string due to prior checks
281 281
     $fileNameA = substr($fileName, 0, strlen(/** @scrutinizer ignore-type */$ext));
282 282
     $fileNameB = substr($fileName, strlen(/** @scrutinizer ignore-type */$ext));
283 283
 
284 284
     $count = 1;
285
-    while (file_exists($targetDir . DIRECTORY_SEPARATOR . $fileNameA . '_' . $count . $fileNameB)) {
285
+    while (file_exists($targetDir.DIRECTORY_SEPARATOR.$fileNameA.'_'.$count.$fileNameB)) {
286 286
         ++$count;
287 287
     }
288 288
 
289
-    $fileName = $fileNameA . '_' . $count . $fileNameB;
289
+    $fileName = $fileNameA.'_'.$count.$fileNameB;
290 290
 }
291 291
 
292
-$filePath = $targetDir . DIRECTORY_SEPARATOR . $fileName;
292
+$filePath = $targetDir.DIRECTORY_SEPARATOR.$fileName;
293 293
 
294 294
 // Create target dir
295 295
 if (!file_exists($targetDir)) {
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
 // Remove old temp files
304 304
 if ($cleanupTargetDir && is_dir($targetDir) && ($dir = opendir($targetDir))) {
305 305
     while (($fileClean = readdir($dir)) !== false) {
306
-        $tmpfilePath = $targetDir . DIRECTORY_SEPARATOR . $fileClean;
306
+        $tmpfilePath = $targetDir.DIRECTORY_SEPARATOR.$fileClean;
307 307
 
308 308
         // Remove temp file if it is older than the max age and is not the current file
309 309
         if (
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
 
318 318
     closedir($dir);
319 319
 } else {
320
-    echo handleUploadError('Not enough permissions on folder ' . $SETTINGS['path_to_files_folder'] . '.');
320
+    echo handleUploadError('Not enough permissions on folder '.$SETTINGS['path_to_files_folder'].'.');
321 321
     return false;
322 322
 }
323 323
 
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 
354 354
                 // Safe destination folder
355 355
                 $uploadDir = realpath($SETTINGS['path_to_upload_folder']);
356
-                $destinationPath = $uploadDir . DIRECTORY_SEPARATOR . $fileName;
356
+                $destinationPath = $uploadDir.DIRECTORY_SEPARATOR.$fileName;
357 357
                 
358 358
                 if (move_uploaded_file($tmpFilePath, $destinationPath)) {
359 359
                     // Open the moved file in read mode
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
             return false;
395 395
         }
396 396
     } else {
397
-        echo handleUploadError('Failed to move uploaded file to ' . $SETTINGS['path_to_files_folder'] . '.');
397
+        echo handleUploadError('Failed to move uploaded file to '.$SETTINGS['path_to_files_folder'].'.');
398 398
         return false;
399 399
     }
400 400
 } else {
@@ -410,14 +410,14 @@  discard block
 block discarded – undo
410 410
                 fwrite($out, $buff);
411 411
             }
412 412
         } else {
413
-            echo handleUploadError('Failed to open input stream ' . $SETTINGS['path_to_files_folder'] . '.');
413
+            echo handleUploadError('Failed to open input stream '.$SETTINGS['path_to_files_folder'].'.');
414 414
             return false;
415 415
         }
416 416
 
417 417
         fclose($in);
418 418
         fclose($out);
419 419
     } else {
420
-        echo handleUploadError('Failed to open output stream ' . $SETTINGS['path_to_files_folder'] . '.');
420
+        echo handleUploadError('Failed to open output stream '.$SETTINGS['path_to_files_folder'].'.');
421 421
         return false;
422 422
     }
423 423
 }
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
 ) {
451 451
     rename(
452 452
         $filePath,
453
-        $targetDir . DIRECTORY_SEPARATOR . $newFileName
453
+        $targetDir.DIRECTORY_SEPARATOR.$newFileName
454 454
     );
455 455
 
456 456
     // Add in DB
@@ -479,7 +479,7 @@  discard block
 block discarded – undo
479 479
 ) {
480 480
     rename(
481 481
         $filePath,
482
-        $targetDir . DIRECTORY_SEPARATOR . $newFileName
482
+        $targetDir.DIRECTORY_SEPARATOR.$newFileName
483 483
     );
484 484
 
485 485
     // Add in DB
@@ -512,13 +512,13 @@  discard block
 block discarded – undo
512 512
     // rename the file
513 513
     rename(
514 514
         $filePath,
515
-        $targetDir . DIRECTORY_SEPARATOR . $newFileName . '.' . $ext
515
+        $targetDir.DIRECTORY_SEPARATOR.$newFileName.'.'.$ext
516 516
     );
517 517
 
518 518
     // make thumbnail
519 519
     $ret = makeThumbnail(
520
-        $targetDir . DIRECTORY_SEPARATOR . $newFileName . '.' . $ext,
521
-        $targetDir . DIRECTORY_SEPARATOR . $newFileName . '_thumb' . '.' . $ext,
520
+        $targetDir.DIRECTORY_SEPARATOR.$newFileName.'.'.$ext,
521
+        $targetDir.DIRECTORY_SEPARATOR.$newFileName.'_thumb'.'.'.$ext,
522 522
         40
523 523
     );
524 524
 
@@ -530,21 +530,21 @@  discard block
 block discarded – undo
530 530
     }
531 531
 
532 532
     // get current avatar and delete it
533
-    $data = DB::queryFirstRow('SELECT avatar, avatar_thumb FROM ' . prefixTable('users') . ' WHERE id=%i', $session->get('user-id'));
534
-    fileDelete($targetDir . DIRECTORY_SEPARATOR . $data['avatar'], $SETTINGS);
535
-    fileDelete($targetDir . DIRECTORY_SEPARATOR . $data['avatar_thumb'], $SETTINGS);
533
+    $data = DB::queryFirstRow('SELECT avatar, avatar_thumb FROM '.prefixTable('users').' WHERE id=%i', $session->get('user-id'));
534
+    fileDelete($targetDir.DIRECTORY_SEPARATOR.$data['avatar'], $SETTINGS);
535
+    fileDelete($targetDir.DIRECTORY_SEPARATOR.$data['avatar_thumb'], $SETTINGS);
536 536
 
537 537
     // store in DB the new avatar
538 538
     DB::query(
539
-        'UPDATE ' . prefixTable('users') . "
540
-        SET avatar='" . $newFileName . '.' . $ext . "', avatar_thumb='" . $newFileName . '_thumb' . '.' . $ext . "'
539
+        'UPDATE '.prefixTable('users')."
540
+        SET avatar='" . $newFileName.'.'.$ext."', avatar_thumb='".$newFileName.'_thumb'.'.'.$ext."'
541 541
         WHERE id=%i",
542 542
         $session->get('user-id')
543 543
     );
544 544
 
545 545
     // store in session
546
-    $session->set('user-avatar', $newFileName . '.' . $ext);
547
-    $session->set('user-avatar_thumb', $newFileName . '_thumb' . '.' . $ext);
546
+    $session->set('user-avatar', $newFileName.'.'.$ext);
547
+    $session->set('user-avatar_thumb', $newFileName.'_thumb'.'.'.$ext);
548 548
 
549 549
     // return info
550 550
     echo prepareExchangedData(
@@ -563,7 +563,7 @@  discard block
 block discarded – undo
563 563
 ) {
564 564
     rename(
565 565
         $filePath,
566
-        $targetDir . DIRECTORY_SEPARATOR . $newFileName
566
+        $targetDir.DIRECTORY_SEPARATOR.$newFileName
567 567
     );
568 568
 
569 569
     // Add in DB
Please login to merge, or discard this patch.
pages/import.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
     || isset($SETTINGS['allow_import']) === false || (int) $SETTINGS['allow_import'] !== 1) {
71 71
     // Not allowed page
72 72
     $session->set('system-error_code', ERR_NOT_ALLOWED);
73
-    include $SETTINGS['cpassman_dir'] . '/error.php';
73
+    include $SETTINGS['cpassman_dir'].'/error.php';
74 74
     exit;
75 75
 }
76 76
 
@@ -85,9 +85,9 @@  discard block
 block discarded – undo
85 85
  
86 86
 if ((int) $session->get('user-admin') === 1) {
87 87
     $folderOptions = '';
88
-    $rows = DB::query('SELECT id, title FROM ' . prefixTable('nested_tree') . ' WHERE personal_folder = %i', 0);
88
+    $rows = DB::query('SELECT id, title FROM '.prefixTable('nested_tree').' WHERE personal_folder = %i', 0);
89 89
     foreach ($rows as $record) {
90
-        $folderOptions .= '<option value="' . $record['id'] . '">' . htmlspecialchars($record['title'], ENT_QUOTES, 'UTF-8') . '</option>';
90
+        $folderOptions .= '<option value="'.$record['id'].'">'.htmlspecialchars($record['title'], ENT_QUOTES, 'UTF-8').'</option>';
91 91
     }
92 92
 }
93 93
 
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
                                         <?php
190 190
 $complexitySelect = '';
191 191
 foreach (TP_PW_COMPLEXITY as $level) {
192
-    $complexitySelect .= '<option value="' . $level[0] . '">' . $level[1] . '</option>';
192
+    $complexitySelect .= '<option value="'.$level[0].'">'.$level[1].'</option>';
193 193
 }
194 194
 echo $complexitySelect;
195 195
                                         ?>
Please login to merge, or discard this patch.
pages/import.js.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('import') === false) {
73 73
     // Not allowed page
74 74
     $session->set('system-error_code', ERR_NOT_ALLOWED);
75
-    include $SETTINGS['cpassman_dir'] . '/error.php';
75
+    include $SETTINGS['cpassman_dir'].'/error.php';
76 76
     exit;
77 77
 }
78 78
 ?>
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
                     const errorMessages = JSON.parse(response.message);
512 512
                     let errorHtml = '<ul>';
513 513
                     errorMessages.forEach(function(error) {
514
-                        errorHtml += '<li><?php echo $lang->get('import_error_folder_creation');?> "<b>'+error.errorPath+'</b>": '+error.errorMessage+'</li>';
514
+                        errorHtml += '<li><?php echo $lang->get('import_error_folder_creation'); ?> "<b>'+error.errorPath+'</b>": '+error.errorMessage+'</li>';
515 515
                     });
516 516
 
517 517
                     $('#import-feedback-progress-text').html(
@@ -997,7 +997,7 @@  discard block
 block discarded – undo
997 997
                                     // Isolate first item
998 998
                                     if (itemsList.length > 0) {
999 999
                                         $('#import-feedback-progress-text')
1000
-                                            .html('<i class="fa-solid fa-cog fa-spin ml-4 mr-2"></i><?php echo $lang->get('operation_progress');?> ('+((counter*100)/itemsNumber).toFixed(0)+'%)');
1000
+                                            .html('<i class="fa-solid fa-cog fa-spin ml-4 mr-2"></i><?php echo $lang->get('operation_progress'); ?> ('+((counter*100)/itemsNumber).toFixed(0)+'%)');
1001 1001
 
1002 1002
                                         data = {
1003 1003
                                             'edit-all': $('#import-keepass-edit-all-checkbox').prop('checked') === true ? 1 : 0,
Please login to merge, or discard this patch.
sources/expired.datatables.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 ) {
77 77
     // Not allowed page
78 78
     $session->set('system-error_code', ERR_NOT_ALLOWED);
79
-    include $SETTINGS['cpassman_dir'] . '/error.php';
79
+    include $SETTINGS['cpassman_dir'].'/error.php';
80 80
     exit;
81 81
 }
82 82
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 // Is a date sent?
102 102
 $dateCriteria = $request->query->get('dateCriteria');
103 103
 if ($dateCriteria !== null && !empty($dateCriteria)) {
104
-    $sWhere .= ' AND a.del_value < ' . round(filter_var($dateCriteria, FILTER_SANITIZE_NUMBER_INT) / 1000, 0);
104
+    $sWhere .= ' AND a.del_value < '.round(filter_var($dateCriteria, FILTER_SANITIZE_NUMBER_INT) / 1000, 0);
105 105
 }
106 106
 //echo $sWhere;
107 107
 /* BUILD QUERY */
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 $start = $request->query->getInt('start', 0);
111 111
 $length = $request->query->getInt('length', -1);
112 112
 if ($length !== -1) {
113
-    $sLimit = ' LIMIT ' . $start . ', ' . $length;
113
+    $sLimit = ' LIMIT '.$start.', '.$length;
114 114
 }
115 115
 
116 116
 //Ordering
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
         $columnIndex = filter_var($order[0]['column'], FILTER_SANITIZE_NUMBER_INT);
124 124
 
125 125
         if (array_key_exists($columnIndex, $aColumns)) {
126
-            $sOrder .= $aColumns[$columnIndex] . ' ' . $order[0]['dir'];
126
+            $sOrder .= $aColumns[$columnIndex].' '.$order[0]['dir'];
127 127
         }
128 128
 
129 129
         // Supprimez la virgule finale si elle existe
@@ -147,9 +147,9 @@  discard block
 block discarded – undo
147 147
 
148 148
     if ($letter !== '' && $letter !== 'None') {
149 149
         $sWhere .= ' AND ';
150
-        $sWhere .= $aColumns[1] . " LIKE '" . $letter . "%' OR ";
151
-        $sWhere .= $aColumns[2] . " LIKE '" . $letter . "%' OR ";
152
-        $sWhere .= $aColumns[3] . " LIKE '" . $letter . "%' ";
150
+        $sWhere .= $aColumns[1]." LIKE '".$letter."%' OR ";
151
+        $sWhere .= $aColumns[2]." LIKE '".$letter."%' OR ";
152
+        $sWhere .= $aColumns[3]." LIKE '".$letter."%' ";
153 153
     }
154 154
 }
155 155
 
@@ -160,26 +160,26 @@  discard block
 block discarded – undo
160 160
 
161 161
         if ($searchValue !== '') {
162 162
             $sWhere = ' AND ';
163
-            $sWhere .= $aColumns[1] . " LIKE '" . $searchValue . "%' OR ";
164
-            $sWhere .= $aColumns[2] . " LIKE '" . $searchValue . "%' OR ";
165
-            $sWhere .= $aColumns[3] . " LIKE '" . $searchValue . "%' ";
163
+            $sWhere .= $aColumns[1]." LIKE '".$searchValue."%' OR ";
164
+            $sWhere .= $aColumns[2]." LIKE '".$searchValue."%' OR ";
165
+            $sWhere .= $aColumns[3]." LIKE '".$searchValue."%' ";
166 166
         }
167 167
     }
168 168
 }
169 169
 
170 170
 $rows = DB::query(
171 171
     'SELECT a.item_id, i.label, a.del_value, i.id_tree
172
-    FROM ' . prefixTable('automatic_del') . ' AS a
173
-    INNER JOIN ' . prefixTable('items') . ' AS i ON (i.id = a.item_id)' .
172
+    FROM ' . prefixTable('automatic_del').' AS a
173
+    INNER JOIN ' . prefixTable('items').' AS i ON (i.id = a.item_id)'.
174 174
     $sWhere.
175 175
     (string) $sOrder
176 176
 );
177 177
 $iTotal = DB::count();
178 178
 $rows = DB::query(
179 179
     'SELECT a.item_id, i.label, a.del_value, i.id_tree
180
-    FROM ' . prefixTable('automatic_del') . ' AS a
181
-    INNER JOIN ' . prefixTable('items') . ' AS i ON (i.id = a.item_id)' .
182
-        $sWhere .
180
+    FROM ' . prefixTable('automatic_del').' AS a
181
+    INNER JOIN ' . prefixTable('items').' AS i ON (i.id = a.item_id)'.
182
+        $sWhere.
183 183
         $sLimit
184 184
 );
185 185
 $iFilteredTotal = DB::count();
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
    * Output
188 188
 */
189 189
 $sOutput = '{';
190
-$sOutput .= '"sEcho": '. (int) $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT) . ', ';
190
+$sOutput .= '"sEcho": '.(int) $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT).', ';
191 191
 $sOutput .= '"iTotalRecords": '.$iTotal.', ';
192 192
 $sOutput .= '"iTotalDisplayRecords": '.$iTotal.', ';
193 193
 $sOutput .= '"aaData": ';
@@ -201,18 +201,18 @@  discard block
 block discarded – undo
201 201
     // start the line
202 202
     $sOutput .= '[';
203 203
     // Column 1
204
-    $sOutput .= '"<i class=\"fas fa-external-link-alt pointer text-primary mr-2\" onclick=\"showItemCard($(this))\" data-item-id=\"' . $record['item_id'] . '\"  data-item-tree-id=\"' . $record['id_tree'] . '\"></i>", ';
204
+    $sOutput .= '"<i class=\"fas fa-external-link-alt pointer text-primary mr-2\" onclick=\"showItemCard($(this))\" data-item-id=\"'.$record['item_id'].'\"  data-item-tree-id=\"'.$record['id_tree'].'\"></i>", ';
205 205
     // Column 2
206
-    $sOutput .= '"' . $record['label'] . '", ';
206
+    $sOutput .= '"'.$record['label'].'", ';
207 207
     // Column 3
208
-    $sOutput .= '"' . date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['del_value']) . '", ';
208
+    $sOutput .= '"'.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['del_value']).'", ';
209 209
     // Column 4
210 210
     $path = [];
211 211
     $treeDesc = $tree->getPath($record['id_tree'], true);
212 212
     foreach ($treeDesc as $t) {
213 213
         array_push($path, $t->title);
214 214
     }
215
-    $sOutput .= '"' . implode('<i class=\"fas fa-angle-right ml-1 mr-1\"></i>', $path) . '"],';
215
+    $sOutput .= '"'.implode('<i class=\"fas fa-angle-right ml-1 mr-1\"></i>', $path).'"],';
216 216
 }
217 217
 
218 218
 if (count($rows) > 0) {
Please login to merge, or discard this patch.
sources/utilities.queries.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 ) {
78 78
     // Not allowed page
79 79
     $session->set('system-error_code', ERR_NOT_ALLOWED);
80
-    include $SETTINGS['cpassman_dir'] . '/error.php';
80
+    include $SETTINGS['cpassman_dir'].'/error.php';
81 81
     exit;
82 82
 }
83 83
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
             $arrFolders = array();
129 129
             $rows = DB::query(
130 130
                 'SELECT valeur, intitule
131
-                FROM ' . prefixTable('misc') . '
131
+                FROM ' . prefixTable('misc').'
132 132
                 WHERE type  = %s',
133 133
                 'folder_deleted'
134 134
             );
@@ -151,11 +151,11 @@  discard block
 block discarded – undo
151 151
                 i.id as id, i.label as label,
152 152
                 i.id_tree as id_tree, l.date as date, n.title as folder_title,
153 153
                 a.del_enabled as del_enabled, a.del_value as del_value, a.del_type as del_type
154
-                FROM ' . prefixTable('log_items') . ' as l
155
-                INNER JOIN ' . prefixTable('items') . ' as i ON (l.id_item=i.id)
156
-                LEFT JOIN ' . prefixTable('users') . ' as u ON (l.id_user=u.id)
157
-                LEFT JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree=n.id)
158
-                INNER JOIN ' . prefixTable('automatic_del') . ' as a ON (l.id_item = a.item_id)
154
+                FROM ' . prefixTable('log_items').' as l
155
+                INNER JOIN ' . prefixTable('items').' as i ON (l.id_item=i.id)
156
+                LEFT JOIN ' . prefixTable('users').' as u ON (l.id_user=u.id)
157
+                LEFT JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree=n.id)
158
+                INNER JOIN ' . prefixTable('automatic_del').' as a ON (l.id_item = a.item_id)
159 159
                 WHERE i.inactif = %i
160 160
                 AND l.action = %s',
161 161
                 1,
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
                             'label' => $record['label'],
178 178
                             'date' => date($SETTINGS['date_format'], (int) $record['date']),
179 179
                             'login' => $record['login'],
180
-                            'name' => $record['name'] . ' ' . $record['lastname'],
180
+                            'name' => $record['name'].' '.$record['lastname'],
181 181
                             'folder_label' => $record['folder_title'],
182 182
                             'folder_deleted' => $thisFolder,
183 183
                             'del_enabled' => (bool) $record['del_enabled'],
@@ -238,10 +238,10 @@  discard block
 block discarded – undo
238 238
             foreach ($post_folders as $folderId) {
239 239
                 $data = DB::queryFirstRow(
240 240
                     'SELECT valeur
241
-                    FROM ' . prefixTable('misc') . "
241
+                    FROM ' . prefixTable('misc')."
242 242
                     WHERE type = 'folder_deleted'
243 243
                     AND intitule = %s",
244
-                    'f' . $folderId
244
+                    'f'.$folderId
245 245
                 );
246 246
                 if ((int) $data['valeur'] !== 0) {
247 247
                     $folderData = explode(', ', $data['valeur']);
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
                         prefixTable('misc'),
269 269
                         'type = %s AND intitule = %s',
270 270
                         'folder_deleted',
271
-                        'f' . $folderId
271
+                        'f'.$folderId
272 272
                     );
273 273
 
274 274
                     // Restore all items in this folder
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
                     // Get list of all items in thos folder
285 285
                     $items = DB::query(
286 286
                         'SELECT id
287
-                        FROM ' . prefixTable('items') . '
287
+                        FROM ' . prefixTable('items').'
288 288
                         WHERE id_tree = %i',
289 289
                         $folderId
290 290
                     );
@@ -373,10 +373,10 @@  discard block
 block discarded – undo
373 373
             foreach ($post_folders as $folderId) {
374 374
                 $data = DB::queryFirstRow(
375 375
                     'SELECT valeur
376
-                    FROM ' . prefixTable('misc') . "
376
+                    FROM ' . prefixTable('misc')."
377 377
                     WHERE type = 'folder_deleted'
378 378
                     AND intitule = %s",
379
-                    'f' . $folderId
379
+                    'f'.$folderId
380 380
                 );
381 381
                 if ((int) $data['valeur'] !== 0) {
382 382
                     $exploded = explode(',', $data['valeur']);
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
                         prefixTable('misc'),
388 388
                         'type = %s AND intitule = %s',
389 389
                         'folder_deleted',
390
-                        'f' . $folderData[0]
390
+                        'f'.$folderData[0]
391 391
                     );
392 392
 
393 393
                     // Delete all items in this folder
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
                     // Get list of all items in thos folder
402 402
                     $items = DB::query(
403 403
                         'SELECT id
404
-                        FROM ' . prefixTable('items') . '
404
+                        FROM ' . prefixTable('items').'
405 405
                         WHERE id_tree = %i',
406 406
                         $folderData[0]
407 407
                     );
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
                         // Delete all fields
419 419
                         $fields = DB::query(
420 420
                             'SELECT id
421
-                            FROM ' . prefixTable('categories_items') . '
421
+                            FROM ' . prefixTable('categories_items').'
422 422
                             WHERE item_id = %i',
423 423
                             $folderData[0]
424 424
                         );
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
                         // Delete all files
439 439
                         $files = DB::query(
440 440
                             'SELECT id
441
-                            FROM ' . prefixTable('files') . '
441
+                            FROM ' . prefixTable('files').'
442 442
                             WHERE id_item = %i',
443 443
                             $folderData[0]
444 444
                         );
@@ -495,7 +495,7 @@  discard block
 block discarded – undo
495 495
                 // Delete sharekey fields
496 496
                 $itemFields = DB::query(
497 497
                     'SELECT id
498
-                    FROM ' . prefixTable('categories_items') . '
498
+                    FROM ' . prefixTable('categories_items').'
499 499
                     WHERE item_id = %i',
500 500
                     $itemId
501 501
                 );
@@ -510,7 +510,7 @@  discard block
 block discarded – undo
510 510
                 // Delete sharekey files
511 511
                 $itemFiles = DB::query(
512 512
                     'SELECT id
513
-                    FROM ' . prefixTable('files') . '
513
+                    FROM ' . prefixTable('files').'
514 514
                     WHERE id_item = %i',
515 515
                     $itemId
516 516
                 );
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
             ) {
588 588
                 if ($post_log_type === 'items') {
589 589
                     DB::query(
590
-                        'SELECT * FROM ' . prefixTable('log_items') . '
590
+                        'SELECT * FROM '.prefixTable('log_items').'
591 591
                         WHERE (date BETWEEN %i AND %i)'
592 592
                         . ($post_filter_action === 'all' ? '' : ' AND action = "'.$post_filter_action.'"')
593 593
                         . ((int) $post_filter_user === -1 ? '' : ' AND id_user = '.(int) $post_filter_user),
@@ -607,7 +607,7 @@  discard block
 block discarded – undo
607 607
                 } elseif ($post_log_type === 'connections') {
608 608
                     //db::debugmode(true);
609 609
                     DB::query(
610
-                        'SELECT * FROM ' . prefixTable('log_system') . '
610
+                        'SELECT * FROM '.prefixTable('log_system').'
611 611
                         WHERE type=%s '
612 612
                         . 'AND (date BETWEEN %i AND %i)'
613 613
                         . ($post_filter_action === 'all' ? '' : ' AND action = '.$post_filter_action)
@@ -630,7 +630,7 @@  discard block
 block discarded – undo
630 630
                     );
631 631
                 } elseif ($post_log_type === 'errors') {
632 632
                     DB::query(
633
-                        'SELECT * FROM ' . prefixTable('log_system') . ' WHERE type=%s ' .
633
+                        'SELECT * FROM '.prefixTable('log_system').' WHERE type=%s '.
634 634
                             'AND (date BETWEEN %i AND %i)',
635 635
                         'error',
636 636
                         $post_date_from,
@@ -647,7 +647,7 @@  discard block
 block discarded – undo
647 647
                     );
648 648
                 } elseif ($post_log_type === 'copy') {
649 649
                     DB::query(
650
-                        'SELECT * FROM ' . prefixTable('log_items') . ' WHERE action=%s ' .
650
+                        'SELECT * FROM '.prefixTable('log_items').' WHERE action=%s '.
651 651
                             'AND (date BETWEEN %i AND %i)',
652 652
                         'at_copy',
653 653
                         $post_date_from,
@@ -664,7 +664,7 @@  discard block
 block discarded – undo
664 664
                     );
665 665
                 } elseif ($post_log_type === 'admin') {
666 666
                     DB::query(
667
-                        'SELECT * FROM ' . prefixTable('log_system') . ' WHERE type=%s ' .
667
+                        'SELECT * FROM '.prefixTable('log_system').' WHERE type=%s '.
668 668
                             'AND (date BETWEEN %i AND %i)',
669 669
                         'admin_action',
670 670
                         $post_date_from,
@@ -681,7 +681,7 @@  discard block
 block discarded – undo
681 681
                     );
682 682
                 } elseif ($post_log_type === 'failed') {
683 683
                     DB::query(
684
-                        'SELECT * FROM ' . prefixTable('log_system') . ' WHERE type=%s ' .
684
+                        'SELECT * FROM '.prefixTable('log_system').' WHERE type=%s '.
685 685
                             'AND (date BETWEEN %i AND %i)',
686 686
                         'failed_auth',
687 687
                         $post_date_from,
@@ -752,19 +752,19 @@  discard block
 block discarded – undo
752 752
             // Get info about task
753 753
             $taskInfo = DB::queryFirstRow(
754 754
                 'SELECT p.process_type as process_type
755
-                FROM ' . prefixTable('background_tasks') . ' as p
755
+                FROM ' . prefixTable('background_tasks').' as p
756 756
                 WHERE p.increment_id = %i',
757 757
                 $post_id
758 758
             );
759 759
             if ($taskInfo !== null) {
760 760
                 // delete task
761 761
                 DB::query(
762
-                    'DELETE FROM ' . prefixTable('background_subtasks') . '
762
+                    'DELETE FROM '.prefixTable('background_subtasks').'
763 763
                     WHERE task_id = %i',
764 764
                     $post_id
765 765
                 );
766 766
                 DB::query(
767
-                    'DELETE FROM ' . prefixTable('background_tasks') . '
767
+                    'DELETE FROM '.prefixTable('background_tasks').'
768 768
                     WHERE increment_id = %i',
769 769
                     $post_id
770 770
                 );
@@ -831,7 +831,7 @@  discard block
 block discarded – undo
831 831
                         ->setDayOfMonth('*')
832 832
                         ->setMonths('*')
833 833
                         ->setDayOfWeek('*')
834
-                        ->setTaskCommandLine($phpBinaryPath . ' ' . $SETTINGS['cpassman_dir'] . '/sources/scheduler.php')
834
+                        ->setTaskCommandLine($phpBinaryPath.' '.$SETTINGS['cpassman_dir'].'/sources/scheduler.php')
835 835
                         ->setComments('Teampass scheduler');
836 836
                     
837 837
                     $crontabRepository->addJob($crontabJob);
Please login to merge, or discard this patch.
api/Controller/Api/BaseController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
         $requestUri = $request->getRequestUri();
48 48
 
49 49
         $uri = parse_url($requestUri, PHP_URL_PATH);
50
-        $uri = explode( '/', $uri );
50
+        $uri = explode('/', $uri);
51 51
         return $this->sanitizeUrl(array_slice($uri, ((int) array_search('index.php', $uri) + 1)));
52 52
     }
53 53
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
     {
61 61
         $request = symfonyRequest::createFromGlobals();
62 62
         $queryString = $request->getQueryString();
63
-<<<<<<< HEAD
63
+<< << <<< HEAD
64 64
         if ($request->getContentTypeFormat() !== 'json') {
65 65
 =======
66 66
         if ($request->getContentTypeFormat() != 'application/json') {
Please login to merge, or discard this patch.
sources/identify.php 1 patch
Spacing   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
     $sessionPwdAttempts = $session->get('pwd_attempts');
148 148
     $sessionUrl = $session->get('user-initial_url');
149 149
     $server = [];
150
-    $server['PHP_AUTH_USER'] =  $request->getUser();
150
+    $server['PHP_AUTH_USER'] = $request->getUser();
151 151
     $server['PHP_AUTH_PW'] = $request->getPassword();
152 152
     
153 153
     // decrypt and retreive data in JSON format
@@ -167,18 +167,18 @@  discard block
 block discarded – undo
167 167
     }
168 168
 
169 169
     // Check if Duo auth is in progress and pass the pw and login back to the standard login process
170
-    if(
170
+    if (
171 171
         isKeyExistingAndEqual('duo', 1, $SETTINGS) === true
172 172
         && $dataReceived['user_2fa_selection'] === 'duo'
173 173
         && $session->get('user-duo_status') === 'IN_PROGRESS'
174 174
         && !empty($dataReceived['duo_state'])
175
-    ){
175
+    ) {
176 176
         $key = hash('sha256', $dataReceived['duo_state']);
177 177
         $iv = substr(hash('sha256', $dataReceived['duo_state']), 0, 16);
178 178
         $duo_data_dec = openssl_decrypt(base64_decode($session->get('user-duo_data')), 'AES-256-CBC', $key, 0, $iv);
179 179
         // Clear the data from the Duo process to continue clean with the standard login process
180
-        $session->set('user-duo_data','');
181
-        if($duo_data_dec === false) {
180
+        $session->set('user-duo_data', '');
181
+        if ($duo_data_dec === false) {
182 182
             // Add failed authentication log
183 183
             addFailedAuthentication(filter_var($dataReceived['login'], FILTER_SANITIZE_FULL_SPECIAL_CHARS), getClientIpServer());
184 184
 
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
         $dataReceived['login'] = $duo_data['duo_login'];
197 197
     }
198 198
 
199
-    if(isset($dataReceived['pw']) === false || isset($dataReceived['login']) === false) {
199
+    if (isset($dataReceived['pw']) === false || isset($dataReceived['login']) === false) {
200 200
         echo json_encode([
201 201
             'data' => prepareExchangedData(
202 202
                 [
@@ -555,7 +555,7 @@  discard block
 block discarded – undo
555 555
         }
556 556
         // Append with roles from AD groups
557 557
         if (is_null($userInfo['roles_from_ad_groups']) === false) {
558
-            $userInfo['fonction_id'] = empty($userInfo['fonction_id'])  === true ? $userInfo['roles_from_ad_groups'] : $userInfo['fonction_id']. ';' . $userInfo['roles_from_ad_groups'];
558
+            $userInfo['fonction_id'] = empty($userInfo['fonction_id']) === true ? $userInfo['roles_from_ad_groups'] : $userInfo['fonction_id'].';'.$userInfo['roles_from_ad_groups'];
559 559
         }
560 560
         // store
561 561
         $session->set('user-roles', $userInfo['fonction_id']);
@@ -567,7 +567,7 @@  discard block
 block discarded – undo
567 567
         if (count($session->get('user-roles_array')) > 0) {
568 568
             $rolesList = DB::query(
569 569
                 'SELECT id, title, complexity
570
-                FROM ' . prefixTable('roles_title') . '
570
+                FROM ' . prefixTable('roles_title').'
571 571
                 WHERE id IN %li',
572 572
                 $session->get('user-roles_array')
573 573
             );
@@ -613,7 +613,7 @@  discard block
 block discarded – undo
613 613
             if ($adjustPermissions) {
614 614
                 $session->set('user-admin', (int) $userInfo['admin']);
615 615
                 $session->set('user-manager', (int) $userInfo['gestionnaire']);
616
-                $session->set('user-can_manage_all_users',(int)  $userInfo['can_manage_all_users']);
616
+                $session->set('user-can_manage_all_users', (int) $userInfo['can_manage_all_users']);
617 617
                 $session->set('user-read_only', (int) $userInfo['read_only']);
618 618
                 DB::update(
619 619
                     prefixTable('users'),
@@ -682,10 +682,10 @@  discard block
 block discarded – undo
682 682
         // Get last seen items
683 683
         $session->set('user-nb_roles', 0);
684 684
         foreach ($session->get('user-latest_items') as $item) {
685
-            if (! empty($item)) {
685
+            if (!empty($item)) {
686 686
                 $dataLastItems = DB::queryFirstRow(
687 687
                     'SELECT id,label,id_tree
688
-                    FROM ' . prefixTable('items') . '
688
+                    FROM ' . prefixTable('items').'
689 689
                     WHERE id=%i',
690 690
                     $item
691 691
                 );
@@ -695,7 +695,7 @@  discard block
 block discarded – undo
695 695
         // Get cahce tree info
696 696
         $cacheTreeData = DB::queryFirstRow(
697 697
             'SELECT visible_folders
698
-            FROM ' . prefixTable('cache_tree') . '
698
+            FROM ' . prefixTable('cache_tree').'
699 699
             WHERE user_id=%i',
700 700
             (int) $session->get('user-id')
701 701
         );
@@ -727,7 +727,7 @@  discard block
 block discarded – undo
727 727
             && (int) $sessionAdmin !== 1
728 728
         ) {
729 729
             // get all Admin users
730
-            $val = DB::queryFirstRow('SELECT email FROM ' . prefixTable('users') . " WHERE admin = %i and email != ''", 1);
730
+            $val = DB::queryFirstRow('SELECT email FROM '.prefixTable('users')." WHERE admin = %i and email != ''", 1);
731 731
             if (DB::count() > 0) {
732 732
                 // Add email to table
733 733
                 prepareSendingEmail(
@@ -739,7 +739,7 @@  discard block
 block discarded – undo
739 739
                             '#tp_time#',
740 740
                         ],
741 741
                         [
742
-                            ' ' . $session->get('user-login') . ' (IP: ' . getClientIpServer() . ')',
742
+                            ' '.$session->get('user-login').' (IP: '.getClientIpServer().')',
743 743
                             date($SETTINGS['date_format'], (int) $session->get('user-last_connection')),
744 744
                             date($SETTINGS['time_format'], (int) $session->get('user-last_connection')),
745 745
                         ],
@@ -850,7 +850,7 @@  discard block
 block discarded – undo
850 850
 {
851 851
     $rows = DB::query(
852 852
         'SELECT date
853
-        FROM ' . prefixTable('log_system') . "
853
+        FROM ' . prefixTable('log_system')."
854 854
         WHERE field_1 = %s
855 855
         AND type = 'failed_auth'
856 856
         AND label = 'password_is_not_correct'
@@ -864,7 +864,7 @@  discard block
 block discarded – undo
864 864
         foreach ($rows as $record) {
865 865
             array_push(
866 866
                 $arrAttempts,
867
-                date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['date'])
867
+                date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['date'])
868 868
             );
869 869
         }
870 870
     }
@@ -899,7 +899,7 @@  discard block
 block discarded – undo
899 899
     $ldapConnection
900 900
 ) : bool
901 901
 {
902
-    include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
902
+    include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
903 903
 
904 904
     if ((int) $userInfoDisabled === 1) {
905 905
         return false;
@@ -1094,7 +1094,7 @@  discard block
 block discarded – undo
1094 1094
     } catch (Exception $e) {
1095 1095
         return [
1096 1096
             'error' => true,
1097
-            'message' => "Error: " . $e->getMessage(),
1097
+            'message' => "Error: ".$e->getMessage(),
1098 1098
         ];
1099 1099
     }
1100 1100
 }
@@ -1125,7 +1125,7 @@  discard block
 block discarded – undo
1125 1125
                 'type' => 'OpenLDAP'
1126 1126
             ];
1127 1127
         default:
1128
-            throw new Exception("Unsupported LDAP type: " . $SETTINGS['ldap_type']);
1128
+            throw new Exception("Unsupported LDAP type: ".$SETTINGS['ldap_type']);
1129 1129
     }
1130 1130
 }
1131 1131
 
@@ -1262,7 +1262,7 @@  discard block
 block discarded – undo
1262 1262
         );
1263 1263
     }
1264 1264
     
1265
-    throw new Exception("Unsupported LDAP type: " . $ldapHandler['type']);
1265
+    throw new Exception("Unsupported LDAP type: ".$ldapHandler['type']);
1266 1266
 }
1267 1267
 
1268 1268
 /**
@@ -1279,12 +1279,12 @@  discard block
 block discarded – undo
1279 1279
     if (isset($SETTINGS['enable_ad_users_with_ad_groups']) === true && (int) $SETTINGS['enable_ad_users_with_ad_groups'] === 1) {
1280 1280
         // Get user groups from AD
1281 1281
         $user_ad_groups = [];
1282
-        foreach($groups as $group) {
1282
+        foreach ($groups as $group) {
1283 1283
             //print_r($group);
1284 1284
             // get relation role id for AD group
1285 1285
             $role = DB::queryFirstRow(
1286 1286
                 'SELECT lgr.role_id
1287
-                FROM ' . prefixTable('ldap_groups_roles') . ' AS lgr
1287
+                FROM ' . prefixTable('ldap_groups_roles').' AS lgr
1288 1288
                 WHERE lgr.ldap_group_id = %s',
1289 1289
                 $group
1290 1290
             );
@@ -1347,7 +1347,7 @@  discard block
 block discarded – undo
1347 1347
     $passwordManager = new PasswordManager();
1348 1348
     
1349 1349
     // Migrate password if needed
1350
-    $result  = $passwordManager->migratePassword(
1350
+    $result = $passwordManager->migratePassword(
1351 1351
         $userInfo['pw'],
1352 1352
         $passwordClear,
1353 1353
         (int) $userInfo['id']
@@ -1418,7 +1418,7 @@  discard block
 block discarded – undo
1418 1418
             // Check if exists in DB
1419 1419
             $groupData = DB::queryFirstRow(
1420 1420
                 'SELECT id
1421
-                FROM ' . prefixTable('roles_title') . '
1421
+                FROM ' . prefixTable('roles_title').'
1422 1422
                 WHERE title = %s',
1423 1423
                 $group["displayName"]
1424 1424
             );
@@ -1559,7 +1559,7 @@  discard block
 block discarded – undo
1559 1559
             
1560 1560
             // generate new QR
1561 1561
             $new_2fa_qr = $tfa->getQRCodeImageAsDataUri(
1562
-                'Teampass - ' . $username,
1562
+                'Teampass - '.$username,
1563 1563
                 $userInfo['ga']
1564 1564
             );
1565 1565
             // clear temporary code from DB
@@ -1572,7 +1572,7 @@  discard block
 block discarded – undo
1572 1572
                 $userInfo['id']
1573 1573
             );
1574 1574
             $firstTime = [
1575
-                'value' => '<img src="' . $new_2fa_qr . '">',
1575
+                'value' => '<img src="'.$new_2fa_qr.'">',
1576 1576
                 'user_admin' => isset($sessionAdmin) ? (int) $sessionAdmin : '',
1577 1577
                 'initial_url' => isset($sessionUrl) === true ? $sessionUrl : '',
1578 1578
                 'pwd_attempts' => (int) $sessionPwdAttempts,
@@ -1728,7 +1728,7 @@  discard block
 block discarded – undo
1728 1728
         }*/
1729 1729
         return [
1730 1730
             'error' => true,
1731
-            'message' => $duo_error . $lang->get('duo_error_check_config'),
1731
+            'message' => $duo_error.$lang->get('duo_error_check_config'),
1732 1732
             'pwd_attempts' => (int) $sessionPwdAttempts,
1733 1733
             'debug_message' => $e->getMessage(),
1734 1734
             'proceedIdentification' => false,
@@ -1744,7 +1744,7 @@  discard block
 block discarded – undo
1744 1744
         } catch (DuoException $e) {
1745 1745
             return [
1746 1746
                 'error' => true,
1747
-                'message' => $duo_error . $lang->get('duo_error_url'),
1747
+                'message' => $duo_error.$lang->get('duo_error_url'),
1748 1748
                 'pwd_attempts' => (int) $sessionPwdAttempts,
1749 1749
                 'debug_message' => $e->getMessage(),
1750 1750
                 'proceedIdentification' => false,
@@ -1752,7 +1752,7 @@  discard block
 block discarded – undo
1752 1752
         }
1753 1753
         
1754 1754
         // Somethimes Duo return success but fail to return a URL, double check if the URL has been created
1755
-        if (!empty($duo_redirect_url) && filter_var($duo_redirect_url,FILTER_SANITIZE_URL)) {
1755
+        if (!empty($duo_redirect_url) && filter_var($duo_redirect_url, FILTER_SANITIZE_URL)) {
1756 1756
             // Since Duo Universal requires a redirect, let's store some info when the user get's back after completing the Duo prompt
1757 1757
             $key = hash('sha256', $duo_state);
1758 1758
             $iv = substr(hash('sha256', $duo_state), 0, 16);
@@ -1780,7 +1780,7 @@  discard block
 block discarded – undo
1780 1780
         } else {
1781 1781
             return [
1782 1782
                 'error' => true,
1783
-                'message' => $duo_error . $lang->get('duo_error_url'),
1783
+                'message' => $duo_error.$lang->get('duo_error_url'),
1784 1784
                 'pwd_attempts' => (int) $sessionPwdAttempts,
1785 1785
                 'proceedIdentification' => false,
1786 1786
             ];
@@ -1801,8 +1801,8 @@  discard block
 block discarded – undo
1801 1801
         // return the response (which should be the user name)
1802 1802
         if ($decoded_token['preferred_username'] === $username) {
1803 1803
             $session->set('user-duo_status', 'COMPLET');
1804
-            $session->set('user-duo_state','');
1805
-            $session->set('user-duo_data','');
1804
+            $session->set('user-duo_state', '');
1805
+            $session->set('user-duo_data', '');
1806 1806
             $session->set('user-login', $username);
1807 1807
 
1808 1808
             return [
@@ -1813,9 +1813,9 @@  discard block
 block discarded – undo
1813 1813
             ];
1814 1814
         } else {
1815 1815
             // Something wrong, username from the original Duo request is different than the one received now
1816
-            $session->set('user-duo_status','');
1817
-            $session->set('user-duo_state','');
1818
-            $session->set('user-duo_data','');
1816
+            $session->set('user-duo_status', '');
1817
+            $session->set('user-duo_state', '');
1818
+            $session->set('user-duo_data', '');
1819 1819
 
1820 1820
             return [
1821 1821
                 'error' => true,
@@ -1826,9 +1826,9 @@  discard block
 block discarded – undo
1826 1826
         }
1827 1827
     }
1828 1828
     // If we are here something wrong
1829
-    $session->set('user-duo_status','');
1830
-    $session->set('user-duo_state','');
1831
-    $session->set('user-duo_data','');
1829
+    $session->set('user-duo_status', '');
1830
+    $session->set('user-duo_state', '');
1831
+    $session->set('user-duo_data', '');
1832 1832
     return [
1833 1833
         'error' => true,
1834 1834
         'message' => $lang->get('duo_login_mismatch'),
@@ -1947,7 +1947,7 @@  discard block
 block discarded – undo
1947 1947
         // Check for existing lock
1948 1948
         $unlock_at = DB::queryFirstField(
1949 1949
             'SELECT MAX(unlock_at)
1950
-             FROM ' . prefixTable('auth_failures') . '
1950
+             FROM ' . prefixTable('auth_failures').'
1951 1951
              WHERE unlock_at > %s
1952 1952
              AND ((source = %s AND value = %s) OR (source = %s AND value = %s))',
1953 1953
             date('Y-m-d H:i:s', time()),
@@ -1969,8 +1969,8 @@  discard block
 block discarded – undo
1969 1969
         // Get user info from DB
1970 1970
         $data = DB::queryFirstRow(
1971 1971
             'SELECT u.*, a.value AS api_key
1972
-            FROM ' . prefixTable('users') . ' AS u
1973
-            LEFT JOIN ' . prefixTable('api') . ' AS a ON (u.id = a.user_id)
1972
+            FROM ' . prefixTable('users').' AS u
1973
+            LEFT JOIN ' . prefixTable('api').' AS a ON (u.id = a.user_id)
1974 1974
             WHERE login = %s AND deleted_at IS NULL',
1975 1975
             $login
1976 1976
         );
@@ -2088,7 +2088,7 @@  discard block
 block discarded – undo
2088 2088
             'array' => [
2089 2089
                 'value' => 'bruteforce_wait',
2090 2090
                 'error' => true,
2091
-                'message' => $lang->get('bruteforce_wait') . (string) $e->getMessage(),
2091
+                'message' => $lang->get('bruteforce_wait').(string) $e->getMessage(),
2092 2092
             ]
2093 2093
         ];
2094 2094
     }
@@ -2193,7 +2193,7 @@  discard block
 block discarded – undo
2193 2193
     // Clean previous failed attempts
2194 2194
     $failedTasks = DB::query(
2195 2195
         'SELECT increment_id
2196
-        FROM ' . prefixTable('background_tasks') . '
2196
+        FROM ' . prefixTable('background_tasks').'
2197 2197
         WHERE process_type = %s
2198 2198
         AND JSON_EXTRACT(arguments, "$.new_user_id") = %i
2199 2199
         AND status = %s',
@@ -2516,12 +2516,12 @@  discard block
 block discarded – undo
2516 2516
 {
2517 2517
     // Find the latest "create_user_keys" task for the given user_id
2518 2518
     $latestTask = DB::queryFirstRow(
2519
-        'SELECT arguments, status FROM ' . prefixTable('background_tasks') . '
2519
+        'SELECT arguments, status FROM '.prefixTable('background_tasks').'
2520 2520
         WHERE process_type = %s
2521 2521
         AND arguments LIKE %s
2522 2522
         ORDER BY increment_id DESC
2523 2523
         LIMIT 1',
2524
-        'create_user_keys', '%"new_user_id":' . $userId . '%'
2524
+        'create_user_keys', '%"new_user_id":'.$userId.'%'
2525 2525
     );
2526 2526
 
2527 2527
     // If a failed task is found, return an error message
@@ -2733,15 +2733,15 @@  discard block
 block discarded – undo
2733 2733
 
2734 2734
             if ($ret['error'] !== false) {
2735 2735
                 logEvents($SETTINGS, 'failed_auth', 'bad_duo_mfa', '', stripslashes($username), stripslashes($username));
2736
-                $session->set('user-duo_status','');
2737
-                $session->set('user-duo_state','');
2738
-                $session->set('user-duo_data','');
2736
+                $session->set('user-duo_status', '');
2737
+                $session->set('user-duo_state', '');
2738
+                $session->set('user-duo_data', '');
2739 2739
                 return [
2740 2740
                     'error' => true,
2741 2741
                     'mfaData' => $ret,
2742 2742
                     'mfaQRCodeInfos' => false,
2743 2743
                 ];
2744
-            } else if ($ret['duo_url_ready'] === true){
2744
+            } else if ($ret['duo_url_ready'] === true) {
2745 2745
                 return [
2746 2746
                     'error' => false,
2747 2747
                     'mfaData' => $ret,
@@ -2805,7 +2805,7 @@  discard block
 block discarded – undo
2805 2805
     // Count failed attempts from this source
2806 2806
     $count = DB::queryFirstField(
2807 2807
         'SELECT COUNT(*)
2808
-        FROM ' . prefixTable('auth_failures') . '
2808
+        FROM ' . prefixTable('auth_failures').'
2809 2809
         WHERE source = %s AND value = %s',
2810 2810
         $source,
2811 2811
         $value
Please login to merge, or discard this patch.