Passed
Pull Request — master (#4676)
by Nils
10:05 queued 03:59
created
includes/language/english.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,8 +28,8 @@
 block discarded – undo
28 28
  * @see       https://www.teampass.net
29 29
  */
30 30
 
31
- // TO REMOVE
32
- // - selected_items_to_be_imported
31
+    // TO REMOVE
32
+    // - selected_items_to_be_imported
33 33
 
34 34
 return array(
35 35
     'max_parallel_tasks' => 'Maximum number of parallel tasks',
Please login to merge, or discard this patch.
sources/items.queries.php 2 patches
Spacing   +280 added lines, -281 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 ) {
80 80
     // Not allowed page
81 81
     $session->set('system-error_code', ERR_NOT_ALLOWED);
82
-    include $SETTINGS['cpassman_dir'] . '/error.php';
82
+    include $SETTINGS['cpassman_dir'].'/error.php';
83 83
     exit;
84 84
 }
85 85
 
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
     date_default_timezone_set('UTC');
105 105
 }
106 106
 
107
-require_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $session->get('user-language') . '.php';
107
+require_once $SETTINGS['cpassman_dir'].'/includes/language/'.$session->get('user-language').'.php';
108 108
 header('Content-type: text/html; charset=utf-8');
109 109
 header('Cache-Control: no-cache, must-revalidate');
110 110
 
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
             // About special settings
365 365
             $dataFolderSettings = DB::queryFirstRow(
366 366
                 'SELECT bloquer_creation, bloquer_modification, personal_folder
367
-                FROM ' . prefixTable('nested_tree') . ' 
367
+                FROM ' . prefixTable('nested_tree').' 
368 368
                 WHERE id = %i',
369 369
                 $inputData['folderId']
370 370
             );
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
             // Get folder complexity
382 382
             $folderComplexity = DB::queryfirstrow(
383 383
                 'SELECT valeur
384
-                FROM ' . prefixTable('misc') . '
384
+                FROM ' . prefixTable('misc').'
385 385
                 WHERE type = %s AND intitule = %i',
386 386
                 'complex',
387 387
                 $inputData['folderId']
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
             $itemExists = 0;
407 407
             $newID = '';
408 408
             $data = DB::queryfirstrow(
409
-                'SELECT * FROM ' . prefixTable('items') . '
409
+                'SELECT * FROM '.prefixTable('items').'
410 410
                 WHERE label = %s AND inactif = %i',
411 411
                 $inputData['label'],
412 412
                 0
@@ -489,8 +489,8 @@  discard block
 block discarded – undo
489 489
                     (int) $post_folder_is_personal,
490 490
                     (int) $newID,
491 491
                     $cryptedStuff['objectKey'],
492
-                    true,   // only for the item creator
493
-                    false,  // no delete all
492
+                    true, // only for the item creator
493
+                    false, // no delete all
494 494
                 );
495 495
 
496 496
                 // update fields
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
                             // should we encrypt the data
504 504
                             $dataTmp = DB::queryFirstRow(
505 505
                                 'SELECT encrypted_data
506
-                                FROM ' . prefixTable('categories') . '
506
+                                FROM ' . prefixTable('categories').'
507 507
                                 WHERE id = %i',
508 508
                                 $field['id']
509 509
                             );
@@ -532,8 +532,8 @@  discard block
 block discarded – undo
532 532
                                     (int) $post_folder_is_personal,
533 533
                                     (int) $newObjectId,
534 534
                                     $cryptedStuff['objectKey'],
535
-                                    true,   // only for the item creator
536
-                                    false,  // no delete all
535
+                                    true, // only for the item creator
536
+                                    false, // no delete all
537 537
                                 );
538 538
 
539 539
                                 array_push(
@@ -570,7 +570,7 @@  discard block
 block discarded – undo
570 570
                 ) {
571 571
                     DB::queryFirstRow(
572 572
                         'SELECT *
573
-                        FROM ' . prefixTable('templates') . '
573
+                        FROM ' . prefixTable('templates').'
574 574
                         WHERE item_id = %i',
575 575
                         $newID
576 576
                     );
@@ -639,11 +639,11 @@  discard block
 block discarded – undo
639 639
                 ) {
640 640
                     foreach ($post_restricted_to as $userRest) {
641 641
                         if (empty($userRest) === false) {
642
-                            $dataTmp = DB::queryfirstrow('SELECT login FROM ' . prefixTable('users') . ' WHERE id= %i', $userRest);
642
+                            $dataTmp = DB::queryfirstrow('SELECT login FROM '.prefixTable('users').' WHERE id= %i', $userRest);
643 643
                             if (empty($listOfRestricted)) {
644 644
                                 $listOfRestricted = $dataTmp['login'];
645 645
                             } else {
646
-                                $listOfRestricted .= ';' . $dataTmp['login'];
646
+                                $listOfRestricted .= ';'.$dataTmp['login'];
647 647
                             }
648 648
                         }
649 649
                     }
@@ -659,7 +659,7 @@  discard block
 block discarded – undo
659 659
                             if (empty($userRest) === false) {
660 660
                                 $dataTmp = DB::queryfirstrow(
661 661
                                     'SELECT login
662
-                                    FROM ' . prefixTable('users') . '
662
+                                    FROM ' . prefixTable('users').'
663 663
                                     WHERE id= %i',
664 664
                                     $userRest
665 665
                                 );
@@ -667,7 +667,7 @@  discard block
 block discarded – undo
667 667
                                 if (empty($oldRestrictionList) === true) {
668 668
                                     $oldRestrictionList = $dataTmp['login'];
669 669
                                 } else {
670
-                                    $oldRestrictionList .= ';' . $dataTmp['login'];
670
+                                    $oldRestrictionList .= ';'.$dataTmp['login'];
671 671
                                 }
672 672
                             }
673 673
                         }
@@ -730,7 +730,7 @@  discard block
 block discarded – undo
730 730
                 if (empty($post_uploaded_file_id) === false) {
731 731
                     $rows = DB::query(
732 732
                         'SELECT id
733
-                        FROM ' . prefixTable('files') . '
733
+                        FROM ' . prefixTable('files').'
734 734
                         WHERE id_item = %s',
735 735
                         $post_uploaded_file_id
736 736
                     );
@@ -786,7 +786,7 @@  discard block
 block discarded – undo
786 786
                                     $lang->get('email_subject_item_updated'),
787 787
                                     str_replace(
788 788
                                         array('#label', '#link'),
789
-                                            array($path, $SETTINGS['email_server_url'] . '/index.php?page=items&group=' . $inputData['folderId'] . '&id=' . $newID . $txt['email_body3']),
789
+                                            array($path, $SETTINGS['email_server_url'].'/index.php?page=items&group='.$inputData['folderId'].'&id='.$newID.$txt['email_body3']),
790 790
                                             $lang->get('new_item_email_body')
791 791
                                     ),
792 792
                                     $emailAddress,
@@ -890,11 +890,11 @@  discard block
 block discarded – undo
890 890
         // Prepare variables
891 891
         $itemInfos = array();
892 892
         $inputData['label'] = isset($dataReceived['label']) && is_string($dataReceived['label']) ? filter_var($dataReceived['label'], FILTER_SANITIZE_FULL_SPECIAL_CHARS) : '';
893
-        $post_url = isset($dataReceived['url'])=== true ? filter_var(htmlspecialchars_decode($dataReceived['url']), FILTER_SANITIZE_URL) : '';
893
+        $post_url = isset($dataReceived['url']) === true ? filter_var(htmlspecialchars_decode($dataReceived['url']), FILTER_SANITIZE_URL) : '';
894 894
         $post_password = $original_pw = isset($dataReceived['pw']) && is_string($dataReceived['pw']) ? htmlspecialchars_decode($dataReceived['pw']) : '';
895 895
         $post_login = isset($dataReceived['login']) && is_string($dataReceived['login']) ? filter_var(htmlspecialchars_decode($dataReceived['login']), FILTER_SANITIZE_FULL_SPECIAL_CHARS) : '';
896
-        $post_tags = isset($dataReceived['tags'])=== true ? htmlspecialchars($dataReceived['tags']) : '';
897
-        $post_email = isset($dataReceived['email'])=== true ? filter_var(htmlspecialchars_decode($dataReceived['email']), FILTER_SANITIZE_EMAIL) : '';
896
+        $post_tags = isset($dataReceived['tags']) === true ? htmlspecialchars($dataReceived['tags']) : '';
897
+        $post_email = isset($dataReceived['email']) === true ? filter_var(htmlspecialchars_decode($dataReceived['email']), FILTER_SANITIZE_EMAIL) : '';
898 898
         $post_template_id = (int) filter_var($dataReceived['template_id'], FILTER_SANITIZE_NUMBER_INT);
899 899
         $inputData['itemId'] = (int) filter_var($dataReceived['id'], FILTER_SANITIZE_NUMBER_INT);
900 900
         $post_anyone_can_modify = (int) filter_var($dataReceived['anyone_can_modify'], FILTER_SANITIZE_NUMBER_INT);
@@ -925,8 +925,7 @@  discard block
 block discarded – undo
925 925
         $post_to_be_deleted_after_date = isset($dataReceived['to_be_deleted_after_date']) === true ? filter_var(
926 926
                 $dataReceived['to_be_deleted_after_date'],
927 927
                 FILTER_SANITIZE_FULL_SPECIAL_CHARS
928
-            ) :
929
-            '';
928
+            ) : '';
930 929
         $post_fields = (filter_var_array(
931 930
             $dataReceived['fields'],
932 931
             FILTER_SANITIZE_FULL_SPECIAL_CHARS
@@ -986,7 +985,7 @@  discard block
 block discarded – undo
986 985
         // About special settings
987 986
         $dataFolderSettings = DB::queryFirstRow(
988 987
             'SELECT bloquer_creation, bloquer_modification, personal_folder, title
989
-            FROM ' . prefixTable('nested_tree') . ' 
988
+            FROM ' . prefixTable('nested_tree').' 
990 989
             WHERE id = %i',
991 990
             $inputData['folderId']
992 991
         );
@@ -1002,7 +1001,7 @@  discard block
 block discarded – undo
1002 1001
         // Get folder complexity
1003 1002
         $folderComplexity = DB::queryfirstrow(
1004 1003
             'SELECT valeur
1005
-            FROM ' . prefixTable('misc') . '
1004
+            FROM ' . prefixTable('misc').'
1006 1005
             WHERE type = %s AND intitule = %i',
1007 1006
             'complex',
1008 1007
             $inputData['folderId']
@@ -1047,8 +1046,8 @@  discard block
 block discarded – undo
1047 1046
         // Get all informations for this item
1048 1047
         $dataItem = DB::queryfirstrow(
1049 1048
             'SELECT *
1050
-            FROM ' . prefixTable('items') . ' as i
1051
-            INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id)
1049
+            FROM ' . prefixTable('items').' as i
1050
+            INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id)
1052 1051
             WHERE i.id=%i AND l.action = %s',
1053 1052
             $inputData['itemId'],
1054 1053
             'at_creation'
@@ -1097,7 +1096,7 @@  discard block
 block discarded – undo
1097 1096
         //db::debugmode(true);
1098 1097
         DB::query(
1099 1098
             'SELECT *
1100
-            FROM ' . prefixTable('sharekeys_items') . '
1099
+            FROM ' . prefixTable('sharekeys_items').'
1101 1100
             WHERE object_id = %i AND user_id = %s',
1102 1101
             $inputData['itemId'],
1103 1102
             $session->get('user-id')
@@ -1149,9 +1148,9 @@  discard block
 block discarded – undo
1149 1148
                 'SELECT i.id as id, i.label as label, i.description as description, i.pw as pw, i.url as url, i.id_tree as id_tree, i.perso as perso, i.login as login, 
1150 1149
                 i.inactif as inactif, i.restricted_to as restricted_to, i.anyone_can_modify as anyone_can_modify, i.email as email, i.notification as notification,
1151 1150
                 u.login as user_login, u.email as user_email
1152
-                FROM ' . prefixTable('items') . ' as i
1153
-                INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id=l.id_item)
1154
-                INNER JOIN ' . prefixTable('users') . ' as u ON (u.id=l.id_user)
1151
+                FROM ' . prefixTable('items').' as i
1152
+                INNER JOIN ' . prefixTable('log_items').' as l ON (i.id=l.id_item)
1153
+                INNER JOIN ' . prefixTable('users').' as u ON (u.id=l.id_user)
1155 1154
                 WHERE i.id=%i',
1156 1155
                 $inputData['itemId']
1157 1156
             );
@@ -1159,7 +1158,7 @@  discard block
 block discarded – undo
1159 1158
             // Should we log a password change?
1160 1159
             $userKey = DB::queryFirstRow(
1161 1160
                 'SELECT share_key
1162
-                FROM ' . prefixTable('sharekeys_items') . '
1161
+                FROM ' . prefixTable('sharekeys_items').'
1163 1162
                 WHERE user_id = %i AND object_id = %i',
1164 1163
                 $session->get('user-id'),
1165 1164
                 $inputData['itemId']
@@ -1223,12 +1222,12 @@  discard block
 block discarded – undo
1223 1222
                     (int) $post_folder_is_personal,
1224 1223
                     (int) $inputData['itemId'],
1225 1224
                     $encrypted_password_key,
1226
-                    true,   // only for the item creator
1227
-                    true,   // delete all
1225
+                    true, // only for the item creator
1226
+                    true, // delete all
1228 1227
                 );
1229 1228
 
1230 1229
                 // Create a task to create sharekeys for users
1231
-                if (WIP=== true) error_log('createTaskForItem - new password for this item - '.$post_password ." -- ". $pw);
1230
+                if (WIP === true) error_log('createTaskForItem - new password for this item - '.$post_password." -- ".$pw);
1232 1231
                 $tasksToBePerformed = ['item_password'];
1233 1232
                 $encryptionTaskIsRequested = true;
1234 1233
             } else {
@@ -1239,7 +1238,7 @@  discard block
 block discarded – undo
1239 1238
             // Get list of tags
1240 1239
             $itemTags = DB::queryFirstColumn(
1241 1240
                 'SELECT tag
1242
-                FROM ' . prefixTable('tags') . '
1241
+                FROM ' . prefixTable('tags').'
1243 1242
                 WHERE item_id = %i',
1244 1243
                 $inputData['itemId']
1245 1244
             );
@@ -1285,7 +1284,7 @@  discard block
 block discarded – undo
1285 1284
                     $session->get('user-id'),
1286 1285
                     'at_modification',
1287 1286
                     $session->get('user-login'),
1288
-                    'at_tag : ' . implode(' ', $itemTags) . ' => ' . $post_tags
1287
+                    'at_tag : '.implode(' ', $itemTags).' => '.$post_tags
1289 1288
                 );
1290 1289
             }
1291 1290
 
@@ -1325,8 +1324,8 @@  discard block
 block discarded – undo
1325 1324
                             'SELECT c.id AS id, c.title AS title, i.data AS data, i.data_iv AS data_iv,
1326 1325
                             i.encryption_type AS encryption_type, c.encrypted_data AS encrypted_data,
1327 1326
                             c.masked AS masked, i.id AS field_item_id
1328
-                            FROM ' . prefixTable('categories_items') . ' AS i
1329
-                            INNER JOIN ' . prefixTable('categories') . ' AS c ON (i.field_id=c.id)
1327
+                            FROM ' . prefixTable('categories_items').' AS i
1328
+                            INNER JOIN ' . prefixTable('categories').' AS c ON (i.field_id=c.id)
1330 1329
                             WHERE i.field_id = %i AND i.item_id = %i',
1331 1330
                             $field['id'],
1332 1331
                             $inputData['itemId']
@@ -1342,7 +1341,7 @@  discard block
 block discarded – undo
1342 1341
                             // Perform new query
1343 1342
                             $dataTmpCat = DB::queryFirstRow(
1344 1343
                                 'SELECT id, title, encrypted_data, masked
1345
-                                FROM ' . prefixTable('categories') . '
1344
+                                FROM ' . prefixTable('categories').'
1346 1345
                                 WHERE id = %i',
1347 1346
                                 $field['id']
1348 1347
                             );
@@ -1372,8 +1371,8 @@  discard block
 block discarded – undo
1372 1371
                                     (int) $post_folder_is_personal,
1373 1372
                                     (int) $newId,
1374 1373
                                     $cryptedStuff['objectKey'],
1375
-                                    true,   // only for the item creator
1376
-                                    true,   // delete all
1374
+                                    true, // only for the item creator
1375
+                                    true, // delete all
1377 1376
                                 );
1378 1377
 
1379 1378
                                 // update value
@@ -1423,7 +1422,7 @@  discard block
 block discarded – undo
1423 1422
                                 $session->get('user-id'),
1424 1423
                                 'at_modification',
1425 1424
                                 $session->get('user-login'),
1426
-                                'at_field : ' . $dataTmpCat['title'] . ' : ' . $field['value']
1425
+                                'at_field : '.$dataTmpCat['title'].' : '.$field['value']
1427 1426
                             );
1428 1427
                         } else {
1429 1428
                             // Case where the field already exists
@@ -1432,7 +1431,7 @@  discard block
 block discarded – undo
1432 1431
                                 // Get user sharekey for this field
1433 1432
                                 $userKey = DB::queryFirstRow(
1434 1433
                                     'SELECT share_key
1435
-                                    FROM ' . prefixTable('sharekeys_fields') . '
1434
+                                    FROM ' . prefixTable('sharekeys_fields').'
1436 1435
                                     WHERE user_id = %i AND object_id = %i',
1437 1436
                                     $session->get('user-id'),
1438 1437
                                     $dataTmpCat['field_item_id']
@@ -1471,8 +1470,8 @@  discard block
 block discarded – undo
1471 1470
                                         (int) $post_folder_is_personal,
1472 1471
                                         (int) $dataTmpCat['field_item_id'],
1473 1472
                                         $cryptedStuff['objectKey'],
1474
-                                        true,   // only for the item creator
1475
-                                        true,   // delete all
1473
+                                        true, // only for the item creator
1474
+                                        true, // delete all
1476 1475
                                     );
1477 1476
 
1478 1477
                                     if ($encryptedFieldIsChanged === false) {
@@ -1514,7 +1513,7 @@  discard block
 block discarded – undo
1514 1513
                                     $session->get('user-id'),
1515 1514
                                     'at_modification',
1516 1515
                                     $session->get('user-login'),
1517
-                                    'at_field : ' . $dataTmpCat['title'] . ' => ' . $oldVal
1516
+                                    'at_field : '.$dataTmpCat['title'].' => '.$oldVal
1518 1517
                                 );
1519 1518
                             }
1520 1519
                         }
@@ -1569,7 +1568,7 @@  discard block
 block discarded – undo
1569 1568
             ) {
1570 1569
                 DB::queryFirstRow(
1571 1570
                     'SELECT *
1572
-                    FROM ' . prefixTable('templates') . '
1571
+                    FROM ' . prefixTable('templates').'
1573 1572
                     WHERE item_id = %i',
1574 1573
                     $inputData['itemId']
1575 1574
                 );
@@ -1612,7 +1611,7 @@  discard block
 block discarded – undo
1612 1611
                 // check if elem exists in Table. If not add it or update it.
1613 1612
                 DB::query(
1614 1613
                     'SELECT *
1615
-                    FROM ' . prefixTable('automatic_del') . '
1614
+                    FROM ' . prefixTable('automatic_del').'
1616 1615
                     WHERE item_id = %i',
1617 1616
                     $inputData['itemId']
1618 1617
                 );
@@ -1639,7 +1638,7 @@  discard block
 block discarded – undo
1639 1638
                         // Store updates performed
1640 1639
                         array_push(
1641 1640
                             $arrayOfChanges,
1642
-                            $lang->get('automatic_deletion_engaged') . ': ' . $lang->get('enabled')
1641
+                            $lang->get('automatic_deletion_engaged').': '.$lang->get('enabled')
1643 1642
                         );
1644 1643
 
1645 1644
                         // update LOG
@@ -1682,7 +1681,7 @@  discard block
 block discarded – undo
1682 1681
                         // Store updates performed
1683 1682
                         array_push(
1684 1683
                             $arrayOfChanges,
1685
-                            $lang->get('automatic_deletion_engaged') . ': ' . $lang->get('disabled')
1684
+                            $lang->get('automatic_deletion_engaged').': '.$lang->get('disabled')
1686 1685
                         );
1687 1686
 
1688 1687
                         // update LOG
@@ -1715,7 +1714,7 @@  discard block
 block discarded – undo
1715 1714
                     if (empty($userId) === false) {
1716 1715
                         $dataTmp = DB::queryfirstrow(
1717 1716
                             'SELECT id, name, lastname
1718
-                            FROM ' . prefixTable('users') . '
1717
+                            FROM ' . prefixTable('users').'
1719 1718
                             WHERE id= %i',
1720 1719
                             $userId
1721 1720
                         );
@@ -1723,7 +1722,7 @@  discard block
 block discarded – undo
1723 1722
                         // Add to array
1724 1723
                         array_push(
1725 1724
                             $arrayOfUsersRestriction,
1726
-                            $dataTmp['name'] . ' ' . $dataTmp['lastname']
1725
+                            $dataTmp['name'].' '.$dataTmp['lastname']
1727 1726
                         );
1728 1727
                         array_push(
1729 1728
                             $arrayOfUsersIdRestriction,
@@ -1754,8 +1753,8 @@  discard block
 block discarded – undo
1754 1753
                 // get values before deleting them
1755 1754
                 $rows = DB::query(
1756 1755
                     'SELECT t.title, t.id AS id
1757
-                    FROM ' . prefixTable('roles_title') . ' as t
1758
-                    INNER JOIN ' . prefixTable('restriction_to_roles') . ' as r ON (t.id=r.role_id)
1756
+                    FROM ' . prefixTable('roles_title').' as t
1757
+                    INNER JOIN ' . prefixTable('restriction_to_roles').' as r ON (t.id=r.role_id)
1759 1758
                     WHERE r.item_id = %i
1760 1759
                     ORDER BY t.title ASC',
1761 1760
                     $inputData['itemId']
@@ -1789,7 +1788,7 @@  discard block
 block discarded – undo
1789 1788
                         );
1790 1789
                         $dataTmp = DB::queryfirstrow(
1791 1790
                             'SELECT title
1792
-                            FROM ' . prefixTable('roles_title') . '
1791
+                            FROM ' . prefixTable('roles_title').'
1793 1792
                             WHERE id = %i',
1794 1793
                             $role
1795 1794
                         );
@@ -1817,7 +1816,7 @@  discard block
 block discarded – undo
1817 1816
             // Get current status
1818 1817
             $otpStatus = DB::queryFirstRow(
1819 1818
                 'SELECT enabled as otp_is_enabled
1820
-                FROM ' . prefixTable('items_otp') . '
1819
+                FROM ' . prefixTable('items_otp').'
1821 1820
                 WHERE item_id = %i',
1822 1821
                 $inputData['itemId']
1823 1822
             );
@@ -1848,7 +1847,7 @@  discard block
 block discarded – undo
1848 1847
                     $session->get('user-id'),
1849 1848
                     'at_modification',
1850 1849
                     $session->get('user-login'),
1851
-                    'at_otp_status:' . ((int) $post_otp_is_enabled === 0 ? 'disabled' : 'enabled')
1850
+                    'at_otp_status:'.((int) $post_otp_is_enabled === 0 ? 'disabled' : 'enabled')
1852 1851
                 );
1853 1852
             } elseif (DB::count() === 0 && empty($post_otp_secret) === false) {
1854 1853
                 // Create the entry in items_otp table
@@ -1892,8 +1891,8 @@  discard block
 block discarded – undo
1892 1891
                     $session->get('user-id'),
1893 1892
                     'at_modification',
1894 1893
                     $session->get('user-login'),
1895
-                    'at_restriction : ' . (count($diffUsersRestiction) > 0 ?
1896
-                        implode(', ', $arrayOfUsersRestriction) . (count($diffRolesRestiction) > 0 ? ', ' : '') : '') . (count($diffRolesRestiction) > 0 ? implode(', ', $arrayOfRestrictionRoles) : '')
1894
+                    'at_restriction : '.(count($diffUsersRestiction) > 0 ?
1895
+                        implode(', ', $arrayOfUsersRestriction).(count($diffRolesRestiction) > 0 ? ', ' : '') : '').(count($diffRolesRestiction) > 0 ? implode(', ', $arrayOfRestrictionRoles) : '')
1897 1896
                 );
1898 1897
             }
1899 1898
 
@@ -1913,7 +1912,7 @@  discard block
 block discarded – undo
1913 1912
                     $session->get('user-id'),
1914 1913
                     'at_modification',
1915 1914
                     $session->get('user-login'),
1916
-                    'at_label : ' . $data['label'] . ' => ' . $inputData['label']
1915
+                    'at_label : '.$data['label'].' => '.$inputData['label']
1917 1916
                 );
1918 1917
             }
1919 1918
             // LOGIN
@@ -1932,7 +1931,7 @@  discard block
 block discarded – undo
1932 1931
                     $session->get('user-id'),
1933 1932
                     'at_modification',
1934 1933
                     $session->get('user-login'),
1935
-                    'at_login : ' . $data['login'] . ' => ' . $post_login
1934
+                    'at_login : '.$data['login'].' => '.$post_login
1936 1935
                 );
1937 1936
             }
1938 1937
             // EMAIL
@@ -1951,7 +1950,7 @@  discard block
 block discarded – undo
1951 1950
                     $session->get('user-id'),
1952 1951
                     'at_modification',
1953 1952
                     $session->get('user-login'),
1954
-                    'at_email : ' . $data['email'] . ' => ' . $post_email
1953
+                    'at_email : '.$data['email'].' => '.$post_email
1955 1954
                 );
1956 1955
             }
1957 1956
             // URL
@@ -1970,7 +1969,7 @@  discard block
 block discarded – undo
1970 1969
                     $session->get('user-id'),
1971 1970
                     'at_modification',
1972 1971
                     $session->get('user-login'),
1973
-                    'at_url : ' . $data['url'] . ' => ' . $post_url
1972
+                    'at_url : '.$data['url'].' => '.$post_url
1974 1973
                 );
1975 1974
             }
1976 1975
             // DESCRIPTION
@@ -1996,7 +1995,7 @@  discard block
 block discarded – undo
1996 1995
             // FOLDER
1997 1996
             if ((int) $data['id_tree'] !== (int) $inputData['folderId']) {
1998 1997
                 // Get name of folders
1999
-                $dataTmp = DB::query('SELECT title FROM ' . prefixTable('nested_tree') . ' WHERE id IN %li', array($data['id_tree'], $inputData['folderId']));
1998
+                $dataTmp = DB::query('SELECT title FROM '.prefixTable('nested_tree').' WHERE id IN %li', array($data['id_tree'], $inputData['folderId']));
2000 1999
 
2001 2000
                 // Store updates performed
2002 2001
                 array_push(
@@ -2012,7 +2011,7 @@  discard block
 block discarded – undo
2012 2011
                     $session->get('user-id'),
2013 2012
                     'at_modification',
2014 2013
                     $session->get('user-login'),
2015
-                    'at_category : ' . $dataTmp[0]['title'] . ' => ' . $dataTmp[1]['title']
2014
+                    'at_category : '.$dataTmp[0]['title'].' => '.$dataTmp[1]['title']
2016 2015
                 );
2017 2016
             }
2018 2017
             // ANYONE_CAN_MODIFY
@@ -2020,7 +2019,7 @@  discard block
 block discarded – undo
2020 2019
                 // Store updates performed
2021 2020
                 array_push(
2022 2021
                     $arrayOfChanges,
2023
-                    $lang->get('at_anyoneconmodify') . ': ' . ((int) $post_anyone_can_modify === 0 ? $lang->get('disabled') : $lang->get('enabled'))
2022
+                    $lang->get('at_anyoneconmodify').': '.((int) $post_anyone_can_modify === 0 ? $lang->get('disabled') : $lang->get('enabled'))
2024 2023
                 );
2025 2024
 
2026 2025
                 // Log
@@ -2031,15 +2030,15 @@  discard block
 block discarded – undo
2031 2030
                     $session->get('user-id'),
2032 2031
                     'at_modification',
2033 2032
                     $session->get('user-login'),
2034
-                    'at_anyoneconmodify : ' . ((int) $post_anyone_can_modify === 0 ? 'disabled' : 'enabled')
2033
+                    'at_anyoneconmodify : '.((int) $post_anyone_can_modify === 0 ? 'disabled' : 'enabled')
2035 2034
                 );
2036 2035
             }
2037 2036
 
2038 2037
             // Reload new values
2039 2038
             $dataItem = DB::queryfirstrow(
2040 2039
                 'SELECT *
2041
-                FROM ' . prefixTable('items') . ' as i
2042
-                INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id)
2040
+                FROM ' . prefixTable('items').' as i
2041
+                INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id)
2043 2042
                 WHERE i.id = %i AND l.action = %s',
2044 2043
                 $inputData['itemId'],
2045 2044
                 'at_creation'
@@ -2048,8 +2047,8 @@  discard block
 block discarded – undo
2048 2047
             $history = '';
2049 2048
             $rows = DB::query(
2050 2049
                 'SELECT l.date as date, l.action as action, l.raison as raison, u.login as login
2051
-                FROM ' . prefixTable('log_items') . ' as l
2052
-                LEFT JOIN ' . prefixTable('users') . ' as u ON (l.id_user=u.id)
2050
+                FROM ' . prefixTable('log_items').' as l
2051
+                LEFT JOIN ' . prefixTable('users').' as u ON (l.id_user=u.id)
2053 2052
                 WHERE l.action <> %s AND id_item=%s',
2054 2053
                 'at_shown',
2055 2054
                 $inputData['itemId']
@@ -2058,14 +2057,14 @@  discard block
 block discarded – undo
2058 2057
                 if ($record['raison'] === NULL) continue;
2059 2058
                 $reason = explode(':', $record['raison']);
2060 2059
                 if (count($reason) > 0) {
2061
-                    $sentence = date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['date']) . ' - '
2062
-                        . $record['login'] . ' - ' . $lang->get($record['action']) . ' - '
2063
-                        . (empty($record['raison']) === false ? (count($reason) > 1 ? $lang->get(trim($reason[0])) . ' : ' . $reason[1]
2060
+                    $sentence = date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['date']).' - '
2061
+                        . $record['login'].' - '.$lang->get($record['action']).' - '
2062
+                        . (empty($record['raison']) === false ? (count($reason) > 1 ? $lang->get(trim($reason[0])).' : '.$reason[1]
2064 2063
                             : $lang->get(trim($reason[0]))) : '');
2065 2064
                     if (empty($history)) {
2066 2065
                         $history = $sentence;
2067 2066
                     } else {
2068
-                        $history .= '<br />' . $sentence;
2067
+                        $history .= '<br />'.$sentence;
2069 2068
                     }
2070 2069
                 }
2071 2070
             }
@@ -2203,7 +2202,7 @@  discard block
 block discarded – undo
2203 2202
         ) {
2204 2203
             // load the original record into an array
2205 2204
             $originalRecord = DB::queryfirstrow(
2206
-                'SELECT * FROM ' . prefixTable('items') . '
2205
+                'SELECT * FROM '.prefixTable('items').'
2207 2206
                 WHERE id = %i',
2208 2207
                 $inputData['itemId']
2209 2208
             );
@@ -2222,7 +2221,7 @@  discard block
 block discarded – undo
2222 2221
 
2223 2222
             // Load the destination folder record into an array
2224 2223
             $dataDestination = DB::queryfirstrow(
2225
-                'SELECT personal_folder FROM ' . prefixTable('nested_tree') . '
2224
+                'SELECT personal_folder FROM '.prefixTable('nested_tree').'
2226 2225
                 WHERE id = %i',
2227 2226
                 $post_dest_id
2228 2227
             );
@@ -2230,7 +2229,7 @@  discard block
 block discarded – undo
2230 2229
             // Get the ITEM object key for the user
2231 2230
             $userKey = DB::queryFirstRow(
2232 2231
                 'SELECT share_key
2233
-                FROM ' . prefixTable('sharekeys_items') . '
2232
+                FROM ' . prefixTable('sharekeys_items').'
2234 2233
                 WHERE user_id = %i AND object_id = %i',
2235 2234
                 $session->get('user-id'),
2236 2235
                 $inputData['itemId']
@@ -2307,8 +2306,8 @@  discard block
 block discarded – undo
2307 2306
             // Manage Custom Fields
2308 2307
             $rows = DB::query(
2309 2308
                 'SELECT ci.id AS id, ci.data AS data, ci.field_id AS field_id, c.encrypted_data AS encrypted_data
2310
-                FROM ' . prefixTable('categories_items') . ' AS ci
2311
-                INNER JOIN ' . prefixTable('categories') . ' AS c ON (c.id = ci.field_id)
2309
+                FROM ' . prefixTable('categories_items').' AS ci
2310
+                INNER JOIN ' . prefixTable('categories').' AS c ON (c.id = ci.field_id)
2312 2311
                 WHERE ci.item_id = %i',
2313 2312
                 $inputData['itemId']
2314 2313
             );
@@ -2320,7 +2319,7 @@  discard block
 block discarded – undo
2320 2319
                     // Get user key
2321 2320
                     $userKey = DB::queryFirstRow(
2322 2321
                         'SELECT share_key
2323
-                        FROM ' . prefixTable('sharekeys_fields') . '
2322
+                        FROM ' . prefixTable('sharekeys_fields').'
2324 2323
                         WHERE user_id = %i AND object_id = %i',
2325 2324
                         $session->get('user-id'),
2326 2325
                         $field['id']
@@ -2387,15 +2386,15 @@  discard block
 block discarded – undo
2387 2386
             $rows = DB::query(
2388 2387
                 'SELECT f.id AS id, f.file AS file, f.name AS name, f.status AS status, f.extension AS extension,
2389 2388
                 f.size AS size, f.type AS type, s.share_key AS share_key
2390
-                FROM ' . prefixTable('files') . ' AS f
2391
-                INNER JOIN ' . prefixTable('sharekeys_files') . ' AS s ON (f.id = s.object_id)
2389
+                FROM ' . prefixTable('files').' AS f
2390
+                INNER JOIN ' . prefixTable('sharekeys_files').' AS s ON (f.id = s.object_id)
2392 2391
                 WHERE s.user_id = %i AND f.id_item = %i',
2393 2392
                 $session->get('user-id'),
2394 2393
                 $inputData['itemId']
2395 2394
             );
2396 2395
             foreach ($rows as $record) {
2397 2396
                 // Check if file still exists
2398
-                if (file_exists($SETTINGS['path_to_upload_folder'] . DIRECTORY_SEPARATOR . TP_FILE_PREFIX . base64_decode($record['file'])) === true) {
2397
+                if (file_exists($SETTINGS['path_to_upload_folder'].DIRECTORY_SEPARATOR.TP_FILE_PREFIX.base64_decode($record['file'])) === true) {
2399 2398
                     // Step1 - decrypt the file
2400 2399
                     // deepcode ignore PT: path is sanitized inside decryptFile()
2401 2400
                     $fileContent = decryptFile(
@@ -2406,8 +2405,8 @@  discard block
 block discarded – undo
2406 2405
 
2407 2406
                     // Step2 - create file
2408 2407
                     // deepcode ignore InsecureHash: md5 is used jonly for file name in order to get a hashed value in database
2409
-                    $newFileName = md5(time() . '_' . $record['id']) . '.' . $record['extension'];
2410
-                    $outstream = fopen($SETTINGS['path_to_upload_folder'] . DIRECTORY_SEPARATOR . $newFileName, 'ab');
2408
+                    $newFileName = md5(time().'_'.$record['id']).'.'.$record['extension'];
2409
+                    $outstream = fopen($SETTINGS['path_to_upload_folder'].DIRECTORY_SEPARATOR.$newFileName, 'ab');
2411 2410
                     if ($outstream === false) {
2412 2411
                         echo prepareExchangedData(
2413 2412
                             array(
@@ -2480,7 +2479,7 @@  discard block
 block discarded – undo
2480 2479
 
2481 2480
             // -------------------------
2482 2481
             // Add specific restrictions
2483
-            $rows = DB::query('SELECT * FROM ' . prefixTable('restriction_to_roles') . ' WHERE item_id = %i', $inputData['itemId']);
2482
+            $rows = DB::query('SELECT * FROM '.prefixTable('restriction_to_roles').' WHERE item_id = %i', $inputData['itemId']);
2484 2483
             foreach ($rows as $record) {
2485 2484
                 DB::insert(
2486 2485
                     prefixTable('restriction_to_roles'),
@@ -2492,7 +2491,7 @@  discard block
 block discarded – undo
2492 2491
             }
2493 2492
 
2494 2493
             // Add Tags
2495
-            $rows = DB::query('SELECT * FROM ' . prefixTable('tags') . ' WHERE item_id = %i', $inputData['itemId']);
2494
+            $rows = DB::query('SELECT * FROM '.prefixTable('tags').' WHERE item_id = %i', $inputData['itemId']);
2496 2495
             foreach ($rows as $record) {
2497 2496
                 DB::insert(
2498 2497
                     prefixTable('tags'),
@@ -2593,7 +2592,7 @@  discard block
 block discarded – undo
2593 2592
         // then we can show it
2594 2593
         $item_deleted = DB::queryFirstRow(
2595 2594
             'SELECT *
2596
-            FROM ' . prefixTable('log_items') . '
2595
+            FROM ' . prefixTable('log_items').'
2597 2596
             WHERE id_item = %i AND action = %s
2598 2597
             ORDER BY date DESC
2599 2598
             LIMIT 0, 1',
@@ -2604,7 +2603,7 @@  discard block
 block discarded – undo
2604 2603
 
2605 2604
         $item_restored = DB::queryFirstRow(
2606 2605
             'SELECT *
2607
-            FROM ' . prefixTable('log_items') . '
2606
+            FROM ' . prefixTable('log_items').'
2608 2607
             WHERE id_item = %i AND action = %s
2609 2608
             ORDER BY date DESC
2610 2609
             LIMIT 0, 1',
@@ -2628,8 +2627,8 @@  discard block
 block discarded – undo
2628 2627
         // Get all informations for this item
2629 2628
         $dataItem = DB::queryfirstrow(
2630 2629
             'SELECT *
2631
-            FROM ' . prefixTable('items') . ' as i
2632
-            INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id)
2630
+            FROM ' . prefixTable('items').' as i
2631
+            INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id)
2633 2632
             WHERE i.id = %i AND l.action = %s',
2634 2633
             $inputData['id'],
2635 2634
             'at_creation'
@@ -2638,7 +2637,7 @@  discard block
 block discarded – undo
2638 2637
         // Notification
2639 2638
         DB::queryfirstrow(
2640 2639
             'SELECT *
2641
-            FROM ' . prefixTable('notification') . '
2640
+            FROM ' . prefixTable('notification').'
2642 2641
             WHERE item_id = %i AND user_id = %i',
2643 2642
             $inputData['id'],
2644 2643
             $session->get('user-id')
@@ -2657,7 +2656,7 @@  discard block
 block discarded – undo
2657 2656
 
2658 2657
         // manage case of API user
2659 2658
         if ($dataItem['id_user'] === API_USER_ID) {
2660
-            $arrData['author'] = 'API [' . $dataItem['description'] . ']';
2659
+            $arrData['author'] = 'API ['.$dataItem['description'].']';
2661 2660
             $arrData['id_user'] = API_USER_ID;
2662 2661
             $arrData['author_email'] = '';
2663 2662
             $arrData['notification_status'] = false;
@@ -2667,7 +2666,7 @@  discard block
 block discarded – undo
2667 2666
         $tags = array();
2668 2667
         $rows = DB::query(
2669 2668
             'SELECT tag
2670
-            FROM ' . prefixTable('tags') . '
2669
+            FROM ' . prefixTable('tags').'
2671 2670
             WHERE item_id = %i',
2672 2671
             $inputData['id']
2673 2672
         );
@@ -2692,7 +2691,7 @@  discard block
 block discarded – undo
2692 2691
         // Check if user has a role that is accepted
2693 2692
         $rows_tmp = DB::query(
2694 2693
             'SELECT role_id
2695
-            FROM ' . prefixTable('restriction_to_roles') . '
2694
+            FROM ' . prefixTable('restriction_to_roles').'
2696 2695
             WHERE item_id=%i',
2697 2696
             $inputData['id']
2698 2697
         );
@@ -2706,7 +2705,7 @@  discard block
 block discarded – undo
2706 2705
         // Get the object key for the user
2707 2706
         $userKey = DB::queryFirstRow(
2708 2707
             'SELECT share_key
2709
-            FROM ' . prefixTable('sharekeys_items') . '
2708
+            FROM ' . prefixTable('sharekeys_items').'
2710 2709
             WHERE user_id = %i AND object_id = %i',
2711 2710
             $session->get('user-id'),
2712 2711
             $inputData['id']
@@ -2803,8 +2802,8 @@  discard block
 block discarded – undo
2803 2802
                 // Add restriction if item is restricted to roles
2804 2803
                 $rows = DB::query(
2805 2804
                     'SELECT t.title, t.id
2806
-                    FROM ' . prefixTable('roles_title') . ' AS t
2807
-                    INNER JOIN ' . prefixTable('restriction_to_roles') . ' AS r ON (t.id=r.role_id)
2805
+                    FROM ' . prefixTable('roles_title').' AS t
2806
+                    INNER JOIN ' . prefixTable('restriction_to_roles').' AS r ON (t.id=r.role_id)
2808 2807
                     WHERE r.item_id = %i
2809 2808
                     ORDER BY t.title ASC',
2810 2809
                     $inputData['id']
@@ -2820,8 +2819,8 @@  discard block
 block discarded – undo
2820 2819
                 $tmp = array();
2821 2820
                 $rows = DB::query(
2822 2821
                     'SELECT k.label, k.id
2823
-                    FROM ' . prefixTable('kb_items') . ' as i
2824
-                    INNER JOIN ' . prefixTable('kb') . ' as k ON (i.kb_id=k.id)
2822
+                    FROM ' . prefixTable('kb_items').' as i
2823
+                    INNER JOIN ' . prefixTable('kb').' as k ON (i.kb_id=k.id)
2825 2824
                     WHERE i.item_id = %i
2826 2825
                     ORDER BY k.label ASC',
2827 2826
                     $inputData['id']
@@ -2904,7 +2903,7 @@  discard block
 block discarded – undo
2904 2903
                 $arrCatList = array();
2905 2904
                 $rows_tmp = DB::query(
2906 2905
                     'SELECT id_category
2907
-                    FROM ' . prefixTable('categories_folders') . '
2906
+                    FROM ' . prefixTable('categories_folders').'
2908 2907
                     WHERE id_folder=%i',
2909 2908
                     $inputData['folderId']
2910 2909
                 );
@@ -2919,8 +2918,8 @@  discard block
 block discarded – undo
2919 2918
                         'SELECT i.id AS id, i.field_id AS field_id, i.data AS data, i.item_id AS item_id,
2920 2919
                         i.encryption_type AS encryption_type, c.encrypted_data AS encrypted_data, c.parent_id AS parent_id,
2921 2920
                         c.type as field_type, c.masked AS field_masked, c.role_visibility AS role_visibility
2922
-                        FROM ' . prefixTable('categories_items') . ' AS i
2923
-                        INNER JOIN ' . prefixTable('categories') . ' AS c ON (i.field_id=c.id)
2921
+                        FROM ' . prefixTable('categories_items').' AS i
2922
+                        INNER JOIN ' . prefixTable('categories').' AS c ON (i.field_id=c.id)
2924 2923
                         WHERE i.item_id=%i AND c.parent_id IN %ls',
2925 2924
                         $inputData['id'],
2926 2925
                         $arrCatList
@@ -2931,7 +2930,7 @@  discard block
 block discarded – undo
2931 2930
                         //db::debugmode(true);
2932 2931
                         $userKey = DB::queryFirstRow(
2933 2932
                             'SELECT share_key
2934
-                            FROM ' . prefixTable('sharekeys_fields') . '
2933
+                            FROM ' . prefixTable('sharekeys_fields').'
2935 2934
                             WHERE user_id = %i AND object_id = %i',
2936 2935
                             $session->get('user-id'),
2937 2936
                             $row['id']
@@ -2949,7 +2948,7 @@  discard block
 block discarded – undo
2949 2948
                         } else if (DB::count() === 0 && (int) $row['encrypted_data'] === 0) {
2950 2949
                             // Data is not encrypted in DB
2951 2950
                             $fieldText = [
2952
-                                'string' => $row['data'],//#3945 - isBase64($row['data']) === true ? base64_decode($row['data']) : 
2951
+                                'string' => $row['data'], //#3945 - isBase64($row['data']) === true ? base64_decode($row['data']) : 
2953 2952
                                 'encrypted' => false,
2954 2953
                                 'error' => false,
2955 2954
                             ];
@@ -2994,7 +2993,7 @@  discard block
 block discarded – undo
2994 2993
             if (isset($SETTINGS['item_creation_templates']) && (int) $SETTINGS['item_creation_templates'] === 1) {
2995 2994
                 $rows_tmp = DB::queryfirstrow(
2996 2995
                     'SELECT category_id
2997
-                    FROM ' . prefixTable('templates') . '
2996
+                    FROM ' . prefixTable('templates').'
2998 2997
                     WHERE item_id = %i',
2999 2998
                     $inputData['id']
3000 2999
                 );
@@ -3011,7 +3010,7 @@  discard block
 block discarded – undo
3011 3010
             // Evaluate if item is ready for all users
3012 3011
             $rows_tmp = DB::queryfirstrow(
3013 3012
                 'SELECT finished_at
3014
-                FROM ' . prefixTable('background_tasks') . '
3013
+                FROM ' . prefixTable('background_tasks').'
3015 3014
                 WHERE item_id = %i',
3016 3015
                 $inputData['id']
3017 3016
             );
@@ -3028,7 +3027,7 @@  discard block
 block discarded – undo
3028 3027
                 // Is the Item to be deleted?
3029 3028
                 $dataDelete = DB::queryfirstrow(
3030 3029
                     'SELECT * 
3031
-                    FROM ' . prefixTable('automatic_del') . '
3030
+                    FROM ' . prefixTable('automatic_del').'
3032 3031
                     WHERE item_id = %i',
3033 3032
                     $inputData['id']
3034 3033
                 );
@@ -3109,14 +3108,14 @@  discard block
 block discarded – undo
3109 3108
                     if (empty($userRest) === false) {
3110 3109
                         $dataTmp = DB::queryfirstrow(
3111 3110
                             'SELECT login
3112
-                            FROM ' . prefixTable('users') . '
3111
+                            FROM ' . prefixTable('users').'
3113 3112
                             WHERE id= %i',
3114 3113
                             $userRest
3115 3114
                         );
3116 3115
                         if (empty($listOfRestricted)) {
3117 3116
                             $listOfRestricted = $dataTmp['login'];
3118 3117
                         } else {
3119
-                            $listOfRestricted .= ';' . $dataTmp['login'];
3118
+                            $listOfRestricted .= ';'.$dataTmp['login'];
3120 3119
                         }
3121 3120
                     }
3122 3121
                 }
@@ -3190,9 +3189,9 @@  discard block
 block discarded – undo
3190 3189
         // Load item data
3191 3190
         $dataItem = DB::queryFirstRow(
3192 3191
             'SELECT i.*, n.title AS folder_title, o.enabled AS otp_for_item_enabled, o.phone_number AS otp_phone_number, o.secret AS otp_secret
3193
-            FROM ' . prefixTable('items') . ' AS i
3194
-            INNER JOIN ' . prefixTable('nested_tree') . ' AS n ON (i.id_tree = n.id)
3195
-            LEFT JOIN ' . prefixTable('items_otp') . ' AS o ON (o.item_id = i.id)
3192
+            FROM ' . prefixTable('items').' AS i
3193
+            INNER JOIN ' . prefixTable('nested_tree').' AS n ON (i.id_tree = n.id)
3194
+            LEFT JOIN ' . prefixTable('items_otp').' AS o ON (o.item_id = i.id)
3196 3195
             WHERE i.id = %i',
3197 3196
             $inputData['id']
3198 3197
         );
@@ -3214,7 +3213,7 @@  discard block
 block discarded – undo
3214 3213
         // Check if user has a role that is accepted
3215 3214
         $rows_tmp = DB::query(
3216 3215
             'SELECT role_id
3217
-            FROM ' . prefixTable('restriction_to_roles') . '
3216
+            FROM ' . prefixTable('restriction_to_roles').'
3218 3217
             WHERE item_id=%i',
3219 3218
             $inputData['id']
3220 3219
         );
@@ -3246,12 +3245,12 @@  discard block
 block discarded – undo
3246 3245
             // launch query
3247 3246
             $rows = DB::query(
3248 3247
                 'SELECT id, name, file, extension, size
3249
-                FROM ' . prefixTable('files') . '
3248
+                FROM ' . prefixTable('files').'
3250 3249
                 WHERE id_item = %i AND confirmed = 1',
3251 3250
                 $inputData['id']
3252 3251
             );
3253 3252
             foreach ($rows as $record) {
3254
-                $filename = basename($record['name'], '.' . $record['extension']);
3253
+                $filename = basename($record['name'], '.'.$record['extension']);
3255 3254
                 $filename = isBase64($filename) === true ? base64_decode($filename) : $filename;
3256 3255
 
3257 3256
                 array_push(
@@ -3264,7 +3263,7 @@  discard block
 block discarded – undo
3264 3263
                         'is_image' => in_array(strtolower($record['extension']), TP_IMAGE_FILE_EXT) === true ? 1 : 0,
3265 3264
                         'id' => $record['id'],
3266 3265
                         'key' => $session->get('user-key_tmp'),
3267
-                        'internalFilename' => basename($record['name'], '.' . $record['extension']),
3266
+                        'internalFilename' => basename($record['name'], '.'.$record['extension']),
3268 3267
                     )
3269 3268
                 );
3270 3269
             }
@@ -3302,7 +3301,7 @@  discard block
 block discarded – undo
3302 3301
                     array(
3303 3302
                         'latest_items' => implode(';', $session->get('user-latest_items')),
3304 3303
                     ),
3305
-                    'id=' . $session->get('user-id')
3304
+                    'id='.$session->get('user-id')
3306 3305
                 );
3307 3306
             }
3308 3307
 
@@ -3311,8 +3310,8 @@  discard block
 block discarded – undo
3311 3310
             $listOptionsForRoles = array();
3312 3311
             $rows = DB::query(
3313 3312
                 'SELECT r.role_id AS role_id, t.title AS title
3314
-                FROM ' . prefixTable('roles_values') . ' AS r
3315
-                INNER JOIN ' . prefixTable('roles_title') . ' AS t ON (r.role_id = t.id)
3313
+                FROM ' . prefixTable('roles_values').' AS r
3314
+                INNER JOIN ' . prefixTable('roles_title').' AS t ON (r.role_id = t.id)
3316 3315
                 WHERE r.folder_id = %i',
3317 3316
                 $dataItem['id_tree']
3318 3317
             );
@@ -3326,9 +3325,9 @@  discard block
 block discarded – undo
3326 3325
                 );
3327 3326
                 $rows2 = DB::query(
3328 3327
                     'SELECT id, login, fonction_id, email, name, lastname
3329
-                    FROM ' . prefixTable('users') . '
3328
+                    FROM ' . prefixTable('users').'
3330 3329
                     WHERE fonction_id LIKE %s',
3331
-                    '%' . $record['role_id'] . '%'
3330
+                    '%'.$record['role_id'].'%'
3332 3331
                 );
3333 3332
                 foreach ($rows2 as $record2) {
3334 3333
                     foreach (explode(';', $record2['fonction_id']) as $role) {
@@ -3341,7 +3340,7 @@  discard block
 block discarded – undo
3341 3340
                                 array(
3342 3341
                                     'id' => (int) $record2['id'],
3343 3342
                                     'login' => $record2['login'],
3344
-                                    'name' => $record2['name'] . ' ' . $record2['lastname'],
3343
+                                    'name' => $record2['name'].' '.$record2['lastname'],
3345 3344
                                     'email' => $record2['email'],
3346 3345
                                 )
3347 3346
                             );
@@ -3360,16 +3359,16 @@  discard block
 block discarded – undo
3360 3359
                 $path = '';
3361 3360
                 foreach ($arbo as $elem) {
3362 3361
                     if (empty($path) === true) {
3363
-                        $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES) . ' ';
3362
+                        $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES).' ';
3364 3363
                     } else {
3365
-                        $path .= '&#8594; ' . htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
3364
+                        $path .= '&#8594; '.htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
3366 3365
                     }
3367 3366
                 }
3368 3367
                 // Build text to show user
3369 3368
                 if (empty($path) === true) {
3370 3369
                     $path = addslashes($dataItem['label']);
3371 3370
                 } else {
3372
-                    $path = addslashes($dataItem['label']) . ' (' . $path . ')';
3371
+                    $path = addslashes($dataItem['label']).' ('.$path.')';
3373 3372
                 }
3374 3373
 
3375 3374
                 // Add Admins to notification list if expected
@@ -3392,7 +3391,7 @@  discard block
 block discarded – undo
3392 3391
                         array(
3393 3392
                             addslashes($session->get('user-login')),
3394 3393
                             $path,
3395
-                            $SETTINGS['cpassman_url'] . '/index.php?page=items&group=' . $dataItem['id_tree'] . '&id=' . $dataItem['id'],
3394
+                            $SETTINGS['cpassman_url'].'/index.php?page=items&group='.$dataItem['id_tree'].'&id='.$dataItem['id'],
3396 3395
                         ),
3397 3396
                         $lang->get('email_on_open_notification_mail')
3398 3397
                     ),
@@ -3402,7 +3401,7 @@  discard block
 block discarded – undo
3402 3401
             }
3403 3402
 
3404 3403
             // has this item a change proposal
3405
-            DB::query('SELECT * FROM ' . prefixTable('items_change') . ' WHERE item_id = %i', $inputData['id']);
3404
+            DB::query('SELECT * FROM '.prefixTable('items_change').' WHERE item_id = %i', $inputData['id']);
3406 3405
             $returnArray['has_change_proposal'] = DB::count();
3407 3406
 
3408 3407
             // Setting
@@ -3413,7 +3412,7 @@  discard block
 block discarded – undo
3413 3412
             if (isset($SETTINGS['otv_is_enabled']) === true && (int) $SETTINGS['otv_is_enabled'] === 1) {
3414 3413
                 DB::query(
3415 3414
                     'SELECT *
3416
-                    FROM ' . prefixTable('otv') . '
3415
+                    FROM ' . prefixTable('otv').'
3417 3416
                     WHERE item_id = %i
3418 3417
                     AND time_limit > %i',
3419 3418
                     $inputData['id'],
@@ -3513,7 +3512,7 @@  discard block
 block discarded – undo
3513 3512
         // Load item data
3514 3513
         $data = DB::queryFirstRow(
3515 3514
             'SELECT id_tree, id, label
3516
-            FROM ' . prefixTable('items') . '
3515
+            FROM ' . prefixTable('items').'
3517 3516
             WHERE id = %i OR item_key = %s',
3518 3517
             $inputData['itemId'],
3519 3518
             $inputData['itemKey']
@@ -3604,7 +3603,7 @@  discard block
 block discarded – undo
3604 3603
         // Load item data
3605 3604
         $dataItem = DB::queryFirstRow(
3606 3605
             'SELECT secret, enabled
3607
-            FROM ' . prefixTable('items_otp') . '
3606
+            FROM ' . prefixTable('items_otp').'
3608 3607
             WHERE item_id = %i',
3609 3608
             $inputData['id']
3610 3609
         );
@@ -3686,13 +3685,13 @@  discard block
 block discarded – undo
3686 3685
 
3687 3686
         // Check if user is allowed to access this folder
3688 3687
         if (!in_array($inputData['folderId'], $session->get('user-accessible_folders'))) {
3689
-            echo '[{"error" : "' . $lang->get('error_not_allowed_to') . '"}]';
3688
+            echo '[{"error" : "'.$lang->get('error_not_allowed_to').'"}]';
3690 3689
             break;
3691 3690
         }
3692 3691
 
3693 3692
         // Check if title doesn't contains html codes
3694 3693
         if (preg_match_all('|<[^>]+>(.*)</[^>]+>|U', $title, $out)) {
3695
-            echo '[ { "error" : "' . $lang->get('error_html_codes') . '" } ]';
3694
+            echo '[ { "error" : "'.$lang->get('error_html_codes').'" } ]';
3696 3695
             break;
3697 3696
         }
3698 3697
         // check that title is not numeric
@@ -3703,9 +3702,9 @@  discard block
 block discarded – undo
3703 3702
 
3704 3703
         // Check if duplicate folders name are allowed
3705 3704
         if (isset($SETTINGS['duplicate_folder']) && $SETTINGS['duplicate_folder'] === '0') {
3706
-            $data = DB::queryFirstRow('SELECT id, title FROM ' . prefixTable('nested_tree') . ' WHERE title = %s', $title);
3705
+            $data = DB::queryFirstRow('SELECT id, title FROM '.prefixTable('nested_tree').' WHERE title = %s', $title);
3707 3706
             if (empty($data['id']) === false && $dataReceived['folder'] !== $data['id']) {
3708
-                echo '[ { "error" : "' . $lang->get('error_group_exist') . '" } ]';
3707
+                echo '[ { "error" : "'.$lang->get('error_group_exist').'" } ]';
3709 3708
                 break;
3710 3709
             }
3711 3710
         }
@@ -3713,7 +3712,7 @@  discard block
 block discarded – undo
3713 3712
         // query on folder
3714 3713
         $data = DB::queryfirstrow(
3715 3714
             'SELECT parent_id, personal_folder
3716
-            FROM ' . prefixTable('nested_tree') . '
3715
+            FROM ' . prefixTable('nested_tree').'
3717 3716
             WHERE id = %i',
3718 3717
             $inputData['folderId']
3719 3718
         );
@@ -3723,20 +3722,20 @@  discard block
 block discarded – undo
3723 3722
         if ($session->get('user-admin') !== 1 && $session->get('user-manager') !== 1 && $data['personal_folder'] === '0') {
3724 3723
             $data = DB::queryfirstrow(
3725 3724
                 'SELECT valeur
3726
-                FROM ' . prefixTable('misc') . '
3725
+                FROM ' . prefixTable('misc').'
3727 3726
                 WHERE intitule = %i AND type = %s',
3728 3727
                 $data['parent_id'],
3729 3728
                 'complex'
3730 3729
             );
3731 3730
             if (intval($dataReceived['complexity']) < intval($data['valeur'])) {
3732
-                echo '[ { "error" : "' . $lang->get('error_folder_complexity_lower_than_top_folder') . ' [<b>' . TP_PW_COMPLEXITY[$data['valeur']][1] . '</b>]"} ]';
3731
+                echo '[ { "error" : "'.$lang->get('error_folder_complexity_lower_than_top_folder').' [<b>'.TP_PW_COMPLEXITY[$data['valeur']][1].'</b>]"} ]';
3733 3732
                 break;
3734 3733
             }
3735 3734
         }
3736 3735
 
3737 3736
         // update Folders table
3738 3737
         $tmp = DB::queryFirstRow(
3739
-            'SELECT title, parent_id, personal_folder FROM ' . prefixTable('nested_tree') . ' WHERE id = %i',
3738
+            'SELECT title, parent_id, personal_folder FROM '.prefixTable('nested_tree').' WHERE id = %i',
3740 3739
             $dataReceived['folder']
3741 3740
         );
3742 3741
         if ($tmp['parent_id'] !== 0 || $tmp['title'] !== $session->get('user-id') || $tmp['personal_folder'] !== 1) {
@@ -3850,7 +3849,7 @@  discard block
 block discarded – undo
3850 3849
             $uniqueLoadData['path'] = $arr_arbo;
3851 3850
 
3852 3851
             // store last folder accessed in cookie
3853
-            $arr_cookie_options = array (
3852
+            $arr_cookie_options = array(
3854 3853
                 'expires' => time() + TP_ONE_DAY_SECONDS * 5,
3855 3854
                 'path' => '/', 
3856 3855
                 'secure' => true,
@@ -3865,7 +3864,7 @@  discard block
 block discarded – undo
3865 3864
             foreach ($session->get('user-roles_array') as $role) {
3866 3865
                 $roleQ = DB::queryfirstrow(
3867 3866
                     'SELECT allow_pw_change
3868
-                    FROM ' . prefixTable('roles_title') . '
3867
+                    FROM ' . prefixTable('roles_title').'
3869 3868
                     WHERE id = %i',
3870 3869
                     $role
3871 3870
                 );
@@ -3896,11 +3895,11 @@  discard block
 block discarded – undo
3896 3895
                 
3897 3896
                 foreach ($session->get('user-roles_array') as $role) {
3898 3897
                     $access = DB::queryFirstRow(
3899
-                        'SELECT type FROM ' . prefixTable('roles_values') . ' WHERE role_id = %i AND folder_id = %i',
3898
+                        'SELECT type FROM '.prefixTable('roles_values').' WHERE role_id = %i AND folder_id = %i',
3900 3899
                         $role,
3901 3900
                         $inputData['id']
3902 3901
                     );
3903
-                    if (DB::count()>0) {
3902
+                    if (DB::count() > 0) {
3904 3903
                         if ($access['type'] === 'R') {
3905 3904
                             array_push($arrTmp, 10);
3906 3905
                         } elseif ($access['type'] === 'W') {
@@ -3965,7 +3964,7 @@  discard block
 block discarded – undo
3965 3964
             } else {
3966 3965
                 DB::query(
3967 3966
                     'SELECT *
3968
-                    FROM ' . prefixTable('items') . '
3967
+                    FROM ' . prefixTable('items').'
3969 3968
                     WHERE inactif = %i',
3970 3969
                     0
3971 3970
                 );
@@ -3975,7 +3974,7 @@  discard block
 block discarded – undo
3975 3974
 
3976 3975
             // Get folder complexity
3977 3976
             $folderComplexity = DB::queryFirstRow(
3978
-                'SELECT valeur FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %i',
3977
+                'SELECT valeur FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %i',
3979 3978
                 'complex',
3980 3979
                 $inputData['id']
3981 3980
             );
@@ -3987,7 +3986,7 @@  discard block
 block discarded – undo
3987 3986
             if (isset($SETTINGS['item_extra_fields']) && (int) $SETTINGS['item_extra_fields'] === 1) {
3988 3987
                 $folderRow = DB::query(
3989 3988
                     'SELECT id_category
3990
-                    FROM ' . prefixTable('categories_folders') . '
3989
+                    FROM ' . prefixTable('categories_folders').'
3991 3990
                     WHERE id_folder = %i',
3992 3991
                     $inputData['id']
3993 3992
                 );
@@ -4102,9 +4101,9 @@  discard block
 block discarded – undo
4102 4101
             // List all ITEMS
4103 4102
             if ($folderIsPf === false) {
4104 4103
                 $where->add('i.inactif=%i', 0);
4105
-                $sql_e='(SELECT date FROM ' . prefixTable('log_items') 
4104
+                $sql_e = '(SELECT date FROM '.prefixTable('log_items') 
4106 4105
                     . " WHERE action = 'at_creation' AND id_item=i.id " 
4107
-                    . 'union all SELECT date FROM '. prefixTable('log_items') 
4106
+                    . 'union all SELECT date FROM '.prefixTable('log_items') 
4108 4107
                     . " WHERE action = 'at_modification' AND raison = 'at_pw'
4109 4108
                     AND id_item=i.id ORDER BY date DESC LIMIT 1)";
4110 4109
                 $where->add('l.date=%l', $sql_e);
@@ -4112,8 +4111,8 @@  discard block
 block discarded – undo
4112 4111
                     $where->add('i.id IN %ls', explode(',', $limited_to_items));
4113 4112
                 }
4114 4113
 
4115
-                $query_limit = ' LIMIT ' .
4116
-                    $start . ',' .
4114
+                $query_limit = ' LIMIT '.
4115
+                    $start.','.
4117 4116
                     $post_nb_items_to_display_once;
4118 4117
                 //db::debugmode(true);
4119 4118
                 $rows = DB::query(
@@ -4125,9 +4124,9 @@  discard block
 block discarded – undo
4125 4124
                     l.id_user AS log_user,
4126 4125
                     i.url AS link,
4127 4126
                     i.email AS email
4128
-                    FROM ' . prefixTable('items') . ' AS i
4129
-                    INNER JOIN ' . prefixTable('nested_tree') . ' AS n ON (i.id_tree = n.id)
4130
-                    INNER JOIN ' . prefixTable('log_items') . ' AS l ON (i.id = l.id_item)
4127
+                    FROM ' . prefixTable('items').' AS i
4128
+                    INNER JOIN ' . prefixTable('nested_tree').' AS n ON (i.id_tree = n.id)
4129
+                    INNER JOIN ' . prefixTable('log_items').' AS l ON (i.id = l.id_item)
4131 4130
                     WHERE %l
4132 4131
                     GROUP BY i.id, l.date, l.id_user, l.action
4133 4132
                     ORDER BY i.label ASC, l.date DESC' . $query_limit,
@@ -4147,9 +4146,9 @@  discard block
 block discarded – undo
4147 4146
                     l.id_user AS log_user,
4148 4147
                     i.url AS link,
4149 4148
                     i.email AS email
4150
-                    FROM ' . prefixTable('items') . ' AS i
4151
-                    INNER JOIN ' . prefixTable('nested_tree') . ' AS n ON (i.id_tree = n.id)
4152
-                    INNER JOIN ' . prefixTable('log_items') . ' AS l ON (i.id = l.id_item)
4149
+                    FROM ' . prefixTable('items').' AS i
4150
+                    INNER JOIN ' . prefixTable('nested_tree').' AS n ON (i.id_tree = n.id)
4151
+                    INNER JOIN ' . prefixTable('log_items').' AS l ON (i.id = l.id_item)
4153 4152
                     WHERE %l
4154 4153
                     GROUP BY i.id, l.date, l.id_user, l.action
4155 4154
                     ORDER BY i.label ASC, l.date DESC',
@@ -4180,7 +4179,7 @@  discard block
 block discarded – undo
4180 4179
                     $item_is_restricted_to_role = false;
4181 4180
                     DB::queryfirstrow(
4182 4181
                         'SELECT role_id
4183
-                        FROM ' . prefixTable('restriction_to_roles') . '
4182
+                        FROM ' . prefixTable('restriction_to_roles').'
4184 4183
                         WHERE item_id = %i',
4185 4184
                         $record['id']
4186 4185
                     );
@@ -4192,7 +4191,7 @@  discard block
 block discarded – undo
4192 4191
                     $user_is_included_in_role = false;
4193 4192
                     DB::query(
4194 4193
                         'SELECT role_id
4195
-                        FROM ' . prefixTable('restriction_to_roles') . '
4194
+                        FROM ' . prefixTable('restriction_to_roles').'
4196 4195
                         WHERE item_id = %i AND role_id IN %ls',
4197 4196
                         $record['id'],
4198 4197
                         $session->get('user-roles_array')
@@ -4402,9 +4401,9 @@  discard block
 block discarded – undo
4402 4401
         if ((int) $start === 0) {
4403 4402
             DB::query(
4404 4403
                 'SELECT i.id
4405
-                FROM ' . prefixTable('items') . ' as i
4406
-                INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree = n.id)
4407
-                INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id = l.id_item)
4404
+                FROM ' . prefixTable('items').' as i
4405
+                INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree = n.id)
4406
+                INNER JOIN ' . prefixTable('log_items').' as l ON (i.id = l.id_item)
4408 4407
                 WHERE %l
4409 4408
                 ORDER BY i.label ASC, l.date DESC',
4410 4409
                 $where
@@ -4469,8 +4468,8 @@  discard block
 block discarded – undo
4469 4468
         $dataItem = DB::queryfirstrow(
4470 4469
             'SELECT i.pw AS pw, s.share_key AS share_key, i.id AS id,
4471 4470
                     i.label AS label, i.id_tree AS id_tree
4472
-            FROM ' . prefixTable('items') . ' AS i
4473
-            INNER JOIN ' . prefixTable('sharekeys_items') . ' AS s ON (s.object_id = i.id)
4471
+            FROM ' . prefixTable('items').' AS i
4472
+            INNER JOIN ' . prefixTable('sharekeys_items').' AS s ON (s.object_id = i.id)
4474 4473
             WHERE user_id = %i AND (i.item_key = %s OR i.id = %i)',
4475 4474
             $session->get('user-id'),
4476 4475
             $inputData['itemKey'] ?? '',
@@ -4565,7 +4564,7 @@  discard block
 block discarded – undo
4565 4564
             // get if existing edition lock
4566 4565
             $dataItemEditionLocks = DB::query(
4567 4566
                 'SELECT timestamp, user_id
4568
-                FROM ' . prefixTable('items_edition') . '
4567
+                FROM ' . prefixTable('items_edition').'
4569 4568
                 WHERE item_id = %i 
4570 4569
                 ORDER BY increment_id DESC',
4571 4570
                 $inputData['itemId']
@@ -4574,7 +4573,7 @@  discard block
 block discarded – undo
4574 4573
             if (WIP === true) error_log('Existing edition locks: '.DB::count());
4575 4574
 
4576 4575
             // Check if item has no edition lock
4577
-            if ((int) DB::count() > 0 ) {
4576
+            if ((int) DB::count() > 0) {
4578 4577
                 // get last edition lock
4579 4578
                 $dataLastItemEditionLock = $dataItemEditionLocks[0];
4580 4579
 
@@ -4584,10 +4583,10 @@  discard block
 block discarded – undo
4584 4583
                 } else {
4585 4584
                     $delay = EDITION_LOCK_PERIOD; // One day delay
4586 4585
                 }
4587
-                if (WIP === true) error_log('delay: ' . $delay);
4586
+                if (WIP === true) error_log('delay: '.$delay);
4588 4587
 
4589 4588
                 // We remove old edition locks if delay is expired meaning more than 1 day long
4590
-                if (round(abs(time() - $dataTmp['timestamp']),0) > $delay) {
4589
+                if (round(abs(time() - $dataTmp['timestamp']), 0) > $delay) {
4591 4590
                     // Case where time is expired
4592 4591
                     // In this case, delete edition lock and possible ongoing processes
4593 4592
                     // and continue editing this time
@@ -4604,7 +4603,7 @@  discard block
 block discarded – undo
4604 4603
                         // Get process Id
4605 4604
                         $processDetail = DB::queryFirstRow(
4606 4605
                             'SELECT increment_id
4607
-                            FROM ' . prefixTable('background_tasks') . '
4606
+                            FROM ' . prefixTable('background_tasks').'
4608 4607
                             WHERE item_id = %i AND finished_at = ""',
4609 4608
                             $inputData['itemId']
4610 4609
                         );
@@ -4622,7 +4621,7 @@  discard block
 block discarded – undo
4622 4621
                     // get if existing process ongoing for this item
4623 4622
                     $dataItemProcessOngoing = DB::queryFirstRow(
4624 4623
                         'SELECT JSON_EXTRACT(arguments, "$.all_users_except_id") AS all_users_except_id
4625
-                        FROM ' . prefixTable('background_tasks') . '
4624
+                        FROM ' . prefixTable('background_tasks').'
4626 4625
                         WHERE item_id = %i AND finished_at = ""
4627 4626
                         ORDER BY increment_id DESC',
4628 4627
                         $inputData['itemId']
@@ -4649,7 +4648,7 @@  discard block
 block discarded – undo
4649 4648
                         );
4650 4649
                         break;
4651 4650
                     }
4652
-                } elseif (round(abs(time() - $dataTmp['timestamp']),0) <= $delay) {
4651
+                } elseif (round(abs(time() - $dataTmp['timestamp']), 0) <= $delay) {
4653 4652
                     // Case where edition lock is already taken by another user
4654 4653
                     // Then no edition is possible
4655 4654
                     $returnValues = array(
@@ -4678,7 +4677,7 @@  discard block
 block discarded – undo
4678 4677
         // do query on this folder
4679 4678
         $data_this_folder = DB::queryFirstRow(
4680 4679
             'SELECT id, personal_folder, title
4681
-            FROM ' . prefixTable('nested_tree') . '
4680
+            FROM ' . prefixTable('nested_tree').'
4682 4681
             WHERE id = %s',
4683 4682
             $inputData['folderId']
4684 4683
         );
@@ -4718,8 +4717,8 @@  discard block
 block discarded – undo
4718 4717
         $visibilite = '';
4719 4718
         $data = DB::queryFirstRow(
4720 4719
             'SELECT m.valeur, n.personal_folder
4721
-            FROM ' . prefixTable('misc') . ' AS m
4722
-            INNER JOIN ' . prefixTable('nested_tree') . ' AS n ON (m.intitule = n.id)
4720
+            FROM ' . prefixTable('misc').' AS m
4721
+            INNER JOIN ' . prefixTable('nested_tree').' AS n ON (m.intitule = n.id)
4723 4722
             WHERE type=%s AND intitule = %s',
4724 4723
             'complex',
4725 4724
             $inputData['folderId']
@@ -4732,8 +4731,8 @@  discard block
 block discarded – undo
4732 4731
             // Prepare Item actual visibility (what Users/Roles can see it)
4733 4732
             $rows = DB::query(
4734 4733
                 'SELECT t.title
4735
-                FROM ' . prefixTable('roles_values') . ' as v
4736
-                INNER JOIN ' . prefixTable('roles_title') . ' as t ON (v.role_id = t.id)
4734
+                FROM ' . prefixTable('roles_values').' as v
4735
+                INNER JOIN ' . prefixTable('roles_title').' as t ON (v.role_id = t.id)
4737 4736
                 WHERE v.folder_id = %i
4738 4737
                 GROUP BY title',
4739 4738
                 $inputData['folderId']
@@ -4742,7 +4741,7 @@  discard block
 block discarded – undo
4742 4741
                 if (empty($visibilite)) {
4743 4742
                     $visibilite = $record['title'];
4744 4743
                 } else {
4745
-                    $visibilite .= ' - ' . $record['title'];
4744
+                    $visibilite .= ' - '.$record['title'];
4746 4745
                 }
4747 4746
             }
4748 4747
         } else {
@@ -4752,14 +4751,14 @@  discard block
 block discarded – undo
4752 4751
             // do new query to know if current folder is pf
4753 4752
             $data_pf = DB::queryFirstRow(
4754 4753
                 'SELECT personal_folder
4755
-                FROM ' . prefixTable('nested_tree') . '
4754
+                FROM ' . prefixTable('nested_tree').'
4756 4755
                 WHERE id = %s',
4757 4756
                 $inputData['folderId']
4758 4757
             );
4759 4758
             
4760 4759
             $folder_is_personal = $data_pf !== null ? (int) $data_pf['personal_folder'] : 0;
4761 4760
             
4762
-            $visibilite = $session->get('user-name') . ' ' . $session->get('user-lastname') . ' (' . $session->get('user-login') . ')';
4761
+            $visibilite = $session->get('user-name').' '.$session->get('user-lastname').' ('.$session->get('user-login').')';
4763 4762
         }
4764 4763
 
4765 4764
         recupDroitCreationSansComplexite($inputData['folderId']);
@@ -4769,8 +4768,8 @@  discard block
 block discarded – undo
4769 4768
         $listOptionsForRoles = array();
4770 4769
         $rows = DB::query(
4771 4770
             'SELECT r.role_id AS role_id, t.title AS title
4772
-            FROM ' . prefixTable('roles_values') . ' AS r
4773
-            INNER JOIN ' . prefixTable('roles_title') . ' AS t ON (r.role_id = t.id)
4771
+            FROM ' . prefixTable('roles_values').' AS r
4772
+            INNER JOIN ' . prefixTable('roles_title').' AS t ON (r.role_id = t.id)
4774 4773
             WHERE r.folder_id = %i',
4775 4774
             $inputData['folderId']
4776 4775
         );
@@ -4784,7 +4783,7 @@  discard block
 block discarded – undo
4784 4783
             );
4785 4784
             $rows2 = DB::query(
4786 4785
                 'SELECT id, login, fonction_id, email, name, lastname
4787
-                FROM ' . prefixTable('users') . '
4786
+                FROM ' . prefixTable('users').'
4788 4787
                 WHERE admin = 0 AND fonction_id is not null'
4789 4788
             );
4790 4789
             foreach ($rows2 as $record2) {
@@ -4798,7 +4797,7 @@  discard block
 block discarded – undo
4798 4797
                             array(
4799 4798
                                 'id' => $record2['id'],
4800 4799
                                 'login' => $record2['login'],
4801
-                                'name' => $record2['name'] . ' ' . $record2['lastname'],
4800
+                                'name' => $record2['name'].' '.$record2['lastname'],
4802 4801
                                 'email' => $record2['email'],
4803 4802
                             )
4804 4803
                         );
@@ -4815,13 +4814,13 @@  discard block
 block discarded – undo
4815 4814
                 //db::debugmode(true);
4816 4815
                 $access = DB::queryFirstRow(
4817 4816
                     'SELECT type
4818
-                    FROM ' . prefixTable('roles_values') . '
4817
+                    FROM ' . prefixTable('roles_values').'
4819 4818
                     WHERE role_id = %i AND folder_id = %i',
4820 4819
                     $role,
4821 4820
                     $inputData['folderId']
4822 4821
                 );
4823 4822
                 //db::debugmode(false);
4824
-                if (DB::count()>0) {
4823
+                if (DB::count() > 0) {
4825 4824
                     if ($access['type'] === 'R') {
4826 4825
                         array_push($arrTmp, 10);
4827 4826
                     } elseif ($access['type'] === 'W') {
@@ -4849,7 +4848,7 @@  discard block
 block discarded – undo
4849 4848
             // Check if personal folder is owned by user
4850 4849
             $folder = DB::queryFirstRow(
4851 4850
                 'SELECT id
4852
-                FROM ' . prefixTable('nested_tree') . '
4851
+                FROM ' . prefixTable('nested_tree').'
4853 4852
                 WHERE title = %s',
4854 4853
                 $session->get('user-id'),
4855 4854
             );
@@ -4954,7 +4953,7 @@  discard block
 block discarded – undo
4954 4953
         // Get some info before deleting
4955 4954
         $data = DB::queryFirstRow(
4956 4955
             'SELECT name, id_item, file
4957
-            FROM ' . prefixTable('files') . '
4956
+            FROM ' . prefixTable('files').'
4958 4957
             WHERE id = %i',
4959 4958
             $fileId
4960 4959
         );
@@ -4962,7 +4961,7 @@  discard block
 block discarded – undo
4962 4961
         // Load item data
4963 4962
         $data_item = DB::queryFirstRow(
4964 4963
             'SELECT id_tree
4965
-            FROM ' . prefixTable('items') . '
4964
+            FROM ' . prefixTable('items').'
4966 4965
             WHERE id = %i',
4967 4966
             $data['id_item']
4968 4967
         );
@@ -4992,7 +4991,7 @@  discard block
 block discarded – undo
4992 4991
                 $session->get('user-id'),
4993 4992
                 'at_modification',
4994 4993
                 $session->get('user-login'),
4995
-                'at_del_file : ' . $data['name']
4994
+                'at_del_file : '.$data['name']
4996 4995
             );
4997 4996
 
4998 4997
             // DElete sharekeys
@@ -5003,7 +5002,7 @@  discard block
 block discarded – undo
5003 5002
             );
5004 5003
 
5005 5004
             // Delete file from server
5006
-            $fileToDelete = $SETTINGS['path_to_upload_folder'] . '/' . TP_FILE_PREFIX . base64_decode($data['file']);
5005
+            $fileToDelete = $SETTINGS['path_to_upload_folder'].'/'.TP_FILE_PREFIX.base64_decode($data['file']);
5007 5006
             $fileToDelete = realpath($fileToDelete);
5008 5007
             if ($fileToDelete && strpos($fileToDelete, $SETTINGS['path_to_upload_folder']) === 0) {
5009 5008
                 fileDelete($fileToDelete, $SETTINGS);
@@ -5057,7 +5056,7 @@  discard block
 block discarded – undo
5057 5056
             // Update SESSION with this new favourite
5058 5057
             $data = DB::queryfirstrow(
5059 5058
                 'SELECT label,id_tree
5060
-                FROM ' . prefixTable('items') . '
5059
+                FROM ' . prefixTable('items').'
5061 5060
                 WHERE id = %i',
5062 5061
                 $inputData['itemId']
5063 5062
             );
@@ -5066,7 +5065,7 @@  discard block
 block discarded – undo
5066 5065
                 [
5067 5066
                     $inputData['itemId'] => [
5068 5067
                         'label' => $data['label'],
5069
-                        'url' => 'index.php?page=items&amp;group=' . $data['id_tree'] . '&amp;id=' . $inputData['itemId'],
5068
+                        'url' => 'index.php?page=items&amp;group='.$data['id_tree'].'&amp;id='.$inputData['itemId'],
5070 5069
                     ],
5071 5070
                 ],
5072 5071
                 'add'
@@ -5135,8 +5134,8 @@  discard block
 block discarded – undo
5135 5134
         // get data about item
5136 5135
         $dataSource = DB::queryfirstrow(
5137 5136
             'SELECT i.pw, f.personal_folder,i.id_tree, f.title,i.label
5138
-            FROM ' . prefixTable('items') . ' as i
5139
-            INNER JOIN ' . prefixTable('nested_tree') . ' as f ON (i.id_tree=f.id)
5137
+            FROM ' . prefixTable('items').' as i
5138
+            INNER JOIN ' . prefixTable('nested_tree').' as f ON (i.id_tree=f.id)
5140 5139
             WHERE i.id=%i',
5141 5140
             $inputData['itemId']
5142 5141
         );
@@ -5180,7 +5179,7 @@  discard block
 block discarded – undo
5180 5179
         // get data about new folder
5181 5180
         $dataDestination = DB::queryfirstrow(
5182 5181
             'SELECT personal_folder, title
5183
-            FROM ' . prefixTable('nested_tree') . '
5182
+            FROM ' . prefixTable('nested_tree').'
5184 5183
             WHERE id = %i',
5185 5184
             $inputData['folderId']
5186 5185
         );
@@ -5233,7 +5232,7 @@  discard block
 block discarded – undo
5233 5232
             // Get fields for this Item
5234 5233
             $rows = DB::query(
5235 5234
                 'SELECT id
5236
-                FROM ' . prefixTable('categories_items') . '
5235
+                FROM ' . prefixTable('categories_items').'
5237 5236
                 WHERE item_id = %i',
5238 5237
                 $inputData['itemId']
5239 5238
             );
@@ -5250,7 +5249,7 @@  discard block
 block discarded – undo
5250 5249
             // Get FILES for this Item
5251 5250
             $rows = DB::query(
5252 5251
                 'SELECT id
5253
-                FROM ' . prefixTable('files') . '
5252
+                FROM ' . prefixTable('files').'
5254 5253
                 WHERE id_item = %i',
5255 5254
                 $inputData['itemId']
5256 5255
             );
@@ -5297,7 +5296,7 @@  discard block
 block discarded – undo
5297 5296
             // Get the ITEM object key for the user
5298 5297
             $userKey = DB::queryFirstRow(
5299 5298
                 'SELECT share_key
5300
-                FROM ' . prefixTable('sharekeys_items') . '
5299
+                FROM ' . prefixTable('sharekeys_items').'
5301 5300
                 WHERE user_id = %i AND object_id = %i',
5302 5301
                 $session->get('user-id'),
5303 5302
                 $inputData['itemId']
@@ -5308,7 +5307,7 @@  discard block
 block discarded – undo
5308 5307
                 // This is a public object
5309 5308
                 $users = DB::query(
5310 5309
                     'SELECT id, public_key
5311
-                    FROM ' . prefixTable('users') . '
5310
+                    FROM ' . prefixTable('users').'
5312 5311
                     WHERE id NOT IN %li
5313 5312
                     AND public_key != ""',
5314 5313
                     $tpUsersIDs
@@ -5331,14 +5330,14 @@  discard block
 block discarded – undo
5331 5330
             // Get fields for this Item
5332 5331
             $rows = DB::query(
5333 5332
                 'SELECT id
5334
-                FROM ' . prefixTable('categories_items') . '
5333
+                FROM ' . prefixTable('categories_items').'
5335 5334
                 WHERE item_id = %i',
5336 5335
                 $inputData['itemId']
5337 5336
             );
5338 5337
             foreach ($rows as $field) {
5339 5338
                 $userKey = DB::queryFirstRow(
5340 5339
                     'SELECT share_key
5341
-                    FROM ' . prefixTable('sharekeys_fields') . '
5340
+                    FROM ' . prefixTable('sharekeys_fields').'
5342 5341
                     WHERE user_id = %i AND object_id = %i',
5343 5342
                     $session->get('user-id'),
5344 5343
                     $field['id']
@@ -5349,7 +5348,7 @@  discard block
 block discarded – undo
5349 5348
                     // This is a public object
5350 5349
                     $users = DB::query(
5351 5350
                         'SELECT id, public_key
5352
-                        FROM ' . prefixTable('users') . '
5351
+                        FROM ' . prefixTable('users').'
5353 5352
                         WHERE id NOT IN %li
5354 5353
                         AND public_key != ""',
5355 5354
                         $tpUsersIDs
@@ -5372,14 +5371,14 @@  discard block
 block discarded – undo
5372 5371
             // Get FILES for this Item
5373 5372
             $rows = DB::query(
5374 5373
                 'SELECT id
5375
-                FROM ' . prefixTable('files') . '
5374
+                FROM ' . prefixTable('files').'
5376 5375
                 WHERE id_item = %i',
5377 5376
                 $inputData['itemId']
5378 5377
             );
5379 5378
             foreach ($rows as $attachment) {
5380 5379
                 $userKey = DB::queryFirstRow(
5381 5380
                     'SELECT share_key
5382
-                    FROM ' . prefixTable('sharekeys_files') . '
5381
+                    FROM ' . prefixTable('sharekeys_files').'
5383 5382
                     WHERE user_id = %i AND object_id = %i',
5384 5383
                     $session->get('user-id'),
5385 5384
                     $attachment['id']
@@ -5390,7 +5389,7 @@  discard block
 block discarded – undo
5390 5389
                     // This is a public object
5391 5390
                     $users = DB::query(
5392 5391
                         'SELECT id, public_key
5393
-                        FROM ' . prefixTable('users') . '
5392
+                        FROM ' . prefixTable('users').'
5394 5393
                         WHERE id NOT IN %li
5395 5394
                         AND public_key != ""',
5396 5395
                         $tpUsersIDs
@@ -5431,7 +5430,7 @@  discard block
 block discarded – undo
5431 5430
             $session->get('user-id'),
5432 5431
             'at_modification',
5433 5432
             $session->get('user-login'),
5434
-            'at_moved : ' . $dataSource['title'] . ' -> ' . $dataDestination['title']
5433
+            'at_moved : '.$dataSource['title'].' -> '.$dataDestination['title']
5435 5434
         );
5436 5435
 
5437 5436
         // Update cache table
@@ -5490,8 +5489,8 @@  discard block
 block discarded – undo
5490 5489
                 // get data about item
5491 5490
                 $dataSource = DB::queryfirstrow(
5492 5491
                     'SELECT i.pw, f.personal_folder,i.id_tree, f.title,i.label
5493
-                    FROM ' . prefixTable('items') . ' as i
5494
-                    INNER JOIN ' . prefixTable('nested_tree') . ' as f ON (i.id_tree=f.id)
5492
+                    FROM ' . prefixTable('items').' as i
5493
+                    INNER JOIN ' . prefixTable('nested_tree').' as f ON (i.id_tree=f.id)
5495 5494
                     WHERE i.id=%i',
5496 5495
                     $item_id
5497 5496
                 );
@@ -5513,7 +5512,7 @@  discard block
 block discarded – undo
5513 5512
 
5514 5513
                 // get data about new folder
5515 5514
                 $dataDestination = DB::queryfirstrow(
5516
-                    'SELECT personal_folder, title FROM ' . prefixTable('nested_tree') . ' WHERE id = %i',
5515
+                    'SELECT personal_folder, title FROM '.prefixTable('nested_tree').' WHERE id = %i',
5517 5516
                     $inputData['folderId']
5518 5517
                 );
5519 5518
 
@@ -5555,7 +5554,7 @@  discard block
 block discarded – undo
5555 5554
                     // Get fields for this Item
5556 5555
                     $rows = DB::query(
5557 5556
                         'SELECT id
5558
-                        FROM ' . prefixTable('categories_items') . '
5557
+                        FROM ' . prefixTable('categories_items').'
5559 5558
                         WHERE item_id = %i',
5560 5559
                         $item_id
5561 5560
                     );
@@ -5572,7 +5571,7 @@  discard block
 block discarded – undo
5572 5571
                     // Get FILES for this Item
5573 5572
                     $rows = DB::query(
5574 5573
                         'SELECT id
5575
-                        FROM ' . prefixTable('files') . '
5574
+                        FROM ' . prefixTable('files').'
5576 5575
                         WHERE id_item = %i',
5577 5576
                         $item_id
5578 5577
                     );
@@ -5627,7 +5626,7 @@  discard block
 block discarded – undo
5627 5626
                     // Get the ITEM object key for the user
5628 5627
                     $userKey = DB::queryFirstRow(
5629 5628
                         'SELECT share_key
5630
-                        FROM ' . prefixTable('sharekeys_items') . '
5629
+                        FROM ' . prefixTable('sharekeys_items').'
5631 5630
                         WHERE user_id = %i AND object_id = %i',
5632 5631
                         $session->get('user-id'),
5633 5632
                         $item_id
@@ -5638,7 +5637,7 @@  discard block
 block discarded – undo
5638 5637
                         // This is a public object
5639 5638
                         $users = DB::query(
5640 5639
                             'SELECT id, public_key
5641
-                            FROM ' . prefixTable('users') . '
5640
+                            FROM ' . prefixTable('users').'
5642 5641
                             WHERE id NOT IN %li
5643 5642
                             AND public_key != ""',
5644 5643
                             $tpUsersIDs
@@ -5661,14 +5660,14 @@  discard block
 block discarded – undo
5661 5660
                     // Get fields for this Item
5662 5661
                     $rows = DB::query(
5663 5662
                         'SELECT id
5664
-                        FROM ' . prefixTable('categories_items') . '
5663
+                        FROM ' . prefixTable('categories_items').'
5665 5664
                         WHERE item_id = %i',
5666 5665
                         $item_id
5667 5666
                     );
5668 5667
                     foreach ($rows as $field) {
5669 5668
                         $userKey = DB::queryFirstRow(
5670 5669
                             'SELECT share_key
5671
-                            FROM ' . prefixTable('sharekeys_fields') . '
5670
+                            FROM ' . prefixTable('sharekeys_fields').'
5672 5671
                             WHERE user_id = %i AND object_id = %i',
5673 5672
                             $session->get('user-id'),
5674 5673
                             $field['id']
@@ -5679,7 +5678,7 @@  discard block
 block discarded – undo
5679 5678
                             // This is a public object
5680 5679
                             $users = DB::query(
5681 5680
                                 'SELECT id, public_key
5682
-                                FROM ' . prefixTable('users') . '
5681
+                                FROM ' . prefixTable('users').'
5683 5682
                                 WHERE id NOT IN %li
5684 5683
                                 AND public_key != ""',
5685 5684
                                 $tpUsersIDs
@@ -5703,14 +5702,14 @@  discard block
 block discarded – undo
5703 5702
                     // Get FILES for this Item
5704 5703
                     $rows = DB::query(
5705 5704
                         'SELECT id
5706
-                        FROM ' . prefixTable('files') . '
5705
+                        FROM ' . prefixTable('files').'
5707 5706
                         WHERE id_item = %i',
5708 5707
                         $item_id
5709 5708
                     );
5710 5709
                     foreach ($rows as $attachment) {
5711 5710
                         $userKey = DB::queryFirstRow(
5712 5711
                             'SELECT share_key
5713
-                            FROM ' . prefixTable('sharekeys_files') . '
5712
+                            FROM ' . prefixTable('sharekeys_files').'
5714 5713
                             WHERE user_id = %i AND object_id = %i',
5715 5714
                             $session->get('user-id'),
5716 5715
                             $attachment['id']
@@ -5721,7 +5720,7 @@  discard block
 block discarded – undo
5721 5720
                             // This is a public object
5722 5721
                             $users = DB::query(
5723 5722
                                 'SELECT id, public_key
5724
-                                FROM ' . prefixTable('users') . '
5723
+                                FROM ' . prefixTable('users').'
5725 5724
                                 WHERE id NOT IN %li
5726 5725
                                 AND public_key != ""',
5727 5726
                                 $tpUsersIDs
@@ -5761,13 +5760,13 @@  discard block
 block discarded – undo
5761 5760
                     $session->get('user-id'),
5762 5761
                     'at_modification',
5763 5762
                     $session->get('user-login'),
5764
-                    'at_moved : ' . $dataSource['title'] . ' -> ' . $dataDestination['title']
5763
+                    'at_moved : '.$dataSource['title'].' -> '.$dataDestination['title']
5765 5764
                 );
5766 5765
             }
5767 5766
         }
5768 5767
 
5769 5768
         // reload cache table
5770
-        require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
5769
+        require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
5771 5770
         updateCacheTable('reload', null);
5772 5771
 
5773 5772
         echo (string) prepareExchangedData(
@@ -5831,7 +5830,7 @@  discard block
 block discarded – undo
5831 5830
                 // get info
5832 5831
                 $dataSource = DB::queryfirstrow(
5833 5832
                     'SELECT label, id_tree
5834
-                    FROM ' . prefixTable('items') . '
5833
+                    FROM ' . prefixTable('items').'
5835 5834
                     WHERE id=%i',
5836 5835
                     $item_id
5837 5836
                 );
@@ -5932,14 +5931,14 @@  discard block
 block discarded – undo
5932 5931
             // Variables
5933 5932
             $dataAuthor = DB::queryfirstrow(
5934 5933
                 'SELECT email,login
5935
-                FROM ' . prefixTable('users') . '
5934
+                FROM ' . prefixTable('users').'
5936 5935
                 WHERE id = %i',
5937 5936
                 $post_content[1]
5938 5937
             );
5939 5938
 
5940 5939
             $dataItem = DB::queryfirstrow(
5941 5940
                 'SELECT label, id_tree
5942
-                FROM ' . prefixTable('items') . '
5941
+                FROM ' . prefixTable('items').'
5943 5942
                 WHERE id = %i',
5944 5943
                 $post_content[0]
5945 5944
             );
@@ -5956,7 +5955,7 @@  discard block
 block discarded – undo
5956 5955
                 $lang->get('email_request_access_subject'),
5957 5956
                 str_replace(
5958 5957
                     array('#tp_item_author#', '#tp_user#', '#tp_item#'),
5959
-                    array(' ' . addslashes($dataAuthor['login']), addslashes($session->get('user-login')), $path),
5958
+                    array(' '.addslashes($dataAuthor['login']), addslashes($session->get('user-login')), $path),
5960 5959
                     $lang->get('email_request_access_mail')
5961 5960
                 ),
5962 5961
                 $dataAuthor['email'],
@@ -5965,7 +5964,7 @@  discard block
 block discarded – undo
5965 5964
         } elseif ($inputData['cat'] === 'share_this_item') {
5966 5965
             $dataItem = DB::queryfirstrow(
5967 5966
                 'SELECT label,id_tree
5968
-                FROM ' . prefixTable('items') . '
5967
+                FROM ' . prefixTable('items').'
5969 5968
                 WHERE id= %i',
5970 5969
                 $inputData['id']
5971 5970
             );
@@ -5988,7 +5987,7 @@  discard block
 block discarded – undo
5988 5987
                     ),
5989 5988
                     array(
5990 5989
                         empty($SETTINGS['email_server_url']) === false ?
5991
-                            $SETTINGS['email_server_url'] . '/index.php?page=items&group=' . $dataItem['id_tree'] . '&id=' . $inputData['id'] : $SETTINGS['cpassman_url'] . '/index.php?page=items&group=' . $dataItem['id_tree'] . '&id=' . $inputData['id'],
5990
+                            $SETTINGS['email_server_url'].'/index.php?page=items&group='.$dataItem['id_tree'].'&id='.$inputData['id'] : $SETTINGS['cpassman_url'].'/index.php?page=items&group='.$dataItem['id_tree'].'&id='.$inputData['id'],
5992 5991
                         addslashes($session->get('user-login')),
5993 5992
                         addslashes($path),
5994 5993
                     ),
@@ -6037,8 +6036,8 @@  discard block
 block discarded – undo
6037 6036
         // Get all informations for this item
6038 6037
         $dataItem = DB::queryfirstrow(
6039 6038
             'SELECT *
6040
-            FROM ' . prefixTable('items') . ' as i
6041
-            INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id)
6039
+            FROM ' . prefixTable('items').' as i
6040
+            INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id)
6042 6041
             WHERE i.id=%i AND l.action = %s',
6043 6042
             $item_id,
6044 6043
             'at_creation'
@@ -6067,18 +6066,18 @@  discard block
 block discarded – undo
6067 6066
                 $session->get('user-login'),
6068 6067
                 htmlspecialchars_decode($label, ENT_QUOTES),
6069 6068
                 null,
6070
-                (string) dateToStamp($date.' '.$time, $SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'])
6069
+                (string) dateToStamp($date.' '.$time, $SETTINGS['date_format'].' '.$SETTINGS['time_format'])
6071 6070
             );
6072 6071
             // Prepare new line
6073 6072
             $data = DB::queryfirstrow(
6074
-                'SELECT * FROM ' . prefixTable('log_items') . ' WHERE id_item = %i ORDER BY date DESC',
6073
+                'SELECT * FROM '.prefixTable('log_items').' WHERE id_item = %i ORDER BY date DESC',
6075 6074
                 $item_id
6076 6075
             );
6077
-            $historic = date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $data['date']) . ' - ' . $session->get('user-login') . ' - ' . $lang->get($data['action']) . ' - ' . $data['raison'];
6076
+            $historic = date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $data['date']).' - '.$session->get('user-login').' - '.$lang->get($data['action']).' - '.$data['raison'];
6078 6077
             // send back
6079 6078
             $data = array(
6080 6079
                 'error' => '',
6081
-                'new_line' => '<br>' . addslashes($historic),
6080
+                'new_line' => '<br>'.addslashes($historic),
6082 6081
             );
6083 6082
             echo (string) prepareExchangedData(
6084 6083
                 $data,
@@ -6153,8 +6152,8 @@  discard block
 block discarded – undo
6153 6152
         // Should we log a password change?
6154 6153
         $itemQ = DB::queryFirstRow(
6155 6154
             'SELECT s.share_key, i.pw
6156
-            FROM ' . prefixTable('items') . ' AS i
6157
-            INNER JOIN ' . prefixTable('sharekeys_items') . ' AS s ON (i.id = s.object_id)
6155
+            FROM ' . prefixTable('items').' AS i
6156
+            INNER JOIN ' . prefixTable('sharekeys_items').' AS s ON (i.id = s.object_id)
6158 6157
             WHERE s.user_id = %i AND s.object_id = %i',
6159 6158
             $session->get('user-id'),
6160 6159
             $dataReceived['id']
@@ -6209,7 +6208,7 @@  discard block
 block discarded – undo
6209 6208
         if (isset($SETTINGS['otv_expiration_period']) === false) {
6210 6209
             $SETTINGS['otv_expiration_period'] = 7;
6211 6210
         }
6212
-        $url = $SETTINGS['cpassman_url'] . '/index.php?' . http_build_query($otv_session);
6211
+        $url = $SETTINGS['cpassman_url'].'/index.php?'.http_build_query($otv_session);
6213 6212
 
6214 6213
         echo json_encode(
6215 6214
             array(
@@ -6240,7 +6239,7 @@  discard block
 block discarded – undo
6240 6239
         // get parameters from original link
6241 6240
         $url = $dataReceived['original_link'];
6242 6241
         $parts = parse_url($url);
6243
-        if(isset($parts['query'])){
6242
+        if (isset($parts['query'])) {
6244 6243
             parse_str($parts['query'], $orignal_link_parameters);
6245 6244
         } else {
6246 6245
             $orignal_link_parameters = array();
@@ -6271,13 +6270,13 @@  discard block
 block discarded – undo
6271 6270
             $domain_scheme = parse_url($SETTINGS['cpassman_url'], PHP_URL_SCHEME);
6272 6271
             $domain_host = parse_url($SETTINGS['cpassman_url'], PHP_URL_HOST);
6273 6272
             if (str_contains($domain_host, 'www.') === true) {
6274
-                $domain_host = (string) $SETTINGS['otv_subdomain'] . '.' . substr($domain_host, 4);
6273
+                $domain_host = (string) $SETTINGS['otv_subdomain'].'.'.substr($domain_host, 4);
6275 6274
             } else {
6276
-                $domain_host = (string) $SETTINGS['otv_subdomain'] . '.' . $domain_host;
6275
+                $domain_host = (string) $SETTINGS['otv_subdomain'].'.'.$domain_host;
6277 6276
             }
6278
-            $url = $domain_scheme.'://'.$domain_host . '/index.php?'.http_build_query($otv_session);
6277
+            $url = $domain_scheme.'://'.$domain_host.'/index.php?'.http_build_query($otv_session);
6279 6278
         } else {
6280
-            $url = $SETTINGS['cpassman_url'] . '/index.php?'.http_build_query($otv_session);
6279
+            $url = $SETTINGS['cpassman_url'].'/index.php?'.http_build_query($otv_session);
6281 6280
         }
6282 6281
 
6283 6282
         echo (string) prepareExchangedData(
@@ -6312,8 +6311,8 @@  discard block
 block discarded – undo
6312 6311
             'SELECT f.id AS id, f.file AS file, f.name AS name, f.status AS status,
6313 6312
             f.extension AS extension, f.type AS type,
6314 6313
             s.share_key AS share_key
6315
-            FROM ' . prefixTable('files') . ' AS f
6316
-            INNER JOIN ' . prefixTable('sharekeys_files') . ' AS s ON (f.id = s.object_id)
6314
+            FROM ' . prefixTable('files').' AS f
6315
+            INNER JOIN ' . prefixTable('sharekeys_files').' AS s ON (f.id = s.object_id)
6317 6316
             WHERE s.user_id = %i AND s.object_id = %i',
6318 6317
             $session->get('user-id'),
6319 6318
             $inputData['id']
@@ -6334,7 +6333,7 @@  discard block
 block discarded – undo
6334 6333
         //$fileName = basename($file_info['name'], '.'.$file_info['extension']);
6335 6334
 
6336 6335
         // prepare image info
6337
-        $post_title = basename($file_info['name'], '.' . $file_info['extension']);
6336
+        $post_title = basename($file_info['name'], '.'.$file_info['extension']);
6338 6337
         $post_title = isBase64($post_title) === true ? base64_decode($post_title) : $post_title;
6339 6338
         
6340 6339
         // Get image content
@@ -6361,7 +6360,7 @@  discard block
 block discarded – undo
6361 6360
         echo (string) prepareExchangedData(
6362 6361
             array(
6363 6362
                 'error' => false,
6364
-                'filename' => $post_title . '.' . $file_info['extension'],
6363
+                'filename' => $post_title.'.'.$file_info['extension'],
6365 6364
                 'file_type' => $file_info['type'],
6366 6365
                 'file_content' => $fileContent,
6367 6366
             ),
@@ -6475,7 +6474,7 @@  discard block
 block discarded – undo
6475 6474
                     $arbo = $tree->getPath($folder->id, false);
6476 6475
                     $path = '';
6477 6476
                     foreach ($arbo as $elem) {
6478
-                        $path = (empty($path) ? '' : $path . ' / ') . htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
6477
+                        $path = (empty($path) ? '' : $path.' / ').htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
6479 6478
                     }
6480 6479
 
6481 6480
                     // Build array
@@ -6544,7 +6543,7 @@  discard block
 block discarded – undo
6544 6543
         if (is_array($foldersArray) === true && $inputData['data'] !== '[null]') {
6545 6544
             $rows = DB::query(
6546 6545
                 'SELECT id, categories
6547
-                FROM ' . prefixTable('nested_tree') . '
6546
+                FROM ' . prefixTable('nested_tree').'
6548 6547
                 WHERE id IN (%l)',
6549 6548
                 implode(',', $foldersArray)
6550 6549
             );
@@ -6586,7 +6585,7 @@  discard block
 block discarded – undo
6586 6585
         // get item info
6587 6586
         $dataItem = DB::queryFirstRow(
6588 6587
             'SELECT *
6589
-            FROM ' . prefixTable('items') . '
6588
+            FROM ' . prefixTable('items').'
6590 6589
             WHERE id=%i',
6591 6590
             $inputData['itemId']
6592 6591
         );
@@ -6598,8 +6597,8 @@  discard block
 block discarded – undo
6598 6597
             'SELECT l.date as date, l.action as action, l.raison as raison,
6599 6598
                 u.login as login, u.avatar_thumb as avatar_thumb, u.name as name, u.lastname as lastname,
6600 6599
                 l.old_value as old_value
6601
-            FROM ' . prefixTable('log_items') . ' as l
6602
-            INNER JOIN ' . prefixTable('users') . ' as u ON (l.id_user=u.id)
6600
+            FROM ' . prefixTable('log_items').' as l
6601
+            INNER JOIN ' . prefixTable('users').' as u ON (l.id_user=u.id)
6603 6602
             WHERE id_item=%i AND l.action NOT IN (%l)
6604 6603
             ORDER BY date DESC',
6605 6604
             $inputData['itemId'],
@@ -6614,18 +6613,18 @@  discard block
 block discarded – undo
6614 6613
             
6615 6614
             // imported via API
6616 6615
             if (empty($record['login']) === true) {
6617
-                $record['login'] = $lang->get('imported_via_api') . ' [' . $record['raison'] . ']';
6616
+                $record['login'] = $lang->get('imported_via_api').' ['.$record['raison'].']';
6618 6617
             }
6619 6618
             
6620 6619
             // Prepare avatar
6621 6620
             if (isset($record['avatar_thumb']) && empty($record['avatar_thumb']) === false) {
6622
-                if (file_exists($SETTINGS['cpassman_dir'] . '/includes/avatars/' . $record['avatar_thumb'])) {
6623
-                    $avatar = $SETTINGS['cpassman_url'] . '/includes/avatars/' . $record['avatar_thumb'];
6621
+                if (file_exists($SETTINGS['cpassman_dir'].'/includes/avatars/'.$record['avatar_thumb'])) {
6622
+                    $avatar = $SETTINGS['cpassman_url'].'/includes/avatars/'.$record['avatar_thumb'];
6624 6623
                 } else {
6625
-                    $avatar = $SETTINGS['cpassman_url'] . '/includes/images/photo.jpg';
6624
+                    $avatar = $SETTINGS['cpassman_url'].'/includes/images/photo.jpg';
6626 6625
                 }
6627 6626
             } else {
6628
-                $avatar = $SETTINGS['cpassman_url'] . '/includes/images/photo.jpg';
6627
+                $avatar = $SETTINGS['cpassman_url'].'/includes/images/photo.jpg';
6629 6628
             }
6630 6629
 
6631 6630
             // Prepare action
@@ -6645,7 +6644,7 @@  discard block
 block discarded – undo
6645 6644
                         $previous_passwords, 
6646 6645
                         [
6647 6646
                             'password' => htmlentities($previous_pwd['string']),
6648
-                            'date' => date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['date']),
6647
+                            'date' => date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['date']),
6649 6648
                         ]
6650 6649
                     );
6651 6650
                 }
@@ -6658,19 +6657,19 @@  discard block
 block discarded – undo
6658 6657
                 $action = $lang->get($reason[0]);
6659 6658
                 if ($reason[0] === 'at_moved') {
6660 6659
                     $tmp = explode(' -> ', $reason[1]);
6661
-                    $detail = $lang->get('from') . ' <span class="font-weight-light">' . $tmp[0] . '</span> ' . $lang->get('to') . ' <span class="font-weight-light">' . $tmp[1] . ' </span>';
6660
+                    $detail = $lang->get('from').' <span class="font-weight-light">'.$tmp[0].'</span> '.$lang->get('to').' <span class="font-weight-light">'.$tmp[1].' </span>';
6662 6661
                 } elseif ($reason[0] === 'at_field') {
6663 6662
                     $tmp = explode(' => ', $reason[1]);
6664 6663
                     if (count($tmp) > 1) {
6665
-                        $detail = '<b>' . trim($tmp[0]) . '</b> | ' . $lang->get('previous_value') .
6666
-                            ': <span class="font-weight-light">' . trim($tmp[1]) . '</span>';
6664
+                        $detail = '<b>'.trim($tmp[0]).'</b> | '.$lang->get('previous_value').
6665
+                            ': <span class="font-weight-light">'.trim($tmp[1]).'</span>';
6667 6666
                     } else {
6668 6667
                         $detail = trim($reason[1]);
6669 6668
                     }
6670 6669
                 } elseif (in_array($reason[0], array('at_restriction', 'at_email', 'at_login', 'at_label', 'at_url', 'at_tag')) === true) {
6671 6670
                     $tmp = explode(' => ', $reason[1]);
6672 6671
                     $detail = empty(trim($tmp[0])) === true ?
6673
-                        $lang->get('no_previous_value') : $lang->get('previous_value') . ': <span class="font-weight-light">' . $tmp[0] . ' </span>';
6672
+                        $lang->get('no_previous_value') : $lang->get('previous_value').': <span class="font-weight-light">'.$tmp[0].' </span>';
6674 6673
                 } elseif ($reason[0] === 'at_automatic_del') {
6675 6674
                     $detail = $lang->get($reason[1]);
6676 6675
                 } elseif ($reason[0] === 'at_anyoneconmodify' || $reason[0] === 'at_otp_status') {
@@ -6679,7 +6678,7 @@  discard block
 block discarded – undo
6679 6678
                     $tmp = explode(':', $reason[1]);
6680 6679
                     $tmp = explode('.', $tmp[0]);
6681 6680
                     $detail = isBase64($tmp[0]) === true ?
6682
-                        base64_decode($tmp[0]) . '.' . $tmp[1] : $tmp[0];
6681
+                        base64_decode($tmp[0]).'.'.$tmp[1] : $tmp[0];
6683 6682
                 } elseif ($reason[0] === 'at_import') {
6684 6683
                     $detail = '';
6685 6684
                 } elseif (in_array($reason[0], array('csv', 'pdf')) === true) {
@@ -6698,8 +6697,8 @@  discard block
 block discarded – undo
6698 6697
                 array(
6699 6698
                     'avatar' => $avatar,
6700 6699
                     'login' => $record['login'],
6701
-                    'name' => $record['name'] . ' ' . $record['lastname'],
6702
-                    'date' => date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['date']),
6700
+                    'name' => $record['name'].' '.$record['lastname'],
6701
+                    'date' => date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['date']),
6703 6702
                     'action' => $action,
6704 6703
                     'detail' => $detail,
6705 6704
                 )
@@ -6787,11 +6786,11 @@  discard block
 block discarded – undo
6787 6786
 
6788 6787
         // get some info to add to the notification email
6789 6788
         $resp_user = DB::queryfirstrow(
6790
-            'SELECT login FROM ' . prefixTable('users') . ' WHERE id = %i',
6789
+            'SELECT login FROM '.prefixTable('users').' WHERE id = %i',
6791 6790
             $session->get('user-id')
6792 6791
         );
6793 6792
         $resp_folder = DB::queryfirstrow(
6794
-            'SELECT title FROM ' . prefixTable('nested_tree') . ' WHERE id = %i',
6793
+            'SELECT title FROM '.prefixTable('nested_tree').' WHERE id = %i',
6795 6794
             $folder
6796 6795
         );
6797 6796
 
@@ -6800,7 +6799,7 @@  discard block
 block discarded – undo
6800 6799
         $emailService = new EmailService();
6801 6800
         $rows = DB::query(
6802 6801
             'SELECT email
6803
-            FROM ' . prefixTable('users') . '
6802
+            FROM ' . prefixTable('users').'
6804 6803
             WHERE `gestionnaire` = %i AND `email` IS NOT NULL',
6805 6804
             1
6806 6805
         );
@@ -6846,7 +6845,7 @@  discard block
 block discarded – undo
6846 6845
         // Send email
6847 6846
         $dataItem = DB::queryfirstrow(
6848 6847
             'SELECT label, id_tree
6849
-            FROM ' . prefixTable('items') . '
6848
+            FROM ' . prefixTable('items').'
6850 6849
             WHERE id = %i',
6851 6850
             $inputData['itemId']
6852 6851
         );
@@ -6900,7 +6899,7 @@  discard block
 block discarded – undo
6900 6899
 
6901 6900
         DB::query(
6902 6901
             'SELECT *
6903
-            FROM ' . prefixTable('notification') . '
6902
+            FROM ' . prefixTable('notification').'
6904 6903
             WHERE item_id = %i AND user_id = %i',
6905 6904
             $inputData['itemId'],
6906 6905
             $session->get('user-id')
@@ -6972,7 +6971,7 @@  discard block
 block discarded – undo
6972 6971
         // And related logs
6973 6972
         $rows = DB::query(
6974 6973
             'SELECT id, file AS filename
6975
-            FROM ' . prefixTable('files') . '
6974
+            FROM ' . prefixTable('files').'
6976 6975
             WHERE id_item = %i AND confirmed = %i',
6977 6976
             $inputData['itemId'],
6978 6977
             0
@@ -6986,12 +6985,12 @@  discard block
 block discarded – undo
6986 6985
             );
6987 6986
 
6988 6987
             // Delete file on server
6989
-            unlink($SETTINGS['path_to_upload_folder'] . '/' . TP_FILE_PREFIX . base64_decode($file['filename']));
6988
+            unlink($SETTINGS['path_to_upload_folder'].'/'.TP_FILE_PREFIX.base64_decode($file['filename']));
6990 6989
 
6991 6990
             // Delete related logs
6992 6991
             $logFile = DB::query(
6993 6992
                 'SELECT increment_id, raison
6994
-                FROM ' . prefixTable('log_items') . '
6993
+                FROM ' . prefixTable('log_items').'
6995 6994
                 WHERE id_item = %i AND id_user = %i AND action = %s AND raison LIKE "at_add_file :%"',
6996 6995
                 $inputData['itemId'],
6997 6996
                 $session->get('user-id'),
@@ -7050,7 +7049,7 @@  discard block
 block discarded – undo
7050 7049
         // Confirm attachments
7051 7050
         $rows = DB::query(
7052 7051
             'SELECT id, file AS filename
7053
-            FROM ' . prefixTable('files') . '
7052
+            FROM ' . prefixTable('files').'
7054 7053
             WHERE id_item = %i AND confirmed = %i',
7055 7054
             $inputData['itemId'],
7056 7055
             0
@@ -7136,15 +7135,15 @@  discard block
 block discarded – undo
7136 7135
         case 'autocomplete_tags':
7137 7136
             // Get a list off all existing TAGS
7138 7137
             $listOfTags = '';
7139
-            $rows = DB::query('SELECT tag FROM ' . prefixTable('tags') . ' WHERE tag LIKE %ss GROUP BY tag', $inputData['getTerm']);
7138
+            $rows = DB::query('SELECT tag FROM '.prefixTable('tags').' WHERE tag LIKE %ss GROUP BY tag', $inputData['getTerm']);
7140 7139
             foreach ($rows as $record) {
7141 7140
                 if (empty($listOfTags)) {
7142
-                    $listOfTags = '"' . $record['tag'] . '"';
7141
+                    $listOfTags = '"'.$record['tag'].'"';
7143 7142
                 } else {
7144
-                    $listOfTags .= ', "' . $record['tag'] . '"';
7143
+                    $listOfTags .= ', "'.$record['tag'].'"';
7145 7144
                 }
7146 7145
             }
7147
-            echo '[' . $listOfTags . ']';
7146
+            echo '['.$listOfTags.']';
7148 7147
             break;
7149 7148
     }
7150 7149
 }
@@ -7160,7 +7159,7 @@  discard block
 block discarded – undo
7160 7159
 {
7161 7160
     $data = DB::queryFirstRow(
7162 7161
         'SELECT bloquer_creation, bloquer_modification, personal_folder
7163
-        FROM ' . prefixTable('nested_tree') . ' WHERE id = %i',
7162
+        FROM ' . prefixTable('nested_tree').' WHERE id = %i',
7164 7163
         $groupe
7165 7164
     );
7166 7165
     // Check if it's in a personal folder. If yes, then force complexity overhead.
@@ -7264,7 +7263,7 @@  discard block
 block discarded – undo
7264 7263
     global $SETTINGS;
7265 7264
 
7266 7265
     // Retrieve the current lock information for the item
7267
-    $itemLockInfo = DB::queryFirstRow('SELECT timestamp, user_id FROM ' . prefixTable('items_edition') . ' WHERE item_id = %i', $itemId);
7266
+    $itemLockInfo = DB::queryFirstRow('SELECT timestamp, user_id FROM '.prefixTable('items_edition').' WHERE item_id = %i', $itemId);
7268 7267
 
7269 7268
     // Check if the item is locked by another user
7270 7269
     if ($itemLockInfo && $itemLockInfo['user_id'] !== $userId) {
@@ -7283,7 +7282,7 @@  discard block
 block discarded – undo
7283 7282
     
7284 7283
     // Check if there's an ongoing background encryption process for the item
7285 7284
     $ongoingProcess = DB::queryFirstRow(
7286
-        'SELECT 1 FROM ' . prefixTable('background_tasks') . ' WHERE item_id = %i AND finished_at = "" LIMIT 1', 
7285
+        'SELECT 1 FROM '.prefixTable('background_tasks').' WHERE item_id = %i AND finished_at = "" LIMIT 1', 
7287 7286
         $itemId
7288 7287
     );
7289 7288
 
@@ -7301,7 +7300,7 @@  discard block
 block discarded – undo
7301 7300
 function getUserVisibleFolders(int $userId): array
7302 7301
 {
7303 7302
     // Query to retrieve visible folders for the user
7304
-    $data = DB::queryFirstRow('SELECT visible_folders FROM ' . prefixTable('cache_tree') . ' WHERE user_id = %i', $userId);
7303
+    $data = DB::queryFirstRow('SELECT visible_folders FROM '.prefixTable('cache_tree').' WHERE user_id = %i', $userId);
7305 7304
     
7306 7305
     // Decode JSON data into an array; return an empty array if the data is invalid
7307 7306
     return json_decode($data['visible_folders'], true) ?? [];
@@ -7325,7 +7324,7 @@  discard block
 block discarded – undo
7325 7324
 
7326 7325
     // Query the access rights for the given roles and folder
7327 7326
     $accessTypes = DB::queryFirstColumn(
7328
-        'SELECT type FROM ' . prefixTable('roles_values') . ' WHERE role_id IN %ls AND folder_id = %i', 
7327
+        'SELECT type FROM '.prefixTable('roles_values').' WHERE role_id IN %ls AND folder_id = %i', 
7329 7328
         $roles, 
7330 7329
         $treeId
7331 7330
     );
Please login to merge, or discard this patch.
Braces   +21 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1228,7 +1228,9 @@  discard block
 block discarded – undo
1228 1228
                 );
1229 1229
 
1230 1230
                 // Create a task to create sharekeys for users
1231
-                if (WIP=== true) error_log('createTaskForItem - new password for this item - '.$post_password ." -- ". $pw);
1231
+                if (WIP=== true) {
1232
+                    error_log('createTaskForItem - new password for this item - '.$post_password ." -- ". $pw);
1233
+                }
1232 1234
                 $tasksToBePerformed = ['item_password'];
1233 1235
                 $encryptionTaskIsRequested = true;
1234 1236
             } else {
@@ -1548,7 +1550,9 @@  discard block
 block discarded – undo
1548 1550
 
1549 1551
             // create a task for all fields updated
1550 1552
             if ($encryptionTaskIsRequested === true) {
1551
-                if (WIP === true) error_log('createTaskForItem - '.print_r($tasksToBePerformed, true));
1553
+                if (WIP === true) {
1554
+                    error_log('createTaskForItem - '.print_r($tasksToBePerformed, true));
1555
+                }
1552 1556
                 createTaskForItem(
1553 1557
                     'item_update_create_keys',
1554 1558
                     array_unique($tasksToBePerformed),
@@ -2055,7 +2059,9 @@  discard block
 block discarded – undo
2055 2059
                 $inputData['itemId']
2056 2060
             );
2057 2061
             foreach ($rows as $record) {
2058
-                if ($record['raison'] === NULL) continue;
2062
+                if ($record['raison'] === NULL) {
2063
+                    continue;
2064
+                }
2059 2065
                 $reason = explode(':', $record['raison']);
2060 2066
                 if (count($reason) > 0) {
2061 2067
                     $sentence = date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['date']) . ' - '
@@ -4571,7 +4577,9 @@  discard block
 block discarded – undo
4571 4577
                 $inputData['itemId']
4572 4578
             );
4573 4579
             
4574
-            if (WIP === true) error_log('Existing edition locks: '.DB::count());
4580
+            if (WIP === true) {
4581
+                error_log('Existing edition locks: '.DB::count());
4582
+            }
4575 4583
 
4576 4584
             // Check if item has no edition lock
4577 4585
             if ((int) DB::count() > 0 ) {
@@ -4584,7 +4592,9 @@  discard block
 block discarded – undo
4584 4592
                 } else {
4585 4593
                     $delay = EDITION_LOCK_PERIOD; // One day delay
4586 4594
                 }
4587
-                if (WIP === true) error_log('delay: ' . $delay);
4595
+                if (WIP === true) {
4596
+                    error_log('delay: ' . $delay);
4597
+                }
4588 4598
 
4589 4599
                 // We remove old edition locks if delay is expired meaning more than 1 day long
4590 4600
                 if (round(abs(time() - $dataTmp['timestamp']),0) > $delay) {
@@ -4592,7 +4602,9 @@  discard block
 block discarded – undo
4592 4602
                     // In this case, delete edition lock and possible ongoing processes
4593 4603
                     // and continue editing this time
4594 4604
                     // We coonsidere if the most recent item is still locked then all other locks can be removed
4595
-                    if (WIP === true)  error_log('Delay is expired, removing old locks');
4605
+                    if (WIP === true) {
4606
+                        error_log('Delay is expired, removing old locks');
4607
+                    }
4596 4608
                     foreach ($dataItemEditionLocks as $itemEditionLock) {
4597 4609
                         // delete lock
4598 4610
                         DB::delete(
@@ -4859,8 +4871,9 @@  discard block
 block discarded – undo
4859 4871
                 $ids = $tree->getDescendants($folder['id'], true, false, true);
4860 4872
 
4861 4873
                 // This folder is owned by user
4862
-                if (in_array($inputData['folderId'], $ids))
4863
-                    $accessLevel = 30;
4874
+                if (in_array($inputData['folderId'], $ids)) {
4875
+                                    $accessLevel = 30;
4876
+                }
4864 4877
             }
4865 4878
         }
4866 4879
 
Please login to merge, or discard this patch.
index.php 1 patch
Spacing   +181 added lines, -181 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 csrfProtector::init();
73 73
 
74 74
 // Load functions
75
-require_once __DIR__. '/includes/config/include.php';
75
+require_once __DIR__.'/includes/config/include.php';
76 76
 require_once __DIR__.'/sources/main.functions.php';
77 77
 
78 78
 // 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');
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 if ($hasSuperPrivilege > 0) {
161 161
     if (defined('MYSQL_LOG') && MYSQL_LOG === true) {
162 162
         DB::query("SET GLOBAL general_log = 'ON'");
163
-        DB::query("SET GLOBAL general_log_file = " . (defined('MYSQL_LOG_FILE') ? MYSQL_LOG_FILE : "'/var/log/teampass_mysql_query.log'"));
163
+        DB::query("SET GLOBAL general_log_file = ".(defined('MYSQL_LOG_FILE') ? MYSQL_LOG_FILE : "'/var/log/teampass_mysql_query.log'"));
164 164
     } else {
165 165
         DB::query("SET GLOBAL general_log = 'OFF'");
166 166
     }
@@ -171,8 +171,8 @@  discard block
 block discarded – undo
171 171
     //get default language
172 172
     $dataLanguage = DB::queryFirstRow(
173 173
         'SELECT m.valeur AS valeur, l.flag AS flag
174
-        FROM ' . prefixTable('misc') . ' AS m
175
-        INNER JOIN ' . prefixTable('languages') . ' AS l ON (m.valeur = l.name)
174
+        FROM ' . prefixTable('misc').' AS m
175
+        INNER JOIN ' . prefixTable('languages').' AS l ON (m.valeur = l.name)
176 176
         WHERE m.type=%s_type AND m.intitule=%s_intitule',
177 177
         [
178 178
             'type' => 'admin',
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
         $session_user_language = $SETTINGS['default_language'];
204 204
     }
205 205
 }
206
-$lang = new Language($session_user_language, __DIR__. '/includes/language/'); 
206
+$lang = new Language($session_user_language, __DIR__.'/includes/language/'); 
207 207
 
208 208
 if (isset($SETTINGS['cpassman_dir']) === false || $SETTINGS['cpassman_dir'] === '') {
209 209
     $SETTINGS['cpassman_dir'] = __DIR__;
@@ -277,29 +277,29 @@  discard block
 block discarded – undo
277 277
     </script>
278 278
 
279 279
     <!-- IonIcons -->
280
-    <link rel="stylesheet" href="includes/css/ionicons.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>">
280
+    <link rel="stylesheet" href="includes/css/ionicons.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>">
281 281
     <!-- Theme style -->
282
-    <link rel="stylesheet" href="plugins/adminlte/css/adminlte.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>">
283
-    <link rel="stylesheet" href="plugins/pace-progress/themes/corner-indicator.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" type="text/css" />
284
-    <link rel="stylesheet" href="plugins/select2/css/select2.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" type="text/css" />
285
-    <link rel="stylesheet" href="plugins/select2/theme/select2-bootstrap4.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" type="text/css" />
282
+    <link rel="stylesheet" href="plugins/adminlte/css/adminlte.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>">
283
+    <link rel="stylesheet" href="plugins/pace-progress/themes/corner-indicator.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" type="text/css" />
284
+    <link rel="stylesheet" href="plugins/select2/css/select2.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" type="text/css" />
285
+    <link rel="stylesheet" href="plugins/select2/theme/select2-bootstrap4.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" type="text/css" />
286 286
     <!-- Theme style -->
287
-    <link rel="stylesheet" href="includes/css/teampass.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>">
287
+    <link rel="stylesheet" href="includes/css/teampass.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>">
288 288
     <!-- Google Font: Source Sans Pro -->
289
-    <link rel="stylesheet" type="text/css" href="includes/fonts/fonts.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>">
289
+    <link rel="stylesheet" type="text/css" href="includes/fonts/fonts.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>">
290 290
     <!-- Altertify -->
291
-    <link rel="stylesheet" href="plugins/alertifyjs/css/alertify.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" />
292
-    <link rel="stylesheet" href="plugins/alertifyjs/css/themes/bootstrap.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" />
291
+    <link rel="stylesheet" href="plugins/alertifyjs/css/alertify.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" />
292
+    <link rel="stylesheet" href="plugins/alertifyjs/css/themes/bootstrap.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" />
293 293
     <!-- Toastr -->
294
-    <link rel="stylesheet" href="plugins/toastr/toastr.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" />
294
+    <link rel="stylesheet" href="plugins/toastr/toastr.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" />
295 295
     <!-- favicon -->
296
-    <link rel="shortcut icon" type="image/png" href="<?php echo $favicon;?>"/>
296
+    <link rel="shortcut icon" type="image/png" href="<?php echo $favicon; ?>"/>
297 297
     <!-- manifest (PWA) -->
298
-    <link rel="manifest" href="manifest.json?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>">
298
+    <link rel="manifest" href="manifest.json?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>">
299 299
     <!-- Custom style -->
300 300
     <?php
301
-    if (file_exists(__DIR__ . '/includes/css/custom.css') === true) {?>
302
-        <link rel="stylesheet" href="includes/css/custom.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>">
301
+    if (file_exists(__DIR__.'/includes/css/custom.css') === true) {?>
302
+        <link rel="stylesheet" href="includes/css/custom.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>">
303 303
     <?php
304 304
     } ?>
305 305
 </head>
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
                         <div class="dropdown show">
347 347
                             <a class="btn btn-primary dropdown-toggle" href="#" data-toggle="dropdown">
348 348
                                 <?php
349
-                                    echo $session_name . '&nbsp;' . $session_lastname; ?>
349
+                                    echo $session_name.'&nbsp;'.$session_lastname; ?>
350 350
                             </a>
351 351
 
352 352
                             <div class="dropdown-menu dropdown-menu-right">
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
                                     </a>
371 371
                                 <?php
372 372
                                     } ?>
373
-                                <a class="dropdown-item user-menu<?php echo (int) $session_user_admin === 1 ? ' hidden' : '';?>" href="#" data-name="generate-new_keys">
373
+                                <a class="dropdown-item user-menu<?php echo (int) $session_user_admin === 1 ? ' hidden' : ''; ?>" href="#" data-name="generate-new_keys">
374 374
                                     <i class="fa-solid fa-spray-can-sparkles fa-fw mr-2"></i><?php echo $lang->get('generate_new_keys'); ?>
375 375
                                 </a>
376 376
 
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
             <!-- Main Sidebar Container -->
405 405
             <aside class="main-sidebar sidebar-dark-primary elevation-4">
406 406
                 <!-- Brand Logo -->
407
-                <a href="<?php echo $cpassman_url . '/index.php?page=' . ((int) $session_user_admin === 1 ? 'admin' : 'items'); ?>" class="brand-link">
407
+                <a href="<?php echo $cpassman_url.'/index.php?page='.((int) $session_user_admin === 1 ? 'admin' : 'items'); ?>" class="brand-link">
408 408
                     <img src="includes/images/teampass-logo2-home.png" alt="Teampass Logo" class="brand-image">
409 409
                     <span class="brand-text font-weight-light"><?php echo TP_TOOL_NAME; ?></span>
410 410
                 </a>
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
                         <a href="#" data-name="items" class="nav-link', $get['page'] === 'items' ? ' active' : '', '">
423 423
                         <i class="nav-icon fa-solid fa-key"></i>
424 424
                         <p>
425
-                            ' . $lang->get('pw') . '
425
+                            ' . $lang->get('pw').'
426 426
                         </p>
427 427
                         </a>
428 428
                     </li>';
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
                         <a href="#" data-name="import" class="nav-link', $get['page'] === 'import' ? ' active' : '', '">
436 436
                         <i class="nav-icon fa-solid fa-file-import"></i>
437 437
                         <p>
438
-                            ' . $lang->get('import') . '
438
+                            ' . $lang->get('import').'
439 439
                         </p>
440 440
                         </a>
441 441
                     </li>';
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
                         <a href="#" data-name="export" class="nav-link', $get['page'] === 'export' ? ' active' : '', '">
457 457
                         <i class="nav-icon fa-solid fa-file-export"></i>
458 458
                         <p>
459
-                            ' . $lang->get('export') . '
459
+                            ' . $lang->get('export').'
460 460
                         </p>
461 461
                         </a>
462 462
                     </li>';
@@ -483,7 +483,7 @@  discard block
 block discarded – undo
483 483
                         <a href="#" data-name="search" class="nav-link', $get['page'] === 'search' ? ' active' : '', '">
484 484
                         <i class="nav-icon fa-solid fa-search"></i>
485 485
                         <p>
486
-                            ' . $lang->get('find') . '
486
+                            ' . $lang->get('find').'
487 487
                         </p>
488 488
                         </a>
489 489
                     </li>';
@@ -499,7 +499,7 @@  discard block
 block discarded – undo
499 499
                         <a href="#" data-name="favourites" class="nav-link', $get['page'] === 'favourites' ? ' active' : '', '">
500 500
                         <i class="nav-icon fa-solid fa-star"></i>
501 501
                         <p>
502
-                            ' . $lang->get('favorites') . '
502
+                            ' . $lang->get('favorites').'
503 503
                         </p>
504 504
                         </a>
505 505
                     </li>';
@@ -529,7 +529,7 @@  discard block
 block discarded – undo
529 529
                         <a href="#" data-name="suggestion" class="nav-link', $get['page'] === 'suggestion' ? ' active' : '', '">
530 530
                         <i class="nav-icon fa-solid fa-lightbulb"></i>
531 531
                         <p>
532
-                            ' . $lang->get('suggestion_menu') . '
532
+                            ' . $lang->get('suggestion_menu').'
533 533
                         </p>
534 534
                         </a>
535 535
                     </li>';
@@ -542,7 +542,7 @@  discard block
 block discarded – undo
542 542
                         <a href="#" data-name="admin" class="nav-link', $get['page'] === 'admin' ? ' active' : '', '">
543 543
                         <i class="nav-icon fa-solid fa-info"></i>
544 544
                         <p>
545
-                            ' . $lang->get('admin_main') . '
545
+                            ' . $lang->get('admin_main').'
546 546
                         </p>
547 547
                         </a>
548 548
                     </li>
@@ -550,7 +550,7 @@  discard block
 block discarded – undo
550 550
                         <a href="#" class="nav-link">
551 551
                             <i class="nav-icon fa-solid fa-wrench"></i>
552 552
                             <p>
553
-                                ' . $lang->get('admin_settings') . '
553
+                                ' . $lang->get('admin_settings').'
554 554
                                 <i class="fa-solid fa-angle-left right"></i>
555 555
                             </p>
556 556
                         </a>
@@ -558,63 +558,63 @@  discard block
 block discarded – undo
558 558
                             <li class="nav-item">
559 559
                                 <a href="#" data-name="options" class="nav-link', $get['page'] === 'options' ? ' active' : '', '">
560 560
                                     <i class="fa-solid fa-check-double nav-icon"></i>
561
-                                    <p>' . $lang->get('options') . '</p>
561
+                                    <p>' . $lang->get('options').'</p>
562 562
                                 </a>
563 563
                             </li>
564 564
                             <li class="nav-item">
565 565
                                 <a href="#" data-name="2fa" class="nav-link', $get['page'] === '2fa' ? ' active' : '', '">
566 566
                                     <i class="fa-solid fa-qrcode nav-icon"></i>
567
-                                    <p>' . $lang->get('mfa_short') . '</p>
567
+                                    <p>' . $lang->get('mfa_short').'</p>
568 568
                                 </a>
569 569
                             </li>
570 570
                             <li class="nav-item">
571 571
                                 <a href="#" data-name="api" class="nav-link', $get['page'] === 'api' ? ' active' : '', '">
572 572
                                     <i class="fa-solid fa-cubes nav-icon"></i>
573
-                                    <p>' . $lang->get('api') . '</p>
573
+                                    <p>' . $lang->get('api').'</p>
574 574
                                 </a>
575 575
                             </li>
576 576
                             <li class="nav-item">
577 577
                                 <a href="#" data-name="backups" class="nav-link', $get['page'] === 'backups' ? ' active' : '', '">
578 578
                                     <i class="fa-solid fa-database nav-icon"></i>
579
-                                    <p>' . $lang->get('backups') . '</p>
579
+                                    <p>' . $lang->get('backups').'</p>
580 580
                                 </a>
581 581
                             </li>
582 582
                             <li class="nav-item">
583 583
                                 <a href="#" data-name="emails" class="nav-link', $get['page'] === 'emails' ? ' active' : '', '">
584 584
                                     <i class="fa-solid fa-envelope nav-icon"></i>
585
-                                    <p>' . $lang->get('emails') . '</p>
585
+                                    <p>' . $lang->get('emails').'</p>
586 586
                                 </a>
587 587
                             </li>
588 588
                             <li class="nav-item">
589 589
                                 <a href="#" data-name="fields" class="nav-link', $get['page'] === 'fields' ? ' active' : '', '">
590 590
                                     <i class="fa-solid fa-keyboard nav-icon"></i>
591
-                                    <p>' . $lang->get('fields') . '</p>
591
+                                    <p>' . $lang->get('fields').'</p>
592 592
                                 </a>
593 593
                             </li>
594 594
                             <li class="nav-item">
595 595
                                 <a href="#" data-name="ldap" class="nav-link', $get['page'] === 'ldap' ? ' active' : '', '">
596 596
                                     <i class="fa-solid fa-id-card nav-icon"></i>
597
-                                    <p>' . $lang->get('ldap') . '</p>
597
+                                    <p>' . $lang->get('ldap').'</p>
598 598
                                 </a>
599 599
                             </li>
600 600
 
601 601
                             <li class="nav-item">
602 602
                                 <a href="#" data-name="oauth" class="nav-link', $get['page'] === 'oauth' ? ' active' : '', '">
603 603
                                     <i class="fa-solid fa-plug nav-icon"></i>
604
-                                    <p>' . $lang->get('oauth') . '</p>
604
+                                    <p>' . $lang->get('oauth').'</p>
605 605
                                 </a>
606 606
                             </li>
607 607
                             
608 608
                             <li class="nav-item">
609 609
                                 <a href="#" data-name="uploads" class="nav-link', $get['page'] === 'uploads' ? ' active' : '', '">
610 610
                                     <i class="fa-solid fa-file-upload nav-icon"></i>
611
-                                    <p>' . $lang->get('uploads') . '</p>
611
+                                    <p>' . $lang->get('uploads').'</p>
612 612
                                 </a>
613 613
                             </li>
614 614
                             <li class="nav-item">
615 615
                                 <a href="#" data-name="statistics" class="nav-link', $get['page'] === 'statistics' ? ' active' : '', '">
616 616
                                     <i class="fa-solid fa-chart-bar nav-icon"></i>
617
-                                    <p>' . $lang->get('statistics') . '</p>
617
+                                    <p>' . $lang->get('statistics').'</p>
618 618
                                 </a>
619 619
                             </li>
620 620
                         </ul>
@@ -625,7 +625,7 @@  discard block
 block discarded – undo
625 625
                     <li class="nav-item">
626 626
                         <a href="#" data-name="tasks" class="nav-link', $get['page'] === 'tasks' ? ' active' : '', '">
627 627
                         <i class="fa-solid fa-tasks nav-icon"></i>
628
-                        <p>' . $lang->get('tasks') . '</p>
628
+                        <p>' . $lang->get('tasks').'</p>
629 629
                         </a>
630 630
                     </li>';
631 631
         }
@@ -636,7 +636,7 @@  discard block
 block discarded – undo
636 636
                         <a href="#" data-name="tools" class="nav-link', $get['page'] === 'tools' ? ' active' : '', '">
637 637
                         <i class="nav-icon fa-solid fa-person-drowning"></i>
638 638
                         <p>
639
-                            ' . $lang->get('tools') . '
639
+                            ' . $lang->get('tools').'
640 640
                         </p>
641 641
                         </a>
642 642
                     </li>';
@@ -646,7 +646,7 @@  discard block
 block discarded – undo
646 646
                         <a href="#" data-name="import" class="nav-link', $get['page'] === 'import' ? ' active' : '', '">
647 647
                         <i class="nav-icon fa-solid fa-file-import"></i>
648 648
                         <p>
649
-                            ' . $lang->get('import') . '
649
+                            ' . $lang->get('import').'
650 650
                         </p>
651 651
                         </a>
652 652
                     </li>';
@@ -662,7 +662,7 @@  discard block
 block discarded – undo
662 662
                         <a href="#" data-name="folders" class="nav-link', $get['page'] === 'folders' ? ' active' : '', '">
663 663
                         <i class="nav-icon fa-solid fa-folder-open"></i>
664 664
                         <p>
665
-                            ' . $lang->get('folders') . '
665
+                            ' . $lang->get('folders').'
666 666
                         </p>
667 667
                         </a>
668 668
                     </li>
@@ -670,7 +670,7 @@  discard block
 block discarded – undo
670 670
                         <a href="#" data-name="roles" class="nav-link', $get['page'] === 'roles' ? ' active' : '', '">
671 671
                         <i class="nav-icon fa-solid fa-graduation-cap"></i>
672 672
                         <p>
673
-                            ' . $lang->get('roles') . '
673
+                            ' . $lang->get('roles').'
674 674
                         </p>
675 675
                         </a>
676 676
                     </li>
@@ -678,38 +678,38 @@  discard block
 block discarded – undo
678 678
                         <a href="#" data-name="users" class="nav-link', $get['page'] === 'users' ? ' active' : '', '">
679 679
                         <i class="nav-icon fa-solid fa-users"></i>
680 680
                         <p>
681
-                            ' . $lang->get('users') . '
681
+                            ' . $lang->get('users').'
682 682
                         </p>
683 683
                         </a>
684 684
                     </li>
685 685
                     <li class="nav-item has-treeview', $menuUtilities === true ? ' menu-open' : '', '">
686 686
                         <a href="#" class="nav-link">
687 687
                         <i class="nav-icon fa-solid fa-cubes"></i>
688
-                        <p>' . $lang->get('admin_views') . '<i class="fa-solid fa-angle-left right"></i></p>
688
+                        <p>' . $lang->get('admin_views').'<i class="fa-solid fa-angle-left right"></i></p>
689 689
                         </a>
690 690
                         <ul class="nav nav-treeview">
691 691
                             <li class="nav-item">
692 692
                                 <a href="#" data-name="utilities.renewal" class="nav-link', $get['page'] === 'utilities.renewal' ? ' active' : '', '">
693 693
                                 <i class="far fa-calendar-alt nav-icon"></i>
694
-                                <p>' . $lang->get('renewal') . '</p>
694
+                                <p>' . $lang->get('renewal').'</p>
695 695
                                 </a>
696 696
                             </li>
697 697
                             <li class="nav-item">
698 698
                                 <a href="#" data-name="utilities.deletion" class="nav-link', $get['page'] === 'utilities.deletion' ? ' active' : '', '">
699 699
                                 <i class="fa-solid fa-trash-alt nav-icon"></i>
700
-                                <p>' . $lang->get('deletion') . '</p>
700
+                                <p>' . $lang->get('deletion').'</p>
701 701
                                 </a>
702 702
                             </li>
703 703
                             <li class="nav-item">
704 704
                                 <a href="#" data-name="utilities.logs" class="nav-link', $get['page'] === 'utilities.logs' ? ' active' : '', '">
705 705
                                 <i class="fa-solid fa-history nav-icon"></i>
706
-                                <p>' . $lang->get('logs') . '</p>
706
+                                <p>' . $lang->get('logs').'</p>
707 707
                                 </a>
708 708
                             </li>
709 709
                             <li class="nav-item">
710 710
                                 <a href="#" data-name="utilities.database" class="nav-link', $get['page'] === 'utilities.database' ? ' active' : '', '">
711 711
                                 <i class="fa-solid fa-database nav-icon"></i>
712
-                                <p>' . $lang->get('database') . '</p>
712
+                                <p>' . $lang->get('database').'</p>
713 713
                                 </a>
714 714
                             </li>
715 715
                         </ul>
@@ -720,10 +720,10 @@  discard block
 block discarded – undo
720 720
                     <!-- /.sidebar-menu -->
721 721
                 <div class="menu-footer">
722 722
                     <div class="" id="sidebar-footer">
723
-                        <i class="fa-solid fa-clock-o mr-2 infotip text-info pointer" title="<?php echo htmlspecialchars($lang->get('server_time') . ' ' .
724
-                            date($date_format, (int) $server['request_time']) . ' - ' .
723
+                        <i class="fa-solid fa-clock-o mr-2 infotip text-info pointer" title="<?php echo htmlspecialchars($lang->get('server_time').' '.
724
+                            date($date_format, (int) $server['request_time']).' - '.
725 725
                             date($time_format, (int) $server['request_time']), ENT_QUOTES, 'UTF-8'); ?>"></i>
726
-                        <i class="fa-solid fa-users mr-2 infotip text-info pointer" title="<?php echo $session_nb_users_online . ' ' . $lang->get('users_online'); ?>"></i>
726
+                        <i class="fa-solid fa-users mr-2 infotip text-info pointer" title="<?php echo $session_nb_users_online.' '.$lang->get('users_online'); ?>"></i>
727 727
                         <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>
728 728
                         <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>
729 729
                         <?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; ?>
@@ -874,7 +874,7 @@  discard block
 block discarded – undo
874 874
                                 </div>
875 875
                                 <div class="mt-3">                                    
876 876
                                     <label>
877
-                                        <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>
877
+                                        <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>
878 878
                                         <input type="checkbox" id="dialog-admin-change-user-password-do-show-password" class="pointer">
879 879
                                     </label>
880 880
                                 </div>
@@ -1041,34 +1041,34 @@  discard block
 block discarded – undo
1041 1041
                     if ($get['page'] === 'items') {
1042 1042
                         // SHow page with Items
1043 1043
                         if ((int) $session_user_admin !== 1) {
1044
-                            include $SETTINGS['cpassman_dir'] . '/pages/items.php';
1044
+                            include $SETTINGS['cpassman_dir'].'/pages/items.php';
1045 1045
                         } elseif ((int) $session_user_admin === 1) {
1046
-                            include $SETTINGS['cpassman_dir'] . '/pages/admin.php';
1046
+                            include $SETTINGS['cpassman_dir'].'/pages/admin.php';
1047 1047
                         } else {
1048 1048
                             $session->set('system-error_code', ERR_NOT_ALLOWED);
1049 1049
                             //not allowed page
1050
-                            include $SETTINGS['cpassman_dir'] . '/error.php';
1050
+                            include $SETTINGS['cpassman_dir'].'/error.php';
1051 1051
                         }
1052 1052
                     } elseif (in_array($get['page'], array_keys($mngPages)) === true) {
1053 1053
                         // Define if user is allowed to see management pages
1054 1054
                         if ($session_user_admin === 1) {
1055 1055
                             // deepcode ignore FileInclusion: $get['page'] is secured through usage of array_keys test bellow
1056
-                            include $SETTINGS['cpassman_dir'] . '/pages/' . basename($mngPages[$get['page']]);
1056
+                            include $SETTINGS['cpassman_dir'].'/pages/'.basename($mngPages[$get['page']]);
1057 1057
                         } elseif ($session_user_manager === 1 || $session_user_human_resources === 1) {
1058 1058
                             if ($get['page'] === 'manage_main' || $get['page'] === 'manage_settings'
1059 1059
                             ) {
1060 1060
                                 $session->set('system-error_code', ERR_NOT_ALLOWED);
1061 1061
                                 //not allowed page
1062
-                                include $SETTINGS['cpassman_dir'] . '/error.php';
1062
+                                include $SETTINGS['cpassman_dir'].'/error.php';
1063 1063
                             }
1064 1064
                         } else {
1065 1065
                             $session->set('system-error_code', ERR_NOT_ALLOWED);
1066 1066
                             //not allowed page
1067
-                            include $SETTINGS['cpassman_dir'] . '/error.php';
1067
+                            include $SETTINGS['cpassman_dir'].'/error.php';
1068 1068
                         }
1069
-                    } elseif (empty($get['page']) === false && file_exists($SETTINGS['cpassman_dir'] . '/pages/' . $get['page'] . '.php') === true) {
1069
+                    } elseif (empty($get['page']) === false && file_exists($SETTINGS['cpassman_dir'].'/pages/'.$get['page'].'.php') === true) {
1070 1070
                         // deepcode ignore FileInclusion: $get['page'] is tested against file_exists just below
1071
-                        include $SETTINGS['cpassman_dir'] . '/pages/' . basename($get['page'] . '.php');
1071
+                        include $SETTINGS['cpassman_dir'].'/pages/'.basename($get['page'].'.php');
1072 1072
                     } else {
1073 1073
                         $session->set('system-array_roles', ERR_NOT_EXIST);
1074 1074
                         //page doesn't exist
@@ -1097,7 +1097,7 @@  discard block
 block discarded – undo
1097 1097
             <footer class="main-footer">
1098 1098
                 <!-- To the right -->
1099 1099
                 <div class="float-right d-none d-sm-inline">
1100
-                    <?php echo $lang->get('version_alone'); ?>&nbsp;<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>
1100
+                    <?php echo $lang->get('version_alone'); ?>&nbsp;<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>
1101 1101
                 </div>
1102 1102
                 <!-- Default to the left -->
1103 1103
                 <strong>Copyright &copy; <?php echo TP_COPYRIGHT; ?> <a href="<?php echo TEAMPASS_URL; ?>"><?php echo TP_TOOL_NAME; ?></a>.</strong> All rights reserved.
@@ -1111,7 +1111,7 @@  discard block
 block discarded – undo
1111 1111
         echo '
1112 1112
 <input type="hidden" id="temps_restant" value="', $session->get('user-session_duration') ?? '', '" />';
1113 1113
 // display an item in the context of OTV link
1114
-} elseif ((null === $session->get('user-validite_pw')|| empty($session->get('user-validite_pw')) === true || empty($session->get('user-id')) === true)
1114
+} elseif ((null === $session->get('user-validite_pw') || empty($session->get('user-validite_pw')) === true || empty($session->get('user-id')) === true)
1115 1115
     && empty($get['otv']) === false
1116 1116
 ) {
1117 1117
     // case where one-shot viewer
@@ -1130,7 +1130,7 @@  discard block
 block discarded – undo
1130 1130
                 FILTER_SANITIZE_URL
1131 1131
             )
1132 1132
         );
1133
-        include $SETTINGS['cpassman_dir'] . '/error.php';
1133
+        include $SETTINGS['cpassman_dir'].'/error.php';
1134 1134
     }
1135 1135
 } elseif (//(empty($session->get('user-id')) === false && $session->get('user-id') !== null) ||
1136 1136
         empty($session->get('user-id')) === true
@@ -1155,7 +1155,7 @@  discard block
 block discarded – undo
1155 1155
     }
1156 1156
     
1157 1157
     // LOGIN form  
1158
-    include $SETTINGS['cpassman_dir'] . '/includes/core/login.php';
1158
+    include $SETTINGS['cpassman_dir'].'/includes/core/login.php';
1159 1159
     
1160 1160
 } else {
1161 1161
     // Clear session
@@ -1188,153 +1188,153 @@  discard block
 block discarded – undo
1188 1188
     <!-- REQUIRED SCRIPTS -->
1189 1189
 
1190 1190
     <!-- Font Awesome Icons -->
1191
-    <link href="plugins/fontawesome-free-6/css/fontawesome.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" rel="stylesheet">
1192
-    <link href="plugins/fontawesome-free-6/css/solid.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" rel="stylesheet">
1193
-    <link href="plugins/fontawesome-free-6/css/regular.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" rel="stylesheet">
1194
-    <link href="plugins/fontawesome-free-6/css/brands.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" rel="stylesheet">
1195
-    <link href="plugins/fontawesome-free-6/css/v5-font-face.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" rel="stylesheet" /> 
1191
+    <link href="plugins/fontawesome-free-6/css/fontawesome.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" rel="stylesheet">
1192
+    <link href="plugins/fontawesome-free-6/css/solid.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" rel="stylesheet">
1193
+    <link href="plugins/fontawesome-free-6/css/regular.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" rel="stylesheet">
1194
+    <link href="plugins/fontawesome-free-6/css/brands.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" rel="stylesheet">
1195
+    <link href="plugins/fontawesome-free-6/css/v5-font-face.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" rel="stylesheet" /> 
1196 1196
     <!-- jQuery -->
1197
-    <script src="plugins/jquery/jquery.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1198
-    <script src="plugins/jquery/jquery.cookie.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" type="text/javascript"></script>
1197
+    <script src="plugins/jquery/jquery.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1198
+    <script src="plugins/jquery/jquery.cookie.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" type="text/javascript"></script>
1199 1199
     <!-- jQuery UI -->
1200
-    <script src="plugins/jqueryUI/jquery-ui.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1201
-    <link rel="stylesheet" href="plugins/jqueryUI/jquery-ui.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>">
1200
+    <script src="plugins/jqueryUI/jquery-ui.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1201
+    <link rel="stylesheet" href="plugins/jqueryUI/jquery-ui.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>">
1202 1202
     <!-- Popper -->
1203
-    <script src="plugins/popper/umd/popper.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1203
+    <script src="plugins/popper/umd/popper.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1204 1204
     <!-- Bootstrap -->
1205
-    <script src="plugins/bootstrap/js/bootstrap.bundle.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1205
+    <script src="plugins/bootstrap/js/bootstrap.bundle.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1206 1206
     <!-- AdminLTE -->
1207
-    <script src="plugins/adminlte/js/adminlte.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1207
+    <script src="plugins/adminlte/js/adminlte.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1208 1208
     <!-- Altertify -->
1209 1209
     <!--<script type="text/javascript" src="plugins/alertifyjs/alertify.min.js"></script>-->
1210 1210
     <!-- Toastr -->
1211
-    <script type="text/javascript" src="plugins/toastr/toastr.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1211
+    <script type="text/javascript" src="plugins/toastr/toastr.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1212 1212
     <!-- STORE.JS -->
1213
-    <script type="text/javascript" src="plugins/store.js/dist/store.everything.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1213
+    <script type="text/javascript" src="plugins/store.js/dist/store.everything.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1214 1214
     <!-- cryptojs-aesphp -->
1215
-    <script type="text/javascript" src="includes/libraries/cryptojs/crypto-js.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1216
-    <script type="text/javascript" src="includes/libraries/cryptojs/encryption.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1215
+    <script type="text/javascript" src="includes/libraries/cryptojs/crypto-js.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1216
+    <script type="text/javascript" src="includes/libraries/cryptojs/encryption.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1217 1217
     <!-- pace -->
1218
-    <script type="text/javascript" data-pace-options='{ "ajax": true, "eventLag": false }' src="plugins/pace-progress/pace.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1218
+    <script type="text/javascript" data-pace-options='{ "ajax": true, "eventLag": false }' src="plugins/pace-progress/pace.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1219 1219
     <!-- select2 -->
1220
-    <script type="text/javascript" src="plugins/select2/js/select2.full.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1220
+    <script type="text/javascript" src="plugins/select2/js/select2.full.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1221 1221
     <!-- simplePassMeter -->
1222
-    <link rel="stylesheet" href="plugins/simplePassMeter/simplePassMeter.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" type="text/css" />
1223
-    <script type="text/javascript" src="plugins/simplePassMeter/simplePassMeter.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1222
+    <link rel="stylesheet" href="plugins/simplePassMeter/simplePassMeter.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" type="text/css" />
1223
+    <script type="text/javascript" src="plugins/simplePassMeter/simplePassMeter.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1224 1224
     <!-- platform -->
1225
-    <script type="text/javascript" src="plugins/platform/platform.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1225
+    <script type="text/javascript" src="plugins/platform/platform.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1226 1226
     <!-- radiobuttons -->
1227
-    <link rel="stylesheet" href="plugins/radioforbuttons/bootstrap-buttons.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" type="text/css" />
1228
-    <script type="text/javascript" src="plugins/radioforbuttons/jquery.radiosforbuttons.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1227
+    <link rel="stylesheet" href="plugins/radioforbuttons/bootstrap-buttons.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" type="text/css" />
1228
+    <script type="text/javascript" src="plugins/radioforbuttons/jquery.radiosforbuttons.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1229 1229
     <!-- ICHECK -->
1230 1230
     <!--<link rel="stylesheet" href="./plugins/icheck-material/icheck-material.min.css">-->
1231
-    <link rel="stylesheet" href="./plugins/icheck/skins/all.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>">
1232
-    <script type="text/javascript" src="./plugins/icheck/icheck.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1231
+    <link rel="stylesheet" href="./plugins/icheck/skins/all.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>">
1232
+    <script type="text/javascript" src="./plugins/icheck/icheck.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1233 1233
     <!-- bootstrap-add-clear -->
1234
-    <script type="text/javascript" src="plugins/bootstrap-add-clear/bootstrap-add-clear.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1234
+    <script type="text/javascript" src="plugins/bootstrap-add-clear/bootstrap-add-clear.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1235 1235
     <!-- DOMPurify -->
1236
-    <script type="text/javascript" src="plugins/DOMPurify/purify.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1236
+    <script type="text/javascript" src="plugins/DOMPurify/purify.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1237 1237
 
1238 1238
     <?php
1239 1239
     $get['page'] = $request->query->filter('page', null, FILTER_SANITIZE_SPECIAL_CHARS);
1240 1240
     if ($menuAdmin === true) {
1241 1241
         ?>
1242
-        <link rel="stylesheet" href="./plugins/toggles/css/toggles.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" />
1243
-        <link rel="stylesheet" href="./plugins/toggles/css/toggles-modern.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" />
1244
-        <script src="./plugins/toggles/toggles.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" type="text/javascript"></script>
1242
+        <link rel="stylesheet" href="./plugins/toggles/css/toggles.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" />
1243
+        <link rel="stylesheet" href="./plugins/toggles/css/toggles-modern.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" />
1244
+        <script src="./plugins/toggles/toggles.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" type="text/javascript"></script>
1245 1245
         <!-- InputMask -->
1246
-        <script src="./plugins/inputmask/jquery.inputmask.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1246
+        <script src="./plugins/inputmask/jquery.inputmask.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1247 1247
         <!-- Sortable -->
1248 1248
         <!--<script src="./plugins/sortable/jquery.sortable.js"></script>-->
1249 1249
         <!-- PLUPLOAD -->
1250
-        <script type="text/javascript" src="plugins/plupload/js/plupload.full.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1250
+        <script type="text/javascript" src="plugins/plupload/js/plupload.full.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1251 1251
         <!-- DataTables -->
1252
-        <link rel="stylesheet" src="./plugins/datatables/css/jquery.dataTables.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>">
1253
-        <link rel="stylesheet" src="./plugins/datatables/css/dataTables.bootstrap4.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>">
1254
-        <script type="text/javascript" src="./plugins/datatables/js/jquery.dataTables.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1255
-        <script type="text/javascript" src="./plugins/datatables/js/dataTables.bootstrap4.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1256
-        <link rel="stylesheet" src="./plugins/datatables/extensions/Responsive-2.2.2/css/responsive.bootstrap4.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>">
1257
-        <script type="text/javascript" src="./plugins/datatables/extensions/Responsive-2.2.2/js/dataTables.responsive.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1258
-        <script type="text/javascript" src="./plugins/datatables/extensions/Responsive-2.2.2/js/responsive.bootstrap4.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1259
-        <script type="text/javascript" src="./plugins/datatables/plugins/select.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1260
-        <link rel="stylesheet" src="./plugins/datatables/extensions/Scroller-1.5.0/css/scroller.bootstrap4.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>">
1261
-        <script type="text/javascript" src="./plugins/datatables/extensions/Scroller-1.5.0/js/dataTables.scroller.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1252
+        <link rel="stylesheet" src="./plugins/datatables/css/jquery.dataTables.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>">
1253
+        <link rel="stylesheet" src="./plugins/datatables/css/dataTables.bootstrap4.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>">
1254
+        <script type="text/javascript" src="./plugins/datatables/js/jquery.dataTables.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1255
+        <script type="text/javascript" src="./plugins/datatables/js/dataTables.bootstrap4.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1256
+        <link rel="stylesheet" src="./plugins/datatables/extensions/Responsive-2.2.2/css/responsive.bootstrap4.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>">
1257
+        <script type="text/javascript" src="./plugins/datatables/extensions/Responsive-2.2.2/js/dataTables.responsive.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1258
+        <script type="text/javascript" src="./plugins/datatables/extensions/Responsive-2.2.2/js/responsive.bootstrap4.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1259
+        <script type="text/javascript" src="./plugins/datatables/plugins/select.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1260
+        <link rel="stylesheet" src="./plugins/datatables/extensions/Scroller-1.5.0/css/scroller.bootstrap4.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>">
1261
+        <script type="text/javascript" src="./plugins/datatables/extensions/Scroller-1.5.0/js/dataTables.scroller.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1262 1262
     <?php
1263 1263
     } elseif (isset($get['page']) === true) {
1264 1264
         if (in_array($get['page'], ['items', 'import']) === true) {
1265 1265
             ?>
1266
-            <link rel="stylesheet" href="./plugins/jstree/themes/default/style.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" />
1267
-            <link rel="stylesheet" href="./plugins/jstree/themes/default-dark/style.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" />
1268
-            <script src="./plugins/jstree/jstree.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" type="text/javascript"></script>
1266
+            <link rel="stylesheet" href="./plugins/jstree/themes/default/style.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" />
1267
+            <link rel="stylesheet" href="./plugins/jstree/themes/default-dark/style.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" />
1268
+            <script src="./plugins/jstree/jstree.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" type="text/javascript"></script>
1269 1269
             <!-- countdownTimer -->
1270
-            <script src="./plugins/jquery.countdown360/jquery.countdown360.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1270
+            <script src="./plugins/jquery.countdown360/jquery.countdown360.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1271 1271
             <!-- SUMMERNOTE -->
1272
-            <link rel="stylesheet" href="./plugins/summernote/summernote-bs4.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>">
1273
-            <script src="./plugins/summernote/summernote-bs4.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1272
+            <link rel="stylesheet" href="./plugins/summernote/summernote-bs4.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>">
1273
+            <script src="./plugins/summernote/summernote-bs4.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1274 1274
             <!-- date-picker -->
1275
-            <link rel="stylesheet" href="./plugins/bootstrap-datepicker/css/bootstrap-datepicker3.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>">
1276
-            <script src="./plugins/bootstrap-datepicker/js/bootstrap-datepicker.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1275
+            <link rel="stylesheet" href="./plugins/bootstrap-datepicker/css/bootstrap-datepicker3.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>">
1276
+            <script src="./plugins/bootstrap-datepicker/js/bootstrap-datepicker.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1277 1277
             <!-- time-picker -->
1278
-            <link rel="stylesheet" href="./plugins/timepicker/bootstrap-timepicker.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>">
1279
-            <script src="./plugins/timepicker/bootstrap-timepicker.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1278
+            <link rel="stylesheet" href="./plugins/timepicker/bootstrap-timepicker.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>">
1279
+            <script src="./plugins/timepicker/bootstrap-timepicker.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1280 1280
             <!-- PLUPLOAD -->
1281
-            <script type="text/javascript" src="plugins/plupload/js/plupload.full.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1281
+            <script type="text/javascript" src="plugins/plupload/js/plupload.full.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1282 1282
             <!-- VALIDATE -->
1283
-            <script type="text/javascript" src="plugins/jquery-validation/jquery.validate.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1283
+            <script type="text/javascript" src="plugins/jquery-validation/jquery.validate.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1284 1284
             <!-- PWSTRENGHT -->
1285
-            <script type="text/javascript" src="plugins/zxcvbn/zxcvbn.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1286
-            <script type="text/javascript" src="plugins/jquery.pwstrength/pwstrength-bootstrap.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1285
+            <script type="text/javascript" src="plugins/zxcvbn/zxcvbn.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1286
+            <script type="text/javascript" src="plugins/jquery.pwstrength/pwstrength-bootstrap.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1287 1287
             <!-- TOGGLE -->
1288
-            <link rel="stylesheet" href="./plugins/toggles/css/toggles.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" />
1289
-            <link rel="stylesheet" href="./plugins/toggles/css/toggles-modern.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" />
1290
-            <script src="./plugins/toggles/toggles.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>" type="text/javascript"></script>
1288
+            <link rel="stylesheet" href="./plugins/toggles/css/toggles.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" />
1289
+            <link rel="stylesheet" href="./plugins/toggles/css/toggles-modern.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" />
1290
+            <script src="./plugins/toggles/toggles.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>" type="text/javascript"></script>
1291 1291
         <?php
1292 1292
         } elseif (in_array($get['page'], ['search', 'folders', 'users', 'roles', 'utilities.deletion', 'utilities.logs', 'utilities.database', 'utilities.renewal', 'tasks']) === true) {
1293 1293
             ?>
1294 1294
             <!-- DataTables -->
1295
-            <link rel="stylesheet" src="./plugins/datatables/css/jquery.dataTables.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>">
1296
-            <link rel="stylesheet" src="./plugins/datatables/css/dataTables.bootstrap4.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>">
1297
-            <script type="text/javascript" src="./plugins/datatables/js/jquery.dataTables.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1298
-            <script type="text/javascript" src="./plugins/datatables/js/dataTables.bootstrap4.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1299
-            <link rel="stylesheet" src="./plugins/datatables/extensions/Responsive-2.2.2/css/responsive.bootstrap4.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>">
1300
-            <script type="text/javascript" src="./plugins/datatables/extensions/Responsive-2.2.2/js/dataTables.responsive.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1301
-            <script type="text/javascript" src="./plugins/datatables/extensions/Responsive-2.2.2/js/responsive.bootstrap4.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1302
-            <script type="text/javascript" src="./plugins/datatables/plugins/select.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1303
-            <link rel="stylesheet" src="./plugins/datatables/extensions/Scroller-1.5.0/css/scroller.bootstrap4.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>">
1304
-            <script type="text/javascript" src="./plugins/datatables/extensions/Scroller-1.5.0/js/dataTables.scroller.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1295
+            <link rel="stylesheet" src="./plugins/datatables/css/jquery.dataTables.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>">
1296
+            <link rel="stylesheet" src="./plugins/datatables/css/dataTables.bootstrap4.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>">
1297
+            <script type="text/javascript" src="./plugins/datatables/js/jquery.dataTables.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1298
+            <script type="text/javascript" src="./plugins/datatables/js/dataTables.bootstrap4.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1299
+            <link rel="stylesheet" src="./plugins/datatables/extensions/Responsive-2.2.2/css/responsive.bootstrap4.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>">
1300
+            <script type="text/javascript" src="./plugins/datatables/extensions/Responsive-2.2.2/js/dataTables.responsive.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1301
+            <script type="text/javascript" src="./plugins/datatables/extensions/Responsive-2.2.2/js/responsive.bootstrap4.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1302
+            <script type="text/javascript" src="./plugins/datatables/plugins/select.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1303
+            <link rel="stylesheet" src="./plugins/datatables/extensions/Scroller-1.5.0/css/scroller.bootstrap4.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>">
1304
+            <script type="text/javascript" src="./plugins/datatables/extensions/Scroller-1.5.0/js/dataTables.scroller.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1305 1305
             <!-- dater picker -->
1306
-            <link rel="stylesheet" href="./plugins/bootstrap-datepicker/css/bootstrap-datepicker3.min.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>">
1307
-            <script src="./plugins/bootstrap-datepicker/js/bootstrap-datepicker.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1306
+            <link rel="stylesheet" href="./plugins/bootstrap-datepicker/css/bootstrap-datepicker3.min.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>">
1307
+            <script src="./plugins/bootstrap-datepicker/js/bootstrap-datepicker.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1308 1308
             <!-- daterange picker -->
1309
-            <link rel="stylesheet" href="./plugins/daterangepicker/daterangepicker.css?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>">
1310
-            <script src="./plugins/moment/moment.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1311
-            <script src="./plugins/daterangepicker/daterangepicker.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1309
+            <link rel="stylesheet" href="./plugins/daterangepicker/daterangepicker.css?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>">
1310
+            <script src="./plugins/moment/moment.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1311
+            <script src="./plugins/daterangepicker/daterangepicker.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1312 1312
             <!-- SlimScroll -->
1313
-            <script src="./plugins/slimScroll/jquery.slimscroll.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1313
+            <script src="./plugins/slimScroll/jquery.slimscroll.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1314 1314
             <!-- FastClick -->
1315
-            <script src="./plugins/fastclick/fastclick.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1315
+            <script src="./plugins/fastclick/fastclick.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1316 1316
         <?php
1317 1317
         } elseif ($get['page'] === 'profile') {
1318 1318
             ?>
1319 1319
             <!-- FILESAVER -->
1320
-            <script type="text/javascript" src="plugins/downloadjs/download.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1320
+            <script type="text/javascript" src="plugins/downloadjs/download.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1321 1321
             <!-- PLUPLOAD -->
1322
-            <script type="text/javascript" src="plugins/plupload/js/plupload.full.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1322
+            <script type="text/javascript" src="plugins/plupload/js/plupload.full.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1323 1323
         <?php
1324 1324
         } elseif ($get['page'] === 'export') {
1325 1325
             ?>
1326 1326
             <!-- FILESAVER -->
1327
-            <script type="text/javascript" src="plugins/downloadjs/download.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1327
+            <script type="text/javascript" src="plugins/downloadjs/download.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1328 1328
             <!-- PWSTRENGHT -->
1329
-            <script type="text/javascript" src="plugins/zxcvbn/zxcvbn.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1330
-            <script type="text/javascript" src="plugins/jquery.pwstrength/pwstrength-bootstrap.min.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1329
+            <script type="text/javascript" src="plugins/zxcvbn/zxcvbn.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1330
+            <script type="text/javascript" src="plugins/jquery.pwstrength/pwstrength-bootstrap.min.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1331 1331
         <?php
1332 1332
         }
1333 1333
     }
1334 1334
     ?>
1335 1335
     <!-- functions -->
1336
-    <script type="text/javascript" src="includes/js/functions.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1337
-    <script type="text/javascript" src="includes/js/CreateRandomString.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1336
+    <script type="text/javascript" src="includes/js/functions.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1337
+    <script type="text/javascript" src="includes/js/CreateRandomString.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1338 1338
     <input type="hidden" id="encryptClientServerStatus" value="<?php echo $SETTINGS['encryptClientServer'] ?? 1; ?>" />
1339 1339
 
1340 1340
     </body>
@@ -1376,7 +1376,7 @@  discard block
 block discarded – undo
1376 1376
     };
1377 1377
 </script>
1378 1378
 
1379
-<script type="text/javascript" src="includes/js/secure-clipboard-cleaner.js?v=<?php echo TP_VERSION . '.' . TP_VERSION_MINOR; ?>"></script>
1379
+<script type="text/javascript" src="includes/js/secure-clipboard-cleaner.js?v=<?php echo TP_VERSION.'.'.TP_VERSION_MINOR; ?>"></script>
1380 1380
 
1381 1381
 <script>
1382 1382
     $(document).ready(function() {
@@ -1435,65 +1435,65 @@  discard block
 block discarded – undo
1435 1435
 
1436 1436
 // Load links, css and javascripts
1437 1437
 if (isset($SETTINGS['cpassman_dir']) === true) {
1438
-    include_once $SETTINGS['cpassman_dir'] . '/includes/core/load.js.php';
1438
+    include_once $SETTINGS['cpassman_dir'].'/includes/core/load.js.php';
1439 1439
     if ($menuAdmin === true) {
1440
-        include_once $SETTINGS['cpassman_dir'] . '/pages/admin.js.php';
1440
+        include_once $SETTINGS['cpassman_dir'].'/pages/admin.js.php';
1441 1441
         if ($get['page'] === '2fa') {
1442
-            include_once $SETTINGS['cpassman_dir'] . '/pages/2fa.js.php';
1442
+            include_once $SETTINGS['cpassman_dir'].'/pages/2fa.js.php';
1443 1443
         } elseif ($get['page'] === 'api') {
1444
-            include_once $SETTINGS['cpassman_dir'] . '/pages/api.js.php';
1444
+            include_once $SETTINGS['cpassman_dir'].'/pages/api.js.php';
1445 1445
         } elseif ($get['page'] === 'backups') {
1446
-            include_once $SETTINGS['cpassman_dir'] . '/pages/backups.js.php';
1446
+            include_once $SETTINGS['cpassman_dir'].'/pages/backups.js.php';
1447 1447
         } elseif ($get['page'] === 'emails') {
1448
-            include_once $SETTINGS['cpassman_dir'] . '/pages/emails.js.php';
1448
+            include_once $SETTINGS['cpassman_dir'].'/pages/emails.js.php';
1449 1449
         } elseif ($get['page'] === 'ldap') {
1450
-            include_once $SETTINGS['cpassman_dir'] . '/pages/ldap.js.php';
1450
+            include_once $SETTINGS['cpassman_dir'].'/pages/ldap.js.php';
1451 1451
         } elseif ($get['page'] === 'uploads') {
1452
-            include_once $SETTINGS['cpassman_dir'] . '/pages/uploads.js.php';
1452
+            include_once $SETTINGS['cpassman_dir'].'/pages/uploads.js.php';
1453 1453
         } elseif ($get['page'] === 'fields') {
1454
-            include_once $SETTINGS['cpassman_dir'] . '/pages/fields.js.php';
1454
+            include_once $SETTINGS['cpassman_dir'].'/pages/fields.js.php';
1455 1455
         } elseif ($get['page'] === 'options') {
1456
-            include_once $SETTINGS['cpassman_dir'] . '/pages/options.js.php';
1456
+            include_once $SETTINGS['cpassman_dir'].'/pages/options.js.php';
1457 1457
         } elseif ($get['page'] === 'statistics') {
1458
-            include_once $SETTINGS['cpassman_dir'] . '/pages/statistics.js.php';
1458
+            include_once $SETTINGS['cpassman_dir'].'/pages/statistics.js.php';
1459 1459
         } elseif ($get['page'] === 'tasks') {
1460
-            include_once $SETTINGS['cpassman_dir'] . '/pages/tasks.js.php';
1460
+            include_once $SETTINGS['cpassman_dir'].'/pages/tasks.js.php';
1461 1461
         } elseif ($get['page'] === 'oauth' && WIP === true) {
1462
-            include_once $SETTINGS['cpassman_dir'] . '/pages/oauth.js.php';        
1462
+            include_once $SETTINGS['cpassman_dir'].'/pages/oauth.js.php';        
1463 1463
         } elseif ($get['page'] === 'tools') {
1464
-            include_once $SETTINGS['cpassman_dir'] . '/pages/tools.js.php';
1464
+            include_once $SETTINGS['cpassman_dir'].'/pages/tools.js.php';
1465 1465
         }
1466 1466
     } elseif (isset($get['page']) === true && $get['page'] !== '') {
1467 1467
         if ($get['page'] === 'items') {
1468
-            include_once $SETTINGS['cpassman_dir'] . '/pages/items.js.php';
1468
+            include_once $SETTINGS['cpassman_dir'].'/pages/items.js.php';
1469 1469
         } elseif ($get['page'] === 'import') {
1470
-            include_once $SETTINGS['cpassman_dir'] . '/pages/import.js.php';
1470
+            include_once $SETTINGS['cpassman_dir'].'/pages/import.js.php';
1471 1471
         } elseif ($get['page'] === 'export') {
1472
-            include_once $SETTINGS['cpassman_dir'] . '/pages/export.js.php';
1472
+            include_once $SETTINGS['cpassman_dir'].'/pages/export.js.php';
1473 1473
         } elseif ($get['page'] === 'offline') {
1474
-            include_once $SETTINGS['cpassman_dir'] . '/pages/offline.js.php';
1474
+            include_once $SETTINGS['cpassman_dir'].'/pages/offline.js.php';
1475 1475
         } elseif ($get['page'] === 'search') {
1476
-            include_once $SETTINGS['cpassman_dir'] . '/pages/search.js.php';
1476
+            include_once $SETTINGS['cpassman_dir'].'/pages/search.js.php';
1477 1477
         } elseif ($get['page'] === 'profile') {
1478
-            include_once $SETTINGS['cpassman_dir'] . '/pages/profile.js.php';
1478
+            include_once $SETTINGS['cpassman_dir'].'/pages/profile.js.php';
1479 1479
         } elseif ($get['page'] === 'favourites') {
1480
-            include_once $SETTINGS['cpassman_dir'] . '/pages/favorites.js.php';
1480
+            include_once $SETTINGS['cpassman_dir'].'/pages/favorites.js.php';
1481 1481
         } elseif ($get['page'] === 'folders') {
1482
-            include_once $SETTINGS['cpassman_dir'] . '/pages/folders.js.php';
1482
+            include_once $SETTINGS['cpassman_dir'].'/pages/folders.js.php';
1483 1483
         } elseif ($get['page'] === 'users') {
1484
-            include_once $SETTINGS['cpassman_dir'] . '/pages/users.js.php';
1484
+            include_once $SETTINGS['cpassman_dir'].'/pages/users.js.php';
1485 1485
         } elseif ($get['page'] === 'roles') {
1486
-            include_once $SETTINGS['cpassman_dir'] . '/pages/roles.js.php';
1486
+            include_once $SETTINGS['cpassman_dir'].'/pages/roles.js.php';
1487 1487
         } elseif ($get['page'] === 'utilities.deletion') {
1488
-            include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.deletion.js.php';
1488
+            include_once $SETTINGS['cpassman_dir'].'/pages/utilities.deletion.js.php';
1489 1489
         } elseif ($get['page'] === 'utilities.logs') {
1490
-            include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.logs.js.php';
1490
+            include_once $SETTINGS['cpassman_dir'].'/pages/utilities.logs.js.php';
1491 1491
         } elseif ($get['page'] === 'utilities.database') {
1492
-            include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.database.js.php';
1492
+            include_once $SETTINGS['cpassman_dir'].'/pages/utilities.database.js.php';
1493 1493
         } elseif ($get['page'] === 'utilities.renewal') {
1494
-            include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.renewal.js.php';
1494
+            include_once $SETTINGS['cpassman_dir'].'/pages/utilities.renewal.js.php';
1495 1495
         }
1496 1496
     } else {
1497
-        include_once $SETTINGS['cpassman_dir'] . '/includes/core/login.js.php';
1497
+        include_once $SETTINGS['cpassman_dir'].'/includes/core/login.js.php';
1498 1498
     }
1499 1499
 }
Please login to merge, or discard this patch.
scripts/traits/UserHandlerTrait.php 2 patches
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -54,13 +54,17 @@  discard block
 block discarded – undo
54 54
         );
55 55
     
56 56
         if (empty($subtasks)) {
57
-            if (LOG_TASKS=== true) $this->logger->log("No subtask was found for task {$this->taskId}");
57
+            if (LOG_TASKS=== true) {
58
+                $this->logger->log("No subtask was found for task {$this->taskId}");
59
+            }
58 60
             return;
59 61
         }
60 62
     
61 63
         // Process each subtask
62 64
         foreach ($subtasks as $subtask) {
63
-            if (LOG_TASKS=== true) $this->logger->log("Processing subtask {$subtask['increment_id']} for task {$this->taskId}");
65
+            if (LOG_TASKS=== true) {
66
+                $this->logger->log("Processing subtask {$subtask['increment_id']} for task {$this->taskId}");
67
+            }
64 68
             $this->processGenerateUserKeysSubtask($subtask, $arguments);
65 69
         }
66 70
     
@@ -97,7 +101,9 @@  discard block
 block discarded – undo
97 101
                 $subtask['increment_id']
98 102
             );
99 103
             
100
-            if (LOG_TASKS=== true) $this->logger->log("Subtask is in progress: ".$taskData['step'], 'INFO');
104
+            if (LOG_TASKS=== true) {
105
+                $this->logger->log("Subtask is in progress: ".$taskData['step'], 'INFO');
106
+            }
101 107
             switch ($taskData['step'] ?? '') {
102 108
                 case 'step0':
103 109
                     $this->generateNewUserStep0($arguments);
Please login to merge, or discard this patch.
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -50,24 +50,24 @@  discard block
 block discarded – undo
50 50
     private function generateUserKeys($arguments) {
51 51
         // Get all subtasks related to this task
52 52
         $subtasks = DB::query(
53
-            'SELECT * FROM ' . prefixTable('background_subtasks') . ' WHERE task_id = %i AND is_in_progress = 0 ORDER BY `task` ASC',
53
+            'SELECT * FROM '.prefixTable('background_subtasks').' WHERE task_id = %i AND is_in_progress = 0 ORDER BY `task` ASC',
54 54
             $this->taskId
55 55
         );
56 56
     
57 57
         if (empty($subtasks)) {
58
-            if (LOG_TASKS=== true) $this->logger->log("No subtask was found for task {$this->taskId}");
58
+            if (LOG_TASKS === true) $this->logger->log("No subtask was found for task {$this->taskId}");
59 59
             return;
60 60
         }
61 61
     
62 62
         // Process each subtask
63 63
         foreach ($subtasks as $subtask) {
64
-            if (LOG_TASKS=== true) $this->logger->log("Processing subtask {$subtask['increment_id']} for task {$this->taskId}");
64
+            if (LOG_TASKS === true) $this->logger->log("Processing subtask {$subtask['increment_id']} for task {$this->taskId}");
65 65
             $this->processGenerateUserKeysSubtask($subtask, $arguments);
66 66
         }
67 67
     
68 68
         // Are all subtasks completed?
69 69
         $remainingSubtasks = DB::queryFirstField(
70
-            'SELECT COUNT(*) FROM ' . prefixTable('background_subtasks') . ' WHERE task_id = %i AND is_in_progress = 0',
70
+            'SELECT COUNT(*) FROM '.prefixTable('background_subtasks').' WHERE task_id = %i AND is_in_progress = 0',
71 71
             $this->taskId
72 72
         );    
73 73
         if ($remainingSubtasks == 0) {
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
                 $subtask['increment_id']
99 99
             );
100 100
             
101
-            if (LOG_TASKS=== true) $this->logger->log("Subtask is in progress: ".$taskData['step'], 'INFO');
101
+            if (LOG_TASKS === true) $this->logger->log("Subtask is in progress: ".$taskData['step'], 'INFO');
102 102
             switch ($taskData['step'] ?? '') {
103 103
                 case 'step0':
104 104
                     $this->generateNewUserStep0($arguments);
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
                 $subtask['increment_id']
153 153
             );
154 154
             
155
-            $this->logger->log("Subtask {$subtask['increment_id']} failure: " . $e->getMessage(), 'ERROR');
155
+            $this->logger->log("Subtask {$subtask['increment_id']} failure: ".$e->getMessage(), 'ERROR');
156 156
         }
157 157
     }
158 158
     
@@ -186,10 +186,10 @@  discard block
 block discarded – undo
186 186
         // Loop on items
187 187
         $rows = DB::query(
188 188
             'SELECT id, pw, perso
189
-            FROM ' . prefixTable('items') . '
189
+            FROM ' . prefixTable('items').'
190 190
             WHERE perso =  %i
191 191
             ORDER BY id ASC
192
-            LIMIT ' . $taskData['index'] . ', ' . $taskData['nb'],
192
+            LIMIT ' . $taskData['index'].', '.$taskData['nb'],
193 193
             ($arguments['only_personal_items'] ?? 0) === 1 ? 1 : 0
194 194
         );
195 195
 
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
             // Get itemKey from current user
198 198
             $currentUserKey = DB::queryFirstRow(
199 199
                 'SELECT share_key, increment_id
200
-                FROM ' . prefixTable('sharekeys_items') . '
200
+                FROM ' . prefixTable('sharekeys_items').'
201 201
                 WHERE object_id = %i AND user_id = %i',
202 202
                 $record['id'],
203 203
                 (int) $record['perso'] === 0 ? $arguments['owner_id'] : $arguments['new_user_id']
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
             
225 225
             $currentUserKey = DB::queryFirstRow(
226 226
                 'SELECT increment_id
227
-                FROM ' . prefixTable('sharekeys_items') . '
227
+                FROM ' . prefixTable('sharekeys_items').'
228 228
                 WHERE object_id = %i AND user_id = %i',
229 229
                 $record['id'],
230 230
                 $arguments['new_user_id']
@@ -274,16 +274,16 @@  discard block
 block discarded – undo
274 274
         // Loop on logs
275 275
         $rows = DB::query(
276 276
             'SELECT increment_id
277
-            FROM ' . prefixTable('log_items') . '
277
+            FROM ' . prefixTable('log_items').'
278 278
             WHERE raison LIKE "at_pw :%" AND encryption_type = "teampass_aes"
279 279
             ORDER BY increment_id ASC
280
-            LIMIT ' . $taskData['index'] . ', ' . $taskData['nb']
280
+            LIMIT ' . $taskData['index'].', '.$taskData['nb']
281 281
         );
282 282
         foreach ($rows as $record) {
283 283
             // Get itemKey from current user
284 284
             $currentUserKey = DB::queryFirstRow(
285 285
                 'SELECT share_key
286
-                FROM ' . prefixTable('sharekeys_logs') . '
286
+                FROM ' . prefixTable('sharekeys_logs').'
287 287
                 WHERE object_id = %i AND user_id = %i',
288 288
                 $record['increment_id'],
289 289
                 $arguments['owner_id']
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
                 if ((int) $arguments['new_user_id'] !== (int) $arguments['owner_id']) {
316 316
                     $currentUserKey = DB::queryFirstRow(
317 317
                         'SELECT increment_id
318
-                        FROM ' . prefixTable('sharekeys_items') . '
318
+                        FROM ' . prefixTable('sharekeys_items').'
319 319
                         WHERE object_id = %i AND user_id = %i',
320 320
                         $record['id'],
321 321
                         $arguments['new_user_id']
@@ -356,16 +356,16 @@  discard block
 block discarded – undo
356 356
         // Loop on fields
357 357
         $rows = DB::query(
358 358
             'SELECT id
359
-            FROM ' . prefixTable('categories_items') . '
359
+            FROM ' . prefixTable('categories_items').'
360 360
             WHERE encryption_type = "teampass_aes"
361 361
             ORDER BY id ASC
362
-            LIMIT ' . $taskData['index'] . ', ' . $taskData['nb']
362
+            LIMIT ' . $taskData['index'].', '.$taskData['nb']
363 363
         );
364 364
         foreach ($rows as $record) {
365 365
             // Get itemKey from current user
366 366
             $currentUserKey = DB::queryFirstRow(
367 367
                 'SELECT share_key
368
-                FROM ' . prefixTable('sharekeys_fields') . '
368
+                FROM ' . prefixTable('sharekeys_fields').'
369 369
                 WHERE object_id = %i AND user_id = %i',
370 370
                 $record['id'],
371 371
                 $arguments['owner_id']
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
                     if ((int) $arguments['new_user_id'] !== (int) $arguments['owner_id']) {
394 394
                         $currentUserKey = DB::queryFirstRow(
395 395
                             'SELECT increment_id
396
-                            FROM ' . prefixTable('sharekeys_items') . '
396
+                            FROM ' . prefixTable('sharekeys_items').'
397 397
                             WHERE object_id = %i AND user_id = %i',
398 398
                             $record['id'],
399 399
                             $arguments['new_user_id']
@@ -435,15 +435,15 @@  discard block
 block discarded – undo
435 435
         // Loop on suggestions
436 436
         $rows = DB::query(
437 437
             'SELECT id
438
-            FROM ' . prefixTable('suggestion') . '
438
+            FROM ' . prefixTable('suggestion').'
439 439
             ORDER BY id ASC
440
-            LIMIT ' . $taskData['index'] . ', ' . $taskData['nb']
440
+            LIMIT ' . $taskData['index'].', '.$taskData['nb']
441 441
         );
442 442
         foreach ($rows as $record) {
443 443
             // Get itemKey from current user
444 444
             $currentUserKey = DB::queryFirstRow(
445 445
                 'SELECT share_key
446
-                FROM ' . prefixTable('sharekeys_suggestions') . '
446
+                FROM ' . prefixTable('sharekeys_suggestions').'
447 447
                 WHERE object_id = %i AND user_id = %i',
448 448
                 $record['id'],
449 449
                 $arguments['owner_id']
@@ -475,7 +475,7 @@  discard block
 block discarded – undo
475 475
                 if ((int) $arguments['new_user_id'] !== (int) $arguments['owner_id']) {
476 476
                     $currentUserKey = DB::queryFirstRow(
477 477
                         'SELECT increment_id
478
-                        FROM ' . prefixTable('sharekeys_items') . '
478
+                        FROM ' . prefixTable('sharekeys_items').'
479 479
                         WHERE object_id = %i AND user_id = %i',
480 480
                         $record['id'],
481 481
                         $arguments['new_user_id']
@@ -516,16 +516,16 @@  discard block
 block discarded – undo
516 516
         // Loop on files
517 517
         $rows = DB::query(
518 518
             'SELECT f.id AS id, i.perso AS perso
519
-            FROM ' . prefixTable('files') . ' AS f
520
-            INNER JOIN ' . prefixTable('items') . ' AS i ON i.id = f.id_item
521
-            WHERE f.status = "' . TP_ENCRYPTION_NAME . '"
522
-            LIMIT ' . $taskData['index'] . ', ' . $taskData['nb']
519
+            FROM ' . prefixTable('files').' AS f
520
+            INNER JOIN ' . prefixTable('items').' AS i ON i.id = f.id_item
521
+            WHERE f.status = "' . TP_ENCRYPTION_NAME.'"
522
+            LIMIT ' . $taskData['index'].', '.$taskData['nb']
523 523
         ); //aes_encryption
524 524
         foreach ($rows as $record) {
525 525
             // Get itemKey from current user
526 526
             $currentUserKey = DB::queryFirstRow(
527 527
                 'SELECT share_key, increment_id
528
-                FROM ' . prefixTable('sharekeys_files') . '
528
+                FROM ' . prefixTable('sharekeys_files').'
529 529
                 WHERE object_id = %i AND user_id = %i',
530 530
                 $record['id'],
531 531
                 (int) $record['perso'] === 0 ? $arguments['owner_id'] : $arguments['new_user_id']
@@ -553,7 +553,7 @@  discard block
 block discarded – undo
553 553
 
554 554
             $currentUserKey = DB::queryFirstRow(
555 555
                 'SELECT increment_id
556
-                FROM ' . prefixTable('sharekeys_files') . '
556
+                FROM ' . prefixTable('sharekeys_files').'
557 557
                 WHERE object_id = %i AND user_id = %i',
558 558
                 $record['id'],
559 559
                 $arguments['new_user_id']
@@ -615,7 +615,7 @@  discard block
 block discarded – undo
615 615
         // get user info
616 616
         $userInfo = DB::queryFirstRow(
617 617
             'SELECT email, login, auth_type, special, lastname, name
618
-            FROM ' . prefixTable('users') . '
618
+            FROM ' . prefixTable('users').'
619 619
             WHERE id = %i',
620 620
             $arguments['new_user_id']
621 621
         );
@@ -630,10 +630,10 @@  discard block
 block discarded – undo
630 630
                 filter_var($userInfo['email'], FILTER_SANITIZE_FULL_SPECIAL_CHARS),
631 631
                 // @scrutinizer ignore-type
632 632
                 empty($arguments['email_body']) === false ? $arguments['email_body'] : $lang->get('email_body_user_config_1'),
633
-                'TEAMPASS - ' . $lang->get('login_credentials'),
633
+                'TEAMPASS - '.$lang->get('login_credentials'),
634 634
                 (array) filter_var_array(
635 635
                     [
636
-                        '#code#' => cryption($arguments['new_user_code'], '','decrypt', $this->settings)['string'],
636
+                        '#code#' => cryption($arguments['new_user_code'], '', 'decrypt', $this->settings)['string'],
637 637
                         '#lastname#' => isset($userInfo['name']) === true ? $userInfo['name'] : '',
638 638
                         '#login#' => isset($userInfo['login']) === true ? $userInfo['login'] : '',
639 639
                     ],
@@ -669,13 +669,13 @@  discard block
 block discarded – undo
669 669
     private function getOwnerInfos(int $owner_id, string $owner_pwd) {
670 670
         $userInfo = DB::queryFirstRow(
671 671
             'SELECT pw, public_key, private_key, login, name
672
-            FROM ' . prefixTable('users') . '
672
+            FROM ' . prefixTable('users').'
673 673
             WHERE id = %i',
674 674
             $owner_id
675 675
         );
676 676
 
677 677
         // decrypt owner password
678
-        $pwd = cryption($owner_pwd, '','decrypt', $this->settings)['string'];
678
+        $pwd = cryption($owner_pwd, '', 'decrypt', $this->settings)['string'];
679 679
         // decrypt private key and send back
680 680
         return [
681 681
             'private_key' => decryptPrivateKey($pwd, $userInfo['private_key']),
Please login to merge, or discard this patch.
scripts/traits/ItemHandlerTrait.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 trait ItemHandlerTrait {    
30 30
 
31 31
     private function generateUserPasswordKeys($arguments) {
32
-        if (LOG_TASKS=== true) $this->logger->log('Processing generateUserPasswordKeys : '.print_r($arguments, true), 'DEBUG');
32
+        if (LOG_TASKS === true) $this->logger->log('Processing generateUserPasswordKeys : '.print_r($arguments, true), 'DEBUG');
33 33
         // Generate keys for user passwords   
34 34
         storeUsersShareKey(
35 35
             prefixTable('sharekeys_items'),
@@ -49,8 +49,8 @@  discard block
 block discarded – undo
49 49
      * @param array $taskData
50 50
      */
51 51
     private function generateUserFileKeys($taskData) {    
52
-        if (LOG_TASKS=== true) $this->logger->log('Processing generateUserFileKeys : '.print_r($taskData, true), 'DEBUG');
53
-        foreach($taskData['files_keys'] as $file) {
52
+        if (LOG_TASKS === true) $this->logger->log('Processing generateUserFileKeys : '.print_r($taskData, true), 'DEBUG');
53
+        foreach ($taskData['files_keys'] as $file) {
54 54
             storeUsersShareKey(
55 55
                 prefixTable('sharekeys_files'),
56 56
                 0,
@@ -70,9 +70,9 @@  discard block
 block discarded – undo
70 70
      * @param array $arguments
71 71
      */
72 72
     private function generateUserFieldKeys($arguments) {
73
-        if (LOG_TASKS=== true) $this->logger->log('Processing generateUserFieldKeys : '.print_r($arguments, true), 'DEBUG');
74
-        foreach($arguments['fields_keys'] as $field) {
75
-            $this->logger->log('Processing generateUserFieldKeys for: ' . $field['object_id'], 'DEBUG');
73
+        if (LOG_TASKS === true) $this->logger->log('Processing generateUserFieldKeys : '.print_r($arguments, true), 'DEBUG');
74
+        foreach ($arguments['fields_keys'] as $field) {
75
+            $this->logger->log('Processing generateUserFieldKeys for: '.$field['object_id'], 'DEBUG');
76 76
             storeUsersShareKey(
77 77
                 prefixTable('sharekeys_fields'),
78 78
                 0,
Please login to merge, or discard this patch.
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,7 +29,9 @@  discard block
 block discarded – undo
29 29
 trait ItemHandlerTrait {    
30 30
 
31 31
     private function generateUserPasswordKeys($arguments) {
32
-        if (LOG_TASKS=== true) $this->logger->log('Processing generateUserPasswordKeys : '.print_r($arguments, true), 'DEBUG');
32
+        if (LOG_TASKS=== true) {
33
+            $this->logger->log('Processing generateUserPasswordKeys : '.print_r($arguments, true), 'DEBUG');
34
+        }
33 35
         // Generate keys for user passwords   
34 36
         storeUsersShareKey(
35 37
             prefixTable('sharekeys_items'),
@@ -49,7 +51,9 @@  discard block
 block discarded – undo
49 51
      * @param array $taskData
50 52
      */
51 53
     private function generateUserFileKeys($taskData) {    
52
-        if (LOG_TASKS=== true) $this->logger->log('Processing generateUserFileKeys : '.print_r($taskData, true), 'DEBUG');
54
+        if (LOG_TASKS=== true) {
55
+            $this->logger->log('Processing generateUserFileKeys : '.print_r($taskData, true), 'DEBUG');
56
+        }
53 57
         foreach($taskData['files_keys'] as $file) {
54 58
             storeUsersShareKey(
55 59
                 prefixTable('sharekeys_files'),
@@ -70,7 +74,9 @@  discard block
 block discarded – undo
70 74
      * @param array $arguments
71 75
      */
72 76
     private function generateUserFieldKeys($arguments) {
73
-        if (LOG_TASKS=== true) $this->logger->log('Processing generateUserFieldKeys : '.print_r($arguments, true), 'DEBUG');
77
+        if (LOG_TASKS=== true) {
78
+            $this->logger->log('Processing generateUserFieldKeys : '.print_r($arguments, true), 'DEBUG');
79
+        }
74 80
         foreach($arguments['fields_keys'] as $field) {
75 81
             $this->logger->log('Processing generateUserFieldKeys for: ' . $field['object_id'], 'DEBUG');
76 82
             storeUsersShareKey(
Please login to merge, or discard this patch.
scripts/task_maintenance_purge_old_files.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 function purgeTemporaryFiles(): void
72 72
 {
73 73
     // Load expected files
74
-    require_once __DIR__. '/../sources/main.functions.php';
74
+    require_once __DIR__.'/../sources/main.functions.php';
75 75
     $SETTINGS = $SETTINGS ?? [];
76 76
 
77 77
     // $SETTINGS is set then read folder
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
             //delete file FILES
82 82
             while (false !== ($f = readdir($dir))) {
83 83
                 if ($f !== '.' && $f !== '..' && $f !== '.htaccess') {
84
-                    $filePath = $SETTINGS['path_to_files_folder'] . '/' . $f;
84
+                    $filePath = $SETTINGS['path_to_files_folder'].'/'.$f;
85 85
                     if (file_exists($filePath) && ((time() - filectime($filePath)) > 604800)) {
86 86
                         fileDelete($filePath, $SETTINGS);
87 87
                     }
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
             while (false !== ($f = readdir($dir))) {
103 103
                 if ($f !== '.' && $f !== '..') {
104 104
                     if (strpos($f, '_delete.') > 0) {
105
-                        fileDelete($SETTINGS['path_to_upload_folder'] . '/' . $f, $SETTINGS);
105
+                        fileDelete($SETTINGS['path_to_upload_folder'].'/'.$f, $SETTINGS);
106 106
                     }
107 107
                 }
108 108
             }
Please login to merge, or discard this patch.
scripts/task_maintenance_users_personal_folder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
     //get through all users with enabled personnal folder.
81 81
     $users = DB::query(
82 82
         'SELECT id, login, email
83
-        FROM ' . prefixTable('users') . '
83
+        FROM ' . prefixTable('users').'
84 84
         WHERE id NOT IN ('.OTV_USER_ID.', '.TP_USER_ID.', '.SSH_USER_ID.', '.API_USER_ID.')
85 85
         AND personal_folder = 1
86 86
         ORDER BY login ASC'
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
         //if folder doesn't exist then create it
90 90
         $data = DB::queryFirstRow(
91 91
             'SELECT id
92
-            FROM ' . prefixTable('nested_tree') . '
92
+            FROM ' . prefixTable('nested_tree').'
93 93
             WHERE title = %s AND parent_id = %i',
94 94
             $user['id'],
95 95
             0
Please login to merge, or discard this patch.
scripts/background_tasks___do_calculation.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     // get count of Items in this folder
73 73
     $get = DB::queryFirstRow(
74 74
         'SELECT count(*) as num_results
75
-        FROM ' . prefixTable('items') . '
75
+        FROM ' . prefixTable('items').'
76 76
         WHERE inactif = %i AND id_tree = %i',
77 77
         0,
78 78
         $child->id
@@ -81,14 +81,14 @@  discard block
 block discarded – undo
81 81
     $ret[$child->id]['id'] = $child->id;
82 82
 
83 83
     // get number of subfolders
84
-    $nodeDescendants =$tree->getDescendants($child->id, false, false, true);
84
+    $nodeDescendants = $tree->getDescendants($child->id, false, false, true);
85 85
     $ret[$child->id]['subfoldersCount'] = count($nodeDescendants);
86 86
 
87 87
     // get items number in subfolders
88 88
     if (count($nodeDescendants) > 0) {
89 89
         $get = DB::queryFirstRow(
90 90
             'SELECT count(*) as num_results
91
-            FROM ' . prefixTable('items') . '
91
+            FROM ' . prefixTable('items').'
92 92
             WHERE inactif = %i AND id_tree IN (%l)',
93 93
             0,
94 94
             implode(',', $nodeDescendants)
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
     // Get item key
140 140
     $itemKey = DB::queryFirstRow(
141 141
         'SELECT share_key
142
-        FROM ' . prefixTable('sharekeys_items') . '
142
+        FROM ' . prefixTable('sharekeys_items').'
143 143
         WHERE user_id = %i AND object_id = %i',
144 144
         TP_USER_ID,
145 145
         $item['itemId']
Please login to merge, or discard this patch.
scripts/task_maintenance_clean_orphan_objects.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -73,64 +73,64 @@
 block discarded – undo
73 73
 {
74 74
     // Delete all item keys for which no user exist
75 75
     DB::query(
76
-        'DELETE k FROM ' . prefixTable('sharekeys_items') . ' k
77
-        LEFT JOIN ' . prefixTable('users') . ' u ON k.user_id = u.id
76
+        'DELETE k FROM '.prefixTable('sharekeys_items').' k
77
+        LEFT JOIN ' . prefixTable('users').' u ON k.user_id = u.id
78 78
         WHERE u.id IS NULL OR u.deleted_at IS NOT NULL'
79 79
     );
80 80
 
81 81
     // Delete all files keys for which no user exist
82 82
     DB::query(
83
-        'DELETE k FROM ' . prefixTable('sharekeys_files') . ' k
84
-        LEFT JOIN ' . prefixTable('users') . ' u ON k.user_id = u.id
83
+        'DELETE k FROM '.prefixTable('sharekeys_files').' k
84
+        LEFT JOIN ' . prefixTable('users').' u ON k.user_id = u.id
85 85
         WHERE u.id IS NULL OR u.deleted_at IS NOT NULL'
86 86
     );
87 87
 
88 88
     // Delete all fields keys for which no user exist
89 89
     DB::query(
90
-        'DELETE k FROM ' . prefixTable('sharekeys_fields') . ' k
91
-        LEFT JOIN ' . prefixTable('users') . ' u ON k.user_id = u.id
90
+        'DELETE k FROM '.prefixTable('sharekeys_fields').' k
91
+        LEFT JOIN ' . prefixTable('users').' u ON k.user_id = u.id
92 92
         WHERE u.id IS NULL OR u.deleted_at IS NOT NULL'
93 93
     );
94 94
 
95 95
     // Delete all item logs for which no user exist
96 96
     DB::query(
97
-        'DELETE l FROM ' . prefixTable('log_items') . ' l
98
-        LEFT JOIN ' . prefixTable('users') . ' u ON l.id_user = u.id
97
+        'DELETE l FROM '.prefixTable('log_items').' l
98
+        LEFT JOIN ' . prefixTable('users').' u ON l.id_user = u.id
99 99
         WHERE u.id IS NULL OR u.deleted_at IS NOT NULL'
100 100
     );
101 101
 
102 102
     // Delete all system logs for which no user exist
103 103
     DB::query(
104
-        'DELETE l FROM ' . prefixTable('log_system') . ' l
105
-        LEFT JOIN ' . prefixTable('users') . ' u ON l.qui = u.id
104
+        'DELETE l FROM '.prefixTable('log_system').' l
105
+        LEFT JOIN ' . prefixTable('users').' u ON l.qui = u.id
106 106
         WHERE u.id IS NULL OR u.deleted_at IS NOT NULL'
107 107
     );
108 108
 
109 109
     // Delete all item keys for which no object exist
110 110
     DB::query(
111
-        'DELETE k FROM ' . prefixTable('sharekeys_items') . ' k
112
-        LEFT JOIN ' . prefixTable('items') . ' i ON k.object_id = i.id
111
+        'DELETE k FROM '.prefixTable('sharekeys_items').' k
112
+        LEFT JOIN ' . prefixTable('items').' i ON k.object_id = i.id
113 113
         WHERE i.id IS NULL'
114 114
     );
115 115
 
116 116
     // Delete all files keys for which no object exist
117 117
     DB::query(
118
-        'DELETE k FROM ' . prefixTable('sharekeys_files') . ' k
119
-        LEFT JOIN ' . prefixTable('items') . ' i ON k.object_id = i.id
118
+        'DELETE k FROM '.prefixTable('sharekeys_files').' k
119
+        LEFT JOIN ' . prefixTable('items').' i ON k.object_id = i.id
120 120
         WHERE i.id IS NULL'
121 121
     );
122 122
 
123 123
     // Delete all fields keys for which no object exist
124 124
     DB::query(
125
-        'DELETE k FROM ' . prefixTable('sharekeys_fields') . ' k
126
-        LEFT JOIN ' . prefixTable('items') . ' i ON k.object_id = i.id
125
+        'DELETE k FROM '.prefixTable('sharekeys_fields').' k
126
+        LEFT JOIN ' . prefixTable('items').' i ON k.object_id = i.id
127 127
         WHERE i.id IS NULL'
128 128
     );
129 129
 
130 130
     // Delete all item logs for which no object exist
131 131
     DB::query(
132
-        'DELETE l FROM ' . prefixTable('log_items') . ' l
133
-        LEFT JOIN ' . prefixTable('items') . ' i ON l.id_item = i.id
132
+        'DELETE l FROM '.prefixTable('log_items').' l
133
+        LEFT JOIN ' . prefixTable('items').' i ON l.id_item = i.id
134 134
         WHERE i.id IS NULL'
135 135
     );
136 136
 
Please login to merge, or discard this patch.