Passed
Push — master ( c7269a...782261 )
by Nils
04:57
created
scripts/background_tasks___userKeysCreation_subtaskHdl.php 1 patch
Spacing   +34 added lines, -34 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,13 +869,13 @@  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
-                    '#password#' => cryption($extra_arguments['new_user_pwd'], '','decrypt', $SETTINGS)['string'],
878
+                    '#password#' => cryption($extra_arguments['new_user_pwd'], '', 'decrypt', $SETTINGS)['string'],
879 879
                 ],
880 880
                 FILTER_SANITIZE_FULL_SPECIAL_CHARS
881 881
             )
Please login to merge, or discard this patch.
sources/downloadFile.php 1 patch
Spacing   +13 added lines, -13 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
 
@@ -100,19 +100,19 @@  discard block
 block discarded – undo
100 100
 $get_filename = str_replace(array("\r", "\n"), '', $get_filename);
101 101
 
102 102
 // prepare Encryption class calls
103
-header('Content-disposition: attachment; filename=' . rawurldecode(basename($get_filename)));
103
+header('Content-disposition: attachment; filename='.rawurldecode(basename($get_filename)));
104 104
 header('Content-Type: application/octet-stream');
105 105
 header('Cache-Control: must-revalidate, no-cache, no-store');
106 106
 header('Expires: 0');
107 107
 if (null !== $request->query->get('pathIsFiles') && (int) $get_pathIsFiles === 1) {
108
-    readfile($SETTINGS['path_to_files_folder'] . '/' . basename($get_filename));
108
+    readfile($SETTINGS['path_to_files_folder'].'/'.basename($get_filename));
109 109
 } else {
110 110
     // get file key
111 111
     $file_info = DB::queryfirstrow(
112 112
         'SELECT f.id AS id, f.file AS file, f.name AS name, f.status AS status, f.extension AS extension,
113 113
         s.share_key AS share_key
114
-        FROM ' . prefixTable('files') . ' AS f
115
-        INNER JOIN ' . prefixTable('sharekeys_files') . ' AS s ON (f.id = s.object_id)
114
+        FROM ' . prefixTable('files').' AS f
115
+        INNER JOIN ' . prefixTable('sharekeys_files').' AS s ON (f.id = s.object_id)
116 116
         WHERE s.user_id = %i AND s.object_id = %i',
117 117
         $session->get('user-id'),
118 118
         $get_fileid
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
         // if not encrypted
132 132
         $file_info = DB::queryfirstrow(
133 133
             'SELECT f.id AS id, f.file AS file, f.name AS name, f.status AS status, f.extension AS extension
134
-            FROM ' . prefixTable('files') . ' AS f
134
+            FROM ' . prefixTable('files').' AS f
135 135
             WHERE f.id = %i',
136 136
             $get_fileid
137 137
         );
@@ -141,25 +141,25 @@  discard block
 block discarded – undo
141 141
     // Set the filename of the download
142 142
     $filename = basename($file_info['name'], '.'.$file_info['extension']);
143 143
     $filename = isBase64($filename) === true ? base64_decode($filename) : $filename;
144
-    $filename = $filename . '.' . $file_info['extension'];
144
+    $filename = $filename.'.'.$file_info['extension'];
145 145
     // Get the full path to the file to be downloaded
146
-    if (file_exists($SETTINGS['path_to_upload_folder'] . '/' .TP_FILE_PREFIX . $file_info['file'])) {
147
-        $filePath = $SETTINGS['path_to_upload_folder'] . '/' . TP_FILE_PREFIX . $file_info['file'];
146
+    if (file_exists($SETTINGS['path_to_upload_folder'].'/'.TP_FILE_PREFIX.$file_info['file'])) {
147
+        $filePath = $SETTINGS['path_to_upload_folder'].'/'.TP_FILE_PREFIX.$file_info['file'];
148 148
     } else {
149
-        $filePath = $SETTINGS['path_to_upload_folder'] . '/' . TP_FILE_PREFIX . base64_decode($file_info['file']);
149
+        $filePath = $SETTINGS['path_to_upload_folder'].'/'.TP_FILE_PREFIX.base64_decode($file_info['file']);
150 150
     }
151 151
     $filePath = realpath($filePath);
152 152
 
153
-    if (WIP === true) error_log('downloadFile.php: filePath: ' . $filePath." - ");
153
+    if (WIP === true) error_log('downloadFile.php: filePath: '.$filePath." - ");
154 154
 
155 155
     if ($filePath && is_readable($filePath) && strpos($filePath, realpath($SETTINGS['path_to_upload_folder'])) === 0) {
156 156
         header('Content-Description: File Transfer');
157 157
         header('Content-Type: application/octet-stream');
158
-        header('Content-Disposition: attachment; filename="' . basename($filename) . '"');
158
+        header('Content-Disposition: attachment; filename="'.basename($filename).'"');
159 159
         header('Expires: 0');
160 160
         header('Cache-Control: must-revalidate');
161 161
         header('Pragma: public');
162
-        header('Content-Length: ' . filesize($filePath));
162
+        header('Content-Length: '.filesize($filePath));
163 163
         flush(); // Clear system output buffer
164 164
         if (empty($fileContent) === true) {
165 165
             // deepcode ignore PT: File and path are secured directly inside the function decryptFile()
Please login to merge, or discard this patch.
sources/main.functions.php 1 patch
Spacing   +153 added lines, -156 removed lines patch added patch discarded remove patch
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
  */
227 227
 function trimElement($chaine, string $element): string
228 228
 {
229
-    if (! empty($chaine)) {
229
+    if (!empty($chaine)) {
230 230
         if (is_array($chaine) === true) {
231 231
             $chaine = implode(';', $chaine);
232 232
         }
@@ -274,8 +274,8 @@  discard block
 block discarded – undo
274 274
  */
275 275
 function db_error_handler(array $params): void
276 276
 {
277
-    echo 'Error: ' . $params['error'] . "<br>\n";
278
-    echo 'Query: ' . $params['query'] . "<br>\n";
277
+    echo 'Error: '.$params['error']."<br>\n";
278
+    echo 'Query: '.$params['query']."<br>\n";
279 279
     throw new Exception('Error - Query', 1);
280 280
 }
281 281
 
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
     $globalsVisibleFolders = $session->get('user-accessible_folders');
356 356
     $globalsPersonalVisibleFolders = $session->get('user-personal_visible_folders');
357 357
     // Get list of Folders
358
-    $rows = DB::query('SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE personal_folder = %i', 0);
358
+    $rows = DB::query('SELECT id FROM '.prefixTable('nested_tree').' WHERE personal_folder = %i', 0);
359 359
     foreach ($rows as $record) {
360 360
         array_push($groupesVisibles, $record['id']);
361 361
     }
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
     }
375 375
     // Get ID of personal folder
376 376
     $persfld = DB::queryfirstrow(
377
-        'SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE title = %s',
377
+        'SELECT id FROM '.prefixTable('nested_tree').' WHERE title = %s',
378 378
         $globalsUserId
379 379
     );
380 380
     if (empty($persfld['id']) === false) {
@@ -394,20 +394,20 @@  discard block
 block discarded – undo
394 394
     // get complete list of ROLES
395 395
     $tmp = explode(';', $idFonctions);
396 396
     $rows = DB::query(
397
-        'SELECT * FROM ' . prefixTable('roles_title') . '
397
+        'SELECT * FROM '.prefixTable('roles_title').'
398 398
         ORDER BY title ASC'
399 399
     );
400 400
     foreach ($rows as $record) {
401
-        if (! empty($record['id']) && ! in_array($record['id'], $tmp)) {
401
+        if (!empty($record['id']) && !in_array($record['id'], $tmp)) {
402 402
             array_push($tmp, $record['id']);
403 403
         }
404 404
     }
405 405
     $session->set('user-roles', implode(';', $tmp));
406 406
     $session->set('user-admin', 1);
407 407
     // Check if admin has created Folders and Roles
408
-    DB::query('SELECT * FROM ' . prefixTable('nested_tree') . '');
408
+    DB::query('SELECT * FROM '.prefixTable('nested_tree').'');
409 409
     $session->set('user-nb_folders', DB::count());
410
-    DB::query('SELECT * FROM ' . prefixTable('roles_title'));
410
+    DB::query('SELECT * FROM '.prefixTable('roles_title'));
411 411
     $session->set('user-nb_roles', DB::count());
412 412
 
413 413
     return true;
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
     // Does this user is allowed to see other items
491 491
     $inc = 0;
492 492
     $rows = DB::query(
493
-        'SELECT id, id_tree FROM ' . prefixTable('items') . '
493
+        'SELECT id, id_tree FROM '.prefixTable('items').'
494 494
             WHERE restricted_to LIKE %ss AND inactif = %s'.
495 495
             (count($allowedFolders) > 0 ? ' AND id_tree NOT IN ('.implode(',', $allowedFolders).')' : ''),
496 496
         $globalsUserId,
@@ -507,8 +507,8 @@  discard block
 block discarded – undo
507 507
     // Check for the users roles if some specific rights exist on items
508 508
     $rows = DB::query(
509 509
         'SELECT i.id_tree, r.item_id
510
-        FROM ' . prefixTable('items') . ' as i
511
-        INNER JOIN ' . prefixTable('restriction_to_roles') . ' as r ON (r.item_id=i.id)
510
+        FROM ' . prefixTable('items').' as i
511
+        INNER JOIN ' . prefixTable('restriction_to_roles').' as r ON (r.item_id=i.id)
512 512
         WHERE i.id_tree <> "" '.
513 513
         (count($userRoles) > 0 ? 'AND r.role_id IN %li ' : '').
514 514
         'ORDER BY i.id_tree ASC',
@@ -562,16 +562,16 @@  discard block
 block discarded – undo
562 562
         ), SORT_NUMERIC)
563 563
     );
564 564
     // Folders and Roles numbers
565
-    DB::queryfirstrow('SELECT id FROM ' . prefixTable('nested_tree') . '');
565
+    DB::queryfirstrow('SELECT id FROM '.prefixTable('nested_tree').'');
566 566
     $session->set('user-nb_folders', DB::count());
567
-    DB::queryfirstrow('SELECT id FROM ' . prefixTable('roles_title'));
567
+    DB::queryfirstrow('SELECT id FROM '.prefixTable('roles_title'));
568 568
     $session->set('user-nb_roles', DB::count());
569 569
     // check if change proposals on User's items
570 570
     if (isset($SETTINGS['enable_suggestion']) === true && (int) $SETTINGS['enable_suggestion'] === 1) {
571 571
         $countNewItems = DB::query(
572 572
             'SELECT COUNT(*)
573
-            FROM ' . prefixTable('items_change') . ' AS c
574
-            LEFT JOIN ' . prefixTable('log_items') . ' AS i ON (c.item_id = i.id_item)
573
+            FROM ' . prefixTable('items_change').' AS c
574
+            LEFT JOIN ' . prefixTable('log_items').' AS i ON (c.item_id = i.id_item)
575 575
             WHERE i.action = %s AND i.id_user = %i',
576 576
             'at_creation',
577 577
             $globalsUserId
@@ -598,7 +598,7 @@  discard block
 block discarded – undo
598 598
 {
599 599
     $rows = DB::query(
600 600
         'SELECT *
601
-        FROM ' . prefixTable('roles_values') . '
601
+        FROM ' . prefixTable('roles_values').'
602 602
         WHERE type IN %ls'.(count($userRoles) > 0 ? ' AND role_id IN %li' : ''),
603 603
         ['W', 'ND', 'NE', 'NDNE', 'R'],
604 604
         $userRoles,
@@ -665,7 +665,7 @@  discard block
 block discarded – undo
665 665
     ) {
666 666
         $persoFld = DB::queryfirstrow(
667 667
             'SELECT id
668
-            FROM ' . prefixTable('nested_tree') . '
668
+            FROM ' . prefixTable('nested_tree').'
669 669
             WHERE title = %s AND personal_folder = %i'.
670 670
             (count($allowedFolders) > 0 ? ' AND id NOT IN ('.implode(',', $allowedFolders).')' : ''),
671 671
             $globalsUserId,
@@ -698,7 +698,7 @@  discard block
 block discarded – undo
698 698
     }
699 699
     $persoFlds = DB::query(
700 700
         'SELECT id
701
-        FROM ' . prefixTable('nested_tree') . '
701
+        FROM ' . prefixTable('nested_tree').'
702 702
         WHERE %l',
703 703
         $where
704 704
     );
@@ -766,12 +766,12 @@  discard block
 block discarded – undo
766 766
     //Load Tree
767 767
     $tree = new NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title');
768 768
     // truncate table
769
-    DB::query('TRUNCATE TABLE ' . prefixTable('cache'));
769
+    DB::query('TRUNCATE TABLE '.prefixTable('cache'));
770 770
     // reload date
771 771
     $rows = DB::query(
772 772
         'SELECT *
773
-        FROM ' . prefixTable('items') . ' as i
774
-        INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id)
773
+        FROM ' . prefixTable('items').' as i
774
+        INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id)
775 775
         AND l.action = %s
776 776
         AND i.inactif = %i',
777 777
         'at_creation',
@@ -783,18 +783,18 @@  discard block
 block discarded – undo
783 783
             $tags = '';
784 784
             $itemTags = DB::query(
785 785
                 'SELECT tag
786
-                FROM ' . prefixTable('tags') . '
786
+                FROM ' . prefixTable('tags').'
787 787
                 WHERE item_id = %i AND tag != ""',
788 788
                 $record['id']
789 789
             );
790 790
             foreach ($itemTags as $itemTag) {
791
-                $tags .= $itemTag['tag'] . ' ';
791
+                $tags .= $itemTag['tag'].' ';
792 792
             }
793 793
 
794 794
             // Get renewal period
795 795
             $resNT = DB::queryfirstrow(
796 796
                 'SELECT renewal_period
797
-                FROM ' . prefixTable('nested_tree') . '
797
+                FROM ' . prefixTable('nested_tree').'
798 798
                 WHERE id = %i',
799 799
                 $record['id_tree']
800 800
             );
@@ -807,7 +807,7 @@  discard block
 block discarded – undo
807 807
                     // Is this a User id?
808 808
                     $user = DB::queryfirstrow(
809 809
                         'SELECT id, login
810
-                        FROM ' . prefixTable('users') . '
810
+                        FROM ' . prefixTable('users').'
811 811
                         WHERE id = %i',
812 812
                         $elem->title
813 813
                     );
@@ -825,11 +825,11 @@  discard block
 block discarded – undo
825 825
                     'id' => $record['id'],
826 826
                     'label' => $record['label'],
827 827
                     'description' => $record['description'] ?? '',
828
-                    'url' => isset($record['url']) && ! empty($record['url']) ? $record['url'] : '0',
828
+                    'url' => isset($record['url']) && !empty($record['url']) ? $record['url'] : '0',
829 829
                     'tags' => $tags,
830 830
                     'id_tree' => $record['id_tree'],
831 831
                     'perso' => $record['perso'],
832
-                    'restricted_to' => isset($record['restricted_to']) && ! empty($record['restricted_to']) ? $record['restricted_to'] : '0',
832
+                    'restricted_to' => isset($record['restricted_to']) && !empty($record['restricted_to']) ? $record['restricted_to'] : '0',
833 833
                     'login' => $record['login'] ?? '',
834 834
                     'folder' => implode(' > ', $folder),
835 835
                     'author' => $record['id_user'],
@@ -858,7 +858,7 @@  discard block
 block discarded – undo
858 858
     // get new value from db
859 859
     $data = DB::queryfirstrow(
860 860
         'SELECT label, description, id_tree, perso, restricted_to, login, url
861
-        FROM ' . prefixTable('items') . '
861
+        FROM ' . prefixTable('items').'
862 862
         WHERE id=%i',
863 863
         $ident
864 864
     );
@@ -866,12 +866,12 @@  discard block
 block discarded – undo
866 866
     $tags = '';
867 867
     $itemTags = DB::query(
868 868
         'SELECT tag
869
-            FROM ' . prefixTable('tags') . '
869
+            FROM ' . prefixTable('tags').'
870 870
             WHERE item_id = %i AND tag != ""',
871 871
         $ident
872 872
     );
873 873
     foreach ($itemTags as $itemTag) {
874
-        $tags .= $itemTag['tag'] . ' ';
874
+        $tags .= $itemTag['tag'].' ';
875 875
     }
876 876
     // form id_tree to full foldername
877 877
     $folder = [];
@@ -882,7 +882,7 @@  discard block
 block discarded – undo
882 882
             // Is this a User id?
883 883
             $user = DB::queryfirstrow(
884 884
                 'SELECT id, login
885
-                FROM ' . prefixTable('users') . '
885
+                FROM ' . prefixTable('users').'
886 886
                 WHERE id = %i',
887 887
                 $elem->title
888 888
             );
@@ -900,10 +900,10 @@  discard block
 block discarded – undo
900 900
             'label' => $data['label'],
901 901
             'description' => $data['description'],
902 902
             'tags' => $tags,
903
-            'url' => isset($data['url']) && ! empty($data['url']) ? $data['url'] : '0',
903
+            'url' => isset($data['url']) && !empty($data['url']) ? $data['url'] : '0',
904 904
             'id_tree' => $data['id_tree'],
905 905
             'perso' => $data['perso'],
906
-            'restricted_to' => isset($data['restricted_to']) && ! empty($data['restricted_to']) ? $data['restricted_to'] : '0',
906
+            'restricted_to' => isset($data['restricted_to']) && !empty($data['restricted_to']) ? $data['restricted_to'] : '0',
907 907
             'login' => $data['login'] ?? '',
908 908
             'folder' => implode(' » ', $folder),
909 909
             'author' => $session->get('user-id'),
@@ -933,8 +933,8 @@  discard block
 block discarded – undo
933 933
     // get new value from db
934 934
     $data = DB::queryFirstRow(
935 935
         'SELECT i.label, i.description, i.id_tree as id_tree, i.perso, i.restricted_to, i.id, i.login, i.url, l.date
936
-        FROM ' . prefixTable('items') . ' as i
937
-        INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id)
936
+        FROM ' . prefixTable('items').' as i
937
+        INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id)
938 938
         WHERE i.id = %i
939 939
         AND l.action = %s',
940 940
         $ident,
@@ -944,12 +944,12 @@  discard block
 block discarded – undo
944 944
     $tags = '';
945 945
     $itemTags = DB::query(
946 946
         'SELECT tag
947
-            FROM ' . prefixTable('tags') . '
947
+            FROM ' . prefixTable('tags').'
948 948
             WHERE item_id = %i AND tag != ""',
949 949
         $ident
950 950
     );
951 951
     foreach ($itemTags as $itemTag) {
952
-        $tags .= $itemTag['tag'] . ' ';
952
+        $tags .= $itemTag['tag'].' ';
953 953
     }
954 954
     // form id_tree to full foldername
955 955
     $folder = [];
@@ -960,7 +960,7 @@  discard block
 block discarded – undo
960 960
             // Is this a User id?
961 961
             $user = DB::queryfirstrow(
962 962
                 'SELECT id, login
963
-                FROM ' . prefixTable('users') . '
963
+                FROM ' . prefixTable('users').'
964 964
                 WHERE id = %i',
965 965
                 $elem->title
966 966
             );
@@ -979,7 +979,7 @@  discard block
 block discarded – undo
979 979
             'label' => $data['label'],
980 980
             'description' => $data['description'],
981 981
             'tags' => isset($tags) && empty($tags) === false ? $tags : 'None',
982
-            'url' => isset($data['url']) && ! empty($data['url']) ? $data['url'] : '0',
982
+            'url' => isset($data['url']) && !empty($data['url']) ? $data['url'] : '0',
983 983
             'id_tree' => $data['id_tree'],
984 984
             'perso' => isset($data['perso']) && empty($data['perso']) === false && $data['perso'] !== 'None' ? $data['perso'] : '0',
985 985
             'restricted_to' => isset($data['restricted_to']) && empty($data['restricted_to']) === false ? $data['restricted_to'] : '0',
@@ -1001,52 +1001,52 @@  discard block
 block discarded – undo
1001 1001
 function getStatisticsData(array $SETTINGS): array
1002 1002
 {
1003 1003
     DB::query(
1004
-        'SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE personal_folder = %i',
1004
+        'SELECT id FROM '.prefixTable('nested_tree').' WHERE personal_folder = %i',
1005 1005
         0
1006 1006
     );
1007 1007
     $counter_folders = DB::count();
1008 1008
     DB::query(
1009
-        'SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE personal_folder = %i',
1009
+        'SELECT id FROM '.prefixTable('nested_tree').' WHERE personal_folder = %i',
1010 1010
         1
1011 1011
     );
1012 1012
     $counter_folders_perso = DB::count();
1013 1013
     DB::query(
1014
-        'SELECT id FROM ' . prefixTable('items') . ' WHERE perso = %i',
1014
+        'SELECT id FROM '.prefixTable('items').' WHERE perso = %i',
1015 1015
         0
1016 1016
     );
1017 1017
     $counter_items = DB::count();
1018 1018
         DB::query(
1019
-        'SELECT id FROM ' . prefixTable('items') . ' WHERE perso = %i',
1019
+        'SELECT id FROM '.prefixTable('items').' WHERE perso = %i',
1020 1020
         1
1021 1021
     );
1022 1022
     $counter_items_perso = DB::count();
1023 1023
         DB::query(
1024
-        'SELECT id FROM ' . prefixTable('users') . ''
1024
+        'SELECT id FROM '.prefixTable('users').''
1025 1025
     );
1026 1026
     $counter_users = DB::count();
1027 1027
         DB::query(
1028
-        'SELECT id FROM ' . prefixTable('users') . ' WHERE admin = %i',
1028
+        'SELECT id FROM '.prefixTable('users').' WHERE admin = %i',
1029 1029
         1
1030 1030
     );
1031 1031
     $admins = DB::count();
1032 1032
     DB::query(
1033
-        'SELECT id FROM ' . prefixTable('users') . ' WHERE gestionnaire = %i',
1033
+        'SELECT id FROM '.prefixTable('users').' WHERE gestionnaire = %i',
1034 1034
         1
1035 1035
     );
1036 1036
     $managers = DB::count();
1037 1037
     DB::query(
1038
-        'SELECT id FROM ' . prefixTable('users') . ' WHERE read_only = %i',
1038
+        'SELECT id FROM '.prefixTable('users').' WHERE read_only = %i',
1039 1039
         1
1040 1040
     );
1041 1041
     $readOnly = DB::count();
1042 1042
     // list the languages
1043 1043
     $usedLang = [];
1044 1044
     $tp_languages = DB::query(
1045
-        'SELECT name FROM ' . prefixTable('languages')
1045
+        'SELECT name FROM '.prefixTable('languages')
1046 1046
     );
1047 1047
     foreach ($tp_languages as $tp_language) {
1048 1048
         DB::query(
1049
-            'SELECT * FROM ' . prefixTable('users') . ' WHERE user_language = %s',
1049
+            'SELECT * FROM '.prefixTable('users').' WHERE user_language = %s',
1050 1050
             $tp_language['name']
1051 1051
         );
1052 1052
         $usedLang[$tp_language['name']] = round((DB::count() * 100 / $counter_users), 0);
@@ -1055,12 +1055,12 @@  discard block
 block discarded – undo
1055 1055
     // get list of ips
1056 1056
     $usedIp = [];
1057 1057
     $tp_ips = DB::query(
1058
-        'SELECT user_ip FROM ' . prefixTable('users')
1058
+        'SELECT user_ip FROM '.prefixTable('users')
1059 1059
     );
1060 1060
     foreach ($tp_ips as $ip) {
1061 1061
         if (array_key_exists($ip['user_ip'], $usedIp)) {
1062 1062
             $usedIp[$ip['user_ip']] += $usedIp[$ip['user_ip']];
1063
-        } elseif (! empty($ip['user_ip']) && $ip['user_ip'] !== 'none') {
1063
+        } elseif (!empty($ip['user_ip']) && $ip['user_ip'] !== 'none') {
1064 1064
             $usedIp[$ip['user_ip']] = 1;
1065 1065
         }
1066 1066
     }
@@ -1211,7 +1211,7 @@  discard block
 block discarded – undo
1211 1211
 {
1212 1212
     // Load PHPMailer
1213 1213
     $mail = new PHPMailer(true);
1214
-    $languageDir = $SETTINGS['cpassman_dir'] . '/vendor/phpmailer/phpmailer/language/';
1214
+    $languageDir = $SETTINGS['cpassman_dir'].'/vendor/phpmailer/phpmailer/language/';
1215 1215
     // Load AntiXSS
1216 1216
     $antiXss = new AntiXSS();
1217 1217
 
@@ -1238,7 +1238,7 @@  discard block
 block discarded – undo
1238 1238
         $mail->Port = (int) $SETTINGS['email_port'];
1239 1239
         $mail->SMTPSecure = $SETTINGS['email_security'] !== 'none' ? $SETTINGS['email_security'] : '';
1240 1240
         $mail->SMTPAutoTLS = $SETTINGS['email_security'] !== 'none';
1241
-        $mail->CharSet = 'utf-8';   //#4143
1241
+        $mail->CharSet = 'utf-8'; //#4143
1242 1242
         $mail->SMTPOptions = [
1243 1243
             'ssl' => [
1244 1244
                 'verify_peer' => false,
@@ -1272,7 +1272,7 @@  discard block
 block discarded – undo
1272 1272
         
1273 1273
         return '';
1274 1274
     } catch (Exception $e) {
1275
-        error_log('Error sending email: ' . $e->getMessage());
1275
+        error_log('Error sending email: '.$e->getMessage());
1276 1276
         if (!$silent || (int) $SETTINGS['email_debug_level'] !== 0) {
1277 1277
             return json_encode([
1278 1278
                 'error' => true,
@@ -1308,7 +1308,7 @@  discard block
 block discarded – undo
1308 1308
         <table width="600" cellpadding="0" cellspacing="0" border="0" class="container" bgcolor="#ffffff" style="border-spacing: 0; border-bottom: 1px solid #e0e0e0; box-shadow: 0 0 3px #ddd; color: #434343; font-family: Helvetica, Verdana, sans-serif;">
1309 1309
         <tr><td class="container-padding" bgcolor="#ffffff" style="border-collapse: collapse; border-left: 1px solid #e0e0e0; background-color: #ffffff; padding-left: 30px; padding-right: 30px;">
1310 1310
         <br><div style="float:right;">' .
1311
-        $textMail .
1311
+        $textMail.
1312 1312
         '<br><br></td></tr></table>
1313 1313
     </td></tr></table>
1314 1314
     <br></body></html>';
@@ -1389,7 +1389,7 @@  discard block
 block discarded – undo
1389 1389
 {
1390 1390
     array_walk_recursive(
1391 1391
         $array,
1392
-        static function (&$item): void {
1392
+        static function(&$item): void {
1393 1393
             if (mb_detect_encoding((string) $item, 'utf-8', true) === false) {
1394 1394
                 $item = mb_convert_encoding($item, 'ISO-8859-1', 'UTF-8');
1395 1395
             }
@@ -1482,7 +1482,7 @@  discard block
 block discarded – undo
1482 1482
  */
1483 1483
 function prefixTable(string $table): string
1484 1484
 {
1485
-    $safeTable = htmlspecialchars(DB_PREFIX . $table);
1485
+    $safeTable = htmlspecialchars(DB_PREFIX.$table);
1486 1486
     if (empty($safeTable) === false) {
1487 1487
         // sanitize string
1488 1488
         return $safeTable;
@@ -1546,7 +1546,7 @@  discard block
 block discarded – undo
1546 1546
 function send_syslog($message, $host, $port, $component = 'teampass'): void
1547 1547
 {
1548 1548
     $sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
1549
-    $syslog_message = '<123>' . date('M d H:i:s ') . $component . ': ' . $message;
1549
+    $syslog_message = '<123>'.date('M d H:i:s ').$component.': '.$message;
1550 1550
     socket_sendto($sock, (string) $syslog_message, strlen($syslog_message), 0, (string) $host, (int) $port);
1551 1551
     socket_close($sock);
1552 1552
 }
@@ -1593,14 +1593,14 @@  discard block
 block discarded – undo
1593 1593
     if (isset($SETTINGS['syslog_enable']) === true && (int) $SETTINGS['syslog_enable'] === 1) {
1594 1594
         if ($type === 'user_mngt') {
1595 1595
             send_syslog(
1596
-                'action=' . str_replace('at_', '', $label) . ' attribute=user user=' . $who . ' userid="' . $login . '" change="' . $field_1 . '" ',
1596
+                'action='.str_replace('at_', '', $label).' attribute=user user='.$who.' userid="'.$login.'" change="'.$field_1.'" ',
1597 1597
                 $SETTINGS['syslog_host'],
1598 1598
                 $SETTINGS['syslog_port'],
1599 1599
                 'teampass'
1600 1600
             );
1601 1601
         } else {
1602 1602
             send_syslog(
1603
-                'action=' . $type . ' attribute=' . $label . ' user=' . $who . ' userid="' . $login . '" ',
1603
+                'action='.$type.' attribute='.$label.' user='.$who.' userid="'.$login.'" ',
1604 1604
                 $SETTINGS['syslog_host'],
1605 1605
                 $SETTINGS['syslog_port'],
1606 1606
                 'teampass'
@@ -1675,7 +1675,7 @@  discard block
 block discarded – undo
1675 1675
         if (empty($item_label) === true) {
1676 1676
             $dataItem = DB::queryfirstrow(
1677 1677
                 'SELECT id, id_tree, label
1678
-                FROM ' . prefixTable('items') . '
1678
+                FROM ' . prefixTable('items').'
1679 1679
                 WHERE id = %i',
1680 1680
                 $item_id
1681 1681
             );
@@ -1683,11 +1683,11 @@  discard block
 block discarded – undo
1683 1683
         }
1684 1684
 
1685 1685
         send_syslog(
1686
-            'action=' . str_replace('at_', '', $action) .
1687
-                ' attribute=' . str_replace('at_', '', $attribute[0]) .
1688
-                ' itemno=' . $item_id .
1689
-                ' user=' . (is_null($login) === true ? '' : addslashes((string) $login)) .
1690
-                ' itemname="' . addslashes($item_label) . '"',
1686
+            'action='.str_replace('at_', '', $action).
1687
+                ' attribute='.str_replace('at_', '', $attribute[0]).
1688
+                ' itemno='.$item_id.
1689
+                ' user='.(is_null($login) === true ? '' : addslashes((string) $login)).
1690
+                ' itemname="'.addslashes($item_label).'"',
1691 1691
             $SETTINGS['syslog_host'],
1692 1692
             $SETTINGS['syslog_port'],
1693 1693
             'teampass'
@@ -1719,8 +1719,8 @@  discard block
 block discarded – undo
1719 1719
     $notification = DB::queryOneColumn(
1720 1720
         'email',
1721 1721
         'SELECT *
1722
-        FROM ' . prefixTable('notification') . ' AS n
1723
-        INNER JOIN ' . prefixTable('users') . ' AS u ON (n.user_id = u.id)
1722
+        FROM ' . prefixTable('notification').' AS n
1723
+        INNER JOIN ' . prefixTable('users').' AS u ON (n.user_id = u.id)
1724 1724
         WHERE n.item_id = %i AND n.user_id != %i',
1725 1725
         $item_id,
1726 1726
         $globalsUserId
@@ -1731,7 +1731,7 @@  discard block
 block discarded – undo
1731 1731
         // Get list of changes
1732 1732
         $htmlChanges = '<ul>';
1733 1733
         foreach ($changes as $change) {
1734
-            $htmlChanges .= '<li>' . $change . '</li>';
1734
+            $htmlChanges .= '<li>'.$change.'</li>';
1735 1735
         }
1736 1736
         $htmlChanges .= '</ul>';
1737 1737
         // send email
@@ -1768,15 +1768,15 @@  discard block
 block discarded – undo
1768 1768
     $path = '';
1769 1769
     foreach ($arbo as $elem) {
1770 1770
         if (empty($path) === true) {
1771
-            $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES) . ' ';
1771
+            $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES).' ';
1772 1772
         } else {
1773
-            $path .= '&#8594; ' . htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
1773
+            $path .= '&#8594; '.htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
1774 1774
         }
1775 1775
     }
1776 1776
 
1777 1777
     // Build text to show user
1778 1778
     if (empty($label) === false) {
1779
-        return empty($path) === true ? addslashes($label) : addslashes($label) . ' (' . $path . ')';
1779
+        return empty($path) === true ? addslashes($label) : addslashes($label).' ('.$path.')';
1780 1780
     }
1781 1781
     return empty($path) === true ? '' : $path;
1782 1782
 }
@@ -1833,7 +1833,7 @@  discard block
 block discarded – undo
1833 1833
  */
1834 1834
 function handleConfigFile($action, $SETTINGS, $field = null, $value = null)
1835 1835
 {
1836
-    $tp_config_file = $SETTINGS['cpassman_dir'] . '/includes/config/tp.config.php';
1836
+    $tp_config_file = $SETTINGS['cpassman_dir'].'/includes/config/tp.config.php';
1837 1837
 
1838 1838
     // Load class DB
1839 1839
     loadClasses('DB');
@@ -1841,8 +1841,8 @@  discard block
 block discarded – undo
1841 1841
     if (file_exists($tp_config_file) === false || $action === 'rebuild') {
1842 1842
         // perform a copy
1843 1843
         if (file_exists($tp_config_file)) {
1844
-            if (! copy($tp_config_file, $tp_config_file . '.' . date('Y_m_d_His', time()))) {
1845
-                return "ERROR: Could not copy file '" . $tp_config_file . "'";
1844
+            if (!copy($tp_config_file, $tp_config_file.'.'.date('Y_m_d_His', time()))) {
1845
+                return "ERROR: Could not copy file '".$tp_config_file."'";
1846 1846
             }
1847 1847
         }
1848 1848
 
@@ -1852,11 +1852,11 @@  discard block
 block discarded – undo
1852 1852
         $data[1] = "global \$SETTINGS;\n";
1853 1853
         $data[2] = "\$SETTINGS = array (\n";
1854 1854
         $rows = DB::query(
1855
-            'SELECT * FROM ' . prefixTable('misc') . ' WHERE type=%s',
1855
+            'SELECT * FROM '.prefixTable('misc').' WHERE type=%s',
1856 1856
             'admin'
1857 1857
         );
1858 1858
         foreach ($rows as $record) {
1859
-            array_push($data, "    '" . $record['intitule'] . "' => '" . htmlspecialchars_decode($record['valeur'], ENT_COMPAT) . "',\n");
1859
+            array_push($data, "    '".$record['intitule']."' => '".htmlspecialchars_decode($record['valeur'], ENT_COMPAT)."',\n");
1860 1860
         }
1861 1861
         array_push($data, ");\n");
1862 1862
         $data = array_unique($data);
@@ -1870,15 +1870,15 @@  discard block
 block discarded – undo
1870 1870
                 break;
1871 1871
             }
1872 1872
 
1873
-            if (stristr($line, "'" . $field . "' => '")) {
1874
-                $data[$inc] = "    '" . $field . "' => '" . htmlspecialchars_decode($value ?? '', ENT_COMPAT) . "',\n";
1873
+            if (stristr($line, "'".$field."' => '")) {
1874
+                $data[$inc] = "    '".$field."' => '".htmlspecialchars_decode($value ?? '', ENT_COMPAT)."',\n";
1875 1875
                 $bFound = true;
1876 1876
                 break;
1877 1877
             }
1878 1878
             ++$inc;
1879 1879
         }
1880 1880
         if ($bFound === false) {
1881
-            $data[$inc] = "    '" . $field . "' => '" . htmlspecialchars_decode($value ?? '', ENT_COMPAT). "',\n);\n";
1881
+            $data[$inc] = "    '".$field."' => '".htmlspecialchars_decode($value ?? '', ENT_COMPAT)."',\n);\n";
1882 1882
         }
1883 1883
     }
1884 1884
 
@@ -1908,7 +1908,7 @@  discard block
 block discarded – undo
1908 1908
 {
1909 1909
     global $SETTINGS;
1910 1910
     /* LOAD CPASSMAN SETTINGS */
1911
-    if (! isset($SETTINGS['loaded']) || $SETTINGS['loaded'] !== 1) {
1911
+    if (!isset($SETTINGS['loaded']) || $SETTINGS['loaded'] !== 1) {
1912 1912
         $SETTINGS = [];
1913 1913
         $SETTINGS['duplicate_folder'] = 0;
1914 1914
         //by default, this is set to 0;
@@ -1918,7 +1918,7 @@  discard block
 block discarded – undo
1918 1918
         //by default, this value is set to 5;
1919 1919
         $settings = [];
1920 1920
         $rows = DB::query(
1921
-            'SELECT * FROM ' . prefixTable('misc') . ' WHERE type=%s_type OR type=%s_type2',
1921
+            'SELECT * FROM '.prefixTable('misc').' WHERE type=%s_type OR type=%s_type2',
1922 1922
             [
1923 1923
                 'type' => 'admin',
1924 1924
                 'type2' => 'settings',
@@ -1950,7 +1950,7 @@  discard block
 block discarded – undo
1950 1950
     $source_cf = [];
1951 1951
     $rows = DB::QUERY(
1952 1952
         'SELECT id_category
1953
-            FROM ' . prefixTable('categories_folders') . '
1953
+            FROM ' . prefixTable('categories_folders').'
1954 1954
             WHERE id_folder = %i',
1955 1955
         $source_id
1956 1956
     );
@@ -1961,7 +1961,7 @@  discard block
 block discarded – undo
1961 1961
     $target_cf = [];
1962 1962
     $rows = DB::QUERY(
1963 1963
         'SELECT id_category
1964
-            FROM ' . prefixTable('categories_folders') . '
1964
+            FROM ' . prefixTable('categories_folders').'
1965 1965
             WHERE id_folder = %i',
1966 1966
         $target_id
1967 1967
     );
@@ -2180,7 +2180,7 @@  discard block
 block discarded – undo
2180 2180
 ) {
2181 2181
     // Check if the path exists
2182 2182
     $path = basename($path);
2183
-    if (! file_exists($path)) {
2183
+    if (!file_exists($path)) {
2184 2184
         return false;
2185 2185
     }
2186 2186
 
@@ -2233,7 +2233,7 @@  discard block
 block discarded – undo
2233 2233
     // Load item data
2234 2234
     $data = DB::queryFirstRow(
2235 2235
         'SELECT id_tree
2236
-        FROM ' . prefixTable('items') . '
2236
+        FROM ' . prefixTable('items').'
2237 2237
         WHERE id = %i',
2238 2238
         $item_id
2239 2239
     );
@@ -2296,7 +2296,7 @@  discard block
 block discarded – undo
2296 2296
         }
2297 2297
         $host .= substr(explode(".", $email[1])[0], -1, 1);
2298 2298
     }
2299
-    $email = $name . "@" . $host . "." . explode(".", $email[1])[1];
2299
+    $email = $name."@".$host.".".explode(".", $email[1])[1];
2300 2300
     return $email;
2301 2301
 }
2302 2302
 
@@ -2319,7 +2319,7 @@  discard block
 block discarded – undo
2319 2319
     
2320 2320
     // Insert log in DB
2321 2321
     return DB::query(
2322
-        'SELECT ' . $fields . '
2322
+        'SELECT '.$fields.'
2323 2323
         FROM ' . prefixTable($table)
2324 2324
     );
2325 2325
 }
@@ -2334,11 +2334,11 @@  discard block
 block discarded – undo
2334 2334
 function formatSizeUnits(int $bytes): string
2335 2335
 {
2336 2336
     if ($bytes >= 1073741824) {
2337
-        $bytes = number_format($bytes / 1073741824, 2) . ' GB';
2337
+        $bytes = number_format($bytes / 1073741824, 2).' GB';
2338 2338
     } elseif ($bytes >= 1048576) {
2339
-        $bytes = number_format($bytes / 1048576, 2) . ' MB';
2339
+        $bytes = number_format($bytes / 1048576, 2).' MB';
2340 2340
     } elseif ($bytes >= 1024) {
2341
-        $bytes = number_format($bytes / 1024, 2) . ' KB';
2341
+        $bytes = number_format($bytes / 1024, 2).' KB';
2342 2342
     } elseif ($bytes > 1) {
2343 2343
         $bytes .= ' bytes';
2344 2344
     } elseif ($bytes === 1) {
@@ -2581,7 +2581,7 @@  discard block
 block discarded – undo
2581 2581
     $cipher->enableContinuousBuffer();
2582 2582
 
2583 2583
     // Encrypt the file content
2584
-    $filePath = filter_var($fileInPath . '/' . $fileInName, FILTER_SANITIZE_URL);
2584
+    $filePath = filter_var($fileInPath.'/'.$fileInName, FILTER_SANITIZE_URL);
2585 2585
     $fileContent = file_get_contents($filePath);
2586 2586
     $plaintext = $fileContent;
2587 2587
     $ciphertext = $cipher->encrypt($plaintext);
@@ -2589,9 +2589,9 @@  discard block
 block discarded – undo
2589 2589
     // Save new file
2590 2590
     // deepcode ignore InsecureHash: is simply used to get a unique name
2591 2591
     $hash = md5($plaintext);
2592
-    $fileOut = $fileInPath . '/' . TP_FILE_PREFIX . $hash;
2592
+    $fileOut = $fileInPath.'/'.TP_FILE_PREFIX.$hash;
2593 2593
     file_put_contents($fileOut, $ciphertext);
2594
-    unlink($fileInPath . '/' . $fileInName);
2594
+    unlink($fileInPath.'/'.$fileInName);
2595 2595
     return [
2596 2596
         'fileHash' => base64_encode($hash),
2597 2597
         'objectKey' => base64_encode($objectKey),
@@ -2609,7 +2609,7 @@  discard block
 block discarded – undo
2609 2609
  */
2610 2610
 function decryptFile(string $fileName, string $filePath, string $key): string
2611 2611
 {
2612
-    if (! defined('FILE_BUFFER_SIZE')) {
2612
+    if (!defined('FILE_BUFFER_SIZE')) {
2613 2613
         define('FILE_BUFFER_SIZE', 128 * 1024);
2614 2614
     }
2615 2615
     
@@ -2626,7 +2626,7 @@  discard block
 block discarded – undo
2626 2626
     $cipher->enableContinuousBuffer();
2627 2627
     $cipher->disablePadding();
2628 2628
     // Get file content
2629
-    $safeFilePath = realpath($filePath . '/' . TP_FILE_PREFIX . $safeFileName);
2629
+    $safeFilePath = realpath($filePath.'/'.TP_FILE_PREFIX.$safeFileName);
2630 2630
     $ciphertext = file_get_contents(filter_var($safeFilePath, FILTER_SANITIZE_URL));
2631 2631
 
2632 2632
     if (WIP) error_log('DEBUG: File image url -> '.filter_var($safeFilePath, FILTER_SANITIZE_URL));
@@ -2712,8 +2712,8 @@  discard block
 block discarded – undo
2712 2712
         // Only create the sharekey for a user
2713 2713
         $user = DB::queryFirstRow(
2714 2714
             'SELECT public_key
2715
-            FROM ' . prefixTable('users') . '
2716
-            WHERE id = ' . ($apiUserId === -1 ? (int) $session->get('user-id') : $apiUserId) . '
2715
+            FROM ' . prefixTable('users').'
2716
+            WHERE id = ' . ($apiUserId === -1 ? (int) $session->get('user-id') : $apiUserId).'
2717 2717
             AND public_key != ""'
2718 2718
         );
2719 2719
 
@@ -2750,17 +2750,16 @@  discard block
 block discarded – undo
2750 2750
         //DB::debugmode(true);
2751 2751
         $users = DB::query(
2752 2752
             'SELECT id, public_key
2753
-            FROM ' . prefixTable('users') . '
2753
+            FROM ' . prefixTable('users').'
2754 2754
             WHERE ' . ($onlyForUser === true ? 
2755
-                'id IN ("' . TP_USER_ID . '","' . ($apiUserId === -1 ? (int) $session->get('user-id') : $apiUserId) . '") ' : 
2756
-                'id NOT IN ("' . OTV_USER_ID . '","' . SSH_USER_ID . '","' . API_USER_ID . '"'.($all_users_except_id === -1 ? '' : ', "'.$all_users_except_id.'"').') ') . '
2755
+                'id IN ("'.TP_USER_ID.'","'.($apiUserId === -1 ? (int) $session->get('user-id') : $apiUserId).'") ' : 'id NOT IN ("'.OTV_USER_ID.'","'.SSH_USER_ID.'","'.API_USER_ID.'"'.($all_users_except_id === -1 ? '' : ', "'.$all_users_except_id.'"').') ').'
2757 2756
             AND public_key != ""'
2758 2757
         );
2759 2758
         //DB::debugmode(false);
2760 2759
         foreach ($users as $user) {
2761 2760
             // Insert in DB the new object key for this item by user
2762 2761
             if (count($objectKeyArray) === 0) {
2763
-                if (WIP === true) error_log('TEAMPASS Debug - storeUsersShareKey case1 - ' . $object_name . ' - ' . $post_object_id . ' - ' . $user['id'] . ' - ' . $objectKey);
2762
+                if (WIP === true) error_log('TEAMPASS Debug - storeUsersShareKey case1 - '.$object_name.' - '.$post_object_id.' - '.$user['id'].' - '.$objectKey);
2764 2763
                 DB::insert(
2765 2764
                     $object_name,
2766 2765
                     [
@@ -2774,7 +2773,7 @@  discard block
 block discarded – undo
2774 2773
                 );
2775 2774
             } else {
2776 2775
                 foreach ($objectKeyArray as $object) {
2777
-                    if (WIP === true) error_log('TEAMPASS Debug - storeUsersShareKey case2 - ' . $object_name . ' - ' . $object['objectId'] . ' - ' . $user['id'] . ' - ' . $object['objectKey']);
2776
+                    if (WIP === true) error_log('TEAMPASS Debug - storeUsersShareKey case2 - '.$object_name.' - '.$object['objectId'].' - '.$user['id'].' - '.$object['objectKey']);
2778 2777
                     DB::insert(
2779 2778
                         $object_name,
2780 2779
                         [
@@ -2802,7 +2801,7 @@  discard block
 block discarded – undo
2802 2801
 function isBase64(string $str): bool
2803 2802
 {
2804 2803
     $str = (string) trim($str);
2805
-    if (! isset($str[0])) {
2804
+    if (!isset($str[0])) {
2806 2805
         return false;
2807 2806
     }
2808 2807
 
@@ -2876,7 +2875,7 @@  discard block
 block discarded – undo
2876 2875
     } catch (\LdapRecord\Auth\BindException $e) {
2877 2876
         $error = $e->getDetailedError();
2878 2877
         if ($error) {
2879
-            error_log('TEAMPASS Error - LDAP - '.$error->getErrorCode()." - ".$error->getErrorMessage(). " - ".$error->getDiagnosticMessage());
2878
+            error_log('TEAMPASS Error - LDAP - '.$error->getErrorCode()." - ".$error->getErrorMessage()." - ".$error->getDiagnosticMessage());
2880 2879
         } else {
2881 2880
             error_log('TEAMPASS Error - LDAP - Code: '.$e->getCode().' - Message: '.$e->getMessage());
2882 2881
         }
@@ -2895,7 +2894,7 @@  discard block
 block discarded – undo
2895 2894
     } catch (\LdapRecord\Auth\BindException $e) {
2896 2895
         $error = $e->getDetailedError();
2897 2896
         if ($error) {
2898
-            error_log('TEAMPASS Error - LDAP - '.$error->getErrorCode()." - ".$error->getErrorMessage(). " - ".$error->getDiagnosticMessage());
2897
+            error_log('TEAMPASS Error - LDAP - '.$error->getErrorCode()." - ".$error->getErrorMessage()." - ".$error->getDiagnosticMessage());
2899 2898
         } else {
2900 2899
             error_log('TEAMPASS Error - LDAP - Code: '.$e->getCode().' - Message: '.$e->getMessage());
2901 2900
         }
@@ -2924,7 +2923,7 @@  discard block
 block discarded – undo
2924 2923
     // expect if personal item
2925 2924
     DB::delete(
2926 2925
         prefixTable('sharekeys_items'),
2927
-        'user_id = %i AND object_id NOT IN (SELECT i.id FROM ' . prefixTable('items') . ' AS i WHERE i.perso = 1)',
2926
+        'user_id = %i AND object_id NOT IN (SELECT i.id FROM '.prefixTable('items').' AS i WHERE i.perso = 1)',
2928 2927
         $userId
2929 2928
     );
2930 2929
     // Remove all item sharekeys files
@@ -2932,8 +2931,8 @@  discard block
 block discarded – undo
2932 2931
         prefixTable('sharekeys_files'),
2933 2932
         'user_id = %i AND object_id NOT IN (
2934 2933
             SELECT f.id 
2935
-            FROM ' . prefixTable('items') . ' AS i 
2936
-            INNER JOIN ' . prefixTable('files') . ' AS f ON f.id_item = i.id
2934
+            FROM ' . prefixTable('items').' AS i 
2935
+            INNER JOIN ' . prefixTable('files').' AS f ON f.id_item = i.id
2937 2936
             WHERE i.perso = 1
2938 2937
         )',
2939 2938
         $userId
@@ -2943,8 +2942,8 @@  discard block
 block discarded – undo
2943 2942
         prefixTable('sharekeys_fields'),
2944 2943
         'user_id = %i AND object_id NOT IN (
2945 2944
             SELECT c.id 
2946
-            FROM ' . prefixTable('items') . ' AS i 
2947
-            INNER JOIN ' . prefixTable('categories_items') . ' AS c ON c.item_id = i.id
2945
+            FROM ' . prefixTable('items').' AS i 
2946
+            INNER JOIN ' . prefixTable('categories_items').' AS c ON c.item_id = i.id
2948 2947
             WHERE i.perso = 1
2949 2948
         )',
2950 2949
         $userId
@@ -2952,13 +2951,13 @@  discard block
 block discarded – undo
2952 2951
     // Remove all item sharekeys logs
2953 2952
     DB::delete(
2954 2953
         prefixTable('sharekeys_logs'),
2955
-        'user_id = %i AND object_id NOT IN (SELECT i.id FROM ' . prefixTable('items') . ' AS i WHERE i.perso = 1)',
2954
+        'user_id = %i AND object_id NOT IN (SELECT i.id FROM '.prefixTable('items').' AS i WHERE i.perso = 1)',
2956 2955
         $userId
2957 2956
     );
2958 2957
     // Remove all item sharekeys suggestions
2959 2958
     DB::delete(
2960 2959
         prefixTable('sharekeys_suggestions'),
2961
-        'user_id = %i AND object_id NOT IN (SELECT i.id FROM ' . prefixTable('items') . ' AS i WHERE i.perso = 1)',
2960
+        'user_id = %i AND object_id NOT IN (SELECT i.id FROM '.prefixTable('items').' AS i WHERE i.perso = 1)',
2962 2961
         $userId
2963 2962
     );
2964 2963
     return false;
@@ -2979,7 +2978,7 @@  discard block
 block discarded – undo
2979 2978
         foreach (DateTimeZone::listIdentifiers() as $timezone) {
2980 2979
             $now->setTimezone(new DateTimeZone($timezone));
2981 2980
             $offsets[] = $offset = $now->getOffset();
2982
-            $timezones[$timezone] = '(' . format_GMT_offset($offset) . ') ' . format_timezone_name($timezone);
2981
+            $timezones[$timezone] = '('.format_GMT_offset($offset).') '.format_timezone_name($timezone);
2983 2982
         }
2984 2983
 
2985 2984
         array_multisort($offsets, $timezones);
@@ -2999,7 +2998,7 @@  discard block
 block discarded – undo
2999 2998
 {
3000 2999
     $hours = intval($offset / 3600);
3001 3000
     $minutes = abs(intval($offset % 3600 / 60));
3002
-    return 'GMT' . ($offset ? sprintf('%+03d:%02d', $hours, $minutes) : '');
3001
+    return 'GMT'.($offset ? sprintf('%+03d:%02d', $hours, $minutes) : '');
3003 3002
 }
3004 3003
 
3005 3004
 /**
@@ -3099,8 +3098,7 @@  discard block
 block discarded – undo
3099 3098
 {
3100 3099
     if (isset($array[$key]) === true
3101 3100
         && (is_int($value) === true ?
3102
-            (int) $array[$key] === $value :
3103
-            (string) $array[$key] === $value)
3101
+            (int) $array[$key] === $value : (string) $array[$key] === $value)
3104 3102
     ) {
3105 3103
         return true;
3106 3104
     }
@@ -3122,8 +3120,7 @@  discard block
 block discarded – undo
3122 3120
 {
3123 3121
     if (isset($var) === false
3124 3122
         || (is_int($value) === true ?
3125
-            (int) $var === $value :
3126
-            (string) $var === $value)
3123
+            (int) $var === $value : (string) $var === $value)
3127 3124
     ) {
3128 3125
         return true;
3129 3126
     }
@@ -3174,7 +3171,7 @@  discard block
 block discarded – undo
3174 3171
  */
3175 3172
 function isSetArrayOfValues(array $arrayOfValues): bool
3176 3173
 {
3177
-    foreach($arrayOfValues as $value) {
3174
+    foreach ($arrayOfValues as $value) {
3178 3175
         if (isset($value) === false) {
3179 3176
             return false;
3180 3177
         }
@@ -3196,7 +3193,7 @@  discard block
 block discarded – undo
3196 3193
     /*PHP8 - integer|string*/$value
3197 3194
 ) : bool
3198 3195
 {
3199
-    foreach($arrayOfVars as $variable) {
3196
+    foreach ($arrayOfVars as $variable) {
3200 3197
         if ($variable !== $value) {
3201 3198
             return false;
3202 3199
         }
@@ -3216,7 +3213,7 @@  discard block
 block discarded – undo
3216 3213
     /*PHP8 - integer|string*/$value
3217 3214
 ) : bool
3218 3215
 {
3219
-    foreach($arrayOfVars as $variable) {
3216
+    foreach ($arrayOfVars as $variable) {
3220 3217
         if ($variable === $value) {
3221 3218
             return true;
3222 3219
         }
@@ -3285,7 +3282,7 @@  discard block
 block discarded – undo
3285 3282
  * @param array     $filters
3286 3283
  * @return array|string
3287 3284
  */
3288
-function dataSanitizer(array $data, array $filters): array|string
3285
+function dataSanitizer(array $data, array $filters): array | string
3289 3286
 {
3290 3287
     // Load Sanitizer library
3291 3288
     $sanitizer = new Sanitizer($data, $filters);
@@ -3314,7 +3311,7 @@  discard block
 block discarded – undo
3314 3311
     // Exists ?
3315 3312
     $userCacheId = DB::queryfirstrow(
3316 3313
         'SELECT increment_id
3317
-        FROM ' . prefixTable('cache_tree') . '
3314
+        FROM ' . prefixTable('cache_tree').'
3318 3315
         WHERE user_id = %i',
3319 3316
         $user_id
3320 3317
     );
@@ -3365,7 +3362,7 @@  discard block
 block discarded – undo
3365 3362
  */
3366 3363
 function pourcentage(float $nombre, float $total, float $pourcentage): float
3367 3364
 { 
3368
-    $resultat = ($nombre/$total) * $pourcentage;
3365
+    $resultat = ($nombre / $total) * $pourcentage;
3369 3366
     return round($resultat);
3370 3367
 }
3371 3368
 
@@ -3395,7 +3392,7 @@  discard block
 block discarded – undo
3395 3392
 
3396 3393
     // Get last folder update
3397 3394
     $lastFolderChange = DB::queryfirstrow(
3398
-        'SELECT valeur FROM ' . prefixTable('misc') . '
3395
+        'SELECT valeur FROM '.prefixTable('misc').'
3399 3396
         WHERE type = %s AND intitule = %s',
3400 3397
         'timestamp',
3401 3398
         'last_folder_change'
@@ -3426,7 +3423,7 @@  discard block
 block discarded – undo
3426 3423
     // Does this user has a tree cache
3427 3424
     $userCacheTree = DB::queryfirstrow(
3428 3425
         'SELECT '.$fieldName.'
3429
-        FROM ' . prefixTable('cache_tree') . '
3426
+        FROM ' . prefixTable('cache_tree').'
3430 3427
         WHERE user_id = %i',
3431 3428
         $session->get('user-id')
3432 3429
     );
@@ -3469,7 +3466,7 @@  discard block
 block discarded – undo
3469 3466
     if (count($folderIds) === 0) {
3470 3467
         $folderIds = DB::queryFirstColumn(
3471 3468
             'SELECT id
3472
-            FROM ' . prefixTable('nested_tree') . '
3469
+            FROM ' . prefixTable('nested_tree').'
3473 3470
             WHERE personal_folder=%i',
3474 3471
             0
3475 3472
         );
@@ -3486,8 +3483,8 @@  discard block
 block discarded – undo
3486 3483
         $rows_tmp = DB::query(
3487 3484
             'SELECT c.id, c.title, c.level, c.type, c.masked, c.order, c.encrypted_data, c.role_visibility, c.is_mandatory,
3488 3485
             f.id_category AS category_id
3489
-            FROM ' . prefixTable('categories_folders') . ' AS f
3490
-            INNER JOIN ' . prefixTable('categories') . ' AS c ON (f.id_category = c.parent_id)
3486
+            FROM ' . prefixTable('categories_folders').' AS f
3487
+            INNER JOIN ' . prefixTable('categories').' AS c ON (f.id_category = c.parent_id)
3491 3488
             WHERE id_folder=%i',
3492 3489
             $folder
3493 3490
         );
@@ -3513,7 +3510,7 @@  discard block
 block discarded – undo
3513 3510
         $valTemp = '';
3514 3511
         $data = DB::queryFirstRow(
3515 3512
             'SELECT valeur
3516
-            FROM ' . prefixTable('misc') . '
3513
+            FROM ' . prefixTable('misc').'
3517 3514
             WHERE type = %s AND intitule=%i',
3518 3515
             'complex',
3519 3516
             $folder
@@ -3530,14 +3527,14 @@  discard block
 block discarded – undo
3530 3527
         $valTemp = '';
3531 3528
         $rows_tmp = DB::query(
3532 3529
             'SELECT t.title
3533
-            FROM ' . prefixTable('roles_values') . ' as v
3534
-            INNER JOIN ' . prefixTable('roles_title') . ' as t ON (v.role_id = t.id)
3530
+            FROM ' . prefixTable('roles_values').' as v
3531
+            INNER JOIN ' . prefixTable('roles_title').' as t ON (v.role_id = t.id)
3535 3532
             WHERE v.folder_id = %i
3536 3533
             GROUP BY title',
3537 3534
             $folder
3538 3535
         );
3539 3536
         foreach ($rows_tmp as $record) {
3540
-            $valTemp .= (empty($valTemp) === true ? '' : ' - ') . $record['title'];
3537
+            $valTemp .= (empty($valTemp) === true ? '' : ' - ').$record['title'];
3541 3538
         }
3542 3539
         $arr_data['visibilityRoles'] = $valTemp;
3543 3540
 
@@ -3570,7 +3567,7 @@  discard block
 block discarded – undo
3570 3567
         // loop on users and check if user has this role
3571 3568
         $rows = DB::query(
3572 3569
             'SELECT id, fonction_id
3573
-            FROM ' . prefixTable('users') . '
3570
+            FROM ' . prefixTable('users').'
3574 3571
             WHERE id != %i AND admin = 0 AND fonction_id IS NOT NULL AND fonction_id != ""',
3575 3572
             $session->get('user-id')
3576 3573
         );
@@ -3602,7 +3599,7 @@  discard block
 block discarded – undo
3602 3599
 
3603 3600
     $val = DB::queryfirstrow(
3604 3601
         'SELECT *
3605
-        FROM ' . prefixTable('users') . '
3602
+        FROM ' . prefixTable('users').'
3606 3603
         WHERE id = %i',
3607 3604
         $userId
3608 3605
     );
@@ -3618,12 +3615,12 @@  discard block
 block discarded – undo
3618 3615
 function upgradeRequired(): bool
3619 3616
 {
3620 3617
     // Get settings.php
3621
-    include_once __DIR__. '/../includes/config/settings.php';
3618
+    include_once __DIR__.'/../includes/config/settings.php';
3622 3619
 
3623 3620
     // Get timestamp in DB
3624 3621
     $val = DB::queryfirstrow(
3625 3622
         'SELECT valeur
3626
-        FROM ' . prefixTable('misc') . '
3623
+        FROM ' . prefixTable('misc').'
3627 3624
         WHERE type = %s AND intitule = %s',
3628 3625
         'admin',
3629 3626
         'upgrade_timestamp'
@@ -3678,7 +3675,7 @@  discard block
 block discarded – undo
3678 3675
     // prepapre background tasks for item keys generation        
3679 3676
     $userTP = DB::queryFirstRow(
3680 3677
         'SELECT pw, public_key, private_key
3681
-        FROM ' . prefixTable('users') . '
3678
+        FROM ' . prefixTable('users').'
3682 3679
         WHERE id = %i',
3683 3680
         TP_USER_ID
3684 3681
     );
@@ -3712,7 +3709,7 @@  discard block
 block discarded – undo
3712 3709
     }
3713 3710
 
3714 3711
     // Generate new keys
3715
-    if ($user_self_change === true && empty($recovery_public_key) === false && empty($recovery_private_key) === false){
3712
+    if ($user_self_change === true && empty($recovery_public_key) === false && empty($recovery_private_key) === false) {
3716 3713
         $userKeys = [
3717 3714
             'public_key' => $recovery_public_key,
3718 3715
             'private_key_clear' => $recovery_private_key,
@@ -3752,8 +3749,8 @@  discard block
 block discarded – undo
3752 3749
             'process_type' => 'create_user_keys',
3753 3750
             'arguments' => json_encode([
3754 3751
                 'new_user_id' => (int) $userId,
3755
-                'new_user_pwd' => cryption($passwordClear, '','encrypt')['string'],
3756
-                'new_user_code' => cryption(empty($encryptionKey) === true ? uniqidReal(20) : $encryptionKey, '','encrypt')['string'],
3752
+                'new_user_pwd' => cryption($passwordClear, '', 'encrypt')['string'],
3753
+                'new_user_code' => cryption(empty($encryptionKey) === true ? uniqidReal(20) : $encryptionKey, '', 'encrypt')['string'],
3757 3754
                 'owner_id' => (int) TP_USER_ID,
3758 3755
                 'creator_pwd' => $userTP['pw'],
3759 3756
                 'send_email' => $sendEmailToUser === true ? 1 : 0,
@@ -4043,7 +4040,7 @@  discard block
 block discarded – undo
4043 4040
  */
4044 4041
 function createTaskForItem(
4045 4042
     string $processType,
4046
-    string|array $taskName,
4043
+    string | array $taskName,
4047 4044
     int $itemId,
4048 4045
     int $userId,
4049 4046
     string $objectKey,
@@ -4067,7 +4064,7 @@  discard block
 block discarded – undo
4067 4064
                 'object_key' => $objectKey,
4068 4065
                 'author' => (int) $userId,
4069 4066
             ]),
4070
-            'item_id' => (int) $parentId !== -1 ?  $parentId : null,
4067
+            'item_id' => (int) $parentId !== -1 ? $parentId : null,
4071 4068
         )
4072 4069
     );
4073 4070
     $processId = DB::insertId();
@@ -4077,7 +4074,7 @@  discard block
 block discarded – undo
4077 4074
     if (is_array($taskName) === false) {
4078 4075
         $taskName = [$taskName];
4079 4076
     }
4080
-    foreach($taskName as $task) {
4077
+    foreach ($taskName as $task) {
4081 4078
         error_log('createTaskForItem - task: '.$task);
4082 4079
         switch ($task) {
4083 4080
             case 'item_password':
@@ -4174,7 +4171,7 @@  discard block
 block discarded – undo
4174 4171
  * @param integer $user_id
4175 4172
  * @return void
4176 4173
  */
4177
-function purgeUnnecessaryKeys(bool $allUsers = true, int $user_id=0)
4174
+function purgeUnnecessaryKeys(bool $allUsers = true, int $user_id = 0)
4178 4175
 {
4179 4176
     if ($allUsers === true) {
4180 4177
         // Load class DB
@@ -4184,7 +4181,7 @@  discard block
 block discarded – undo
4184 4181
 
4185 4182
         $users = DB::query(
4186 4183
             'SELECT id
4187
-            FROM ' . prefixTable('users') . '
4184
+            FROM ' . prefixTable('users').'
4188 4185
             WHERE id NOT IN ('.OTV_USER_ID.', '.TP_USER_ID.', '.SSH_USER_ID.', '.API_USER_ID.')
4189 4186
             ORDER BY login ASC'
4190 4187
         );
@@ -4202,7 +4199,7 @@  discard block
 block discarded – undo
4202 4199
  * @param integer $user_id
4203 4200
  * @return void
4204 4201
  */
4205
-function purgeUnnecessaryKeysForUser(int $user_id=0)
4202
+function purgeUnnecessaryKeysForUser(int $user_id = 0)
4206 4203
 {
4207 4204
     if ($user_id === 0) {
4208 4205
         return;
@@ -4213,8 +4210,8 @@  discard block
 block discarded – undo
4213 4210
 
4214 4211
     $personalItems = DB::queryFirstColumn(
4215 4212
         'SELECT id
4216
-        FROM ' . prefixTable('items') . ' AS i
4217
-        INNER JOIN ' . prefixTable('log_items') . ' AS li ON li.id_item = i.id
4213
+        FROM ' . prefixTable('items').' AS i
4214
+        INNER JOIN ' . prefixTable('log_items').' AS li ON li.id_item = i.id
4218 4215
         WHERE i.perso = 1 AND li.action = "at_creation" AND li.id_user IN (%i, '.TP_USER_ID.')',
4219 4216
         $user_id
4220 4217
     );
@@ -4263,7 +4260,7 @@  discard block
 block discarded – undo
4263 4260
     // Check if user exists
4264 4261
     $userInfo = DB::queryFirstRow(
4265 4262
         'SELECT pw, public_key, private_key, login, name
4266
-        FROM ' . prefixTable('users') . '
4263
+        FROM ' . prefixTable('users').'
4267 4264
         WHERE id = %i',
4268 4265
         $userId
4269 4266
     );
@@ -4273,7 +4270,7 @@  discard block
 block discarded – undo
4273 4270
 
4274 4271
         // Prepare file content
4275 4272
         $export_value = file_get_contents(__DIR__."/../includes/core/teampass_ascii.txt")."\n".
4276
-            "Generation date: ".date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], $now)."\n\n".
4273
+            "Generation date: ".date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], $now)."\n\n".
4277 4274
             "RECOVERY KEYS - Not to be shared - To be store safely\n\n".
4278 4275
             "Public Key:\n".$userInfo['public_key']."\n\n".
4279 4276
             "Private Key:\n".decryptPrivateKey($session->get('user-password'), $userInfo['private_key'])."\n\n";
@@ -4296,7 +4293,7 @@  discard block
 block discarded – undo
4296 4293
         return prepareExchangedData(
4297 4294
             array(
4298 4295
                 'error' => false,
4299
-                'datetime' => date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], $now),
4296
+                'datetime' => date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], $now),
4300 4297
                 'timestamp' => $now,
4301 4298
                 'content' => base64_encode($export_value),
4302 4299
                 'login' => $userInfo['login'],
@@ -4322,8 +4319,8 @@  discard block
 block discarded – undo
4322 4319
  */
4323 4320
 function loadClasses(string $className = ''): void
4324 4321
 {
4325
-    require_once __DIR__. '/../includes/config/include.php';
4326
-    require_once __DIR__. '/../includes/config/settings.php';
4322
+    require_once __DIR__.'/../includes/config/include.php';
4323
+    require_once __DIR__.'/../includes/config/settings.php';
4327 4324
     require_once __DIR__.'/../vendor/autoload.php';
4328 4325
 
4329 4326
     if (defined('DB_PASSWD_CLEAR') === false) {
Please login to merge, or discard this patch.
index.php 1 patch
Spacing   +83 added lines, -83 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 csrfProtector::init();
74 74
 
75 75
 // Load functions
76
-require_once __DIR__. '/includes/config/include.php';
76
+require_once __DIR__.'/includes/config/include.php';
77 77
 require_once __DIR__.'/sources/main.functions.php';
78 78
 
79 79
 // init
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 $SETTINGS = $antiXss->xss_clean($SETTINGS);
107 107
 
108 108
 // Load Core library
109
-require_once $SETTINGS['cpassman_dir'] . '/sources/core.php';
109
+require_once $SETTINGS['cpassman_dir'].'/sources/core.php';
110 110
 // Prepare POST variables
111 111
 $post_language = filter_input(INPUT_POST, 'language', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
112 112
 $session_user_language = $session->get('user-language');
@@ -145,8 +145,8 @@  discard block
 block discarded – undo
145 145
     //get default language
146 146
     $dataLanguage = DB::queryFirstRow(
147 147
         'SELECT m.valeur AS valeur, l.flag AS flag
148
-        FROM ' . prefixTable('misc') . ' AS m
149
-        INNER JOIN ' . prefixTable('languages') . ' AS l ON (m.valeur = l.name)
148
+        FROM ' . prefixTable('misc').' AS m
149
+        INNER JOIN ' . prefixTable('languages').' AS l ON (m.valeur = l.name)
150 150
         WHERE m.type=%s_type AND m.intitule=%s_intitule',
151 151
         [
152 152
             'type' => 'admin',
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
         $session_user_language = $SETTINGS['default_language'];
178 178
     }
179 179
 }
180
-$lang = new Language($session_user_language, __DIR__. '/includes/language/'); 
180
+$lang = new Language($session_user_language, __DIR__.'/includes/language/'); 
181 181
 
182 182
 if (isset($SETTINGS['cpassman_dir']) === false || $SETTINGS['cpassman_dir'] === '') {
183 183
     $SETTINGS['cpassman_dir'] = __DIR__;
@@ -268,12 +268,12 @@  discard block
 block discarded – undo
268 268
     <!-- Toastr -->
269 269
     <link rel="stylesheet" href="plugins/toastr/toastr.min.css?v=<?php echo TP_VERSION; ?>" />
270 270
     <!-- favicon -->
271
-    <link rel="shortcut icon" type="image/png" href="<?php echo $favicon;?>"/>
271
+    <link rel="shortcut icon" type="image/png" href="<?php echo $favicon; ?>"/>
272 272
     <!-- manifest -->
273 273
     <!-- <link rel="manifest" href="includes/manifest.json?v=<?php echo TP_VERSION; ?>"> -->
274 274
     <!-- Custom style -->
275 275
     <?php
276
-    if (file_exists(__DIR__ . '/includes/css/custom.css') === true) {?>
276
+    if (file_exists(__DIR__.'/includes/css/custom.css') === true) {?>
277 277
         <link rel="stylesheet" href="includes/css/custom.css?v=<?php echo TP_VERSION; ?>">
278 278
     <?php
279 279
     } ?>
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
                         <div class="dropdown show">
323 323
                             <a class="btn btn-primary dropdown-toggle" href="#" data-toggle="dropdown">
324 324
                                 <?php
325
-                                    echo $session_name . '&nbsp;' . $session_lastname; ?>
325
+                                    echo $session_name.'&nbsp;'.$session_lastname; ?>
326 326
                             </a>
327 327
 
328 328
                             <div class="dropdown-menu dropdown-menu-right">
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
                                     </a>
347 347
                                 <?php
348 348
                                     } ?>
349
-                                <a class="dropdown-item user-menu<?php echo (int) $session_user_admin === 1 ? ' hidden' : '';?>" href="#" data-name="generate-new_keys">
349
+                                <a class="dropdown-item user-menu<?php echo (int) $session_user_admin === 1 ? ' hidden' : ''; ?>" href="#" data-name="generate-new_keys">
350 350
                                     <i class="fa-solid fa-spray-can-sparkles fa-fw mr-2"></i><?php echo $lang->get('generate_new_keys'); ?>
351 351
                                 </a>
352 352
 
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
             <!-- Main Sidebar Container -->
381 381
             <aside class="main-sidebar sidebar-dark-primary elevation-4">
382 382
                 <!-- Brand Logo -->
383
-                <a href="<?php echo $cpassman_url . '/index.php?page=' . ((int) $session_user_admin === 1 ? 'admin' : 'items'); ?>" class="brand-link">
383
+                <a href="<?php echo $cpassman_url.'/index.php?page='.((int) $session_user_admin === 1 ? 'admin' : 'items'); ?>" class="brand-link">
384 384
                     <img src="includes/images/teampass-logo2-home.png" alt="Teampass Logo" class="brand-image">
385 385
                     <span class="brand-text font-weight-light"><?php echo TP_TOOL_NAME; ?></span>
386 386
                 </a>
@@ -398,20 +398,20 @@  discard block
 block discarded – undo
398 398
                         <a href="#" data-name="items" class="nav-link', $get['page'] === 'items' ? ' active' : '', '">
399 399
                         <i class="nav-icon fa-solid fa-key"></i>
400 400
                         <p>
401
-                            ' . $lang->get('pw') . '
401
+                            ' . $lang->get('pw').'
402 402
                         </p>
403 403
                         </a>
404 404
                     </li>';
405 405
                                 }
406 406
 
407 407
     // IMPORT menu
408
-    if (isset($SETTINGS['allow_import']) === true && (int) $SETTINGS['allow_import'] === 1&& $session_user_admin === 0) {
408
+    if (isset($SETTINGS['allow_import']) === true && (int) $SETTINGS['allow_import'] === 1 && $session_user_admin === 0) {
409 409
         echo '
410 410
                     <li class="nav-item">
411 411
                         <a href="#" data-name="import" class="nav-link', $get['page'] === 'import' ? ' active' : '', '">
412 412
                         <i class="nav-icon fa-solid fa-file-import"></i>
413 413
                         <p>
414
-                            ' . $lang->get('import') . '
414
+                            ' . $lang->get('import').'
415 415
                         </p>
416 416
                         </a>
417 417
                     </li>';
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
                         <a href="#" data-name="export" class="nav-link', $get['page'] === 'export' ? ' active' : '', '">
433 433
                         <i class="nav-icon fa-solid fa-file-export"></i>
434 434
                         <p>
435
-                            ' . $lang->get('export') . '
435
+                            ' . $lang->get('export').'
436 436
                         </p>
437 437
                         </a>
438 438
                     </li>';
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
                         <a href="#" data-name="search" class="nav-link', $get['page'] === 'search' ? ' active' : '', '">
460 460
                         <i class="nav-icon fa-solid fa-search"></i>
461 461
                         <p>
462
-                            ' . $lang->get('find') . '
462
+                            ' . $lang->get('find').'
463 463
                         </p>
464 464
                         </a>
465 465
                     </li>';
@@ -475,7 +475,7 @@  discard block
 block discarded – undo
475 475
                         <a href="#" data-name="favourites" class="nav-link', $get['page'] === 'favourites' ? ' active' : '', '">
476 476
                         <i class="nav-icon fa-solid fa-star"></i>
477 477
                         <p>
478
-                            ' . $lang->get('favorites') . '
478
+                            ' . $lang->get('favorites').'
479 479
                         </p>
480 480
                         </a>
481 481
                     </li>';
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
                         <a href="#" data-name="suggestion" class="nav-link', $get['page'] === 'suggestion' ? ' active' : '', '">
506 506
                         <i class="nav-icon fa-solid fa-lightbulb"></i>
507 507
                         <p>
508
-                            ' . $lang->get('suggestion_menu') . '
508
+                            ' . $lang->get('suggestion_menu').'
509 509
                         </p>
510 510
                         </a>
511 511
                     </li>';
@@ -518,7 +518,7 @@  discard block
 block discarded – undo
518 518
                         <a href="#" data-name="admin" class="nav-link', $get['page'] === 'admin' ? ' active' : '', '">
519 519
                         <i class="nav-icon fa-solid fa-info"></i>
520 520
                         <p>
521
-                            ' . $lang->get('admin_main') . '
521
+                            ' . $lang->get('admin_main').'
522 522
                         </p>
523 523
                         </a>
524 524
                     </li>
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
                         <a href="#" class="nav-link">
527 527
                             <i class="nav-icon fa-solid fa-wrench"></i>
528 528
                             <p>
529
-                                ' . $lang->get('admin_settings') . '
529
+                                ' . $lang->get('admin_settings').'
530 530
                                 <i class="fa-solid fa-angle-left right"></i>
531 531
                             </p>
532 532
                         </a>
@@ -534,43 +534,43 @@  discard block
 block discarded – undo
534 534
                             <li class="nav-item">
535 535
                                 <a href="#" data-name="options" class="nav-link', $get['page'] === 'options' ? ' active' : '', '">
536 536
                                     <i class="fa-solid fa-check-double nav-icon"></i>
537
-                                    <p>' . $lang->get('options') . '</p>
537
+                                    <p>' . $lang->get('options').'</p>
538 538
                                 </a>
539 539
                             </li>
540 540
                             <li class="nav-item">
541 541
                                 <a href="#" data-name="2fa" class="nav-link', $get['page'] === '2fa' ? ' active' : '', '">
542 542
                                     <i class="fa-solid fa-qrcode nav-icon"></i>
543
-                                    <p>' . $lang->get('mfa_short') . '</p>
543
+                                    <p>' . $lang->get('mfa_short').'</p>
544 544
                                 </a>
545 545
                             </li>
546 546
                             <li class="nav-item">
547 547
                                 <a href="#" data-name="api" class="nav-link', $get['page'] === 'api' ? ' active' : '', '">
548 548
                                     <i class="fa-solid fa-cubes nav-icon"></i>
549
-                                    <p>' . $lang->get('api') . '</p>
549
+                                    <p>' . $lang->get('api').'</p>
550 550
                                 </a>
551 551
                             </li>
552 552
                             <li class="nav-item">
553 553
                                 <a href="#" data-name="backups" class="nav-link', $get['page'] === 'backups' ? ' active' : '', '">
554 554
                                     <i class="fa-solid fa-database nav-icon"></i>
555
-                                    <p>' . $lang->get('backups') . '</p>
555
+                                    <p>' . $lang->get('backups').'</p>
556 556
                                 </a>
557 557
                             </li>
558 558
                             <li class="nav-item">
559 559
                                 <a href="#" data-name="emails" class="nav-link', $get['page'] === 'emails' ? ' active' : '', '">
560 560
                                     <i class="fa-solid fa-envelope nav-icon"></i>
561
-                                    <p>' . $lang->get('emails') . '</p>
561
+                                    <p>' . $lang->get('emails').'</p>
562 562
                                 </a>
563 563
                             </li>
564 564
                             <li class="nav-item">
565 565
                                 <a href="#" data-name="fields" class="nav-link', $get['page'] === 'fields' ? ' active' : '', '">
566 566
                                     <i class="fa-solid fa-keyboard nav-icon"></i>
567
-                                    <p>' . $lang->get('fields') . '</p>
567
+                                    <p>' . $lang->get('fields').'</p>
568 568
                                 </a>
569 569
                             </li>
570 570
                             <li class="nav-item">
571 571
                                 <a href="#" data-name="ldap" class="nav-link', $get['page'] === 'ldap' ? ' active' : '', '">
572 572
                                     <i class="fa-solid fa-id-card nav-icon"></i>
573
-                                    <p>' . $lang->get('ldap') . '</p>
573
+                                    <p>' . $lang->get('ldap').'</p>
574 574
                                 </a>
575 575
                             </li>';
576 576
 if (WIP === true) {
@@ -578,7 +578,7 @@  discard block
 block discarded – undo
578 578
                             <li class="nav-item">
579 579
                                 <a href="#" data-name="oauth" class="nav-link', $get['page'] === 'oauth' ? ' active' : '', '">
580 580
                                     <i class="fa-solid fa-plug nav-icon"></i>
581
-                                    <p>' . $lang->get('oauth') . '</p>
581
+                                    <p>' . $lang->get('oauth').'</p>
582 582
                                 </a>
583 583
                             </li>';
584 584
 }
@@ -586,13 +586,13 @@  discard block
 block discarded – undo
586 586
                             <li class="nav-item">
587 587
                                 <a href="#" data-name="uploads" class="nav-link', $get['page'] === 'uploads' ? ' active' : '', '">
588 588
                                     <i class="fa-solid fa-file-upload nav-icon"></i>
589
-                                    <p>' . $lang->get('uploads') . '</p>
589
+                                    <p>' . $lang->get('uploads').'</p>
590 590
                                 </a>
591 591
                             </li>
592 592
                             <li class="nav-item">
593 593
                                 <a href="#" data-name="statistics" class="nav-link', $get['page'] === 'statistics' ? ' active' : '', '">
594 594
                                     <i class="fa-solid fa-chart-bar nav-icon"></i>
595
-                                    <p>' . $lang->get('statistics') . '</p>
595
+                                    <p>' . $lang->get('statistics').'</p>
596 596
                                 </a>
597 597
                             </li>
598 598
                         </ul>
@@ -603,7 +603,7 @@  discard block
 block discarded – undo
603 603
                     <li class="nav-item">
604 604
                         <a href="#" data-name="tasks" class="nav-link', $get['page'] === 'tasks' ? ' active' : '', '">
605 605
                         <i class="fa-solid fa-tasks nav-icon"></i>
606
-                        <p>' . $lang->get('tasks') . '</p>
606
+                        <p>' . $lang->get('tasks').'</p>
607 607
                         </a>
608 608
                     </li>';
609 609
                     }
@@ -620,7 +620,7 @@  discard block
 block discarded – undo
620 620
                         <a href="#" data-name="tools" class="nav-link', $get['page'] === 'tools' ? ' active' : '', '">
621 621
                         <i class="nav-icon fa-solid fa-screwdriver-wrench"></i>
622 622
                         <p>
623
-                            ' . $lang->get('tools') . '
623
+                            ' . $lang->get('tools').'
624 624
                         </p>
625 625
                         </a>
626 626
                     </li>';
@@ -630,7 +630,7 @@  discard block
 block discarded – undo
630 630
                         <a href="#" data-name="folders" class="nav-link', $get['page'] === 'folders' ? ' active' : '', '">
631 631
                         <i class="nav-icon fa-solid fa-folder-open"></i>
632 632
                         <p>
633
-                            ' . $lang->get('folders') . '
633
+                            ' . $lang->get('folders').'
634 634
                         </p>
635 635
                         </a>
636 636
                     </li>
@@ -638,7 +638,7 @@  discard block
 block discarded – undo
638 638
                         <a href="#" data-name="roles" class="nav-link', $get['page'] === 'roles' ? ' active' : '', '">
639 639
                         <i class="nav-icon fa-solid fa-graduation-cap"></i>
640 640
                         <p>
641
-                            ' . $lang->get('roles') . '
641
+                            ' . $lang->get('roles').'
642 642
                         </p>
643 643
                         </a>
644 644
                     </li>
@@ -646,38 +646,38 @@  discard block
 block discarded – undo
646 646
                         <a href="#" data-name="users" class="nav-link', $get['page'] === 'users' ? ' active' : '', '">
647 647
                         <i class="nav-icon fa-solid fa-users"></i>
648 648
                         <p>
649
-                            ' . $lang->get('users') . '
649
+                            ' . $lang->get('users').'
650 650
                         </p>
651 651
                         </a>
652 652
                     </li>
653 653
                     <li class="nav-item has-treeview', $menuUtilities === true ? ' menu-open' : '', '">
654 654
                         <a href="#" class="nav-link">
655 655
                         <i class="nav-icon fa-solid fa-cubes"></i>
656
-                        <p>' . $lang->get('admin_views') . '<i class="fa-solid fa-angle-left right"></i></p>
656
+                        <p>' . $lang->get('admin_views').'<i class="fa-solid fa-angle-left right"></i></p>
657 657
                         </a>
658 658
                         <ul class="nav nav-treeview">
659 659
                             <li class="nav-item">
660 660
                                 <a href="#" data-name="utilities.renewal" class="nav-link', $get['page'] === 'utilities.renewal' ? ' active' : '', '">
661 661
                                 <i class="far fa-calendar-alt nav-icon"></i>
662
-                                <p>' . $lang->get('renewal') . '</p>
662
+                                <p>' . $lang->get('renewal').'</p>
663 663
                                 </a>
664 664
                             </li>
665 665
                             <li class="nav-item">
666 666
                                 <a href="#" data-name="utilities.deletion" class="nav-link', $get['page'] === 'utilities.deletion' ? ' active' : '', '">
667 667
                                 <i class="fa-solid fa-trash-alt nav-icon"></i>
668
-                                <p>' . $lang->get('deletion') . '</p>
668
+                                <p>' . $lang->get('deletion').'</p>
669 669
                                 </a>
670 670
                             </li>
671 671
                             <li class="nav-item">
672 672
                                 <a href="#" data-name="utilities.logs" class="nav-link', $get['page'] === 'utilities.logs' ? ' active' : '', '">
673 673
                                 <i class="fa-solid fa-history nav-icon"></i>
674
-                                <p>' . $lang->get('logs') . '</p>
674
+                                <p>' . $lang->get('logs').'</p>
675 675
                                 </a>
676 676
                             </li>
677 677
                             <li class="nav-item">
678 678
                                 <a href="#" data-name="utilities.database" class="nav-link', $get['page'] === 'utilities.database' ? ' active' : '', '">
679 679
                                 <i class="fa-solid fa-database nav-icon"></i>
680
-                                <p>' . $lang->get('database') . '</p>
680
+                                <p>' . $lang->get('database').'</p>
681 681
                                 </a>
682 682
                             </li>
683 683
                         </ul>
@@ -688,10 +688,10 @@  discard block
 block discarded – undo
688 688
                     <!-- /.sidebar-menu -->
689 689
                 <div class="menu-footer">
690 690
                     <div class="" id="sidebar-footer">
691
-                        <i class="fa-solid fa-clock-o mr-2 infotip text-info pointer" title="<?php echo $lang->get('server_time') . ' ' .
692
-                            date($date_format, (int) $server['request_time']) . ' - ' .
691
+                        <i class="fa-solid fa-clock-o mr-2 infotip text-info pointer" title="<?php echo $lang->get('server_time').' '.
692
+                            date($date_format, (int) $server['request_time']).' - '.
693 693
                             date($time_format, (int) $server['request_time']); ?>"></i>
694
-                        <i class="fa-solid fa-users mr-2 infotip text-info pointer" title="<?php echo $session_nb_users_online . ' ' . $lang->get('users_online'); ?>"></i>
694
+                        <i class="fa-solid fa-users mr-2 infotip text-info pointer" title="<?php echo $session_nb_users_online.' '.$lang->get('users_online'); ?>"></i>
695 695
                         <a href="<?php echo DOCUMENTATION_URL; ?>" target="_blank" class="text-info"><i class="fa-solid fa-book mr-2 infotip" title="<?php echo $lang->get('documentation_canal'); ?>"></i></a>
696 696
                         <a href="<?php echo HELP_URL; ?>" target="_blank" class="text-info"><i class="fa-solid fa-life-ring mr-2 infotip" title="<?php echo $lang->get('admin_help'); ?>"></i></a>
697 697
                         <?php if ($session_user_admin === 1) : ?><i class="fa-solid fa-bug infotip pointer text-info" title="<?php echo $lang->get('bugs_page'); ?>" onclick="generateBugReport()"></i><?php endif; ?>
@@ -840,7 +840,7 @@  discard block
 block discarded – undo
840 840
                                 </div>
841 841
                                 <div class="mt-3">                                    
842 842
                                     <label>
843
-                                        <span class="mr-2 pointer fw-normal"><i class="fa-solid fa-eye mr-2 text-orange"></i><?php echo $lang->get('show_user_password');?></span>
843
+                                        <span class="mr-2 pointer fw-normal"><i class="fa-solid fa-eye mr-2 text-orange"></i><?php echo $lang->get('show_user_password'); ?></span>
844 844
                                         <input type="checkbox" id="dialog-admin-change-user-password-do-show-password" class="pointer">
845 845
                                     </label>
846 846
                                 </div>
@@ -999,34 +999,34 @@  discard block
 block discarded – undo
999 999
                     if ($get['page'] === 'items') {
1000 1000
                         // SHow page with Items
1001 1001
                         if ((int) $session_user_admin !== 1) {
1002
-                            include $SETTINGS['cpassman_dir'] . '/pages/items.php';
1002
+                            include $SETTINGS['cpassman_dir'].'/pages/items.php';
1003 1003
                         } elseif ((int) $session_user_admin === 1) {
1004
-                            include $SETTINGS['cpassman_dir'] . '/pages/admin.php';
1004
+                            include $SETTINGS['cpassman_dir'].'/pages/admin.php';
1005 1005
                         } else {
1006 1006
                             $session->set('system-error_code', ERR_NOT_ALLOWED);
1007 1007
                             //not allowed page
1008
-                            include $SETTINGS['cpassman_dir'] . '/error.php';
1008
+                            include $SETTINGS['cpassman_dir'].'/error.php';
1009 1009
                         }
1010 1010
                     } elseif (in_array($get['page'], array_keys($mngPages)) === true) {
1011 1011
                         // Define if user is allowed to see management pages
1012 1012
                         if ($session_user_admin === 1) {
1013 1013
                             // deepcode ignore FileInclusion: $get['page'] is secured through usage of array_keys test bellow
1014
-                            include $SETTINGS['cpassman_dir'] . '/pages/' . basename($mngPages[$get['page']]);
1014
+                            include $SETTINGS['cpassman_dir'].'/pages/'.basename($mngPages[$get['page']]);
1015 1015
                         } elseif ($session_user_manager === 1 || $session_user_human_resources === 1) {
1016 1016
                             if ($get['page'] === 'manage_main' || $get['page'] === 'manage_settings'
1017 1017
                             ) {
1018 1018
                                 $session->set('system-error_code', ERR_NOT_ALLOWED);
1019 1019
                                 //not allowed page
1020
-                                include $SETTINGS['cpassman_dir'] . '/error.php';
1020
+                                include $SETTINGS['cpassman_dir'].'/error.php';
1021 1021
                             }
1022 1022
                         } else {
1023 1023
                             $session->set('system-error_code', ERR_NOT_ALLOWED);
1024 1024
                             //not allowed page
1025
-                            include $SETTINGS['cpassman_dir'] . '/error.php';
1025
+                            include $SETTINGS['cpassman_dir'].'/error.php';
1026 1026
                         }
1027
-                    } elseif (empty($get['page']) === false && file_exists($SETTINGS['cpassman_dir'] . '/pages/' . $get['page'] . '.php') === true) {
1027
+                    } elseif (empty($get['page']) === false && file_exists($SETTINGS['cpassman_dir'].'/pages/'.$get['page'].'.php') === true) {
1028 1028
                         // deepcode ignore FileInclusion: $get['page'] is tested against file_exists just below
1029
-                        include $SETTINGS['cpassman_dir'] . '/pages/' . basename($get['page'] . '.php');
1029
+                        include $SETTINGS['cpassman_dir'].'/pages/'.basename($get['page'].'.php');
1030 1030
                     } else {
1031 1031
                         $session->set('system-array_roles', ERR_NOT_EXIST);
1032 1032
                         //page doesn't exist
@@ -1075,7 +1075,7 @@  discard block
 block discarded – undo
1075 1075
         echo '
1076 1076
 <input type="hidden" id="temps_restant" value="', $session->get('user-session_duration') ?? '', '" />';
1077 1077
 // display an item in the context of OTV link
1078
-} elseif ((null === $session->get('user-validite_pw')|| empty($session->get('user-validite_pw')) === true || empty($session->get('user-id')) === true)
1078
+} elseif ((null === $session->get('user-validite_pw') || empty($session->get('user-validite_pw')) === true || empty($session->get('user-id')) === true)
1079 1079
     && empty($get['otv']) === false
1080 1080
 ) {
1081 1081
     // case where one-shot viewer
@@ -1094,7 +1094,7 @@  discard block
 block discarded – undo
1094 1094
                 FILTER_SANITIZE_URL
1095 1095
             )
1096 1096
         );
1097
-        include $SETTINGS['cpassman_dir'] . '/error.php';
1097
+        include $SETTINGS['cpassman_dir'].'/error.php';
1098 1098
     }
1099 1099
 } elseif (//(empty($session->get('user-id')) === false && $session->get('user-id') !== null) ||
1100 1100
         empty($session->get('user-id')) === true
@@ -1126,7 +1126,7 @@  discard block
 block discarded – undo
1126 1126
     }
1127 1127
     
1128 1128
     // LOGIN form
1129
-    include $SETTINGS['cpassman_dir'] . '/includes/core/login.php';
1129
+    include $SETTINGS['cpassman_dir'].'/includes/core/login.php';
1130 1130
 } else {
1131 1131
     // Clear session
1132 1132
     $session->invalidate();
@@ -1345,65 +1345,65 @@  discard block
 block discarded – undo
1345 1345
 
1346 1346
 // Load links, css and javascripts
1347 1347
 if (isset($SETTINGS['cpassman_dir']) === true) {
1348
-    include_once $SETTINGS['cpassman_dir'] . '/includes/core/load.js.php';
1348
+    include_once $SETTINGS['cpassman_dir'].'/includes/core/load.js.php';
1349 1349
     if ($menuAdmin === true) {
1350
-        include_once $SETTINGS['cpassman_dir'] . '/pages/admin.js.php';
1350
+        include_once $SETTINGS['cpassman_dir'].'/pages/admin.js.php';
1351 1351
         if ($get['page'] === '2fa') {
1352
-            include_once $SETTINGS['cpassman_dir'] . '/pages/2fa.js.php';
1352
+            include_once $SETTINGS['cpassman_dir'].'/pages/2fa.js.php';
1353 1353
         } elseif ($get['page'] === 'api') {
1354
-            include_once $SETTINGS['cpassman_dir'] . '/pages/api.js.php';
1354
+            include_once $SETTINGS['cpassman_dir'].'/pages/api.js.php';
1355 1355
         } elseif ($get['page'] === 'backups') {
1356
-            include_once $SETTINGS['cpassman_dir'] . '/pages/backups.js.php';
1356
+            include_once $SETTINGS['cpassman_dir'].'/pages/backups.js.php';
1357 1357
         } elseif ($get['page'] === 'emails') {
1358
-            include_once $SETTINGS['cpassman_dir'] . '/pages/emails.js.php';
1358
+            include_once $SETTINGS['cpassman_dir'].'/pages/emails.js.php';
1359 1359
         } elseif ($get['page'] === 'ldap') {
1360
-            include_once $SETTINGS['cpassman_dir'] . '/pages/ldap.js.php';
1360
+            include_once $SETTINGS['cpassman_dir'].'/pages/ldap.js.php';
1361 1361
         } elseif ($get['page'] === 'uploads') {
1362
-            include_once $SETTINGS['cpassman_dir'] . '/pages/uploads.js.php';
1362
+            include_once $SETTINGS['cpassman_dir'].'/pages/uploads.js.php';
1363 1363
         } elseif ($get['page'] === 'fields') {
1364
-            include_once $SETTINGS['cpassman_dir'] . '/pages/fields.js.php';
1364
+            include_once $SETTINGS['cpassman_dir'].'/pages/fields.js.php';
1365 1365
         } elseif ($get['page'] === 'options') {
1366
-            include_once $SETTINGS['cpassman_dir'] . '/pages/options.js.php';
1366
+            include_once $SETTINGS['cpassman_dir'].'/pages/options.js.php';
1367 1367
         } elseif ($get['page'] === 'statistics') {
1368
-            include_once $SETTINGS['cpassman_dir'] . '/pages/statistics.js.php';
1368
+            include_once $SETTINGS['cpassman_dir'].'/pages/statistics.js.php';
1369 1369
         } elseif ($get['page'] === 'tasks') {
1370
-            include_once $SETTINGS['cpassman_dir'] . '/pages/tasks.js.php';
1370
+            include_once $SETTINGS['cpassman_dir'].'/pages/tasks.js.php';
1371 1371
         } elseif ($get['page'] === 'oauth' && WIP === true) {
1372
-            include_once $SETTINGS['cpassman_dir'] . '/pages/oauth.js.php';        
1372
+            include_once $SETTINGS['cpassman_dir'].'/pages/oauth.js.php';        
1373 1373
         } elseif ($get['page'] === 'tools') {
1374
-            include_once $SETTINGS['cpassman_dir'] . '/pages/tools.js.php';
1374
+            include_once $SETTINGS['cpassman_dir'].'/pages/tools.js.php';
1375 1375
         }
1376 1376
     } elseif (isset($get['page']) === true && $get['page'] !== '') {
1377 1377
         if ($get['page'] === 'items') {
1378
-            include_once $SETTINGS['cpassman_dir'] . '/pages/items.js.php';
1378
+            include_once $SETTINGS['cpassman_dir'].'/pages/items.js.php';
1379 1379
         } elseif ($get['page'] === 'import') {
1380
-            include_once $SETTINGS['cpassman_dir'] . '/pages/import.js.php';
1380
+            include_once $SETTINGS['cpassman_dir'].'/pages/import.js.php';
1381 1381
         } elseif ($get['page'] === 'export') {
1382
-            include_once $SETTINGS['cpassman_dir'] . '/pages/export.js.php';
1382
+            include_once $SETTINGS['cpassman_dir'].'/pages/export.js.php';
1383 1383
         } elseif ($get['page'] === 'offline') {
1384
-            include_once $SETTINGS['cpassman_dir'] . '/pages/offline.js.php';
1384
+            include_once $SETTINGS['cpassman_dir'].'/pages/offline.js.php';
1385 1385
         } elseif ($get['page'] === 'search') {
1386
-            include_once $SETTINGS['cpassman_dir'] . '/pages/search.js.php';
1386
+            include_once $SETTINGS['cpassman_dir'].'/pages/search.js.php';
1387 1387
         } elseif ($get['page'] === 'profile') {
1388
-            include_once $SETTINGS['cpassman_dir'] . '/pages/profile.js.php';
1388
+            include_once $SETTINGS['cpassman_dir'].'/pages/profile.js.php';
1389 1389
         } elseif ($get['page'] === 'favourites') {
1390
-            include_once $SETTINGS['cpassman_dir'] . '/pages/favorites.js.php';
1390
+            include_once $SETTINGS['cpassman_dir'].'/pages/favorites.js.php';
1391 1391
         } elseif ($get['page'] === 'folders') {
1392
-            include_once $SETTINGS['cpassman_dir'] . '/pages/folders.js.php';
1392
+            include_once $SETTINGS['cpassman_dir'].'/pages/folders.js.php';
1393 1393
         } elseif ($get['page'] === 'users') {
1394
-            include_once $SETTINGS['cpassman_dir'] . '/pages/users.js.php';
1394
+            include_once $SETTINGS['cpassman_dir'].'/pages/users.js.php';
1395 1395
         } elseif ($get['page'] === 'roles') {
1396
-            include_once $SETTINGS['cpassman_dir'] . '/pages/roles.js.php';
1396
+            include_once $SETTINGS['cpassman_dir'].'/pages/roles.js.php';
1397 1397
         } elseif ($get['page'] === 'utilities.deletion') {
1398
-            include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.deletion.js.php';
1398
+            include_once $SETTINGS['cpassman_dir'].'/pages/utilities.deletion.js.php';
1399 1399
         } elseif ($get['page'] === 'utilities.logs') {
1400
-            include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.logs.js.php';
1400
+            include_once $SETTINGS['cpassman_dir'].'/pages/utilities.logs.js.php';
1401 1401
         } elseif ($get['page'] === 'utilities.database') {
1402
-            include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.database.js.php';
1402
+            include_once $SETTINGS['cpassman_dir'].'/pages/utilities.database.js.php';
1403 1403
         } elseif ($get['page'] === 'utilities.renewal') {
1404
-            include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.renewal.js.php';
1404
+            include_once $SETTINGS['cpassman_dir'].'/pages/utilities.renewal.js.php';
1405 1405
         }
1406 1406
     } else {
1407
-        include_once $SETTINGS['cpassman_dir'] . '/includes/core/login.js.php';
1407
+        include_once $SETTINGS['cpassman_dir'].'/includes/core/login.js.php';
1408 1408
     }
1409 1409
 }
Please login to merge, or discard this patch.
includes/core/login.php 1 patch
Spacing   +39 added lines, -40 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 $postType = $request->query->get('post_type', '');
49 49
 $postType = filter_var($postType, FILTER_SANITIZE_SPECIAL_CHARS);
50 50
 $get['post_type'] = $postType;
51
-if (isset($SETTINGS['duo']) === true && (int) $SETTINGS['duo'] === 1 && $get['post_type'] === 'duo' ) {
51
+if (isset($SETTINGS['duo']) === true && (int) $SETTINGS['duo'] === 1 && $get['post_type'] === 'duo') {
52 52
     $get['duo_state'] = $request->query->get('state');
53 53
     $get['duo_code'] = $request->query->get('duo_code');
54 54
 }
@@ -72,8 +72,7 @@  discard block
 block discarded – undo
72 72
 <div class="login-box">
73 73
     <div class="login-logo"><div style="margin:30px;">',
74 74
     isset($SETTINGS['custom_logo']) === true && empty($SETTINGS['custom_logo']) === false ?
75
-        '<img src="' . (string) $SETTINGS['custom_logo'] . '" alt="" style="text-align:center; max-width:100px;" />' :
76
-        '<img src="includes/images/teampass-logo2-login.png" alt="Teampass Logo">',
75
+        '<img src="'.(string) $SETTINGS['custom_logo'].'" alt="" style="text-align:center; max-width:100px;" />' : '<img src="includes/images/teampass-logo2-login.png" alt="Teampass Logo">',
77 76
         '
78 77
         </div>
79 78
         <div style="font-weight:bold;">
@@ -93,14 +92,14 @@  discard block
 block discarded – undo
93 92
 
94 93
         <div class="card-body login-card-body1">
95 94
             <div class="input-group has-feedback mb-2">
96
-                <div class="input-group-prepend infotip" title="' . $lang->get('login') . '">
95
+                <div class="input-group-prepend infotip" title="' . $lang->get('login').'">
97 96
                     <span class="input-group-text"><i class="fa-solid fa-user fa-fw"></i></span>
98 97
                 </div>';
99 98
 if (
100 99
     isset($SETTINGS['enable_http_request_login']) === true
101 100
     && (int) $SETTINGS['enable_http_request_login'] === 1
102 101
     && $request->getUser() !== null
103
-    && ! (isset($SETTINGS['maintenance_mode']) === true
102
+    && !(isset($SETTINGS['maintenance_mode']) === true
104 103
         && (int) $SETTINGS['maintenance_mode'] === 1)
105 104
 ) {
106 105
     if (strpos($request->getUser(), '@') !== false) {
@@ -114,42 +113,42 @@  discard block
 block discarded – undo
114 113
             <input type="text" id="login" class="form-control" placeholder="', filter_var($username, FILTER_SANITIZE_FULL_SPECIAL_CHARS), '" readonly>';
115 114
 } else {
116 115
     echo '
117
-            <input type="text" id="login" class="form-control" placeholder="' . $lang->get('index_login') . '" value="'.(null !== $session->get('user-login') && empty($session->get('user-login')) === false ? filter_var($session->get('user-login'), FILTER_SANITIZE_FULL_SPECIAL_CHARS) : '').'">';
116
+            <input type="text" id="login" class="form-control" placeholder="' . $lang->get('index_login').'" value="'.(null !== $session->get('user-login') && empty($session->get('user-login')) === false ? filter_var($session->get('user-login'), FILTER_SANITIZE_FULL_SPECIAL_CHARS) : '').'">';
118 117
 }
119 118
 
120 119
 echo '
121 120
         </div>';
122
-if (! (isset($SETTINGS['enable_http_request_login']) === true
121
+if (!(isset($SETTINGS['enable_http_request_login']) === true
123 122
     && (int) $SETTINGS['enable_http_request_login'] === 1
124 123
     && $request->getUser() !== null
125
-    && ! (isset($SETTINGS['maintenance_mode']) === true
124
+    && !(isset($SETTINGS['maintenance_mode']) === true
126 125
         && (int) $SETTINGS['maintenance_mode'] === 1))) {
127 126
     echo '
128 127
         <div class="input-group has-feedback mb-2">
129
-            <div class="input-group-prepend infotip" title="' . $lang->get('password') . '">
128
+            <div class="input-group-prepend infotip" title="' . $lang->get('password').'">
130 129
                 <span class="input-group-text"><i class="fa-solid fa-lock fa-fw"></i></span>
131 130
             </div>
132
-            <input type="password" id="pw" class="form-control submit-button" placeholder="' . $lang->get('index_password') . '">
131
+            <input type="password" id="pw" class="form-control submit-button" placeholder="' . $lang->get('index_password').'">
133 132
         </div>';
134 133
 }
135 134
 
136 135
 echo '
137 136
         <div class="input-group has-feedback mb-2">
138
-            <div class="input-group-prepend infotip" title="' . $lang->get('session_expiration_in_minutes') . '">
137
+            <div class="input-group-prepend infotip" title="' . $lang->get('session_expiration_in_minutes').'">
139 138
                 <span class="input-group-text"><i class="fa-solid fa-clock fa-fw"></i></span>
140 139
             </div>
141 140
             <input type="text" id="session_duration" class="form-control submit-button" 
142
-            placeholder="' . $lang->get('index_session_duration') .'&nbsp;(' . $lang->get('minutes') . ')" 
141
+            placeholder="' . $lang->get('index_session_duration').'&nbsp;('.$lang->get('minutes').')" 
143 142
             value="', isset($SETTINGS['default_session_expiration_time']) === true ? $SETTINGS['default_session_expiration_time'] : '', '">
144 143
         </div>';
145 144
 // 2FA auth selector
146 145
 $mfaHtmlPart = '
147
-        <input type="hidden" id="2fa_user_selection" value="'.htmlspecialchars((isset($get['post_type']) === true && $get['post_type'] === 'duo') ? 'duo' : ''). '">
148
-        <input type="hidden" id="duo_code" value="'.htmlspecialchars(isset($get['duo_code']) === true && is_null($get['duo_code']) === false ? $get['duo_code'] : ''). '">
149
-        <input type="hidden" id="duo_state" value="'.htmlspecialchars(isset($get['duo_state']) === true && is_null($get['duo_state']) === false ? $get['duo_state'] : ''). '">
146
+        <input type="hidden" id="2fa_user_selection" value="'.htmlspecialchars((isset($get['post_type']) === true && $get['post_type'] === 'duo') ? 'duo' : '').'">
147
+        <input type="hidden" id="duo_code" value="'.htmlspecialchars(isset($get['duo_code']) === true && is_null($get['duo_code']) === false ? $get['duo_code'] : '').'">
148
+        <input type="hidden" id="duo_state" value="'.htmlspecialchars(isset($get['duo_state']) === true && is_null($get['duo_state']) === false ? $get['duo_state'] : '').'">
150 149
         <div class="row mb-3 hidden" id="2fa_methods_selector">
151 150
             <div class="col-12">
152
-                <h8 class="login-box-msg">' . $lang->get('2fa_authentication_selector') . '</h8>
151
+                <h8 class="login-box-msg">' . $lang->get('2fa_authentication_selector').'</h8>
153 152
                 <div class="2fa-methods text-center mt-2">'.
154 153
                 (isset($SETTINGS['google_authentication']) === true && (int) $SETTINGS['google_authentication'] === 1 ?
155 154
         '
@@ -182,14 +181,14 @@  discard block
 block discarded – undo
182 181
     echo '
183 182
         <div id="div-2fa-google" class="mb-3 div-2fa-method hidden">
184 183
             <div class="input-group has-feedback mb-2">
185
-                <div class="input-group-prepend infotip" title="' . $lang->get('mfa_unique_code') . '">
184
+                <div class="input-group-prepend infotip" title="' . $lang->get('mfa_unique_code').'">
186 185
                     <span class="input-group-text"><i class="fa-solid fa-key fa-fw"></i></span>
187 186
                 </div>
188
-                <input type="text" id="ga_code" class="form-control submit-button" placeholder="' . $lang->get('ga_identification_code') . '" />
187
+                <input type="text" id="ga_code" class="form-control submit-button" placeholder="' . $lang->get('ga_identification_code').'" />
189 188
                 <span class="input-group-append">
190 189
                     <button type="button" class="btn btn-info btn-flat" onclick="send_user_new_temporary_ga_code()">
191 190
                         <i class="fa-solid fa-envelope form-control-feedback pointer infotip" 
192
-                    title="' . $lang->get('i_need_to_generate_new_ga_code') . '"></i>
191
+                    title="' . $lang->get('i_need_to_generate_new_ga_code').'"></i>
193 192
                     </button>
194 193
                 </span>
195 194
             </div>
@@ -207,7 +206,7 @@  discard block
 block discarded – undo
207 206
 <script>
208 207
 var seconds = 1;
209 208
 function updateLogonButton(timeToGo){
210
-    document.getElementById("but_identify_user").value = "' . $lang->get('duration_login_attempt') . ' " + timeToGo;
209
+    document.getElementById("but_identify_user").value = "' . $lang->get('duration_login_attempt').' " + timeToGo;
211 210
 }
212 211
 $( window ).on( "load", function() {
213 212
     updateLogonButton(seconds);
@@ -216,7 +215,7 @@  discard block
 block discarded – undo
216 215
         if (seconds >= 0) {
217 216
             updateLogonButton(seconds);
218 217
         } else if(seconds === 0) {
219
-            launchIdentify("", "' . $nextUrl . '");
218
+            launchIdentify("", "' . $nextUrl.'");
220 219
         }
221 220
         updateLogonButton(seconds);
222 221
     },
@@ -237,15 +236,15 @@  discard block
 block discarded – undo
237 236
             <div class="col-8">
238 237
                 <div id="yubiko-new-key" class="alert alert-info hidden">
239 238
                     <p>
240
-                        <input type="text" size="10" id="yubico_user_id" class="form-control" placeholder="' . $lang->get('yubico_user_id') . '">
239
+                        <input type="text" size="10" id="yubico_user_id" class="form-control" placeholder="' . $lang->get('yubico_user_id').'">
241 240
                     </p>
242 241
                     <p>
243
-                    <input type="text" size="10" id="yubico_user_key" class="form-control" placeholder="' . $lang->get('yubico_user_key') . '">
242
+                    <input type="text" size="10" id="yubico_user_key" class="form-control" placeholder="' . $lang->get('yubico_user_key').'">
244 243
                     </p>
245 244
                 </div>
246
-                <input autocomplete="off" type="text" id="yubico_key" class="form-control submit-button" placeholder="' . $lang->get('press_your_yubico_key') . '">
245
+                <input autocomplete="off" type="text" id="yubico_key" class="form-control submit-button" placeholder="' . $lang->get('press_your_yubico_key').'">
247 246
                 <div class="row">
248
-                    <span class="ml-2 mt-1 font-weight-light small pointer" id="register-yubiko-key">' . $lang->get('register_new_yubiko_key') . '</span>
247
+                    <span class="ml-2 mt-1 font-weight-light small pointer" id="register-yubiko-key">' . $lang->get('register_new_yubiko_key').'</span>
249 248
                 </div>
250 249
             </div>
251 250
         </div>';
@@ -254,22 +253,22 @@  discard block
 block discarded – undo
254 253
 echo '
255 254
         <div class="row mt-5">
256 255
             <div class="col-12">
257
-                <button id="but_identify_user" class="btn btn-primary btn-block">' . $lang->get('log_in') . '</button>
256
+                <button id="but_identify_user" class="btn btn-primary btn-block">' . $lang->get('log_in').'</button>
258 257
                 
259 258
                 <!-- In case of upgrade, the user has to provide his One Time Code -->
260 259
                 <div class="card-body user-one-time-code-card-body hidden">
261
-                    <h5 class="login-box-msg">' . $lang->get('provide_personal_one_time_code') . '</h5>
260
+                    <h5 class="login-box-msg">' . $lang->get('provide_personal_one_time_code').'</h5>
262 261
 
263 262
                     <div class="input-group has-feedback mb-2 mt-4">
264 263
                         <div class="input-group-prepend">
265 264
                             <span class="input-group-text"><i class="fa-solid fa-unlock-alt"></i></span>
266 265
                         </div>
267
-                        <input type="password" id="user-one-time-code" class="form-control" placeholder="' . $lang->get('one_time_code') . '">
266
+                        <input type="password" id="user-one-time-code" class="form-control" placeholder="' . $lang->get('one_time_code').'">
268 267
                     </div>
269 268
 
270 269
                     <div class="row mb-3">
271 270
                         <div class="col-12">
272
-                            <button id="but_confirm_otc" class="btn btn-primary btn-block">' . $lang->get('confirm') . '</button>
271
+                            <button id="but_confirm_otc" class="btn btn-primary btn-block">' . $lang->get('confirm').'</button>
273 272
                         </div>
274 273
                     </div>
275 274
                 </div>
@@ -284,7 +283,7 @@  discard block
 block discarded – undo
284 283
         <hr class="mt-3 mb-3"/>
285 284
         <div class="row mb-2">
286 285
             <div class="col-12">
287
-                <button id="but_login_with_sso" class="btn btn-primary btn-block">' . $SETTINGS['oauth2_client_appname'] . '</button>
286
+                <button id="but_login_with_sso" class="btn btn-primary btn-block">' . $SETTINGS['oauth2_client_appname'].'</button>
288 287
             </div>
289 288
         </div>';
290 289
 }
@@ -297,10 +296,10 @@  discard block
 block discarded – undo
297 296
 // In case of password change
298 297
 echo '
299 298
     <div class="card-body confirm-password-card-body hidden">
300
-        <h5 class="login-box-msg">' . $lang->get('new_password_required') . '</h5>
299
+        <h5 class="login-box-msg">' . $lang->get('new_password_required').'</h5>
301 300
 
302 301
         <div class="alert alert-info">
303
-            <div class="text-center"><i class="icon fa fa-info"></i>' . $lang->get('password_strength') . '
302
+            <div class="text-center"><i class="icon fa fa-info"></i>' . $lang->get('password_strength').'
304 303
             <span id="confirm-password-level" class="ml-2 font-weight-bold"></span></div>
305 304
         </div>
306 305
 
@@ -310,20 +309,20 @@  discard block
 block discarded – undo
310 309
                     <div class="input-group-prepend">
311 310
                         <span class="input-group-text"><i class="fas fa-key"></i></span>
312 311
                     </div>
313
-                    <input type="password" id="current-user-password" class="form-control" placeholder="' . $lang->get('current_password') . '">
312
+                    <input type="password" id="current-user-password" class="form-control" placeholder="' . $lang->get('current_password').'">
314 313
                 </div>
315 314
             </div>
316 315
             <div class="input-group has-feedback mb-2 mt-4">
317 316
                 <div class="input-group-prepend">
318 317
                     <span class="input-group-text"><i class="fas fa-key"></i></span>
319 318
                 </div>
320
-                <input type="password" id="new-user-password" class="form-control" placeholder="' . $lang->get('index_new_pw') . '">
319
+                <input type="password" id="new-user-password" class="form-control" placeholder="' . $lang->get('index_new_pw').'">
321 320
             </div>
322 321
             <div class="input-group has-feedback mb-2">
323 322
                 <div class="input-group-prepend">
324 323
                     <span class="input-group-text"><i class="fas fa-key"></i></span>
325 324
                 </div>
326
-                <input type="password" id="new-user-password-confirm" class="form-control" placeholder="' . $lang->get('index_change_pw_confirmation') . '">
325
+                <input type="password" id="new-user-password-confirm" class="form-control" placeholder="' . $lang->get('index_change_pw_confirmation').'">
327 326
             </div>
328 327
             <div class="row mb-3">
329 328
                 <div class="col-md-12 offset-sm-4 text-center">
@@ -334,7 +333,7 @@  discard block
 block discarded – undo
334 333
             </div>
335 334
             <div class="row mb-3">
336 335
                 <div class="col-12">
337
-                    <button id="but_confirm_new_password" class="btn btn-primary btn-block">' . $lang->get('confirm') . '</button>
336
+                    <button id="but_confirm_new_password" class="btn btn-primary btn-block">' . $lang->get('confirm').'</button>
338 337
                 </div>
339 338
             </div>
340 339
         </div>
@@ -342,20 +341,20 @@  discard block
 block discarded – undo
342 341
 
343 342
     <div class="card-body hidden" id="card-user-treat-psk">
344 343
         <div class="alert alert-info">
345
-            <div class="text-center"><i class="icon fa fa-info"></i>' . $lang->get('user_has_psk_info') . '</div>
344
+            <div class="text-center"><i class="icon fa fa-info"></i>' . $lang->get('user_has_psk_info').'</div>
346 345
         </div>
347 346
         <div class="input-group has-feedback mb-2">
348 347
             <div class="input-group-prepend">
349 348
                 <span class="input-group-text"><i class="fas fa-key"></i></span>
350 349
             </div>
351
-            <input type="password" id="user-old-defuse-psk" class="form-control" placeholder="' . $lang->get('home_personal_saltkey') . '">
350
+            <input type="password" id="user-old-defuse-psk" class="form-control" placeholder="' . $lang->get('home_personal_saltkey').'">
352 351
         </div>
353 352
         <div class="row mb-3 mt-4">
354 353
             <div class="col-12">
355
-                <button id="but_confirm_defuse_psk" class="btn btn-primary btn-block">' . $lang->get('launch') . '</button>
354
+                <button id="but_confirm_defuse_psk" class="btn btn-primary btn-block">' . $lang->get('launch').'</button>
356 355
             </div>
357 356
             <div class="col-12 mt-3">
358
-                <button id="but_confirm_forgot_defuse_psk" class="btn btn-danger btn-block text-bold">' . $lang->get('i_cannot_remember') . '</button>
357
+                <button id="but_confirm_forgot_defuse_psk" class="btn btn-danger btn-block text-bold">' . $lang->get('i_cannot_remember').'</button>
359 358
             </div>
360 359
         </div>
361 360
     </div>
Please login to merge, or discard this patch.