Passed
Push — master ( ddace9...a18ce8 )
by Nils
06:12 queued 16s
created
sources/items.queries.php 3 patches
Braces   +12 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1234,7 +1234,9 @@  discard block
 block discarded – undo
1234 1234
                 );
1235 1235
 
1236 1236
                 // Create a task to create sharekeys for users
1237
-                if (WIP=== true) error_log('createTaskForItem - new password for this item - '.$post_password ." -- ". $pw);
1237
+                if (WIP=== true) {
1238
+                    error_log('createTaskForItem - new password for this item - '.$post_password ." -- ". $pw);
1239
+                }
1238 1240
                 $tasksToBePerformed = ['item_password'];
1239 1241
                 $encryptionTaskIsRequested = true;
1240 1242
             } else {
@@ -1554,7 +1556,9 @@  discard block
 block discarded – undo
1554 1556
 
1555 1557
             // create a task for all fields updated
1556 1558
             if ($encryptionTaskIsRequested === true) {
1557
-                if (WIP === true) error_log('createTaskForItem - '.print_r($tasksToBePerformed, true));
1559
+                if (WIP === true) {
1560
+                    error_log('createTaskForItem - '.print_r($tasksToBePerformed, true));
1561
+                }
1558 1562
                 createTaskForItem(
1559 1563
                     'item_update_create_keys',
1560 1564
                     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']) . ' - '
@@ -4757,8 +4763,9 @@  discard block
 block discarded – undo
4757 4763
                 $ids = $tree->getDescendants($folder['id'], true, false, true);
4758 4764
 
4759 4765
                 // This folder is owned by user
4760
-                if (in_array($inputData['folderId'], $ids))
4761
-                    $accessLevel = 30;
4766
+                if (in_array($inputData['folderId'], $ids)) {
4767
+                                    $accessLevel = 30;
4768
+                }
4762 4769
             }
4763 4770
         }
4764 4771
 
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1836,7 +1836,7 @@
 block discarded – undo
1836 1836
                     '',
1837 1837
                     'encrypt'
1838 1838
                 );
1839
-           }
1839
+            }
1840 1840
 
1841 1841
             // Check if status or secret or phone number has changed
1842 1842
             if (DB::count() > 0
Please login to merge, or discard this patch.
Spacing   +281 added lines, -282 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
 
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
             // About special settings
366 366
             $dataFolderSettings = DB::queryFirstRow(
367 367
                 'SELECT bloquer_creation, bloquer_modification, personal_folder
368
-                FROM ' . prefixTable('nested_tree') . ' 
368
+                FROM ' . prefixTable('nested_tree').' 
369 369
                 WHERE id = %i',
370 370
                 $inputData['folderId']
371 371
             );
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
             // Get folder complexity
383 383
             $folderComplexity = DB::queryFirstRow(
384 384
                 'SELECT valeur
385
-                FROM ' . prefixTable('misc') . '
385
+                FROM ' . prefixTable('misc').'
386 386
                 WHERE type = %s AND intitule = %i',
387 387
                 'complex',
388 388
                 $inputData['folderId']
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
             $itemExists = 0;
408 408
             $newID = '';
409 409
             $data = DB::queryFirstRow(
410
-                'SELECT * FROM ' . prefixTable('items') . '
410
+                'SELECT * FROM '.prefixTable('items').'
411 411
                 WHERE label = %s AND inactif = %i',
412 412
                 $inputData['label'],
413 413
                 0
@@ -488,8 +488,8 @@  discard block
 block discarded – undo
488 488
                     (int) $post_folder_is_personal,
489 489
                     (int) $newID,
490 490
                     $cryptedStuff['objectKey'],
491
-                    true,   // only for the item creator
492
-                    false,  // no delete all
491
+                    true, // only for the item creator
492
+                    false, // no delete all
493 493
                 );
494 494
 
495 495
                 // update fields
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
                             // should we encrypt the data
503 503
                             $dataTmp = DB::queryFirstRow(
504 504
                                 'SELECT encrypted_data
505
-                                FROM ' . prefixTable('categories') . '
505
+                                FROM ' . prefixTable('categories').'
506 506
                                 WHERE id = %i',
507 507
                                 $field['id']
508 508
                             );
@@ -531,8 +531,8 @@  discard block
 block discarded – undo
531 531
                                     (int) $post_folder_is_personal,
532 532
                                     (int) $newObjectId,
533 533
                                     $cryptedStuff['objectKey'],
534
-                                    true,   // only for the item creator
535
-                                    false,  // no delete all
534
+                                    true, // only for the item creator
535
+                                    false, // no delete all
536 536
                                 );
537 537
 
538 538
                                 array_push(
@@ -568,7 +568,7 @@  discard block
 block discarded – undo
568 568
                 ) {
569 569
                     DB::queryFirstRow(
570 570
                         'SELECT *
571
-                        FROM ' . prefixTable('templates') . '
571
+                        FROM ' . prefixTable('templates').'
572 572
                         WHERE item_id = %i',
573 573
                         $newID
574 574
                     );
@@ -637,11 +637,11 @@  discard block
 block discarded – undo
637 637
                 ) {
638 638
                     foreach ($post_restricted_to as $userRest) {
639 639
                         if (empty($userRest) === false) {
640
-                            $dataTmp = DB::queryFirstRow('SELECT login FROM ' . prefixTable('users') . ' WHERE id= %i', $userRest);
640
+                            $dataTmp = DB::queryFirstRow('SELECT login FROM '.prefixTable('users').' WHERE id= %i', $userRest);
641 641
                             if (empty($listOfRestricted)) {
642 642
                                 $listOfRestricted = $dataTmp['login'];
643 643
                             } else {
644
-                                $listOfRestricted .= ';' . $dataTmp['login'];
644
+                                $listOfRestricted .= ';'.$dataTmp['login'];
645 645
                             }
646 646
                         }
647 647
                     }
@@ -657,7 +657,7 @@  discard block
 block discarded – undo
657 657
                             if (empty($userRest) === false) {
658 658
                                 $dataTmp = DB::queryFirstRow(
659 659
                                     'SELECT login
660
-                                    FROM ' . prefixTable('users') . '
660
+                                    FROM ' . prefixTable('users').'
661 661
                                     WHERE id= %i',
662 662
                                     $userRest
663 663
                                 );
@@ -665,7 +665,7 @@  discard block
 block discarded – undo
665 665
                                 if (empty($oldRestrictionList) === true) {
666 666
                                     $oldRestrictionList = $dataTmp['login'];
667 667
                                 } else {
668
-                                    $oldRestrictionList .= ';' . $dataTmp['login'];
668
+                                    $oldRestrictionList .= ';'.$dataTmp['login'];
669 669
                                 }
670 670
                             }
671 671
                         }
@@ -728,7 +728,7 @@  discard block
 block discarded – undo
728 728
                 if (empty($post_uploaded_file_id) === false) {
729 729
                     $rows = DB::query(
730 730
                         'SELECT id
731
-                        FROM ' . prefixTable('files') . '
731
+                        FROM ' . prefixTable('files').'
732 732
                         WHERE id_item = %s',
733 733
                         $post_uploaded_file_id
734 734
                     );
@@ -784,7 +784,7 @@  discard block
 block discarded – undo
784 784
                                     $lang->get('email_subject_item_updated'),
785 785
                                     str_replace(
786 786
                                         array('#label', '#link'),
787
-                                            array($path, $SETTINGS['email_server_url'] . '/index.php?page=items&group=' . $inputData['folderId'] . '&id=' . $newID . $lang['email_body3']),
787
+                                            array($path, $SETTINGS['email_server_url'].'/index.php?page=items&group='.$inputData['folderId'].'&id='.$newID.$lang['email_body3']),
788 788
                                             $lang->get('new_item_email_body')
789 789
                                     ),
790 790
                                     $emailAddress,
@@ -888,11 +888,11 @@  discard block
 block discarded – undo
888 888
         // Prepare variables
889 889
         $itemInfos = array();
890 890
         $inputData['label'] = isset($dataReceived['label']) && is_string($dataReceived['label']) ? filter_var($dataReceived['label'], FILTER_SANITIZE_FULL_SPECIAL_CHARS) : '';
891
-        $post_url = isset($dataReceived['url'])=== true ? filter_var(htmlspecialchars_decode($dataReceived['url']), FILTER_SANITIZE_URL) : '';
891
+        $post_url = isset($dataReceived['url']) === true ? filter_var(htmlspecialchars_decode($dataReceived['url']), FILTER_SANITIZE_URL) : '';
892 892
         $post_password = $original_pw = isset($dataReceived['pw']) && is_string($dataReceived['pw']) ? htmlspecialchars_decode($dataReceived['pw']) : '';
893 893
         $post_login = isset($dataReceived['login']) && is_string($dataReceived['login']) ? filter_var(htmlspecialchars_decode($dataReceived['login']), FILTER_SANITIZE_FULL_SPECIAL_CHARS) : '';
894
-        $post_tags = isset($dataReceived['tags'])=== true ? htmlspecialchars($dataReceived['tags']) : '';
895
-        $post_email = isset($dataReceived['email'])=== true ? filter_var(htmlspecialchars_decode($dataReceived['email']), FILTER_SANITIZE_EMAIL) : '';
894
+        $post_tags = isset($dataReceived['tags']) === true ? htmlspecialchars($dataReceived['tags']) : '';
895
+        $post_email = isset($dataReceived['email']) === true ? filter_var(htmlspecialchars_decode($dataReceived['email']), FILTER_SANITIZE_EMAIL) : '';
896 896
         $post_template_id = (int) filter_var($dataReceived['template_id'], FILTER_SANITIZE_NUMBER_INT);
897 897
         $inputData['itemId'] = (int) filter_var($dataReceived['id'], FILTER_SANITIZE_NUMBER_INT);
898 898
         $post_anyone_can_modify = (int) filter_var($dataReceived['anyone_can_modify'], FILTER_SANITIZE_NUMBER_INT);
@@ -923,8 +923,7 @@  discard block
 block discarded – undo
923 923
         $post_to_be_deleted_after_date = isset($dataReceived['to_be_deleted_after_date']) === true ? filter_var(
924 924
                 $dataReceived['to_be_deleted_after_date'],
925 925
                 FILTER_SANITIZE_FULL_SPECIAL_CHARS
926
-            ) :
927
-            '';
926
+            ) : '';
928 927
         $post_fields = (filter_var_array(
929 928
             $dataReceived['fields'],
930 929
             FILTER_SANITIZE_FULL_SPECIAL_CHARS
@@ -984,7 +983,7 @@  discard block
 block discarded – undo
984 983
         // About special settings
985 984
         $dataFolderSettings = DB::queryFirstRow(
986 985
             'SELECT bloquer_creation, bloquer_modification, personal_folder, title
987
-            FROM ' . prefixTable('nested_tree') . ' 
986
+            FROM ' . prefixTable('nested_tree').' 
988 987
             WHERE id = %i',
989 988
             $inputData['folderId']
990 989
         );
@@ -1000,7 +999,7 @@  discard block
 block discarded – undo
1000 999
         // Get folder complexity
1001 1000
         $folderComplexity = DB::queryFirstRow(
1002 1001
             'SELECT valeur
1003
-            FROM ' . prefixTable('misc') . '
1002
+            FROM ' . prefixTable('misc').'
1004 1003
             WHERE type = %s AND intitule = %i',
1005 1004
             'complex',
1006 1005
             $inputData['folderId']
@@ -1045,8 +1044,8 @@  discard block
 block discarded – undo
1045 1044
         // Get all informations for this item
1046 1045
         $dataItem = DB::queryFirstRow(
1047 1046
             'SELECT *
1048
-            FROM ' . prefixTable('items') . ' as i
1049
-            INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id)
1047
+            FROM ' . prefixTable('items').' as i
1048
+            INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id)
1050 1049
             WHERE i.id=%i AND l.action = %s',
1051 1050
             $inputData['itemId'],
1052 1051
             'at_creation'
@@ -1089,7 +1088,7 @@  discard block
 block discarded – undo
1089 1088
         //db::debugmode(true);
1090 1089
         DB::query(
1091 1090
             'SELECT *
1092
-            FROM ' . prefixTable('sharekeys_items') . '
1091
+            FROM ' . prefixTable('sharekeys_items').'
1093 1092
             WHERE object_id = %i AND user_id = %s',
1094 1093
             $inputData['itemId'],
1095 1094
             $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
                         }
@@ -1568,7 +1567,7 @@  discard block
 block discarded – undo
1568 1567
             ) {
1569 1568
                 DB::queryFirstRow(
1570 1569
                     'SELECT *
1571
-                    FROM ' . prefixTable('templates') . '
1570
+                    FROM ' . prefixTable('templates').'
1572 1571
                     WHERE item_id = %i',
1573 1572
                     $inputData['itemId']
1574 1573
                 );
@@ -1611,7 +1610,7 @@  discard block
 block discarded – undo
1611 1610
                 // check if elem exists in Table. If not add it or update it.
1612 1611
                 DB::query(
1613 1612
                     'SELECT *
1614
-                    FROM ' . prefixTable('automatic_del') . '
1613
+                    FROM ' . prefixTable('automatic_del').'
1615 1614
                     WHERE item_id = %i',
1616 1615
                     $inputData['itemId']
1617 1616
                 );
@@ -1638,7 +1637,7 @@  discard block
 block discarded – undo
1638 1637
                         // Store updates performed
1639 1638
                         array_push(
1640 1639
                             $arrayOfChanges,
1641
-                            $lang->get('automatic_deletion_engaged') . ': ' . $lang->get('enabled')
1640
+                            $lang->get('automatic_deletion_engaged').': '.$lang->get('enabled')
1642 1641
                         );
1643 1642
 
1644 1643
                         // update LOG
@@ -1681,7 +1680,7 @@  discard block
 block discarded – undo
1681 1680
                         // Store updates performed
1682 1681
                         array_push(
1683 1682
                             $arrayOfChanges,
1684
-                            $lang->get('automatic_deletion_engaged') . ': ' . $lang->get('disabled')
1683
+                            $lang->get('automatic_deletion_engaged').': '.$lang->get('disabled')
1685 1684
                         );
1686 1685
 
1687 1686
                         // update LOG
@@ -1709,7 +1708,7 @@  discard block
 block discarded – undo
1709 1708
                     if (empty($userId) === false) {
1710 1709
                         $dataTmp = DB::queryFirstRow(
1711 1710
                             'SELECT id, name, lastname
1712
-                            FROM ' . prefixTable('users') . '
1711
+                            FROM ' . prefixTable('users').'
1713 1712
                             WHERE id= %i',
1714 1713
                             $userId
1715 1714
                         );
@@ -1717,7 +1716,7 @@  discard block
 block discarded – undo
1717 1716
                         // Add to array
1718 1717
                         array_push(
1719 1718
                             $arrayOfUsersRestriction,
1720
-                            $dataTmp['name'] . ' ' . $dataTmp['lastname']
1719
+                            $dataTmp['name'].' '.$dataTmp['lastname']
1721 1720
                         );
1722 1721
                         array_push(
1723 1722
                             $arrayOfUsersIdRestriction,
@@ -1748,8 +1747,8 @@  discard block
 block discarded – undo
1748 1747
                 // get values before deleting them
1749 1748
                 $rows = DB::query(
1750 1749
                     'SELECT t.title, t.id AS id
1751
-                    FROM ' . prefixTable('roles_title') . ' as t
1752
-                    INNER JOIN ' . prefixTable('restriction_to_roles') . ' as r ON (t.id=r.role_id)
1750
+                    FROM ' . prefixTable('roles_title').' as t
1751
+                    INNER JOIN ' . prefixTable('restriction_to_roles').' as r ON (t.id=r.role_id)
1753 1752
                     WHERE r.item_id = %i
1754 1753
                     ORDER BY t.title ASC',
1755 1754
                     $inputData['itemId']
@@ -1783,7 +1782,7 @@  discard block
 block discarded – undo
1783 1782
                         );
1784 1783
                         $dataTmp = DB::queryFirstRow(
1785 1784
                             'SELECT title
1786
-                            FROM ' . prefixTable('roles_title') . '
1785
+                            FROM ' . prefixTable('roles_title').'
1787 1786
                             WHERE id = %i',
1788 1787
                             $role
1789 1788
                         );
@@ -1811,7 +1810,7 @@  discard block
 block discarded – undo
1811 1810
             // Get current status
1812 1811
             $otpStatus = DB::queryFirstRow(
1813 1812
                 'SELECT enabled as otp_is_enabled, phone_number, secret
1814
-                FROM ' . prefixTable('items_otp') . '
1813
+                FROM ' . prefixTable('items_otp').'
1815 1814
                 WHERE item_id = %i',
1816 1815
                 $inputData['itemId']
1817 1816
             );
@@ -1825,7 +1824,7 @@  discard block
 block discarded – undo
1825 1824
                     'decrypt'
1826 1825
                 )['string'];
1827 1826
             } else {
1828
-                $currentsecret='';
1827
+                $currentsecret = '';
1829 1828
             }
1830 1829
 
1831 1830
             // If OTP secret provided then encrypt it
@@ -1875,7 +1874,7 @@  discard block
 block discarded – undo
1875 1874
                         $session->get('user-id'),
1876 1875
                         'at_modification',
1877 1876
                         $session->get('user-login'),
1878
-                        'at_otp_status:' . ((int) $post_otp_is_enabled === 0 ? 'disabled' : 'enabled')
1877
+                        'at_otp_status:'.((int) $post_otp_is_enabled === 0 ? 'disabled' : 'enabled')
1879 1878
                     );
1880 1879
                 }
1881 1880
                 if ($otpStatus['phone_number'] !== $post_otp_phone_number) {
@@ -1886,7 +1885,7 @@  discard block
 block discarded – undo
1886 1885
                         $session->get('user-id'),
1887 1886
                         'at_modification',
1888 1887
                         $session->get('user-login'),
1889
-                        'at_phone_number:' . $otpStatus['phone_number'] . ' => ' . $post_otp_phone_number
1888
+                        'at_phone_number:'.$otpStatus['phone_number'].' => '.$post_otp_phone_number
1890 1889
                     );
1891 1890
                 }
1892 1891
                 if ($currentsecret !== $post_otp_secret) {
@@ -1935,8 +1934,8 @@  discard block
 block discarded – undo
1935 1934
                     $session->get('user-id'),
1936 1935
                     'at_modification',
1937 1936
                     $session->get('user-login'),
1938
-                    'at_restriction : ' . (count($diffUsersRestiction) > 0 ?
1939
-                        implode(', ', $arrayOfUsersRestriction) . (count($diffRolesRestiction) > 0 ? ', ' : '') : '') . (count($diffRolesRestiction) > 0 ? implode(', ', $arrayOfRestrictionRoles) : '')
1937
+                    'at_restriction : '.(count($diffUsersRestiction) > 0 ?
1938
+                        implode(', ', $arrayOfUsersRestriction).(count($diffRolesRestiction) > 0 ? ', ' : '') : '').(count($diffRolesRestiction) > 0 ? implode(', ', $arrayOfRestrictionRoles) : '')
1940 1939
                 );
1941 1940
             }
1942 1941
 
@@ -1956,7 +1955,7 @@  discard block
 block discarded – undo
1956 1955
                     $session->get('user-id'),
1957 1956
                     'at_modification',
1958 1957
                     $session->get('user-login'),
1959
-                    'at_label : ' . $data['label'] . ' => ' . $inputData['label']
1958
+                    'at_label : '.$data['label'].' => '.$inputData['label']
1960 1959
                 );
1961 1960
             }
1962 1961
             // LOGIN
@@ -1975,7 +1974,7 @@  discard block
 block discarded – undo
1975 1974
                     $session->get('user-id'),
1976 1975
                     'at_modification',
1977 1976
                     $session->get('user-login'),
1978
-                    'at_login : ' . $data['login'] . ' => ' . $post_login
1977
+                    'at_login : '.$data['login'].' => '.$post_login
1979 1978
                 );
1980 1979
             }
1981 1980
             // EMAIL
@@ -1994,7 +1993,7 @@  discard block
 block discarded – undo
1994 1993
                     $session->get('user-id'),
1995 1994
                     'at_modification',
1996 1995
                     $session->get('user-login'),
1997
-                    'at_email : ' . $data['email'] . ' => ' . $post_email
1996
+                    'at_email : '.$data['email'].' => '.$post_email
1998 1997
                 );
1999 1998
             }
2000 1999
             // URL
@@ -2013,7 +2012,7 @@  discard block
 block discarded – undo
2013 2012
                     $session->get('user-id'),
2014 2013
                     'at_modification',
2015 2014
                     $session->get('user-login'),
2016
-                    'at_url : ' . $data['url'] . ' => ' . $post_url
2015
+                    'at_url : '.$data['url'].' => '.$post_url
2017 2016
                 );
2018 2017
             }
2019 2018
             // DESCRIPTION
@@ -2039,7 +2038,7 @@  discard block
 block discarded – undo
2039 2038
             // FOLDER
2040 2039
             if ((int) $data['id_tree'] !== (int) $inputData['folderId']) {
2041 2040
                 // Get name of folders
2042
-                $dataTmp = DB::query('SELECT title FROM ' . prefixTable('nested_tree') . ' WHERE id IN %li', array($data['id_tree'], $inputData['folderId']));
2041
+                $dataTmp = DB::query('SELECT title FROM '.prefixTable('nested_tree').' WHERE id IN %li', array($data['id_tree'], $inputData['folderId']));
2043 2042
 
2044 2043
                 // Store updates performed
2045 2044
                 array_push(
@@ -2055,7 +2054,7 @@  discard block
 block discarded – undo
2055 2054
                     $session->get('user-id'),
2056 2055
                     'at_modification',
2057 2056
                     $session->get('user-login'),
2058
-                    'at_category : ' . $dataTmp[0]['title'] . ' => ' . $dataTmp[1]['title']
2057
+                    'at_category : '.$dataTmp[0]['title'].' => '.$dataTmp[1]['title']
2059 2058
                 );
2060 2059
             }
2061 2060
             // ANYONE_CAN_MODIFY
@@ -2063,7 +2062,7 @@  discard block
 block discarded – undo
2063 2062
                 // Store updates performed
2064 2063
                 array_push(
2065 2064
                     $arrayOfChanges,
2066
-                    $lang->get('at_anyoneconmodify') . ': ' . ((int) $post_anyone_can_modify === 0 ? $lang->get('disabled') : $lang->get('enabled'))
2065
+                    $lang->get('at_anyoneconmodify').': '.((int) $post_anyone_can_modify === 0 ? $lang->get('disabled') : $lang->get('enabled'))
2067 2066
                 );
2068 2067
 
2069 2068
                 // Log
@@ -2074,15 +2073,15 @@  discard block
 block discarded – undo
2074 2073
                     $session->get('user-id'),
2075 2074
                     'at_modification',
2076 2075
                     $session->get('user-login'),
2077
-                    'at_anyoneconmodify : ' . ((int) $post_anyone_can_modify === 0 ? 'disabled' : 'enabled')
2076
+                    'at_anyoneconmodify : '.((int) $post_anyone_can_modify === 0 ? 'disabled' : 'enabled')
2078 2077
                 );
2079 2078
             }
2080 2079
 
2081 2080
             // Reload new values
2082 2081
             $dataItem = DB::queryFirstRow(
2083 2082
                 'SELECT *
2084
-                FROM ' . prefixTable('items') . ' as i
2085
-                INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id)
2083
+                FROM ' . prefixTable('items').' as i
2084
+                INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id)
2086 2085
                 WHERE i.id = %i AND l.action = %s',
2087 2086
                 $inputData['itemId'],
2088 2087
                 'at_creation'
@@ -2091,8 +2090,8 @@  discard block
 block discarded – undo
2091 2090
             $history = '';
2092 2091
             $rows = DB::query(
2093 2092
                 'SELECT l.date as date, l.action as action, l.raison as raison, u.login as login
2094
-                FROM ' . prefixTable('log_items') . ' as l
2095
-                LEFT JOIN ' . prefixTable('users') . ' as u ON (l.id_user=u.id)
2093
+                FROM ' . prefixTable('log_items').' as l
2094
+                LEFT JOIN ' . prefixTable('users').' as u ON (l.id_user=u.id)
2096 2095
                 WHERE l.action <> %s AND id_item=%s',
2097 2096
                 'at_shown',
2098 2097
                 $inputData['itemId']
@@ -2101,14 +2100,14 @@  discard block
 block discarded – undo
2101 2100
                 if ($record['raison'] === NULL) continue;
2102 2101
                 $reason = explode(':', $record['raison']);
2103 2102
                 if (count($reason) > 0) {
2104
-                    $sentence = date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['date']) . ' - '
2105
-                        . $record['login'] . ' - ' . $lang->get($record['action']) . ' - '
2106
-                        . (empty($record['raison']) === false ? (count($reason) > 1 ? $lang->get(trim($reason[0])) . ' : ' . $reason[1]
2103
+                    $sentence = date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['date']).' - '
2104
+                        . $record['login'].' - '.$lang->get($record['action']).' - '
2105
+                        . (empty($record['raison']) === false ? (count($reason) > 1 ? $lang->get(trim($reason[0])).' : '.$reason[1]
2107 2106
                             : $lang->get(trim($reason[0]))) : '');
2108 2107
                     if (empty($history)) {
2109 2108
                         $history = $sentence;
2110 2109
                     } else {
2111
-                        $history .= '<br />' . $sentence;
2110
+                        $history .= '<br />'.$sentence;
2112 2111
                     }
2113 2112
                 }
2114 2113
             }
@@ -2246,7 +2245,7 @@  discard block
 block discarded – undo
2246 2245
         ) {
2247 2246
             // load the original record into an array
2248 2247
             $originalRecord = DB::queryFirstRow(
2249
-                'SELECT * FROM ' . prefixTable('items') . '
2248
+                'SELECT * FROM '.prefixTable('items').'
2250 2249
                 WHERE id = %i',
2251 2250
                 $inputData['itemId']
2252 2251
             );
@@ -2265,7 +2264,7 @@  discard block
 block discarded – undo
2265 2264
 
2266 2265
             // Load the destination folder record into an array
2267 2266
             $dataDestination = DB::queryFirstRow(
2268
-                'SELECT personal_folder FROM ' . prefixTable('nested_tree') . '
2267
+                'SELECT personal_folder FROM '.prefixTable('nested_tree').'
2269 2268
                 WHERE id = %i',
2270 2269
                 $post_dest_id
2271 2270
             );
@@ -2273,7 +2272,7 @@  discard block
 block discarded – undo
2273 2272
             // Get the ITEM object key for the user
2274 2273
             $userKey = DB::queryFirstRow(
2275 2274
                 'SELECT share_key
2276
-                FROM ' . prefixTable('sharekeys_items') . '
2275
+                FROM ' . prefixTable('sharekeys_items').'
2277 2276
                 WHERE user_id = %i AND object_id = %i',
2278 2277
                 $session->get('user-id'),
2279 2278
                 $inputData['itemId']
@@ -2350,8 +2349,8 @@  discard block
 block discarded – undo
2350 2349
             // Manage Custom Fields
2351 2350
             $rows = DB::query(
2352 2351
                 'SELECT ci.id AS id, ci.data AS data, ci.field_id AS field_id, c.encrypted_data AS encrypted_data
2353
-                FROM ' . prefixTable('categories_items') . ' AS ci
2354
-                INNER JOIN ' . prefixTable('categories') . ' AS c ON (c.id = ci.field_id)
2352
+                FROM ' . prefixTable('categories_items').' AS ci
2353
+                INNER JOIN ' . prefixTable('categories').' AS c ON (c.id = ci.field_id)
2355 2354
                 WHERE ci.item_id = %i',
2356 2355
                 $inputData['itemId']
2357 2356
             );
@@ -2363,7 +2362,7 @@  discard block
 block discarded – undo
2363 2362
                     // Get user key
2364 2363
                     $userKey = DB::queryFirstRow(
2365 2364
                         'SELECT share_key
2366
-                        FROM ' . prefixTable('sharekeys_fields') . '
2365
+                        FROM ' . prefixTable('sharekeys_fields').'
2367 2366
                         WHERE user_id = %i AND object_id = %i',
2368 2367
                         $session->get('user-id'),
2369 2368
                         $field['id']
@@ -2430,15 +2429,15 @@  discard block
 block discarded – undo
2430 2429
             $rows = DB::query(
2431 2430
                 'SELECT f.id AS id, f.file AS file, f.name AS name, f.status AS status, f.extension AS extension,
2432 2431
                 f.size AS size, f.type AS type, s.share_key AS share_key
2433
-                FROM ' . prefixTable('files') . ' AS f
2434
-                INNER JOIN ' . prefixTable('sharekeys_files') . ' AS s ON (f.id = s.object_id)
2432
+                FROM ' . prefixTable('files').' AS f
2433
+                INNER JOIN ' . prefixTable('sharekeys_files').' AS s ON (f.id = s.object_id)
2435 2434
                 WHERE s.user_id = %i AND f.id_item = %i',
2436 2435
                 $session->get('user-id'),
2437 2436
                 $inputData['itemId']
2438 2437
             );
2439 2438
             foreach ($rows as $record) {
2440 2439
                 // Check if file still exists
2441
-                if (file_exists($SETTINGS['path_to_upload_folder'] . DIRECTORY_SEPARATOR . TP_FILE_PREFIX . base64_decode($record['file'])) === true) {
2440
+                if (file_exists($SETTINGS['path_to_upload_folder'].DIRECTORY_SEPARATOR.TP_FILE_PREFIX.base64_decode($record['file'])) === true) {
2442 2441
                     // Step1 - decrypt the file
2443 2442
                     // deepcode ignore PT: path is sanitized inside decryptFile()
2444 2443
                     $fileContent = decryptFile(
@@ -2449,8 +2448,8 @@  discard block
 block discarded – undo
2449 2448
 
2450 2449
                     // Step2 - create file
2451 2450
                     // deepcode ignore InsecureHash: md5 is used jonly for file name in order to get a hashed value in database
2452
-                    $newFileName = md5(time() . '_' . $record['id']) . '.' . $record['extension'];
2453
-                    $outstream = fopen($SETTINGS['path_to_upload_folder'] . DIRECTORY_SEPARATOR . $newFileName, 'ab');
2451
+                    $newFileName = md5(time().'_'.$record['id']).'.'.$record['extension'];
2452
+                    $outstream = fopen($SETTINGS['path_to_upload_folder'].DIRECTORY_SEPARATOR.$newFileName, 'ab');
2454 2453
                     if ($outstream === false) {
2455 2454
                         echo prepareExchangedData(
2456 2455
                             array(
@@ -2523,7 +2522,7 @@  discard block
 block discarded – undo
2523 2522
 
2524 2523
             // -------------------------
2525 2524
             // Add specific restrictions
2526
-            $rows = DB::query('SELECT * FROM ' . prefixTable('restriction_to_roles') . ' WHERE item_id = %i', $inputData['itemId']);
2525
+            $rows = DB::query('SELECT * FROM '.prefixTable('restriction_to_roles').' WHERE item_id = %i', $inputData['itemId']);
2527 2526
             foreach ($rows as $record) {
2528 2527
                 DB::insert(
2529 2528
                     prefixTable('restriction_to_roles'),
@@ -2535,7 +2534,7 @@  discard block
 block discarded – undo
2535 2534
             }
2536 2535
 
2537 2536
             // Add Tags
2538
-            $rows = DB::query('SELECT * FROM ' . prefixTable('tags') . ' WHERE item_id = %i', $inputData['itemId']);
2537
+            $rows = DB::query('SELECT * FROM '.prefixTable('tags').' WHERE item_id = %i', $inputData['itemId']);
2539 2538
             foreach ($rows as $record) {
2540 2539
                 DB::insert(
2541 2540
                     prefixTable('tags'),
@@ -2637,7 +2636,7 @@  discard block
 block discarded – undo
2637 2636
         // then we can show it
2638 2637
         $item_deleted = DB::queryFirstRow(
2639 2638
             'SELECT *
2640
-            FROM ' . prefixTable('log_items') . '
2639
+            FROM ' . prefixTable('log_items').'
2641 2640
             WHERE id_item = %i AND action = %s
2642 2641
             ORDER BY date DESC
2643 2642
             LIMIT 0, 1',
@@ -2648,7 +2647,7 @@  discard block
 block discarded – undo
2648 2647
 
2649 2648
         $item_restored = DB::queryFirstRow(
2650 2649
             'SELECT *
2651
-            FROM ' . prefixTable('log_items') . '
2650
+            FROM ' . prefixTable('log_items').'
2652 2651
             WHERE id_item = %i AND action = %s
2653 2652
             ORDER BY date DESC
2654 2653
             LIMIT 0, 1',
@@ -2672,8 +2671,8 @@  discard block
 block discarded – undo
2672 2671
         // Get all informations for this item
2673 2672
         $dataItem = DB::queryFirstRow(
2674 2673
             'SELECT *
2675
-            FROM ' . prefixTable('items') . ' as i
2676
-            INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id)
2674
+            FROM ' . prefixTable('items').' as i
2675
+            INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id)
2677 2676
             WHERE i.id = %i AND l.action = %s',
2678 2677
             $inputData['id'],
2679 2678
             'at_creation'
@@ -2682,7 +2681,7 @@  discard block
 block discarded – undo
2682 2681
         // Notification
2683 2682
         DB::queryFirstRow(
2684 2683
             'SELECT *
2685
-            FROM ' . prefixTable('notification') . '
2684
+            FROM ' . prefixTable('notification').'
2686 2685
             WHERE item_id = %i AND user_id = %i',
2687 2686
             $inputData['id'],
2688 2687
             $session->get('user-id')
@@ -2701,7 +2700,7 @@  discard block
 block discarded – undo
2701 2700
 
2702 2701
         // manage case of API user
2703 2702
         if ($dataItem['id_user'] === API_USER_ID) {
2704
-            $arrData['author'] = 'API [' . $dataItem['description'] . ']';
2703
+            $arrData['author'] = 'API ['.$dataItem['description'].']';
2705 2704
             $arrData['id_user'] = API_USER_ID;
2706 2705
             $arrData['author_email'] = '';
2707 2706
             $arrData['notification_status'] = false;
@@ -2711,7 +2710,7 @@  discard block
 block discarded – undo
2711 2710
         $tags = array();
2712 2711
         $rows = DB::query(
2713 2712
             'SELECT tag
2714
-            FROM ' . prefixTable('tags') . '
2713
+            FROM ' . prefixTable('tags').'
2715 2714
             WHERE item_id = %i',
2716 2715
             $inputData['id']
2717 2716
         );
@@ -2736,7 +2735,7 @@  discard block
 block discarded – undo
2736 2735
         // Check if user has a role that is accepted
2737 2736
         $rows_tmp = DB::query(
2738 2737
             'SELECT role_id
2739
-            FROM ' . prefixTable('restriction_to_roles') . '
2738
+            FROM ' . prefixTable('restriction_to_roles').'
2740 2739
             WHERE item_id=%i',
2741 2740
             $inputData['id']
2742 2741
         );
@@ -2750,7 +2749,7 @@  discard block
 block discarded – undo
2750 2749
         // Get the object key for the user
2751 2750
         $userKey = DB::queryFirstRow(
2752 2751
             'SELECT share_key
2753
-            FROM ' . prefixTable('sharekeys_items') . '
2752
+            FROM ' . prefixTable('sharekeys_items').'
2754 2753
             WHERE user_id = %i AND object_id = %i',
2755 2754
             $session->get('user-id'),
2756 2755
             $inputData['id']
@@ -2847,8 +2846,8 @@  discard block
 block discarded – undo
2847 2846
                 // Add restriction if item is restricted to roles
2848 2847
                 $rows = DB::query(
2849 2848
                     'SELECT t.title, t.id
2850
-                    FROM ' . prefixTable('roles_title') . ' AS t
2851
-                    INNER JOIN ' . prefixTable('restriction_to_roles') . ' AS r ON (t.id=r.role_id)
2849
+                    FROM ' . prefixTable('roles_title').' AS t
2850
+                    INNER JOIN ' . prefixTable('restriction_to_roles').' AS r ON (t.id=r.role_id)
2852 2851
                     WHERE r.item_id = %i
2853 2852
                     ORDER BY t.title ASC',
2854 2853
                     $inputData['id']
@@ -2864,8 +2863,8 @@  discard block
 block discarded – undo
2864 2863
                 $tmp = array();
2865 2864
                 $rows = DB::query(
2866 2865
                     'SELECT k.label, k.id
2867
-                    FROM ' . prefixTable('kb_items') . ' as i
2868
-                    INNER JOIN ' . prefixTable('kb') . ' as k ON (i.kb_id=k.id)
2866
+                    FROM ' . prefixTable('kb_items').' as i
2867
+                    INNER JOIN ' . prefixTable('kb').' as k ON (i.kb_id=k.id)
2869 2868
                     WHERE i.item_id = %i
2870 2869
                     ORDER BY k.label ASC',
2871 2870
                     $inputData['id']
@@ -2948,7 +2947,7 @@  discard block
 block discarded – undo
2948 2947
                 $arrCatList = array();
2949 2948
                 $rows_tmp = DB::query(
2950 2949
                     'SELECT id_category
2951
-                    FROM ' . prefixTable('categories_folders') . '
2950
+                    FROM ' . prefixTable('categories_folders').'
2952 2951
                     WHERE id_folder=%i',
2953 2952
                     $inputData['folderId']
2954 2953
                 );
@@ -2963,8 +2962,8 @@  discard block
 block discarded – undo
2963 2962
                         'SELECT i.id AS id, i.field_id AS field_id, i.data AS data, i.item_id AS item_id,
2964 2963
                         i.encryption_type AS encryption_type, c.encrypted_data AS encrypted_data, c.parent_id AS parent_id,
2965 2964
                         c.type as field_type, c.masked AS field_masked, c.role_visibility AS role_visibility
2966
-                        FROM ' . prefixTable('categories_items') . ' AS i
2967
-                        INNER JOIN ' . prefixTable('categories') . ' AS c ON (i.field_id=c.id)
2965
+                        FROM ' . prefixTable('categories_items').' AS i
2966
+                        INNER JOIN ' . prefixTable('categories').' AS c ON (i.field_id=c.id)
2968 2967
                         WHERE i.item_id=%i AND c.parent_id IN %ls',
2969 2968
                         $inputData['id'],
2970 2969
                         $arrCatList
@@ -2975,7 +2974,7 @@  discard block
 block discarded – undo
2975 2974
                         //db::debugmode(true);
2976 2975
                         $userKey = DB::queryFirstRow(
2977 2976
                             'SELECT share_key
2978
-                            FROM ' . prefixTable('sharekeys_fields') . '
2977
+                            FROM ' . prefixTable('sharekeys_fields').'
2979 2978
                             WHERE user_id = %i AND object_id = %i',
2980 2979
                             $session->get('user-id'),
2981 2980
                             $row['id']
@@ -2993,7 +2992,7 @@  discard block
 block discarded – undo
2993 2992
                         } else if (DB::count() === 0 && (int) $row['encrypted_data'] === 0) {
2994 2993
                             // Data is not encrypted in DB
2995 2994
                             $fieldText = [
2996
-                                'string' => $row['data'],//#3945 - isBase64($row['data']) === true ? base64_decode($row['data']) : 
2995
+                                'string' => $row['data'], //#3945 - isBase64($row['data']) === true ? base64_decode($row['data']) : 
2997 2996
                                 'encrypted' => false,
2998 2997
                                 'error' => false,
2999 2998
                             ];
@@ -3038,7 +3037,7 @@  discard block
 block discarded – undo
3038 3037
             if (isset($SETTINGS['item_creation_templates']) && (int) $SETTINGS['item_creation_templates'] === 1) {
3039 3038
                 $rows_tmp = DB::queryFirstRow(
3040 3039
                     'SELECT category_id
3041
-                    FROM ' . prefixTable('templates') . '
3040
+                    FROM ' . prefixTable('templates').'
3042 3041
                     WHERE item_id = %i',
3043 3042
                     $inputData['id']
3044 3043
                 );
@@ -3055,7 +3054,7 @@  discard block
 block discarded – undo
3055 3054
             // Evaluate if item is ready for all users
3056 3055
             $rows_tmp = DB::queryFirstRow(
3057 3056
                 'SELECT finished_at
3058
-                FROM ' . prefixTable('background_tasks') . '
3057
+                FROM ' . prefixTable('background_tasks').'
3059 3058
                 WHERE item_id = %i',
3060 3059
                 $inputData['id']
3061 3060
             );
@@ -3072,7 +3071,7 @@  discard block
 block discarded – undo
3072 3071
                 // Is the Item to be deleted?
3073 3072
                 $dataDelete = DB::queryFirstRow(
3074 3073
                     'SELECT * 
3075
-                    FROM ' . prefixTable('automatic_del') . '
3074
+                    FROM ' . prefixTable('automatic_del').'
3076 3075
                     WHERE item_id = %i',
3077 3076
                     $inputData['id']
3078 3077
                 );
@@ -3153,14 +3152,14 @@  discard block
 block discarded – undo
3153 3152
                     if (empty($userRest) === false) {
3154 3153
                         $dataTmp = DB::queryFirstRow(
3155 3154
                             'SELECT login
3156
-                            FROM ' . prefixTable('users') . '
3155
+                            FROM ' . prefixTable('users').'
3157 3156
                             WHERE id= %i',
3158 3157
                             $userRest
3159 3158
                         );
3160 3159
                         if (empty($listOfRestricted)) {
3161 3160
                             $listOfRestricted = $dataTmp['login'];
3162 3161
                         } else {
3163
-                            $listOfRestricted .= ';' . $dataTmp['login'];
3162
+                            $listOfRestricted .= ';'.$dataTmp['login'];
3164 3163
                         }
3165 3164
                     }
3166 3165
                 }
@@ -3234,9 +3233,9 @@  discard block
 block discarded – undo
3234 3233
         // Load item data
3235 3234
         $dataItem = DB::queryFirstRow(
3236 3235
             '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
3237
-            FROM ' . prefixTable('items') . ' AS i
3238
-            INNER JOIN ' . prefixTable('nested_tree') . ' AS n ON (i.id_tree = n.id)
3239
-            LEFT JOIN ' . prefixTable('items_otp') . ' AS o ON (o.item_id = i.id)
3236
+            FROM ' . prefixTable('items').' AS i
3237
+            INNER JOIN ' . prefixTable('nested_tree').' AS n ON (i.id_tree = n.id)
3238
+            LEFT JOIN ' . prefixTable('items_otp').' AS o ON (o.item_id = i.id)
3240 3239
             WHERE i.id = %i',
3241 3240
             $inputData['id']
3242 3241
         );
@@ -3258,7 +3257,7 @@  discard block
 block discarded – undo
3258 3257
         // Check if user has a role that is accepted
3259 3258
         $rows_tmp = DB::query(
3260 3259
             'SELECT role_id
3261
-            FROM ' . prefixTable('restriction_to_roles') . '
3260
+            FROM ' . prefixTable('restriction_to_roles').'
3262 3261
             WHERE item_id=%i',
3263 3262
             $inputData['id']
3264 3263
         );
@@ -3290,12 +3289,12 @@  discard block
 block discarded – undo
3290 3289
             // launch query
3291 3290
             $rows = DB::query(
3292 3291
                 'SELECT id, name, file, extension, size
3293
-                FROM ' . prefixTable('files') . '
3292
+                FROM ' . prefixTable('files').'
3294 3293
                 WHERE id_item = %i AND confirmed = 1',
3295 3294
                 $inputData['id']
3296 3295
             );
3297 3296
             foreach ($rows as $record) {
3298
-                $filename = basename($record['name'], '.' . $record['extension']);
3297
+                $filename = basename($record['name'], '.'.$record['extension']);
3299 3298
                 $filename = isBase64($filename) === true ? base64_decode($filename) : $filename;
3300 3299
 
3301 3300
                 array_push(
@@ -3308,7 +3307,7 @@  discard block
 block discarded – undo
3308 3307
                         'is_image' => in_array(strtolower($record['extension']), TP_IMAGE_FILE_EXT) === true ? 1 : 0,
3309 3308
                         'id' => $record['id'],
3310 3309
                         'key' => $session->get('user-key_tmp'),
3311
-                        'internalFilename' => basename($record['name'], '.' . $record['extension']),
3310
+                        'internalFilename' => basename($record['name'], '.'.$record['extension']),
3312 3311
                     )
3313 3312
                 );
3314 3313
             }
@@ -3346,7 +3345,7 @@  discard block
 block discarded – undo
3346 3345
                     array(
3347 3346
                         'latest_items' => implode(';', $session->get('user-latest_items')),
3348 3347
                     ),
3349
-                    'id=' . $session->get('user-id')
3348
+                    'id='.$session->get('user-id')
3350 3349
                 );
3351 3350
             }
3352 3351
 
@@ -3355,8 +3354,8 @@  discard block
 block discarded – undo
3355 3354
             $listOptionsForRoles = array();
3356 3355
             $rows = DB::query(
3357 3356
                 'SELECT r.role_id AS role_id, t.title AS title
3358
-                FROM ' . prefixTable('roles_values') . ' AS r
3359
-                INNER JOIN ' . prefixTable('roles_title') . ' AS t ON (r.role_id = t.id)
3357
+                FROM ' . prefixTable('roles_values').' AS r
3358
+                INNER JOIN ' . prefixTable('roles_title').' AS t ON (r.role_id = t.id)
3360 3359
                 WHERE r.folder_id = %i',
3361 3360
                 $dataItem['id_tree']
3362 3361
             );
@@ -3370,9 +3369,9 @@  discard block
 block discarded – undo
3370 3369
                 );
3371 3370
                 $rows2 = DB::query(
3372 3371
                     'SELECT id, login, fonction_id, email, name, lastname
3373
-                    FROM ' . prefixTable('users') . '
3372
+                    FROM ' . prefixTable('users').'
3374 3373
                     WHERE fonction_id LIKE %s',
3375
-                    '%' . $record['role_id'] . '%'
3374
+                    '%'.$record['role_id'].'%'
3376 3375
                 );
3377 3376
                 foreach ($rows2 as $record2) {
3378 3377
                     foreach (explode(';', $record2['fonction_id']) as $role) {
@@ -3385,7 +3384,7 @@  discard block
 block discarded – undo
3385 3384
                                 array(
3386 3385
                                     'id' => (int) $record2['id'],
3387 3386
                                     'login' => $record2['login'],
3388
-                                    'name' => $record2['name'] . ' ' . $record2['lastname'],
3387
+                                    'name' => $record2['name'].' '.$record2['lastname'],
3389 3388
                                     'email' => $record2['email'],
3390 3389
                                 )
3391 3390
                             );
@@ -3404,16 +3403,16 @@  discard block
 block discarded – undo
3404 3403
                 $path = '';
3405 3404
                 foreach ($arbo as $elem) {
3406 3405
                     if (empty($path) === true) {
3407
-                        $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES) . ' ';
3406
+                        $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES).' ';
3408 3407
                     } else {
3409
-                        $path .= '&#8594; ' . htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
3408
+                        $path .= '&#8594; '.htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
3410 3409
                     }
3411 3410
                 }
3412 3411
                 // Build text to show user
3413 3412
                 if (empty($path) === true) {
3414 3413
                     $path = addslashes($dataItem['label']);
3415 3414
                 } else {
3416
-                    $path = addslashes($dataItem['label']) . ' (' . $path . ')';
3415
+                    $path = addslashes($dataItem['label']).' ('.$path.')';
3417 3416
                 }
3418 3417
 
3419 3418
                 // Add Admins to notification list if expected
@@ -3436,7 +3435,7 @@  discard block
 block discarded – undo
3436 3435
                         array(
3437 3436
                             addslashes($session->get('user-login')),
3438 3437
                             $path,
3439
-                            $SETTINGS['cpassman_url'] . '/index.php?page=items&group=' . $dataItem['id_tree'] . '&id=' . $dataItem['id'],
3438
+                            $SETTINGS['cpassman_url'].'/index.php?page=items&group='.$dataItem['id_tree'].'&id='.$dataItem['id'],
3440 3439
                         ),
3441 3440
                         $lang->get('email_on_open_notification_mail')
3442 3441
                     ),
@@ -3446,7 +3445,7 @@  discard block
 block discarded – undo
3446 3445
             }
3447 3446
 
3448 3447
             // has this item a change proposal
3449
-            DB::query('SELECT * FROM ' . prefixTable('items_change') . ' WHERE item_id = %i', $inputData['id']);
3448
+            DB::query('SELECT * FROM '.prefixTable('items_change').' WHERE item_id = %i', $inputData['id']);
3450 3449
             $returnArray['has_change_proposal'] = DB::count();
3451 3450
 
3452 3451
             // Setting
@@ -3457,7 +3456,7 @@  discard block
 block discarded – undo
3457 3456
             if (isset($SETTINGS['otv_is_enabled']) === true && (int) $SETTINGS['otv_is_enabled'] === 1) {
3458 3457
                 DB::query(
3459 3458
                     'SELECT *
3460
-                    FROM ' . prefixTable('otv') . '
3459
+                    FROM ' . prefixTable('otv').'
3461 3460
                     WHERE item_id = %i
3462 3461
                     AND time_limit > %i',
3463 3462
                     $inputData['id'],
@@ -3556,7 +3555,7 @@  discard block
 block discarded – undo
3556 3555
         // Load item data
3557 3556
         $data = DB::queryFirstRow(
3558 3557
             'SELECT id_tree, id, label
3559
-            FROM ' . prefixTable('items') . '
3558
+            FROM ' . prefixTable('items').'
3560 3559
             WHERE id = %i OR item_key = %s',
3561 3560
             $inputData['itemId'],
3562 3561
             $inputData['itemKey']
@@ -3647,7 +3646,7 @@  discard block
 block discarded – undo
3647 3646
         // Load item data
3648 3647
         $dataItem = DB::queryFirstRow(
3649 3648
             'SELECT secret, enabled
3650
-            FROM ' . prefixTable('items_otp') . '
3649
+            FROM ' . prefixTable('items_otp').'
3651 3650
             WHERE item_id = %i',
3652 3651
             $inputData['id']
3653 3652
         );
@@ -3729,13 +3728,13 @@  discard block
 block discarded – undo
3729 3728
 
3730 3729
         // Check if user is allowed to access this folder
3731 3730
         if (!in_array($inputData['folderId'], $session->get('user-accessible_folders'))) {
3732
-            echo '[{"error" : "' . $lang->get('error_not_allowed_to') . '"}]';
3731
+            echo '[{"error" : "'.$lang->get('error_not_allowed_to').'"}]';
3733 3732
             break;
3734 3733
         }
3735 3734
 
3736 3735
         // Check if title doesn't contains html codes
3737 3736
         if (preg_match_all('|<[^>]+>(.*)</[^>]+>|U', $title, $out)) {
3738
-            echo '[ { "error" : "' . $lang->get('error_html_codes') . '" } ]';
3737
+            echo '[ { "error" : "'.$lang->get('error_html_codes').'" } ]';
3739 3738
             break;
3740 3739
         }
3741 3740
         // check that title is not numeric
@@ -3746,9 +3745,9 @@  discard block
 block discarded – undo
3746 3745
 
3747 3746
         // Check if duplicate folders name are allowed
3748 3747
         if (isset($SETTINGS['duplicate_folder']) && $SETTINGS['duplicate_folder'] === '0') {
3749
-            $data = DB::queryFirstRow('SELECT id, title FROM ' . prefixTable('nested_tree') . ' WHERE title = %s', $title);
3748
+            $data = DB::queryFirstRow('SELECT id, title FROM '.prefixTable('nested_tree').' WHERE title = %s', $title);
3750 3749
             if (empty($data['id']) === false && $dataReceived['folder'] !== $data['id']) {
3751
-                echo '[ { "error" : "' . $lang->get('error_group_exist') . '" } ]';
3750
+                echo '[ { "error" : "'.$lang->get('error_group_exist').'" } ]';
3752 3751
                 break;
3753 3752
             }
3754 3753
         }
@@ -3756,7 +3755,7 @@  discard block
 block discarded – undo
3756 3755
         // query on folder
3757 3756
         $data = DB::queryFirstRow(
3758 3757
             'SELECT parent_id, personal_folder
3759
-            FROM ' . prefixTable('nested_tree') . '
3758
+            FROM ' . prefixTable('nested_tree').'
3760 3759
             WHERE id = %i',
3761 3760
             $inputData['folderId']
3762 3761
         );
@@ -3766,20 +3765,20 @@  discard block
 block discarded – undo
3766 3765
         if ($session->get('user-admin') !== 1 && $session->get('user-manager') !== 1 && $data['personal_folder'] === '0') {
3767 3766
             $data = DB::queryFirstRow(
3768 3767
                 'SELECT valeur
3769
-                FROM ' . prefixTable('misc') . '
3768
+                FROM ' . prefixTable('misc').'
3770 3769
                 WHERE intitule = %i AND type = %s',
3771 3770
                 $data['parent_id'],
3772 3771
                 'complex'
3773 3772
             );
3774 3773
             if (intval($dataReceived['complexity']) < intval($data['valeur'])) {
3775
-                echo '[ { "error" : "' . $lang->get('error_folder_complexity_lower_than_top_folder') . ' [<b>' . TP_PW_COMPLEXITY[$data['valeur']][1] . '</b>]"} ]';
3774
+                echo '[ { "error" : "'.$lang->get('error_folder_complexity_lower_than_top_folder').' [<b>'.TP_PW_COMPLEXITY[$data['valeur']][1].'</b>]"} ]';
3776 3775
                 break;
3777 3776
             }
3778 3777
         }
3779 3778
 
3780 3779
         // update Folders table
3781 3780
         $tmp = DB::queryFirstRow(
3782
-            'SELECT title, parent_id, personal_folder FROM ' . prefixTable('nested_tree') . ' WHERE id = %i',
3781
+            'SELECT title, parent_id, personal_folder FROM '.prefixTable('nested_tree').' WHERE id = %i',
3783 3782
             $dataReceived['folder']
3784 3783
         );
3785 3784
         if ($tmp['parent_id'] !== 0 || $tmp['title'] !== $session->get('user-id') || $tmp['personal_folder'] !== 1) {
@@ -3893,7 +3892,7 @@  discard block
 block discarded – undo
3893 3892
             $uniqueLoadData['path'] = $arr_arbo;
3894 3893
 
3895 3894
             // store last folder accessed in cookie
3896
-            $arr_cookie_options = array (
3895
+            $arr_cookie_options = array(
3897 3896
                 'expires' => time() + TP_ONE_DAY_SECONDS * 5,
3898 3897
                 'path' => '/', 
3899 3898
                 'secure' => true,
@@ -3908,7 +3907,7 @@  discard block
 block discarded – undo
3908 3907
             foreach ($session->get('user-roles_array') as $role) {
3909 3908
                 $roleQ = DB::queryFirstRow(
3910 3909
                     'SELECT allow_pw_change
3911
-                    FROM ' . prefixTable('roles_title') . '
3910
+                    FROM ' . prefixTable('roles_title').'
3912 3911
                     WHERE id = %i',
3913 3912
                     $role
3914 3913
                 );
@@ -3939,11 +3938,11 @@  discard block
 block discarded – undo
3939 3938
                 
3940 3939
                 foreach ($session->get('user-roles_array') as $role) {
3941 3940
                     $access = DB::queryFirstRow(
3942
-                        'SELECT type FROM ' . prefixTable('roles_values') . ' WHERE role_id = %i AND folder_id = %i',
3941
+                        'SELECT type FROM '.prefixTable('roles_values').' WHERE role_id = %i AND folder_id = %i',
3943 3942
                         $role,
3944 3943
                         $inputData['id']
3945 3944
                     );
3946
-                    if (DB::count()>0) {
3945
+                    if (DB::count() > 0) {
3947 3946
                         if ($access['type'] === 'R') {
3948 3947
                             array_push($arrTmp, 10);
3949 3948
                         } elseif ($access['type'] === 'W') {
@@ -4008,7 +4007,7 @@  discard block
 block discarded – undo
4008 4007
             } else {
4009 4008
                 DB::query(
4010 4009
                     'SELECT *
4011
-                    FROM ' . prefixTable('items') . '
4010
+                    FROM ' . prefixTable('items').'
4012 4011
                     WHERE inactif = %i',
4013 4012
                     0
4014 4013
                 );
@@ -4018,7 +4017,7 @@  discard block
 block discarded – undo
4018 4017
 
4019 4018
             // Get folder complexity
4020 4019
             $folderComplexity = DB::queryFirstRow(
4021
-                'SELECT valeur FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %i',
4020
+                'SELECT valeur FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %i',
4022 4021
                 'complex',
4023 4022
                 $inputData['id']
4024 4023
             );
@@ -4030,7 +4029,7 @@  discard block
 block discarded – undo
4030 4029
             if (isset($SETTINGS['item_extra_fields']) && (int) $SETTINGS['item_extra_fields'] === 1) {
4031 4030
                 $folderRow = DB::query(
4032 4031
                     'SELECT id_category
4033
-                    FROM ' . prefixTable('categories_folders') . '
4032
+                    FROM ' . prefixTable('categories_folders').'
4034 4033
                     WHERE id_folder = %i',
4035 4034
                     $inputData['id']
4036 4035
                 );
@@ -4145,15 +4144,15 @@  discard block
 block discarded – undo
4145 4144
             // List all ITEMS
4146 4145
             if ($folderIsPf === false) {
4147 4146
                 $where->add('i.inactif=%i', 0);
4148
-                $sql_e='(SELECT date FROM ' . prefixTable('log_items') 
4147
+                $sql_e = '(SELECT date FROM '.prefixTable('log_items') 
4149 4148
                     . " WHERE action = 'at_creation' AND id_item=i.id " 
4150
-                    . 'union all SELECT date FROM '. prefixTable('log_items') 
4149
+                    . 'union all SELECT date FROM '.prefixTable('log_items') 
4151 4150
                     . " WHERE action = 'at_modification' AND raison = 'at_pw'
4152 4151
                     AND id_item=i.id ORDER BY date DESC LIMIT 1)";
4153 4152
                 $where->add('l.date=%l', $sql_e);
4154 4153
 
4155
-                $query_limit = ' LIMIT ' .
4156
-                    $start . ',' .
4154
+                $query_limit = ' LIMIT '.
4155
+                    $start.','.
4157 4156
                     $post_nb_items_to_display_once;
4158 4157
                 //db::debugmode(true);
4159 4158
                 $rows = DB::query(
@@ -4165,9 +4164,9 @@  discard block
 block discarded – undo
4165 4164
                     l.id_user AS log_user,
4166 4165
                     i.url AS link,
4167 4166
                     i.email AS email
4168
-                    FROM ' . prefixTable('items') . ' AS i
4169
-                    INNER JOIN ' . prefixTable('nested_tree') . ' AS n ON (i.id_tree = n.id)
4170
-                    INNER JOIN ' . prefixTable('log_items') . ' AS l ON (i.id = l.id_item)
4167
+                    FROM ' . prefixTable('items').' AS i
4168
+                    INNER JOIN ' . prefixTable('nested_tree').' AS n ON (i.id_tree = n.id)
4169
+                    INNER JOIN ' . prefixTable('log_items').' AS l ON (i.id = l.id_item)
4171 4170
                     WHERE %l
4172 4171
                     GROUP BY i.id, l.date, l.id_user, l.action
4173 4172
                     ORDER BY i.label ASC, l.date DESC' . $query_limit,
@@ -4187,9 +4186,9 @@  discard block
 block discarded – undo
4187 4186
                     l.id_user AS log_user,
4188 4187
                     i.url AS link,
4189 4188
                     i.email AS email
4190
-                    FROM ' . prefixTable('items') . ' AS i
4191
-                    INNER JOIN ' . prefixTable('nested_tree') . ' AS n ON (i.id_tree = n.id)
4192
-                    INNER JOIN ' . prefixTable('log_items') . ' AS l ON (i.id = l.id_item)
4189
+                    FROM ' . prefixTable('items').' AS i
4190
+                    INNER JOIN ' . prefixTable('nested_tree').' AS n ON (i.id_tree = n.id)
4191
+                    INNER JOIN ' . prefixTable('log_items').' AS l ON (i.id = l.id_item)
4193 4192
                     WHERE %l
4194 4193
                     GROUP BY i.id, l.date, l.id_user, l.action
4195 4194
                     ORDER BY i.label ASC, l.date DESC',
@@ -4220,7 +4219,7 @@  discard block
 block discarded – undo
4220 4219
                     $item_is_restricted_to_role = false;
4221 4220
                     DB::queryFirstRow(
4222 4221
                         'SELECT role_id
4223
-                        FROM ' . prefixTable('restriction_to_roles') . '
4222
+                        FROM ' . prefixTable('restriction_to_roles').'
4224 4223
                         WHERE item_id = %i',
4225 4224
                         $record['id']
4226 4225
                     );
@@ -4232,7 +4231,7 @@  discard block
 block discarded – undo
4232 4231
                     $user_is_included_in_role = false;
4233 4232
                     DB::query(
4234 4233
                         'SELECT role_id
4235
-                        FROM ' . prefixTable('restriction_to_roles') . '
4234
+                        FROM ' . prefixTable('restriction_to_roles').'
4236 4235
                         WHERE item_id = %i AND role_id IN %ls',
4237 4236
                         $record['id'],
4238 4237
                         $session->get('user-roles_array')
@@ -4443,9 +4442,9 @@  discard block
 block discarded – undo
4443 4442
         if ((int) $start === 0) {
4444 4443
             DB::query(
4445 4444
                 'SELECT i.id
4446
-                FROM ' . prefixTable('items') . ' as i
4447
-                INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree = n.id)
4448
-                INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id = l.id_item)
4445
+                FROM ' . prefixTable('items').' as i
4446
+                INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree = n.id)
4447
+                INNER JOIN ' . prefixTable('log_items').' as l ON (i.id = l.id_item)
4449 4448
                 WHERE %l
4450 4449
                 ORDER BY i.label ASC, l.date DESC',
4451 4450
                 $where
@@ -4510,8 +4509,8 @@  discard block
 block discarded – undo
4510 4509
         $dataItem = DB::queryFirstRow(
4511 4510
             'SELECT i.pw AS pw, s.share_key AS share_key, i.id AS id,
4512 4511
                     i.label AS label, i.id_tree AS id_tree
4513
-            FROM ' . prefixTable('items') . ' AS i
4514
-            INNER JOIN ' . prefixTable('sharekeys_items') . ' AS s ON (s.object_id = i.id)
4512
+            FROM ' . prefixTable('items').' AS i
4513
+            INNER JOIN ' . prefixTable('sharekeys_items').' AS s ON (s.object_id = i.id)
4515 4514
             WHERE user_id = %i AND (i.item_key = %s OR i.id = %i)',
4516 4515
             $session->get('user-id'),
4517 4516
             $inputData['itemKey'] ?? '',
@@ -4622,7 +4621,7 @@  discard block
 block discarded – undo
4622 4621
         // do query on this folder
4623 4622
         $data_this_folder = DB::queryFirstRow(
4624 4623
             'SELECT id, personal_folder, title
4625
-            FROM ' . prefixTable('nested_tree') . '
4624
+            FROM ' . prefixTable('nested_tree').'
4626 4625
             WHERE id = %s',
4627 4626
             $inputData['folderId']
4628 4627
         );
@@ -4662,8 +4661,8 @@  discard block
 block discarded – undo
4662 4661
         $visibilite = '';
4663 4662
         $data = DB::queryFirstRow(
4664 4663
             'SELECT m.valeur, n.personal_folder
4665
-            FROM ' . prefixTable('misc') . ' AS m
4666
-            INNER JOIN ' . prefixTable('nested_tree') . ' AS n ON (m.intitule = n.id)
4664
+            FROM ' . prefixTable('misc').' AS m
4665
+            INNER JOIN ' . prefixTable('nested_tree').' AS n ON (m.intitule = n.id)
4667 4666
             WHERE type=%s AND intitule = %s',
4668 4667
             'complex',
4669 4668
             $inputData['folderId']
@@ -4676,8 +4675,8 @@  discard block
 block discarded – undo
4676 4675
             // Prepare Item actual visibility (what Users/Roles can see it)
4677 4676
             $rows = DB::query(
4678 4677
                 'SELECT t.title
4679
-                FROM ' . prefixTable('roles_values') . ' as v
4680
-                INNER JOIN ' . prefixTable('roles_title') . ' as t ON (v.role_id = t.id)
4678
+                FROM ' . prefixTable('roles_values').' as v
4679
+                INNER JOIN ' . prefixTable('roles_title').' as t ON (v.role_id = t.id)
4681 4680
                 WHERE v.folder_id = %i
4682 4681
                 GROUP BY title',
4683 4682
                 $inputData['folderId']
@@ -4686,7 +4685,7 @@  discard block
 block discarded – undo
4686 4685
                 if (empty($visibilite)) {
4687 4686
                     $visibilite = $record['title'];
4688 4687
                 } else {
4689
-                    $visibilite .= ' - ' . $record['title'];
4688
+                    $visibilite .= ' - '.$record['title'];
4690 4689
                 }
4691 4690
             }
4692 4691
         } else {
@@ -4696,14 +4695,14 @@  discard block
 block discarded – undo
4696 4695
             // do new query to know if current folder is pf
4697 4696
             $data_pf = DB::queryFirstRow(
4698 4697
                 'SELECT personal_folder
4699
-                FROM ' . prefixTable('nested_tree') . '
4698
+                FROM ' . prefixTable('nested_tree').'
4700 4699
                 WHERE id = %s',
4701 4700
                 $inputData['folderId']
4702 4701
             );
4703 4702
             
4704 4703
             $folder_is_personal = $data_pf !== null ? (int) $data_pf['personal_folder'] : 0;
4705 4704
             
4706
-            $visibilite = $session->get('user-name') . ' ' . $session->get('user-lastname') . ' (' . $session->get('user-login') . ')';
4705
+            $visibilite = $session->get('user-name').' '.$session->get('user-lastname').' ('.$session->get('user-login').')';
4707 4706
         }
4708 4707
 
4709 4708
         recupDroitCreationSansComplexite($inputData['folderId']);
@@ -4713,8 +4712,8 @@  discard block
 block discarded – undo
4713 4712
         $listOptionsForRoles = array();
4714 4713
         $rows = DB::query(
4715 4714
             'SELECT r.role_id AS role_id, t.title AS title
4716
-            FROM ' . prefixTable('roles_values') . ' AS r
4717
-            INNER JOIN ' . prefixTable('roles_title') . ' AS t ON (r.role_id = t.id)
4715
+            FROM ' . prefixTable('roles_values').' AS r
4716
+            INNER JOIN ' . prefixTable('roles_title').' AS t ON (r.role_id = t.id)
4718 4717
             WHERE r.folder_id = %i',
4719 4718
             $inputData['folderId']
4720 4719
         );
@@ -4728,7 +4727,7 @@  discard block
 block discarded – undo
4728 4727
             );
4729 4728
             $rows2 = DB::query(
4730 4729
                 'SELECT id, login, fonction_id, email, name, lastname
4731
-                FROM ' . prefixTable('users') . '
4730
+                FROM ' . prefixTable('users').'
4732 4731
                 WHERE admin = 0 AND fonction_id is not null'
4733 4732
             );
4734 4733
             foreach ($rows2 as $record2) {
@@ -4742,7 +4741,7 @@  discard block
 block discarded – undo
4742 4741
                             array(
4743 4742
                                 'id' => $record2['id'],
4744 4743
                                 'login' => $record2['login'],
4745
-                                'name' => $record2['name'] . ' ' . $record2['lastname'],
4744
+                                'name' => $record2['name'].' '.$record2['lastname'],
4746 4745
                                 'email' => $record2['email'],
4747 4746
                             )
4748 4747
                         );
@@ -4759,12 +4758,12 @@  discard block
 block discarded – undo
4759 4758
             foreach ($session->get('user-roles_array') as $role) {
4760 4759
                 $access = DB::queryFirstRow(
4761 4760
                     'SELECT type
4762
-                    FROM ' . prefixTable('roles_values') . '
4761
+                    FROM ' . prefixTable('roles_values').'
4763 4762
                     WHERE role_id = %i AND folder_id = %i',
4764 4763
                     $role,
4765 4764
                     $inputData['folderId']
4766 4765
                 );
4767
-                if (DB::count()>0) {
4766
+                if (DB::count() > 0) {
4768 4767
                     if ($access['type'] === 'R') {
4769 4768
                         array_push($arrTmp, 10);
4770 4769
                     } elseif ($access['type'] === 'W') {
@@ -4792,7 +4791,7 @@  discard block
 block discarded – undo
4792 4791
             // Check if personal folder is owned by user
4793 4792
             $folder = DB::queryFirstRow(
4794 4793
                 'SELECT id
4795
-                FROM ' . prefixTable('nested_tree') . '
4794
+                FROM ' . prefixTable('nested_tree').'
4796 4795
                 WHERE title = %s',
4797 4796
                 $session->get('user-id'),
4798 4797
             );
@@ -4897,7 +4896,7 @@  discard block
 block discarded – undo
4897 4896
         // Get some info before deleting
4898 4897
         $data = DB::queryFirstRow(
4899 4898
             'SELECT name, id_item, file
4900
-            FROM ' . prefixTable('files') . '
4899
+            FROM ' . prefixTable('files').'
4901 4900
             WHERE id = %i',
4902 4901
             $fileId
4903 4902
         );
@@ -4905,7 +4904,7 @@  discard block
 block discarded – undo
4905 4904
         // Load item data
4906 4905
         $data_item = DB::queryFirstRow(
4907 4906
             'SELECT id_tree
4908
-            FROM ' . prefixTable('items') . '
4907
+            FROM ' . prefixTable('items').'
4909 4908
             WHERE id = %i',
4910 4909
             $data['id_item']
4911 4910
         );
@@ -4935,7 +4934,7 @@  discard block
 block discarded – undo
4935 4934
                 $session->get('user-id'),
4936 4935
                 'at_modification',
4937 4936
                 $session->get('user-login'),
4938
-                'at_del_file : ' . $data['name']
4937
+                'at_del_file : '.$data['name']
4939 4938
             );
4940 4939
 
4941 4940
             // DElete sharekeys
@@ -4946,7 +4945,7 @@  discard block
 block discarded – undo
4946 4945
             );
4947 4946
 
4948 4947
             // Delete file from server
4949
-            $fileToDelete = $SETTINGS['path_to_upload_folder'] . '/' . TP_FILE_PREFIX . base64_decode($data['file']);
4948
+            $fileToDelete = $SETTINGS['path_to_upload_folder'].'/'.TP_FILE_PREFIX.base64_decode($data['file']);
4950 4949
             $fileToDelete = realpath($fileToDelete);
4951 4950
             if ($fileToDelete && strpos($fileToDelete, $SETTINGS['path_to_upload_folder']) === 0) {
4952 4951
                 fileDelete($fileToDelete, $SETTINGS);
@@ -5000,7 +4999,7 @@  discard block
 block discarded – undo
5000 4999
             // Update SESSION with this new favourite
5001 5000
             $data = DB::queryFirstRow(
5002 5001
                 'SELECT label,id_tree
5003
-                FROM ' . prefixTable('items') . '
5002
+                FROM ' . prefixTable('items').'
5004 5003
                 WHERE id = %i',
5005 5004
                 $inputData['itemId']
5006 5005
             );
@@ -5009,7 +5008,7 @@  discard block
 block discarded – undo
5009 5008
                 [
5010 5009
                     $inputData['itemId'] => [
5011 5010
                         'label' => $data['label'],
5012
-                        'url' => 'index.php?page=items&amp;group=' . $data['id_tree'] . '&amp;id=' . $inputData['itemId'],
5011
+                        'url' => 'index.php?page=items&amp;group='.$data['id_tree'].'&amp;id='.$inputData['itemId'],
5013 5012
                     ],
5014 5013
                 ],
5015 5014
                 'add'
@@ -5078,8 +5077,8 @@  discard block
 block discarded – undo
5078 5077
         // get data about item
5079 5078
         $dataSource = DB::queryFirstRow(
5080 5079
             'SELECT i.pw, f.personal_folder,i.id_tree, f.title,i.label
5081
-            FROM ' . prefixTable('items') . ' as i
5082
-            INNER JOIN ' . prefixTable('nested_tree') . ' as f ON (i.id_tree=f.id)
5080
+            FROM ' . prefixTable('items').' as i
5081
+            INNER JOIN ' . prefixTable('nested_tree').' as f ON (i.id_tree=f.id)
5083 5082
             WHERE i.id=%i',
5084 5083
             $inputData['itemId']
5085 5084
         );
@@ -5123,7 +5122,7 @@  discard block
 block discarded – undo
5123 5122
         // get data about new folder
5124 5123
         $dataDestination = DB::queryFirstRow(
5125 5124
             'SELECT personal_folder, title
5126
-            FROM ' . prefixTable('nested_tree') . '
5125
+            FROM ' . prefixTable('nested_tree').'
5127 5126
             WHERE id = %i',
5128 5127
             $inputData['folderId']
5129 5128
         );
@@ -5176,7 +5175,7 @@  discard block
 block discarded – undo
5176 5175
             // Get fields for this Item
5177 5176
             $rows = DB::query(
5178 5177
                 'SELECT id
5179
-                FROM ' . prefixTable('categories_items') . '
5178
+                FROM ' . prefixTable('categories_items').'
5180 5179
                 WHERE item_id = %i',
5181 5180
                 $inputData['itemId']
5182 5181
             );
@@ -5193,7 +5192,7 @@  discard block
 block discarded – undo
5193 5192
             // Get FILES for this Item
5194 5193
             $rows = DB::query(
5195 5194
                 'SELECT id
5196
-                FROM ' . prefixTable('files') . '
5195
+                FROM ' . prefixTable('files').'
5197 5196
                 WHERE id_item = %i',
5198 5197
                 $inputData['itemId']
5199 5198
             );
@@ -5240,7 +5239,7 @@  discard block
 block discarded – undo
5240 5239
             // Get the ITEM object key for the user
5241 5240
             $userKey = DB::queryFirstRow(
5242 5241
                 'SELECT share_key
5243
-                FROM ' . prefixTable('sharekeys_items') . '
5242
+                FROM ' . prefixTable('sharekeys_items').'
5244 5243
                 WHERE user_id = %i AND object_id = %i',
5245 5244
                 $session->get('user-id'),
5246 5245
                 $inputData['itemId']
@@ -5251,7 +5250,7 @@  discard block
 block discarded – undo
5251 5250
                 // This is a public object
5252 5251
                 $users = DB::query(
5253 5252
                     'SELECT id, public_key
5254
-                    FROM ' . prefixTable('users') . '
5253
+                    FROM ' . prefixTable('users').'
5255 5254
                     WHERE id NOT IN %li
5256 5255
                     AND public_key != ""',
5257 5256
                     $tpUsersIDs
@@ -5274,14 +5273,14 @@  discard block
 block discarded – undo
5274 5273
             // Get fields for this Item
5275 5274
             $rows = DB::query(
5276 5275
                 'SELECT id
5277
-                FROM ' . prefixTable('categories_items') . '
5276
+                FROM ' . prefixTable('categories_items').'
5278 5277
                 WHERE item_id = %i',
5279 5278
                 $inputData['itemId']
5280 5279
             );
5281 5280
             foreach ($rows as $field) {
5282 5281
                 $userKey = DB::queryFirstRow(
5283 5282
                     'SELECT share_key
5284
-                    FROM ' . prefixTable('sharekeys_fields') . '
5283
+                    FROM ' . prefixTable('sharekeys_fields').'
5285 5284
                     WHERE user_id = %i AND object_id = %i',
5286 5285
                     $session->get('user-id'),
5287 5286
                     $field['id']
@@ -5292,7 +5291,7 @@  discard block
 block discarded – undo
5292 5291
                     // This is a public object
5293 5292
                     $users = DB::query(
5294 5293
                         'SELECT id, public_key
5295
-                        FROM ' . prefixTable('users') . '
5294
+                        FROM ' . prefixTable('users').'
5296 5295
                         WHERE id NOT IN %li
5297 5296
                         AND public_key != ""',
5298 5297
                         $tpUsersIDs
@@ -5315,14 +5314,14 @@  discard block
 block discarded – undo
5315 5314
             // Get FILES for this Item
5316 5315
             $rows = DB::query(
5317 5316
                 'SELECT id
5318
-                FROM ' . prefixTable('files') . '
5317
+                FROM ' . prefixTable('files').'
5319 5318
                 WHERE id_item = %i',
5320 5319
                 $inputData['itemId']
5321 5320
             );
5322 5321
             foreach ($rows as $attachment) {
5323 5322
                 $userKey = DB::queryFirstRow(
5324 5323
                     'SELECT share_key
5325
-                    FROM ' . prefixTable('sharekeys_files') . '
5324
+                    FROM ' . prefixTable('sharekeys_files').'
5326 5325
                     WHERE user_id = %i AND object_id = %i',
5327 5326
                     $session->get('user-id'),
5328 5327
                     $attachment['id']
@@ -5333,7 +5332,7 @@  discard block
 block discarded – undo
5333 5332
                     // This is a public object
5334 5333
                     $users = DB::query(
5335 5334
                         'SELECT id, public_key
5336
-                        FROM ' . prefixTable('users') . '
5335
+                        FROM ' . prefixTable('users').'
5337 5336
                         WHERE id NOT IN %li
5338 5337
                         AND public_key != ""',
5339 5338
                         $tpUsersIDs
@@ -5374,7 +5373,7 @@  discard block
 block discarded – undo
5374 5373
             $session->get('user-id'),
5375 5374
             'at_modification',
5376 5375
             $session->get('user-login'),
5377
-            'at_moved : ' . $dataSource['title'] . ' -> ' . $dataDestination['title']
5376
+            'at_moved : '.$dataSource['title'].' -> '.$dataDestination['title']
5378 5377
         );
5379 5378
 
5380 5379
         // Update cache table
@@ -5433,8 +5432,8 @@  discard block
 block discarded – undo
5433 5432
                 // get data about item
5434 5433
                 $dataSource = DB::queryFirstRow(
5435 5434
                     'SELECT i.pw, f.personal_folder,i.id_tree, f.title,i.label
5436
-                    FROM ' . prefixTable('items') . ' as i
5437
-                    INNER JOIN ' . prefixTable('nested_tree') . ' as f ON (i.id_tree=f.id)
5435
+                    FROM ' . prefixTable('items').' as i
5436
+                    INNER JOIN ' . prefixTable('nested_tree').' as f ON (i.id_tree=f.id)
5438 5437
                     WHERE i.id=%i',
5439 5438
                     $item_id
5440 5439
                 );
@@ -5456,7 +5455,7 @@  discard block
 block discarded – undo
5456 5455
 
5457 5456
                 // get data about new folder
5458 5457
                 $dataDestination = DB::queryFirstRow(
5459
-                    'SELECT personal_folder, title FROM ' . prefixTable('nested_tree') . ' WHERE id = %i',
5458
+                    'SELECT personal_folder, title FROM '.prefixTable('nested_tree').' WHERE id = %i',
5460 5459
                     $inputData['folderId']
5461 5460
                 );
5462 5461
 
@@ -5498,7 +5497,7 @@  discard block
 block discarded – undo
5498 5497
                     // Get fields for this Item
5499 5498
                     $rows = DB::query(
5500 5499
                         'SELECT id
5501
-                        FROM ' . prefixTable('categories_items') . '
5500
+                        FROM ' . prefixTable('categories_items').'
5502 5501
                         WHERE item_id = %i',
5503 5502
                         $item_id
5504 5503
                     );
@@ -5515,7 +5514,7 @@  discard block
 block discarded – undo
5515 5514
                     // Get FILES for this Item
5516 5515
                     $rows = DB::query(
5517 5516
                         'SELECT id
5518
-                        FROM ' . prefixTable('files') . '
5517
+                        FROM ' . prefixTable('files').'
5519 5518
                         WHERE id_item = %i',
5520 5519
                         $item_id
5521 5520
                     );
@@ -5570,7 +5569,7 @@  discard block
 block discarded – undo
5570 5569
                     // Get the ITEM object key for the user
5571 5570
                     $userKey = DB::queryFirstRow(
5572 5571
                         'SELECT share_key
5573
-                        FROM ' . prefixTable('sharekeys_items') . '
5572
+                        FROM ' . prefixTable('sharekeys_items').'
5574 5573
                         WHERE user_id = %i AND object_id = %i',
5575 5574
                         $session->get('user-id'),
5576 5575
                         $item_id
@@ -5581,7 +5580,7 @@  discard block
 block discarded – undo
5581 5580
                         // This is a public object
5582 5581
                         $users = DB::query(
5583 5582
                             'SELECT id, public_key
5584
-                            FROM ' . prefixTable('users') . '
5583
+                            FROM ' . prefixTable('users').'
5585 5584
                             WHERE id NOT IN %li
5586 5585
                             AND public_key != ""',
5587 5586
                             $tpUsersIDs
@@ -5604,14 +5603,14 @@  discard block
 block discarded – undo
5604 5603
                     // Get fields for this Item
5605 5604
                     $rows = DB::query(
5606 5605
                         'SELECT id
5607
-                        FROM ' . prefixTable('categories_items') . '
5606
+                        FROM ' . prefixTable('categories_items').'
5608 5607
                         WHERE item_id = %i',
5609 5608
                         $item_id
5610 5609
                     );
5611 5610
                     foreach ($rows as $field) {
5612 5611
                         $userKey = DB::queryFirstRow(
5613 5612
                             'SELECT share_key
5614
-                            FROM ' . prefixTable('sharekeys_fields') . '
5613
+                            FROM ' . prefixTable('sharekeys_fields').'
5615 5614
                             WHERE user_id = %i AND object_id = %i',
5616 5615
                             $session->get('user-id'),
5617 5616
                             $field['id']
@@ -5622,7 +5621,7 @@  discard block
 block discarded – undo
5622 5621
                             // This is a public object
5623 5622
                             $users = DB::query(
5624 5623
                                 'SELECT id, public_key
5625
-                                FROM ' . prefixTable('users') . '
5624
+                                FROM ' . prefixTable('users').'
5626 5625
                                 WHERE id NOT IN %li
5627 5626
                                 AND public_key != ""',
5628 5627
                                 $tpUsersIDs
@@ -5646,14 +5645,14 @@  discard block
 block discarded – undo
5646 5645
                     // Get FILES for this Item
5647 5646
                     $rows = DB::query(
5648 5647
                         'SELECT id
5649
-                        FROM ' . prefixTable('files') . '
5648
+                        FROM ' . prefixTable('files').'
5650 5649
                         WHERE id_item = %i',
5651 5650
                         $item_id
5652 5651
                     );
5653 5652
                     foreach ($rows as $attachment) {
5654 5653
                         $userKey = DB::queryFirstRow(
5655 5654
                             'SELECT share_key
5656
-                            FROM ' . prefixTable('sharekeys_files') . '
5655
+                            FROM ' . prefixTable('sharekeys_files').'
5657 5656
                             WHERE user_id = %i AND object_id = %i',
5658 5657
                             $session->get('user-id'),
5659 5658
                             $attachment['id']
@@ -5664,7 +5663,7 @@  discard block
 block discarded – undo
5664 5663
                             // This is a public object
5665 5664
                             $users = DB::query(
5666 5665
                                 'SELECT id, public_key
5667
-                                FROM ' . prefixTable('users') . '
5666
+                                FROM ' . prefixTable('users').'
5668 5667
                                 WHERE id NOT IN %li
5669 5668
                                 AND public_key != ""',
5670 5669
                                 $tpUsersIDs
@@ -5704,13 +5703,13 @@  discard block
 block discarded – undo
5704 5703
                     $session->get('user-id'),
5705 5704
                     'at_modification',
5706 5705
                     $session->get('user-login'),
5707
-                    'at_moved : ' . $dataSource['title'] . ' -> ' . $dataDestination['title']
5706
+                    'at_moved : '.$dataSource['title'].' -> '.$dataDestination['title']
5708 5707
                 );
5709 5708
             }
5710 5709
         }
5711 5710
 
5712 5711
         // reload cache table
5713
-        require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
5712
+        require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
5714 5713
         updateCacheTable('reload', null);
5715 5714
 
5716 5715
         echo (string) prepareExchangedData(
@@ -5774,7 +5773,7 @@  discard block
 block discarded – undo
5774 5773
                 // get info
5775 5774
                 $dataSource = DB::queryFirstRow(
5776 5775
                     'SELECT label, id_tree
5777
-                    FROM ' . prefixTable('items') . '
5776
+                    FROM ' . prefixTable('items').'
5778 5777
                     WHERE id=%i',
5779 5778
                     $item_id
5780 5779
                 );
@@ -5875,14 +5874,14 @@  discard block
 block discarded – undo
5875 5874
             // Variables
5876 5875
             $dataAuthor = DB::queryFirstRow(
5877 5876
                 'SELECT email,login
5878
-                FROM ' . prefixTable('users') . '
5877
+                FROM ' . prefixTable('users').'
5879 5878
                 WHERE id = %i',
5880 5879
                 $post_content[1]
5881 5880
             );
5882 5881
 
5883 5882
             $dataItem = DB::queryFirstRow(
5884 5883
                 'SELECT label, id_tree
5885
-                FROM ' . prefixTable('items') . '
5884
+                FROM ' . prefixTable('items').'
5886 5885
                 WHERE id = %i',
5887 5886
                 $post_content[0]
5888 5887
             );
@@ -5899,7 +5898,7 @@  discard block
 block discarded – undo
5899 5898
                 $lang->get('email_request_access_subject'),
5900 5899
                 str_replace(
5901 5900
                     array('#tp_item_author#', '#tp_user#', '#tp_item#'),
5902
-                    array(' ' . addslashes($dataAuthor['login']), addslashes($session->get('user-login')), $path),
5901
+                    array(' '.addslashes($dataAuthor['login']), addslashes($session->get('user-login')), $path),
5903 5902
                     $lang->get('email_request_access_mail')
5904 5903
                 ),
5905 5904
                 $dataAuthor['email'],
@@ -5908,7 +5907,7 @@  discard block
 block discarded – undo
5908 5907
         } elseif ($inputData['cat'] === 'share_this_item') {
5909 5908
             $dataItem = DB::queryFirstRow(
5910 5909
                 'SELECT label,id_tree
5911
-                FROM ' . prefixTable('items') . '
5910
+                FROM ' . prefixTable('items').'
5912 5911
                 WHERE id= %i',
5913 5912
                 $inputData['id']
5914 5913
             );
@@ -5931,7 +5930,7 @@  discard block
 block discarded – undo
5931 5930
                     ),
5932 5931
                     array(
5933 5932
                         empty($SETTINGS['email_server_url']) === false ?
5934
-                            $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'],
5933
+                            $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'],
5935 5934
                         addslashes($session->get('user-login')),
5936 5935
                         addslashes($path),
5937 5936
                     ),
@@ -5980,8 +5979,8 @@  discard block
 block discarded – undo
5980 5979
         // Get all informations for this item
5981 5980
         $dataItem = DB::queryFirstRow(
5982 5981
             'SELECT *
5983
-            FROM ' . prefixTable('items') . ' as i
5984
-            INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id)
5982
+            FROM ' . prefixTable('items').' as i
5983
+            INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id)
5985 5984
             WHERE i.id=%i AND l.action = %s',
5986 5985
             $item_id,
5987 5986
             'at_creation'
@@ -6010,18 +6009,18 @@  discard block
 block discarded – undo
6010 6009
                 $session->get('user-login'),
6011 6010
                 htmlspecialchars_decode($label, ENT_QUOTES),
6012 6011
                 null,
6013
-                (string) dateToStamp($date.' '.$time, $SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'])
6012
+                (string) dateToStamp($date.' '.$time, $SETTINGS['date_format'].' '.$SETTINGS['time_format'])
6014 6013
             );
6015 6014
             // Prepare new line
6016 6015
             $data = DB::queryFirstRow(
6017
-                'SELECT * FROM ' . prefixTable('log_items') . ' WHERE id_item = %i ORDER BY date DESC',
6016
+                'SELECT * FROM '.prefixTable('log_items').' WHERE id_item = %i ORDER BY date DESC',
6018 6017
                 $item_id
6019 6018
             );
6020
-            $historic = date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $data['date']) . ' - ' . $session->get('user-login') . ' - ' . $lang->get($data['action']) . ' - ' . $data['raison'];
6019
+            $historic = date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $data['date']).' - '.$session->get('user-login').' - '.$lang->get($data['action']).' - '.$data['raison'];
6021 6020
             // send back
6022 6021
             $data = array(
6023 6022
                 'error' => '',
6024
-                'new_line' => '<br>' . addslashes($historic),
6023
+                'new_line' => '<br>'.addslashes($historic),
6025 6024
             );
6026 6025
             echo (string) prepareExchangedData(
6027 6026
                 $data,
@@ -6096,8 +6095,8 @@  discard block
 block discarded – undo
6096 6095
         // Should we log a password change?
6097 6096
         $itemQ = DB::queryFirstRow(
6098 6097
             'SELECT s.share_key, i.pw
6099
-            FROM ' . prefixTable('items') . ' AS i
6100
-            INNER JOIN ' . prefixTable('sharekeys_items') . ' AS s ON (i.id = s.object_id)
6098
+            FROM ' . prefixTable('items').' AS i
6099
+            INNER JOIN ' . prefixTable('sharekeys_items').' AS s ON (i.id = s.object_id)
6101 6100
             WHERE s.user_id = %i AND s.object_id = %i',
6102 6101
             $session->get('user-id'),
6103 6102
             $dataReceived['id']
@@ -6152,7 +6151,7 @@  discard block
 block discarded – undo
6152 6151
         if (isset($SETTINGS['otv_expiration_period']) === false) {
6153 6152
             $SETTINGS['otv_expiration_period'] = 7;
6154 6153
         }
6155
-        $url = $SETTINGS['cpassman_url'] . '/index.php?' . http_build_query($otv_session);
6154
+        $url = $SETTINGS['cpassman_url'].'/index.php?'.http_build_query($otv_session);
6156 6155
 
6157 6156
         echo json_encode(
6158 6157
             array(
@@ -6183,7 +6182,7 @@  discard block
 block discarded – undo
6183 6182
         // get parameters from original link
6184 6183
         $url = $dataReceived['original_link'];
6185 6184
         $parts = parse_url($url);
6186
-        if(isset($parts['query'])){
6185
+        if (isset($parts['query'])) {
6187 6186
             parse_str($parts['query'], $orignal_link_parameters);
6188 6187
         } else {
6189 6188
             $orignal_link_parameters = array();
@@ -6214,13 +6213,13 @@  discard block
 block discarded – undo
6214 6213
             $domain_scheme = parse_url($SETTINGS['cpassman_url'], PHP_URL_SCHEME);
6215 6214
             $domain_host = parse_url($SETTINGS['cpassman_url'], PHP_URL_HOST);
6216 6215
             if (str_contains($domain_host, 'www.') === true) {
6217
-                $domain_host = (string) $SETTINGS['otv_subdomain'] . '.' . substr($domain_host, 4);
6216
+                $domain_host = (string) $SETTINGS['otv_subdomain'].'.'.substr($domain_host, 4);
6218 6217
             } else {
6219
-                $domain_host = (string) $SETTINGS['otv_subdomain'] . '.' . $domain_host;
6218
+                $domain_host = (string) $SETTINGS['otv_subdomain'].'.'.$domain_host;
6220 6219
             }
6221
-            $url = $domain_scheme.'://'.$domain_host . '/index.php?'.http_build_query($otv_session);
6220
+            $url = $domain_scheme.'://'.$domain_host.'/index.php?'.http_build_query($otv_session);
6222 6221
         } else {
6223
-            $url = $SETTINGS['cpassman_url'] . '/index.php?'.http_build_query($otv_session);
6222
+            $url = $SETTINGS['cpassman_url'].'/index.php?'.http_build_query($otv_session);
6224 6223
         }
6225 6224
 
6226 6225
         echo (string) prepareExchangedData(
@@ -6255,8 +6254,8 @@  discard block
 block discarded – undo
6255 6254
             'SELECT f.id AS id, f.file AS file, f.name AS name, f.status AS status,
6256 6255
             f.extension AS extension, f.type AS type,
6257 6256
             s.share_key AS share_key
6258
-            FROM ' . prefixTable('files') . ' AS f
6259
-            INNER JOIN ' . prefixTable('sharekeys_files') . ' AS s ON (f.id = s.object_id)
6257
+            FROM ' . prefixTable('files').' AS f
6258
+            INNER JOIN ' . prefixTable('sharekeys_files').' AS s ON (f.id = s.object_id)
6260 6259
             WHERE s.user_id = %i AND s.object_id = %i',
6261 6260
             $session->get('user-id'),
6262 6261
             $inputData['id']
@@ -6277,7 +6276,7 @@  discard block
 block discarded – undo
6277 6276
         //$fileName = basename($file_info['name'], '.'.$file_info['extension']);
6278 6277
 
6279 6278
         // prepare image info
6280
-        $post_title = basename($file_info['name'], '.' . $file_info['extension']);
6279
+        $post_title = basename($file_info['name'], '.'.$file_info['extension']);
6281 6280
         $post_title = isBase64($post_title) === true ? base64_decode($post_title) : $post_title;
6282 6281
         
6283 6282
         // Get image content
@@ -6304,7 +6303,7 @@  discard block
 block discarded – undo
6304 6303
         echo (string) prepareExchangedData(
6305 6304
             array(
6306 6305
                 'error' => false,
6307
-                'filename' => $post_title . '.' . $file_info['extension'],
6306
+                'filename' => $post_title.'.'.$file_info['extension'],
6308 6307
                 'file_type' => $file_info['type'],
6309 6308
                 'file_content' => $fileContent,
6310 6309
             ),
@@ -6418,7 +6417,7 @@  discard block
 block discarded – undo
6418 6417
                     $arbo = $tree->getPath($folder->id, false);
6419 6418
                     $path = '';
6420 6419
                     foreach ($arbo as $elem) {
6421
-                        $path = (empty($path) ? '' : $path . ' / ') . htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
6420
+                        $path = (empty($path) ? '' : $path.' / ').htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
6422 6421
                     }
6423 6422
 
6424 6423
                     // Build array
@@ -6487,7 +6486,7 @@  discard block
 block discarded – undo
6487 6486
         if (is_array($foldersArray) === true && $inputData['data'] !== '[null]') {
6488 6487
             $rows = DB::query(
6489 6488
                 'SELECT id, categories
6490
-                FROM ' . prefixTable('nested_tree') . '
6489
+                FROM ' . prefixTable('nested_tree').'
6491 6490
                 WHERE id IN (%l)',
6492 6491
                 implode(',', $foldersArray)
6493 6492
             );
@@ -6529,7 +6528,7 @@  discard block
 block discarded – undo
6529 6528
         // get item info
6530 6529
         $dataItem = DB::queryFirstRow(
6531 6530
             'SELECT *
6532
-            FROM ' . prefixTable('items') . '
6531
+            FROM ' . prefixTable('items').'
6533 6532
             WHERE id=%i',
6534 6533
             $inputData['itemId']
6535 6534
         );
@@ -6541,8 +6540,8 @@  discard block
 block discarded – undo
6541 6540
             'SELECT l.date as date, l.action as action, l.raison as raison,
6542 6541
                 u.login as login, u.avatar_thumb as avatar_thumb, u.name as name, u.lastname as lastname,
6543 6542
                 l.old_value as old_value
6544
-            FROM ' . prefixTable('log_items') . ' as l
6545
-            INNER JOIN ' . prefixTable('users') . ' as u ON (l.id_user=u.id)
6543
+            FROM ' . prefixTable('log_items').' as l
6544
+            INNER JOIN ' . prefixTable('users').' as u ON (l.id_user=u.id)
6546 6545
             WHERE id_item=%i AND l.action NOT IN (%l)
6547 6546
             ORDER BY date DESC',
6548 6547
             $inputData['itemId'],
@@ -6557,18 +6556,18 @@  discard block
 block discarded – undo
6557 6556
             
6558 6557
             // imported via API
6559 6558
             if (empty($record['login']) === true) {
6560
-                $record['login'] = $lang->get('imported_via_api') . ' [' . $record['raison'] . ']';
6559
+                $record['login'] = $lang->get('imported_via_api').' ['.$record['raison'].']';
6561 6560
             }
6562 6561
             
6563 6562
             // Prepare avatar
6564 6563
             if (isset($record['avatar_thumb']) && empty($record['avatar_thumb']) === false) {
6565
-                if (file_exists($SETTINGS['cpassman_dir'] . '/includes/avatars/' . $record['avatar_thumb'])) {
6566
-                    $avatar = $SETTINGS['cpassman_url'] . '/includes/avatars/' . $record['avatar_thumb'];
6564
+                if (file_exists($SETTINGS['cpassman_dir'].'/includes/avatars/'.$record['avatar_thumb'])) {
6565
+                    $avatar = $SETTINGS['cpassman_url'].'/includes/avatars/'.$record['avatar_thumb'];
6567 6566
                 } else {
6568
-                    $avatar = $SETTINGS['cpassman_url'] . '/includes/images/photo.jpg';
6567
+                    $avatar = $SETTINGS['cpassman_url'].'/includes/images/photo.jpg';
6569 6568
                 }
6570 6569
             } else {
6571
-                $avatar = $SETTINGS['cpassman_url'] . '/includes/images/photo.jpg';
6570
+                $avatar = $SETTINGS['cpassman_url'].'/includes/images/photo.jpg';
6572 6571
             }
6573 6572
 
6574 6573
             // Prepare action
@@ -6588,7 +6587,7 @@  discard block
 block discarded – undo
6588 6587
                         $previous_passwords, 
6589 6588
                         [
6590 6589
                             'password' => htmlentities($previous_pwd['string']),
6591
-                            'date' => date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['date']),
6590
+                            'date' => date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['date']),
6592 6591
                         ]
6593 6592
                     );
6594 6593
                 }
@@ -6601,19 +6600,19 @@  discard block
 block discarded – undo
6601 6600
                 $action = $lang->get($reason[0]);
6602 6601
                 if ($reason[0] === 'at_moved') {
6603 6602
                     $tmp = explode(' -> ', $reason[1]);
6604
-                    $detail = $lang->get('from') . ' <span class="font-weight-light">' . $tmp[0] . '</span> ' . $lang->get('to') . ' <span class="font-weight-light">' . $tmp[1] . ' </span>';
6603
+                    $detail = $lang->get('from').' <span class="font-weight-light">'.$tmp[0].'</span> '.$lang->get('to').' <span class="font-weight-light">'.$tmp[1].' </span>';
6605 6604
                 } elseif ($reason[0] === 'at_field') {
6606 6605
                     $tmp = explode(' => ', $reason[1]);
6607 6606
                     if (count($tmp) > 1) {
6608
-                        $detail = '<b>' . trim($tmp[0]) . '</b> | ' . $lang->get('previous_value') .
6609
-                            ': <span class="font-weight-light">' . trim($tmp[1]) . '</span>';
6607
+                        $detail = '<b>'.trim($tmp[0]).'</b> | '.$lang->get('previous_value').
6608
+                            ': <span class="font-weight-light">'.trim($tmp[1]).'</span>';
6610 6609
                     } else {
6611 6610
                         $detail = trim($reason[1]);
6612 6611
                     }
6613 6612
                 } elseif (in_array($reason[0], array('at_restriction', 'at_email', 'at_login', 'at_label', 'at_url', 'at_tag')) === true) {
6614 6613
                     $tmp = explode(' => ', $reason[1]);
6615 6614
                     $detail = empty(trim($tmp[0])) === true ?
6616
-                        $lang->get('no_previous_value') : $lang->get('previous_value') . ': <span class="font-weight-light">' . $tmp[0] . ' </span>';
6615
+                        $lang->get('no_previous_value') : $lang->get('previous_value').': <span class="font-weight-light">'.$tmp[0].' </span>';
6617 6616
                 } elseif ($reason[0] === 'at_automatic_del') {
6618 6617
                     $detail = $lang->get($reason[1]);
6619 6618
                 } elseif ($reason[0] === 'at_anyoneconmodify' || $reason[0] === 'at_otp_status' || $reason[0] === 'at_otp_secret' || $reason[0] === 'at_phone_number') {
@@ -6622,7 +6621,7 @@  discard block
 block discarded – undo
6622 6621
                     $tmp = explode(':', $reason[1]);
6623 6622
                     $tmp = explode('.', $tmp[0]);
6624 6623
                     $detail = isBase64($tmp[0]) === true ?
6625
-                        base64_decode($tmp[0]) . '.' . $tmp[1] : $tmp[0];
6624
+                        base64_decode($tmp[0]).'.'.$tmp[1] : $tmp[0];
6626 6625
                 } elseif ($reason[0] === 'at_import') {
6627 6626
                     $detail = '';
6628 6627
                 } elseif (in_array($reason[0], array('csv', 'pdf')) === true) {
@@ -6641,8 +6640,8 @@  discard block
 block discarded – undo
6641 6640
                 array(
6642 6641
                     'avatar' => $avatar,
6643 6642
                     'login' => $record['login'],
6644
-                    'name' => $record['name'] . ' ' . $record['lastname'],
6645
-                    'date' => date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['date']),
6643
+                    'name' => $record['name'].' '.$record['lastname'],
6644
+                    'date' => date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['date']),
6646 6645
                     'action' => $action,
6647 6646
                     'detail' => $detail,
6648 6647
                 )
@@ -6730,11 +6729,11 @@  discard block
 block discarded – undo
6730 6729
 
6731 6730
         // get some info to add to the notification email
6732 6731
         $resp_user = DB::queryFirstRow(
6733
-            'SELECT login FROM ' . prefixTable('users') . ' WHERE id = %i',
6732
+            'SELECT login FROM '.prefixTable('users').' WHERE id = %i',
6734 6733
             $session->get('user-id')
6735 6734
         );
6736 6735
         $resp_folder = DB::queryFirstRow(
6737
-            'SELECT title FROM ' . prefixTable('nested_tree') . ' WHERE id = %i',
6736
+            'SELECT title FROM '.prefixTable('nested_tree').' WHERE id = %i',
6738 6737
             $folder
6739 6738
         );
6740 6739
 
@@ -6743,7 +6742,7 @@  discard block
 block discarded – undo
6743 6742
         $emailService = new EmailService();
6744 6743
         $rows = DB::query(
6745 6744
             'SELECT email
6746
-            FROM ' . prefixTable('users') . '
6745
+            FROM ' . prefixTable('users').'
6747 6746
             WHERE `gestionnaire` = %i AND `email` IS NOT NULL',
6748 6747
             1
6749 6748
         );
@@ -6789,7 +6788,7 @@  discard block
 block discarded – undo
6789 6788
         // Send email
6790 6789
         $dataItem = DB::queryFirstRow(
6791 6790
             'SELECT label, id_tree
6792
-            FROM ' . prefixTable('items') . '
6791
+            FROM ' . prefixTable('items').'
6793 6792
             WHERE id = %i',
6794 6793
             $inputData['itemId']
6795 6794
         );
@@ -6843,7 +6842,7 @@  discard block
 block discarded – undo
6843 6842
 
6844 6843
         DB::query(
6845 6844
             'SELECT *
6846
-            FROM ' . prefixTable('notification') . '
6845
+            FROM ' . prefixTable('notification').'
6847 6846
             WHERE item_id = %i AND user_id = %i',
6848 6847
             $inputData['itemId'],
6849 6848
             $session->get('user-id')
@@ -6915,7 +6914,7 @@  discard block
 block discarded – undo
6915 6914
         // And related logs
6916 6915
         $rows = DB::query(
6917 6916
             'SELECT id, file AS filename
6918
-            FROM ' . prefixTable('files') . '
6917
+            FROM ' . prefixTable('files').'
6919 6918
             WHERE id_item = %i AND confirmed = %i',
6920 6919
             $inputData['itemId'],
6921 6920
             0
@@ -6929,12 +6928,12 @@  discard block
 block discarded – undo
6929 6928
             );
6930 6929
 
6931 6930
             // Delete file on server
6932
-            unlink($SETTINGS['path_to_upload_folder'] . '/' . TP_FILE_PREFIX . base64_decode($file['filename']));
6931
+            unlink($SETTINGS['path_to_upload_folder'].'/'.TP_FILE_PREFIX.base64_decode($file['filename']));
6933 6932
 
6934 6933
             // Delete related logs
6935 6934
             $logFile = DB::query(
6936 6935
                 'SELECT increment_id, raison
6937
-                FROM ' . prefixTable('log_items') . '
6936
+                FROM ' . prefixTable('log_items').'
6938 6937
                 WHERE id_item = %i AND id_user = %i AND action = %s AND raison LIKE "at_add_file :%"',
6939 6938
                 $inputData['itemId'],
6940 6939
                 $session->get('user-id'),
@@ -6993,7 +6992,7 @@  discard block
 block discarded – undo
6993 6992
         // Confirm attachments
6994 6993
         $rows = DB::query(
6995 6994
             'SELECT id, file AS filename
6996
-            FROM ' . prefixTable('files') . '
6995
+            FROM ' . prefixTable('files').'
6997 6996
             WHERE id_item = %i AND confirmed = %i',
6998 6997
             $inputData['itemId'],
6999 6998
             0
@@ -7109,7 +7108,7 @@  discard block
 block discarded – undo
7109 7108
             $successfulDeletions = array();
7110 7109
             $failedDeletions = array();
7111 7110
 
7112
-            foreach( $selectedItemIds as $itemId) {
7111
+            foreach ($selectedItemIds as $itemId) {
7113 7112
                 // Check that user can access this item
7114 7113
                 $granted = accessToItemIsGranted((int) $itemId, $SETTINGS);
7115 7114
                 if ($granted !== true) {
@@ -7120,7 +7119,7 @@  discard block
 block discarded – undo
7120 7119
                 // Load item data
7121 7120
                 $data = DB::queryFirstRow(
7122 7121
                     'SELECT id_tree, id, label
7123
-                    FROM ' . prefixTable('items') . '
7122
+                    FROM ' . prefixTable('items').'
7124 7123
                     WHERE id = %i',
7125 7124
                     $itemId
7126 7125
                 );
@@ -7203,15 +7202,15 @@  discard block
 block discarded – undo
7203 7202
         case 'autocomplete_tags':
7204 7203
             // Get a list off all existing TAGS
7205 7204
             $listOfTags = '';
7206
-            $rows = DB::query('SELECT tag FROM ' . prefixTable('tags') . ' WHERE tag LIKE %ss GROUP BY tag', $inputData['getTerm']);
7205
+            $rows = DB::query('SELECT tag FROM '.prefixTable('tags').' WHERE tag LIKE %ss GROUP BY tag', $inputData['getTerm']);
7207 7206
             foreach ($rows as $record) {
7208 7207
                 if (empty($listOfTags)) {
7209
-                    $listOfTags = '"' . $record['tag'] . '"';
7208
+                    $listOfTags = '"'.$record['tag'].'"';
7210 7209
                 } else {
7211
-                    $listOfTags .= ', "' . $record['tag'] . '"';
7210
+                    $listOfTags .= ', "'.$record['tag'].'"';
7212 7211
                 }
7213 7212
             }
7214
-            echo '[' . $listOfTags . ']';
7213
+            echo '['.$listOfTags.']';
7215 7214
             break;
7216 7215
     }
7217 7216
 }
@@ -7227,7 +7226,7 @@  discard block
 block discarded – undo
7227 7226
 {
7228 7227
     $data = DB::queryFirstRow(
7229 7228
         'SELECT bloquer_creation, bloquer_modification, personal_folder
7230
-        FROM ' . prefixTable('nested_tree') . ' WHERE id = %i',
7229
+        FROM ' . prefixTable('nested_tree').' WHERE id = %i',
7231 7230
         $groupe
7232 7231
     );
7233 7232
     // Check if it's in a personal folder. If yes, then force complexity overhead.
@@ -7341,7 +7340,7 @@  discard block
 block discarded – undo
7341 7340
     // Get item date
7342 7341
     $itemRestrictedUsersList = DB::queryFirstRow(
7343 7342
         'SELECT restricted_to
7344
-         FROM ' . prefixTable('items') . '
7343
+         FROM ' . prefixTable('items').'
7345 7344
          WHERE id = %i',
7346 7345
         $itemId
7347 7346
     );
@@ -7374,7 +7373,7 @@  discard block
 block discarded – undo
7374 7373
     $now = time();
7375 7374
     $editionLocks = DB::query(
7376 7375
         'SELECT timestamp, user_id, increment_id
7377
-         FROM ' . prefixTable('items_edition') . '
7376
+         FROM ' . prefixTable('items_edition').'
7378 7377
          WHERE item_id = %i 
7379 7378
          ORDER BY increment_id DESC',
7380 7379
         $itemId
@@ -7420,7 +7419,7 @@  discard block
 block discarded – undo
7420 7419
 
7421 7420
         // Delete related background tasks if any
7422 7421
         $task = DB::queryFirstRow(
7423
-            'SELECT increment_id FROM ' . prefixTable('background_tasks') . '
7422
+            'SELECT increment_id FROM '.prefixTable('background_tasks').'
7424 7423
              WHERE item_id = %i AND finished_at = ""',
7425 7424
             $itemId
7426 7425
         );
@@ -7433,7 +7432,7 @@  discard block
 block discarded – undo
7433 7432
         // Check if encryption process is still running
7434 7433
         DB::queryFirstRow(
7435 7434
             'SELECT JSON_EXTRACT(arguments, "$.all_users_except_id") AS all_users_except_id
7436
-             FROM ' . prefixTable('background_tasks') . '
7435
+             FROM ' . prefixTable('background_tasks').'
7437 7436
              WHERE item_id = %i AND finished_at = ""
7438 7437
              ORDER BY increment_id DESC',
7439 7438
             $itemId
@@ -7454,7 +7453,7 @@  discard block
 block discarded – undo
7454 7453
         }
7455 7454
 
7456 7455
         return [
7457
-            'status' => true,   // Encryption in progress
7456
+            'status' => true, // Encryption in progress
7458 7457
             'delay' => $delay - $elapsed, // Time remaining before the lock expires
7459 7458
         ];
7460 7459
     }
@@ -7499,7 +7498,7 @@  discard block
 block discarded – undo
7499 7498
 {
7500 7499
     // Check if there's an ongoing background encryption process for the item
7501 7500
     $ongoingProcess = DB::queryFirstRow(
7502
-        'SELECT 1 FROM ' . prefixTable('background_tasks') . ' WHERE item_id = %i AND finished_at = "" LIMIT 1', 
7501
+        'SELECT 1 FROM '.prefixTable('background_tasks').' WHERE item_id = %i AND finished_at = "" LIMIT 1', 
7503 7502
         $itemId
7504 7503
     );
7505 7504
 
@@ -7517,7 +7516,7 @@  discard block
 block discarded – undo
7517 7516
 function getUserVisibleFolders(int $userId): array
7518 7517
 {
7519 7518
     // Query to retrieve visible folders for the user
7520
-    $data = DB::queryFirstRow('SELECT visible_folders FROM ' . prefixTable('cache_tree') . ' WHERE user_id = %i', $userId);
7519
+    $data = DB::queryFirstRow('SELECT visible_folders FROM '.prefixTable('cache_tree').' WHERE user_id = %i', $userId);
7521 7520
     
7522 7521
     // Decode JSON data into an array; return an empty array if the data is invalid
7523 7522
     return json_decode($data['visible_folders'], true) ?? [];
@@ -7541,7 +7540,7 @@  discard block
 block discarded – undo
7541 7540
 
7542 7541
     // Query the access rights for the given roles and folder
7543 7542
     $accessTypes = DB::queryFirstColumn(
7544
-        'SELECT DISTINCT type FROM ' . prefixTable('roles_values') . ' WHERE role_id IN %ls AND folder_id = %i', 
7543
+        'SELECT DISTINCT type FROM '.prefixTable('roles_values').' WHERE role_id IN %ls AND folder_id = %i', 
7545 7544
         $roles, 
7546 7545
         $treeId
7547 7546
     );
Please login to merge, or discard this patch.
sources/backups.queries.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 ) {
78 78
     // Not allowed page
79 79
     $session->set('system-error_code', ERR_NOT_ALLOWED);
80
-    include $SETTINGS['cpassman_dir'] . '/error.php';
80
+    include $SETTINGS['cpassman_dir'].'/error.php';
81 81
     exit;
82 82
 }
83 83
 
@@ -138,14 +138,14 @@  discard block
 block discarded – undo
138 138
             // Prepare variables
139 139
             $post_key = filter_var($dataReceived['encryptionKey'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
140 140
         
141
-            require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
141
+            require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
142 142
         
143 143
             // get a token
144 144
             $token = GenerateCryptKey(20, false, true, true, false, true);
145 145
         
146 146
             //save file
147
-            $filename = time() . '-' . $token . '.sql';
148
-            $filepath = $SETTINGS['path_to_files_folder'] . '/' . $filename;
147
+            $filename = time().'-'.$token.'.sql';
148
+            $filepath = $SETTINGS['path_to_files_folder'].'/'.$filename;
149 149
             $handle = fopen($filepath, 'w+');
150 150
             
151 151
             if ($handle === false) {
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
             $tables = array();
164 164
             $result = DB::query('SHOW TABLES');
165 165
             foreach ($result as $row) {
166
-                $tables[] = $row['Tables_in_' . DB_NAME];
166
+                $tables[] = $row['Tables_in_'.DB_NAME];
167 167
             }
168 168
         
169 169
             $backupSuccess = true;
@@ -173,9 +173,9 @@  discard block
 block discarded – undo
173 173
                 if (empty($pre) || substr_count($table, $pre) > 0) {
174 174
                     $table = safeString($table);
175 175
                     // Write table drop and creation
176
-                    fwrite($handle, 'DROP TABLE IF EXISTS ' . $table . ";\n");
177
-                    $row2 = DB::queryFirstRow('SHOW CREATE TABLE ' . $table);
178
-                    fwrite($handle, safeString($row2['Create Table']) . ";\n\n");
176
+                    fwrite($handle, 'DROP TABLE IF EXISTS '.$table.";\n");
177
+                    $row2 = DB::queryFirstRow('SHOW CREATE TABLE '.$table);
178
+                    fwrite($handle, safeString($row2['Create Table']).";\n\n");
179 179
         
180 180
                     // Get field information
181 181
                     DB::query(
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
                         }
201 201
                         
202 202
                         foreach ($rows as $record) {
203
-                            $insertQuery = 'INSERT INTO ' . $table . ' VALUES(';
203
+                            $insertQuery = 'INSERT INTO '.$table.' VALUES(';
204 204
                             $values = array();
205 205
                             
206 206
                             foreach ($record as $value) {
@@ -208,11 +208,11 @@  discard block
 block discarded – undo
208 208
                                 if ($value === null) {
209 209
                                     $values[] = 'NULL';
210 210
                                 } else {
211
-                                    $values[] = '"' . addslashes(preg_replace("/\n/", '\\n', $value)) . '"';
211
+                                    $values[] = '"'.addslashes(preg_replace("/\n/", '\\n', $value)).'"';
212 212
                                 }
213 213
                             }
214 214
                             
215
-                            $insertQuery .= implode(',', $values) . ");\n";
215
+                            $insertQuery .= implode(',', $values).");\n";
216 216
                             fwrite($handle, $insertQuery);
217 217
                             
218 218
                             // Flush buffer periodically to free memory
@@ -242,14 +242,14 @@  discard block
 block discarded – undo
242 242
                 prepareFileWithDefuse(
243 243
                     'encrypt',
244 244
                     $filepath,
245
-                    $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $filename,
245
+                    $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$filename,
246 246
                     $post_key
247 247
                 );
248 248
         
249 249
                 // Do clean
250 250
                 unlink($filepath);
251 251
                 rename(
252
-                    $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $filename,
252
+                    $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$filename,
253 253
                     $filepath
254 254
                 );
255 255
             }
@@ -270,9 +270,9 @@  discard block
 block discarded – undo
270 270
                 array(
271 271
                     'error' => false,
272 272
                     'message' => '',
273
-                    'download' => 'sources/downloadFile.php?name=' . urlencode($filename) .
274
-                        '&sub=files&file=' . $filename . '&type=sql&key=' . $session->get('key') . '&key_tmp=' .
275
-                        $session->get('user-key_tmp') . '&pathIsFiles=1',
273
+                    'download' => 'sources/downloadFile.php?name='.urlencode($filename).
274
+                        '&sub=files&file='.$filename.'&type=sql&key='.$session->get('key').'&key_tmp='.
275
+                        $session->get('user-key_tmp').'&pathIsFiles=1',
276 276
                 ),
277 277
                 'encode'
278 278
             );
@@ -333,13 +333,13 @@  discard block
 block discarded – undo
333 333
                 error_log('DEBUG: Offset -> '.$post_offset.'/'.$post_totalSize.' | File -> '.$post_clearFilename.' | key -> '.$post_key);
334 334
             }
335 335
         
336
-            include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
336
+            include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
337 337
         
338 338
             if (empty($post_clearFilename) === true) {
339 339
                 // Get filename from database
340 340
                 $data = DB::queryFirstRow(
341 341
                     'SELECT valeur
342
-                    FROM ' . prefixTable('misc') . '
342
+                    FROM ' . prefixTable('misc').'
343 343
                     WHERE increment_id = %i',
344 344
                     $post_backupFile
345 345
                 );
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
                 $post_backupFile = safeString($data['valeur']);
367 367
                 
368 368
                 // Verify file exists
369
-                if (!file_exists($SETTINGS['path_to_files_folder'] . '/' . $post_backupFile)) {
369
+                if (!file_exists($SETTINGS['path_to_files_folder'].'/'.$post_backupFile)) {
370 370
                     echo prepareExchangedData(
371 371
                         array(
372 372
                             'error' => true,
@@ -383,8 +383,8 @@  discard block
 block discarded – undo
383 383
                     // Decrypt the file
384 384
                     $ret = prepareFileWithDefuse(
385 385
                         'decrypt',
386
-                        $SETTINGS['path_to_files_folder'] . '/' . $post_backupFile,
387
-                        $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $post_backupFile,
386
+                        $SETTINGS['path_to_files_folder'].'/'.$post_backupFile,
387
+                        $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$post_backupFile,
388 388
                         $post_key
389 389
                     );
390 390
                     
@@ -401,8 +401,8 @@  discard block
 block discarded – undo
401 401
                     }
402 402
         
403 403
                     // Do clean
404
-                    fileDelete($SETTINGS['path_to_files_folder'] . '/' . $post_backupFile, $SETTINGS);
405
-                    $post_backupFile = $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $post_backupFile;
404
+                    fileDelete($SETTINGS['path_to_files_folder'].'/'.$post_backupFile, $SETTINGS);
405
+                    $post_backupFile = $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$post_backupFile;
406 406
                 } else {
407 407
                     echo prepareExchangedData(
408 408
                         array(
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
                                 DB::query($query);
485 485
                                 $executedQueries++;
486 486
                             } catch (Exception $e) {
487
-                                $errors[] = "Error executing query: " . $e->getMessage() . " - Query: " . substr($query, 0, 100) . "...";
487
+                                $errors[] = "Error executing query: ".$e->getMessage()." - Query: ".substr($query, 0, 100)."...";
488 488
                             }
489 489
                             $query = '';
490 490
                         }
@@ -500,7 +500,7 @@  discard block
 block discarded – undo
500 500
             } catch (Exception $e) {
501 501
                 // Rollback transaction on any exception
502 502
                 DB::rollback();
503
-                $errors[] = "Transaction failed: " . $e->getMessage();
503
+                $errors[] = "Transaction failed: ".$e->getMessage();
504 504
             }
505 505
         
506 506
             // Calculate the new offset
@@ -515,7 +515,7 @@  discard block
 block discarded – undo
515 515
                 echo prepareExchangedData(
516 516
                     array(
517 517
                         'error' => true,
518
-                        'message' => 'Errors occurred during import: ' . implode('; ', $errors),
518
+                        'message' => 'Errors occurred during import: '.implode('; ', $errors),
519 519
                         'newOffset' => $newOffset,
520 520
                         'totalSize' => $post_totalSize,
521 521
                         'clearFilename' => $post_backupFile,
Please login to merge, or discard this patch.
sources/folders.queries.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -137,14 +137,14 @@  discard block
 block discarded – undo
137 137
                     && $t->personal_folder == 0
138 138
                 ) {
139 139
                     // get $t->parent_id
140
-                    $data = DB::queryFirstRow('SELECT title FROM ' . prefixTable('nested_tree') . ' WHERE id = %i', $t->parent_id);
140
+                    $data = DB::queryFirstRow('SELECT title FROM '.prefixTable('nested_tree').' WHERE id = %i', $t->parent_id);
141 141
                     if ($t->nlevel == 1) {
142 142
                         $data['title'] = $lang->get('root');
143 143
                     }
144 144
 
145 145
                     // get rights on this folder
146 146
                     $arrayRights = array();
147
-                    $rows = DB::query('SELECT fonction_id  FROM ' . prefixTable('rights') . ' WHERE authorized=%i AND tree_id = %i', 1, $t->id);
147
+                    $rows = DB::query('SELECT fonction_id  FROM '.prefixTable('rights').' WHERE authorized=%i AND tree_id = %i', 1, $t->id);
148 148
                     foreach ($rows as $record) {
149 149
                         array_push($arrayRights, $record['fonction_id']);
150 150
                     }
@@ -162,8 +162,8 @@  discard block
 block discarded – undo
162 162
                         'SELECT m.valeur AS valeur, n.renewal_period AS renewal_period,
163 163
                         n.bloquer_creation AS bloquer_creation, n.bloquer_modification AS bloquer_modification,
164 164
                         n.fa_icon AS fa_icon, n.fa_icon_selected AS fa_icon_selected
165
-                        FROM ' . prefixTable('misc') . ' AS m,
166
-                        ' . prefixTable('nested_tree') . ' AS n
165
+                        FROM ' . prefixTable('misc').' AS m,
166
+                        ' . prefixTable('nested_tree').' AS n
167 167
                         WHERE m.type=%s AND m.intitule = n.id AND m.intitule = %i',
168 168
                         'complex',
169 169
                         $t->id
@@ -191,16 +191,16 @@  discard block
 block discarded – undo
191 191
                         $arrayColumns['folderComplexity'] = '';
192 192
                     }
193 193
 
194
-                    if (is_null($node_data)=== false) {
194
+                    if (is_null($node_data) === false) {
195 195
                         $arrayColumns['renewalPeriod'] = (int) $node_data['renewal_period'];
196 196
                     } else {
197
-                        $arrayColumns['renewalPeriod']=0;
197
+                        $arrayColumns['renewalPeriod'] = 0;
198 198
                     }
199 199
 
200 200
                     //col7
201 201
                     $data7 = DB::queryFirstRow(
202 202
                         'SELECT bloquer_creation,bloquer_modification
203
-                        FROM ' . prefixTable('nested_tree') . '
203
+                        FROM ' . prefixTable('nested_tree').'
204 204
                         WHERE id = %i',
205 205
                         intval($t->id)
206 206
                     );
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
             // Get info about this folder
359 359
             $dataFolder = DB::queryFirstRow(
360 360
                 'SELECT *
361
-                FROM ' . prefixTable('nested_tree') . '
361
+                FROM ' . prefixTable('nested_tree').'
362 362
                 WHERE id = %i',
363 363
                 $inputData['id']
364 364
             );
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
             //check if parent folder is personal
395 395
             $dataParent = DB::queryFirstRow(
396 396
                 'SELECT personal_folder, bloquer_creation, bloquer_modification
397
-                FROM ' . prefixTable('nested_tree') . '
397
+                FROM ' . prefixTable('nested_tree').'
398 398
                 WHERE id = %i',
399 399
                 $inputData['parentId']
400 400
             );
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
                     // get complexity level for this folder
424 424
                     $data = DB::queryFirstRow(
425 425
                         'SELECT valeur
426
-                        FROM ' . prefixTable('misc') . '
426
+                        FROM ' . prefixTable('misc').'
427 427
                         WHERE intitule = %i AND type = %s',
428 428
                         $inputData['parentId'],
429 429
                         'complex'
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
                             array(
435 435
                                 'error' => true,
436 436
                                 'message' => $lang->get('error_folder_complexity_lower_than_top_folder')
437
-                                    . ' [<b>' . TP_PW_COMPLEXITY[$data['valeur']][1] . '</b>]',
437
+                                    . ' [<b>'.TP_PW_COMPLEXITY[$data['valeur']][1].'</b>]',
438 438
                             ),
439 439
                             'encode'
440 440
                         );
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
             // Check if parent folder is personal
595 595
             $dataParent = DB::queryFirstRow(
596 596
                 'SELECT personal_folder
597
-                FROM ' . prefixTable('nested_tree') . '
597
+                FROM ' . prefixTable('nested_tree').'
598 598
                 WHERE id = %i',
599 599
                 $inputData['parentId']
600 600
             );
@@ -634,7 +634,7 @@  discard block
 block discarded – undo
634 634
             echo prepareExchangedData(
635 635
                 array(
636 636
                     'error' => $creationStatus['error'],
637
-                    'message' => $creationStatus['error'] === true ? $lang->get('error_not_allowed_to') : $lang->get('folder_created') ,
637
+                    'message' => $creationStatus['error'] === true ? $lang->get('error_not_allowed_to') : $lang->get('folder_created'),
638 638
                     'newId' => $creationStatus['newId'],
639 639
                 ),
640 640
                 'encode'
@@ -682,7 +682,7 @@  discard block
 block discarded – undo
682 682
                 echo prepareExchangedData(
683 683
                     array(
684 684
                         'error' => true,
685
-                        'message' => $lang->get('error_not_allowed_to'). " (You can't delete the root folder)",
685
+                        'message' => $lang->get('error_not_allowed_to')." (You can't delete the root folder)",
686 686
                     ),
687 687
                     'encode'
688 688
                 );
@@ -692,7 +692,7 @@  discard block
 block discarded – undo
692 692
             // Ensure that user has access to all folders
693 693
             $foldersAccessible = DB::query(
694 694
                 'SELECT id
695
-                FROM ' . prefixTable('nested_tree') . '
695
+                FROM ' . prefixTable('nested_tree').'
696 696
                 WHERE id IN %li AND id IN %li',
697 697
                 $post_folders,
698 698
                 $session->get('user-accessible_folders')
@@ -706,7 +706,7 @@  discard block
 block discarded – undo
706 706
                 echo prepareExchangedData(
707 707
                     array(
708 708
                         'error' => true,
709
-                        'message' => $lang->get('error_not_allowed_to') . ' (The following folders are not accessible or do not exist: ' . implode(', ', $missingFolders) . ')',
709
+                        'message' => $lang->get('error_not_allowed_to').' (The following folders are not accessible or do not exist: '.implode(', ', $missingFolders).')',
710 710
                     ),
711 711
                     'encode'
712 712
                 );
@@ -723,7 +723,7 @@  discard block
 block discarded – undo
723 723
                 // Check if parent folder is personal
724 724
                 $dataParent = DB::queryFirstRow(
725 725
                     'SELECT personal_folder
726
-                    FROM ' . prefixTable('nested_tree') . '
726
+                    FROM ' . prefixTable('nested_tree').'
727 727
                     WHERE id = %i',
728 728
                     $folderId
729 729
                 );
@@ -769,10 +769,10 @@  discard block
 block discarded – undo
769 769
                                 prefixTable('misc'),
770 770
                                 array(
771 771
                                     'type' => 'folder_deleted',
772
-                                    'intitule' => 'f' . $thisSubFolders->id,
773
-                                    'valeur' => $thisSubFolders->id . ', ' . $thisSubFolders->parent_id . ', ' .
774
-                                        $thisSubFolders->title . ', ' . $thisSubFolders->nleft . ', ' . $thisSubFolders->nright . ', ' .
775
-                                        $thisSubFolders->nlevel . ', 0, 0, 0, 0',
772
+                                    'intitule' => 'f'.$thisSubFolders->id,
773
+                                    'valeur' => $thisSubFolders->id.', '.$thisSubFolders->parent_id.', '.
774
+                                        $thisSubFolders->title.', '.$thisSubFolders->nleft.', '.$thisSubFolders->nright.', '.
775
+                                        $thisSubFolders->nlevel.', 0, 0, 0, 0',
776 776
                                     'created_at' => time(),
777 777
                                 )
778 778
                             );
@@ -781,7 +781,7 @@  discard block
 block discarded – undo
781 781
 
782 782
                             //delete items & logs
783 783
                             $itemsInSubFolder = DB::query(
784
-                                'SELECT id FROM ' . prefixTable('items') . ' 
784
+                                'SELECT id FROM '.prefixTable('items').' 
785 785
                                 WHERE id_tree=%i', 
786 786
                                 $thisSubFolders->id
787 787
                             );
@@ -811,7 +811,7 @@  discard block
 block discarded – undo
811 811
                                 }
812 812
 
813 813
                                 //Update CACHE table
814
-                                updateCacheTable('delete_value',(int) $item['id']);
814
+                                updateCacheTable('delete_value', (int) $item['id']);
815 815
                             }
816 816
 
817 817
                             //Actualize the variable
@@ -921,7 +921,7 @@  discard block
 block discarded – undo
921 921
             // Check if target parent folder is personal
922 922
             $dataParent = DB::queryFirstRow(
923 923
                 'SELECT personal_folder
924
-                FROM ' . prefixTable('nested_tree') . '
924
+                FROM ' . prefixTable('nested_tree').'
925 925
                 WHERE id = %i',
926 926
                 $post_target_folder_id
927 927
             );
@@ -975,7 +975,7 @@  discard block
 block discarded – undo
975 975
                 // get complexity of current node
976 976
                 $nodeComplexity = DB::queryFirstRow(
977 977
                     'SELECT valeur
978
-                    FROM ' . prefixTable('misc') . '
978
+                    FROM ' . prefixTable('misc').'
979 979
                     WHERE intitule = %i AND type= %s',
980 980
                     $nodeInfo->id,
981 981
                     'complex'
@@ -1052,7 +1052,7 @@  discard block
 block discarded – undo
1052 1052
                 // If it is a subfolder, then give access to it for all roles that allows the parent folder
1053 1053
                 $rows = DB::query(
1054 1054
                     'SELECT role_id, type
1055
-                    FROM ' . prefixTable('roles_values') . '
1055
+                    FROM ' . prefixTable('roles_values').'
1056 1056
                     WHERE folder_id = %i',
1057 1057
                     $parentId
1058 1058
                 );
@@ -1071,7 +1071,7 @@  discard block
 block discarded – undo
1071 1071
                 // if parent folder has Custom Fields Categories then add to this child one too
1072 1072
                 $rows = DB::query(
1073 1073
                     'SELECT id_category
1074
-                    FROM ' . prefixTable('categories_folders') . '
1074
+                    FROM ' . prefixTable('categories_folders').'
1075 1075
                     WHERE id_folder = %i',
1076 1076
                     $nodeInfo->id
1077 1077
                 );
@@ -1090,7 +1090,7 @@  discard block
 block discarded – undo
1090 1090
 
1091 1091
                 $rows = DB::query(
1092 1092
                     'SELECT *
1093
-                    FROM ' . prefixTable('items') . '
1093
+                    FROM ' . prefixTable('items').'
1094 1094
                     WHERE id_tree = %i',
1095 1095
                     $nodeInfo->id
1096 1096
                 );
@@ -1099,7 +1099,7 @@  discard block
 block discarded – undo
1099 1099
                     // if it is then don't copy it
1100 1100
                     $item_deleted = DB::queryFirstRow(
1101 1101
                         'SELECT *
1102
-                        FROM ' . prefixTable('log_items') . '
1102
+                        FROM ' . prefixTable('log_items').'
1103 1103
                         WHERE id_item = %i AND action = %s
1104 1104
                         ORDER BY date DESC
1105 1105
                         LIMIT 0, 1',
@@ -1110,7 +1110,7 @@  discard block
 block discarded – undo
1110 1110
 
1111 1111
                     $item_restored = DB::queryFirstRow(
1112 1112
                         'SELECT *
1113
-                        FROM ' . prefixTable('log_items') . '
1113
+                        FROM ' . prefixTable('log_items').'
1114 1114
                         WHERE id_item = %i AND action = %s
1115 1115
                         ORDER BY date DESC
1116 1116
                         LIMIT 0, 1',
@@ -1125,7 +1125,7 @@  discard block
 block discarded – undo
1125 1125
                         // Get the ITEM object key for the user
1126 1126
                         $userKey = DB::queryFirstRow(
1127 1127
                             'SELECT share_key
1128
-                            FROM ' . prefixTable('sharekeys_items') . '
1128
+                            FROM ' . prefixTable('sharekeys_items').'
1129 1129
                             WHERE user_id = %i AND object_id = %i',
1130 1130
                             $session->get('user-id'),
1131 1131
                             $record['id']
@@ -1287,7 +1287,7 @@  discard block
 block discarded – undo
1287 1287
                     // Get path
1288 1288
                     $text = '';
1289 1289
                     foreach ($tree->getPath($folder->id, false) as $fld) {
1290
-                        $text .= empty($text) === true ? '     [<i>' . $fld->title : ' > ' . $fld->title;
1290
+                        $text .= empty($text) === true ? '     [<i>'.$fld->title : ' > '.$fld->title;
1291 1291
                     }
1292 1292
 
1293 1293
                     // Save array
@@ -1297,7 +1297,7 @@  discard block
 block discarded – undo
1297 1297
                             'id' => (int) $folder->id,
1298 1298
                             'label' => $folder->title,
1299 1299
                             'level' => $folder->nlevel,
1300
-                            'path' => empty($text) === true ? '' : $text . '</i>]'
1300
+                            'path' => empty($text) === true ? '' : $text.'</i>]'
1301 1301
                         )
1302 1302
                     );
1303 1303
                 }
Please login to merge, or discard this patch.
pages/users.js.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('users') === false) {
73 73
     // Not allowed page
74 74
     $session->set('system-error_code', ERR_NOT_ALLOWED);
75
-    include $SETTINGS['cpassman_dir'] . '/error.php';
75
+    include $SETTINGS['cpassman_dir'].'/error.php';
76 76
     exit;
77 77
 }
78 78
 ?>
@@ -325,8 +325,8 @@  discard block
 block discarded – undo
325 325
         if (store.get('teampassApplication').formUserAction === "add_new_user") {
326 326
             var data = {
327 327
                 'receipt': $('#form-email').val(),
328
-                'subject': 'TEAMPASS - <?php echo $lang->get('temporary_encryption_code');?>',
329
-                'body': '<?php echo $lang->get('email_body_new_user');?>',
328
+                'subject': 'TEAMPASS - <?php echo $lang->get('temporary_encryption_code'); ?>',
329
+                'body': '<?php echo $lang->get('email_body_new_user'); ?>',
330 330
                 'pre_replace' : {
331 331
                     '#code#' : store.get('teampassUser').admin_new_user_temporary_encryption_code,
332 332
                     '#login#' : store.get('teampassUser').admin_new_user_login,
@@ -336,8 +336,8 @@  discard block
 block discarded – undo
336 336
         } else {
337 337
             var data = {
338 338
                 'receipt': $('#form-email').val(),
339
-                'subject': 'TEAMPASS - <?php echo $lang->get('temporary_encryption_code');?>',
340
-                'body': '<?php echo $lang->get('email_body_temporary_encryption_code');?>',
339
+                'subject': 'TEAMPASS - <?php echo $lang->get('temporary_encryption_code'); ?>',
340
+                'body': '<?php echo $lang->get('email_body_temporary_encryption_code'); ?>',
341 341
                 'pre_replace' : {
342 342
                     '#enc_code#' : store.get('teampassUser').admin_new_user_temporary_encryption_code,
343 343
                 }
@@ -532,14 +532,14 @@  discard block
 block discarded – undo
532 532
             }
533 533
             // Inform user
534 534
             $("#warningModalBody").html('<b><?php echo $lang->get('encryption_keys'); ?> - ' +
535
-                stepText + '</b> [' + start + ' - ' + (parseInt(start) + <?php echo NUMBER_ITEMS_IN_BATCH;?>) + ']<span id="warningModalBody_extra">' + $nbItemsToConvert + '</span> ' +
535
+                stepText + '</b> [' + start + ' - ' + (parseInt(start) + <?php echo NUMBER_ITEMS_IN_BATCH; ?>) + ']<span id="warningModalBody_extra">' + $nbItemsToConvert + '</span> ' +
536 536
                 '... <?php echo $lang->get('please_wait'); ?><i class="fa-solid fa-spinner fa-pulse ml-3 text-primary"></i>');
537 537
 
538 538
             // If expected, show the OPT to the admin
539 539
             if (constVisibleOTP === true) {
540 540
                 toastr.info(
541
-                    '<?php echo $lang->get('show_encryption_code_to_admin');?> <div><input class="form-control form-item-control flex-nowrap" value="' + userTemporaryCode + '" readonly></div>'
542
-                    + '<br /><button type="button" class="btn clear"><?php echo $lang->get('close');?></button>',
541
+                    '<?php echo $lang->get('show_encryption_code_to_admin'); ?> <div><input class="form-control form-item-control flex-nowrap" value="' + userTemporaryCode + '" readonly></div>'
542
+                    + '<br /><button type="button" class="btn clear"><?php echo $lang->get('close'); ?></button>',
543 543
                     '<?php echo $lang->get('information'); ?>',
544 544
                     {
545 545
                         extendedTimeOut: 0,
@@ -558,7 +558,7 @@  discard block
 block discarded – undo
558 558
             var data = {
559 559
                 action: step,
560 560
                 start: start,
561
-                length: <?php echo NUMBER_ITEMS_IN_BATCH;?>,
561
+                length: <?php echo NUMBER_ITEMS_IN_BATCH; ?>,
562 562
                 user_id: userId,
563 563
             }
564 564
             if (debugJavascript === true) {
@@ -1395,7 +1395,7 @@  discard block
 block discarded – undo
1395 1395
                         } else {
1396 1396
                             // Show icon or not
1397 1397
                             if ($('#user-disabled').prop('checked') === true) {
1398
-                                $('#user-login-'+userID).before('<i class="fa-solid fa-user-slash infotip text-danger mr-2" title="<?php echo $lang->get('account_is_locked');?>" id="user-disable-'+userID+'"></i>');
1398
+                                $('#user-login-'+userID).before('<i class="fa-solid fa-user-slash infotip text-danger mr-2" title="<?php echo $lang->get('account_is_locked'); ?>" id="user-disable-'+userID+'"></i>');
1399 1399
                             } else {
1400 1400
                                 $('#user-disable-'+userID).remove();
1401 1401
                             }
Please login to merge, or discard this patch.
pages/users.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('users') === false) {
70 70
     // Not allowed page
71 71
     $session->set('system-error_code', ERR_NOT_ALLOWED);
72
-    include $SETTINGS['cpassman_dir'] . '/error.php';
72
+    include $SETTINGS['cpassman_dir'].'/error.php';
73 73
     exit;
74 74
 }
75 75
 
@@ -92,24 +92,24 @@  discard block
 block discarded – undo
92 92
 // If administrator then all roles are shown
93 93
 // else only the Roles the users is associated to.
94 94
 if ((int) $session->get('user-admin') === 1) {
95
-    $optionsManagedBy .= '<option value="0">' . $lang->get('administrators_only') . '</option>';
95
+    $optionsManagedBy .= '<option value="0">'.$lang->get('administrators_only').'</option>';
96 96
 }
97 97
 
98 98
 $rows = DB::query(
99 99
     'SELECT id, title, creator_id
100
-    FROM ' . prefixTable('roles_title') . '
100
+    FROM ' . prefixTable('roles_title').'
101 101
     ORDER BY title ASC'
102 102
 );
103 103
 foreach ($rows as $record) {
104 104
     if ((int) $session->get('user-admin') === 1 || in_array($record['id'], $session->get('user-roles_array')) === true) {
105
-        $optionsManagedBy .= '<option value="' . $record['id'] . '">' . $lang->get('managers_of') . ' ' . addslashes($record['title']) . '</option>';
105
+        $optionsManagedBy .= '<option value="'.$record['id'].'">'.$lang->get('managers_of').' '.addslashes($record['title']).'</option>';
106 106
     }
107 107
     if (
108 108
         (int) $session->get('user-admin') === 1
109 109
         || (((int) $session->get('user-manager') === 1 || (int) $session->get('user-can_manage_all_users') === 1)
110 110
             && (in_array($record['id'], $userRoles) === true) || (int) $record['creator_id'] === (int) $session->get('user-id'))
111 111
     ) {
112
-        $optionsRoles .= '<option value="' . $record['id'] . '">' . addslashes($record['title']) . '</option>';
112
+        $optionsRoles .= '<option value="'.$record['id'].'">'.addslashes($record['title']).'</option>';
113 113
     }
114 114
 }
115 115
 
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
         for ($y = 1; $y < $t->nlevel; ++$y) {
125 125
             $ident .= '&nbsp;&nbsp;';
126 126
         }
127
-        $foldersList .= '<option value="' . $t->id . '">' . $ident . htmlspecialchars($t->title, ENT_COMPAT, 'UTF-8') . '</option>';
127
+        $foldersList .= '<option value="'.$t->id.'">'.$ident.htmlspecialchars($t->title, ENT_COMPAT, 'UTF-8').'</option>';
128 128
     }
129 129
 }
130 130
 
@@ -161,13 +161,13 @@  discard block
 block discarded – undo
161 161
                         </button><?php
162 162
                                     echo isset($SETTINGS['ldap_mode']) === true && (int) $SETTINGS['ldap_mode'] === 1 && (int) $session->get('user-admin') === 1 ?
163 163
                                         '<button type="button" class="btn btn-primary btn-sm tp-action mr-2" data-action="ldap-sync">
164
-                            <i class="fa-solid fa-address-card mr-2"></i>' . $lang->get('ldap_synchronization') . '
164
+                            <i class="fa-solid fa-address-card mr-2"></i>' . $lang->get('ldap_synchronization').'
165 165
                         </button>' : '';
166 166
                                     ?>
167 167
                         </button><?php
168 168
                                     echo isset($SETTINGS['oauth2_enabled']) === true && (int) $SETTINGS['oauth2_enabled'] === 1 && (int) $session->get('user-admin') === 1 ?
169 169
                                         '<button type="button" class="btn btn-primary btn-sm tp-action mr-2" data-action="oauth2-sync">
170
-                            <i class="fa-solid fa-plug mr-2"></i>' . $lang->get('oauth2_synchronization') . '
170
+                            <i class="fa-solid fa-plug mr-2"></i>' . $lang->get('oauth2_synchronization').'
171 171
                         </button>' : '';
172 172
                                     ?>
173 173
                     </h3>
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 
176 176
                 <!-- /.card-header -->
177 177
                 <div class="card-body form" id="users-list">
178
-                    <label><input type="checkbox" id="warnings_display" class="tp-action pointer" data-action="refresh"><span class="ml-2 pointer"><?php echo $lang->get('display_warning_icons');?></span></label>
178
+                    <label><input type="checkbox" id="warnings_display" class="tp-action pointer" data-action="refresh"><span class="ml-2 pointer"><?php echo $lang->get('display_warning_icons'); ?></span></label>
179 179
                     <table id="table-users" class="table table-striped nowrap table-responsive-sm">
180 180
                         <thead>
181 181
                             <tr>
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
                                             <?php
240 240
                                             foreach (TP_PW_COMPLEXITY as $entry) {
241 241
                                                 echo '
242
-                                            <option value="' . $entry[0] . '">' . addslashes($entry[1]) . '</option>';
242
+                                            <option value="' . $entry[0].'">'.addslashes($entry[1]).'</option>';
243 243
                                             }
244 244
                                             ?>
245 245
                                         </select>
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
                                             <?php
317 317
                                             foreach (TP_PW_COMPLEXITY as $entry) {
318 318
                                                 echo '
319
-                                            <option value="' . $entry[0] . '">' . addslashes($entry[1]) . '</option>';
319
+                                            <option value="' . $entry[0].'">'.addslashes($entry[1]).'</option>';
320 320
                                             }
321 321
                                             ?>
322 322
                                         </select>
Please login to merge, or discard this patch.
sources/users.datatable.php 1 patch
Spacing   +15 added lines, -17 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 ) {
78 78
     // Not allowed page
79 79
     $session->set('system-error_code', ERR_NOT_ALLOWED);
80
-    include $SETTINGS['cpassman_dir'] . '/error.php';
80
+    include $SETTINGS['cpassman_dir'].'/error.php';
81 81
     exit;
82 82
 }
83 83
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
     if (isset($order['column']) && preg_match('#^(asc|desc)$#i', $order['dir'])) {
129 129
         $columnIndex = filter_var($order['column'], FILTER_SANITIZE_NUMBER_INT);
130 130
         $dir = filter_var($order['dir'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
131
-        $sOrder .= $aColumns[$columnIndex] . ' ' . $dir . ', ';
131
+        $sOrder .= $aColumns[$columnIndex].' '.$dir.', ';
132 132
     }
133 133
 
134 134
     $sOrder = substr_replace($sOrder, '', -2);
@@ -152,15 +152,15 @@  discard block
 block discarded – undo
152 152
 
153 153
 if ($letter !== '' && $letter !== 'None') {
154 154
     $sWhere .= ' AND (';
155
-    $sWhere .= $aColumns[1] . " LIKE '" . $letter . "%' OR ";
156
-    $sWhere .= $aColumns[2] . " LIKE '" . $letter . "%' OR ";
157
-    $sWhere .= $aColumns[3] . " LIKE '" . $letter . "%' ";
155
+    $sWhere .= $aColumns[1]." LIKE '".$letter."%' OR ";
156
+    $sWhere .= $aColumns[2]." LIKE '".$letter."%' OR ";
157
+    $sWhere .= $aColumns[3]." LIKE '".$letter."%' ";
158 158
     $sWhere .= ')';
159 159
 } elseif ($searchValue !== '') {
160 160
     $sWhere .= ' AND (';
161
-    $sWhere .= $aColumns[1] . " LIKE '" . $searchValue . "%' OR ";
162
-    $sWhere .= $aColumns[2] . " LIKE '" . $searchValue . "%' OR ";
163
-    $sWhere .= $aColumns[3] . " LIKE '" . $searchValue . "%' ";
161
+    $sWhere .= $aColumns[1]." LIKE '".$searchValue."%' OR ";
162
+    $sWhere .= $aColumns[2]." LIKE '".$searchValue."%' OR ";
163
+    $sWhere .= $aColumns[3]." LIKE '".$searchValue."%' ";
164 164
     $sWhere .= ')';
165 165
 }
166 166
 
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
         // Check for existing lock
247 247
         $unlock_at = DB::queryFirstField(
248 248
             'SELECT MAX(unlock_at)
249
-             FROM ' . prefixTable('auth_failures') . '
249
+             FROM ' . prefixTable('auth_failures').'
250 250
              WHERE unlock_at > %s AND source = %s AND value = %s',
251 251
             date('Y-m-d H:i:s', time()),
252 252
             'login',
@@ -255,33 +255,31 @@  discard block
 block discarded – undo
255 255
 
256 256
         // Get some infos about user
257 257
         $userDisplayInfos = 
258
-            (isset($userDate['date']) ? '<i class=\"fas fa-calendar-day infotip text-info ml-2\" title=\"'.$lang->get('creation_date').': '.date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $userDate['date']).'\"></i>' : '')
258
+            (isset($userDate['date']) ? '<i class=\"fas fa-calendar-day infotip text-info ml-2\" title=\"'.$lang->get('creation_date').': '.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $userDate['date']).'\"></i>' : '')
259 259
             .
260 260
             ((int) $record['last_connexion'] > 0 ? '<i class=\"far fa-clock infotip text-info ml-2\" title=\"'.$lang->get('index_last_seen').": ".
261
-            date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['last_connexion']).'\"></i>' : '')
261
+            date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['last_connexion']).'\"></i>' : '')
262 262
             .
263 263
             ((int) $record['user_ip'] > 0 ? '<i class=\"fas fa-street-view infotip text-info ml-1\" title=\"'.$lang->get('ip').": ".($record['user_ip']).'\"></i>' : '')
264 264
             .
265 265
             (($record['auth_type'] === 'ldap' || $record['auth_type'] === 'oauth2') ? '<i class=\"far fa-address-book infotip text-warning ml-1\" title=\"'.$lang->get('managed_through_ad').'\"></i>' : '')
266 266
             .
267 267
             ((in_array($record['id'], [OTV_USER_ID, TP_USER_ID, SSH_USER_ID, API_USER_ID]) === false && (int) $record['admin'] !== 1 && ((int) $SETTINGS['duo'] === 1 || (int) $SETTINGS['google_authentication'] === 1)) ?
268
-                ((int) $record['mfa_enabled'] === 1 ? '' : '<i class=\"fa-solid fa-fingerprint infotip ml-1\" style=\"color:Tomato\" title=\"'.$lang->get('mfa_disabled_for_user').'\"></i>') :
269
-                ''
268
+                ((int) $record['mfa_enabled'] === 1 ? '' : '<i class=\"fa-solid fa-fingerprint infotip ml-1\" style=\"color:Tomato\" title=\"'.$lang->get('mfa_disabled_for_user').'\"></i>') : ''
270 269
                 )
271 270
             .
272 271
             (($unlock_at) ? '<i class=\"fas fa-solid text-red fa-lock infotip text-info ml-1\" title=\"'.$lang->get('bruteforce_unlock_at').$unlock_at.'\"></i>' : '');
273 272
         if ($request->query->filter('display_warnings', '', FILTER_VALIDATE_BOOLEAN) === true) {
274 273
             $userDisplayInfos .= '<br>'.
275 274
                 ((in_array($record['id'], [OTV_USER_ID, TP_USER_ID, SSH_USER_ID, API_USER_ID]) === false && (int) $record['admin'] !== 1 && is_null($record['keys_recovery_time']) === true) ? 
276
-                    '<i class=\"fa-solid fa-download infotip ml-1\" style=\"color:Tomato\" title=\"'.$lang->get('recovery_keys_not_downloaded').'\"></i>' :
277
-                    ''
275
+                    '<i class=\"fa-solid fa-download infotip ml-1\" style=\"color:Tomato\" title=\"'.$lang->get('recovery_keys_not_downloaded').'\"></i>' : ''
278 276
                 ).
279 277
                 ((in_array($record['id'], [OTV_USER_ID, TP_USER_ID, SSH_USER_ID, API_USER_ID]) === false && (int) $record['pw_passwordlib'] === 1) ? '<i class=\"fa-solid fa-person-walking-luggage infotip ml-1\" style=\"color:Tomato\" title=\"Old password encryption. Shall login to initialize.\"></i>' : '');
280 278
         }
281 279
 
282 280
         $sOutput .= '["<span data-id=\"'.$record['id'].'\" data-fullname=\"'.
283
-            (empty($record['name']) === false ? htmlentities($record['name'], ENT_QUOTES|ENT_SUBSTITUTE|ENT_DISALLOWED) : '').' '.
284
-            (empty($record['lastname']) === false ? htmlentities($record['lastname'], ENT_QUOTES|ENT_SUBSTITUTE|ENT_DISALLOWED) : '').
281
+            (empty($record['name']) === false ? htmlentities($record['name'], ENT_QUOTES | ENT_SUBSTITUTE | ENT_DISALLOWED) : '').' '.
282
+            (empty($record['lastname']) === false ? htmlentities($record['lastname'], ENT_QUOTES | ENT_SUBSTITUTE | ENT_DISALLOWED) : '').
285 283
             '\" data-auth-type=\"'.$record['auth_type'].'\" data-special=\"'.$record['special'].'\" data-mfa-enabled=\"'.$record['mfa_enabled'].'\" data-otp-provided=\"'.(isset($record['otp_provided']) === true ? $record['otp_provided'] : '').'\"></span>", ';
286 284
         //col2
287 285
         $sOutput .= '"'.
Please login to merge, or discard this patch.
pages/oauth.js.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
 if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('oauth') === false) {
72 72
     // Not allowed page
73 73
     $session->set('system-error_code', ERR_NOT_ALLOWED);
74
-    include $SETTINGS['cpassman_dir'] . '/error.php';
74
+    include $SETTINGS['cpassman_dir'].'/error.php';
75 75
     exit;
76 76
 }
77 77
 ?>
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
                     if (data[i].selected_role === 1) {
227 227
                         selected_role = data[i].id;
228 228
                     }
229
-                    html_admin_by += '<option value="' + data[i].id + '"><?php echo $lang->get('managers_of') . ' '; ?>' + data[i].title + '</option>';
229
+                    html_admin_by += '<option value="' + data[i].id + '"><?php echo $lang->get('managers_of').' '; ?>' + data[i].title + '</option>';
230 230
                     html_roles += '<option value="' + data[i].id + '">' + data[i].title + '</option>';
231 231
                 }
232 232
                 $('#oauth_new_user_is_administrated_by')
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
             }).fail(function(error) {
256 256
                 toastr.remove();
257 257
                 toastr.error(
258
-                    '<?php echo $lang->get('server_answer_error') . '<br />' . $lang->get('server_returned_data') . ':<br />'; ?>' + error,
258
+                    '<?php echo $lang->get('server_answer_error').'<br />'.$lang->get('server_returned_data').':<br />'; ?>' + error,
259 259
                     '', {
260 260
                         closeButton: true,
261 261
                         positionClass: 'toast-bottom-right'
Please login to merge, or discard this patch.
pages/admin.js.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('admin') === false) {
69 69
     // Not allowed page
70 70
     $session->set('system-error_code', ERR_NOT_ALLOWED);
71
-    include $SETTINGS['cpassman_dir'] . '/error.php';
71
+    include $SETTINGS['cpassman_dir'].'/error.php';
72 72
     exit;
73 73
 }
74 74
 
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
                     // error
170 170
                     toastr.remove();
171 171
                     toastr.error(
172
-                        '<?php echo $lang->get('server_answer_error') . '<br />' . $lang->get('server_returned_data') . ':<br />'; ?>' + data.error,
172
+                        '<?php echo $lang->get('server_answer_error').'<br />'.$lang->get('server_returned_data').':<br />'; ?>' + data.error,
173 173
                         '', {
174 174
                             closeButton: true,
175 175
                             positionClass: 'toast-bottom-right'
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
                     // error
249 249
                     toastr.remove();
250 250
                     toastr.error(
251
-                        '<?php echo $lang->get('server_answer_error') . '<br />' . $lang->get('server_returned_data') . ':<br />'; ?>' + data.error,
251
+                        '<?php echo $lang->get('server_answer_error').'<br />'.$lang->get('server_returned_data').':<br />'; ?>' + data.error,
252 252
                         '', {
253 253
                             closeButton: true,
254 254
                             positionClass: 'toast-bottom-right'
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
                     // error
311 311
                     toastr.remove();
312 312
                     toastr.error(
313
-                        '<?php echo $lang->get('server_answer_error') . '<br />' . $lang->get('server_returned_data') . ':<br />'; ?>' + data.error,
313
+                        '<?php echo $lang->get('server_answer_error').'<br />'.$lang->get('server_returned_data').':<br />'; ?>' + data.error,
314 314
                         '', {
315 315
                             closeButton: true,
316 316
                             positionClass: 'toast-bottom-right'
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
                     // error
405 405
                     toastr.remove();
406 406
                     toastr.error(
407
-                        '<?php echo $lang->get('server_answer_error') . '<br />' . $lang->get('server_returned_data') . ':<br />'; ?>' + data.error,
407
+                        '<?php echo $lang->get('server_answer_error').'<br />'.$lang->get('server_returned_data').':<br />'; ?>' + data.error,
408 408
                         '', {
409 409
                             closeButton: true,
410 410
                             positionClass: 'toast-bottom-right'
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
                     
434 434
                     //const className = result.success ? 'success' : 'error';
435 435
                     const icon = result.success ? '<i class="fa-solid fa-check text-success mr-1"></i>' : '<i class="fa-solid fa-xmark text-danger mr-1"></i>';
436
-                    const message = result.success ? '<?php echo $lang->get('server_returned_data');?>' : 'Error: ' + result.error;
436
+                    const message = result.success ? '<?php echo $lang->get('server_returned_data'); ?>' : 'Error: ' + result.error;
437 437
                     
438 438
                     output += '<li>' + icon + '<b>' + file + '</b><br/>' + message + '</li>';
439 439
                 });
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
                     // error
465 465
                     toastr.remove();
466 466
                     toastr.error(
467
-                        '<?php echo $lang->get('server_answer_error') . '<br />' . $lang->get('server_returned_data') . ':<br />'; ?>' + data.error,
467
+                        '<?php echo $lang->get('server_answer_error').'<br />'.$lang->get('server_returned_data').':<br />'; ?>' + data.error,
468 468
                         '', {
469 469
                             closeButton: true,
470 470
                             positionClass: 'toast-bottom-right'
Please login to merge, or discard this patch.
pages/items.js.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('items') === false) {
73 73
     // Not allowed page
74 74
     $session->set('system-error_code', ERR_NOT_ALLOWED);
75
-    include $SETTINGS['cpassman_dir'] . '/error.php';
75
+    include $SETTINGS['cpassman_dir'].'/error.php';
76 76
     exit;
77 77
 }
78 78
 
@@ -1056,7 +1056,7 @@  discard block
 block discarded – undo
1056 1056
             //
1057 1057
         } else if ($(this).data('item-action') === 'link') {
1058 1058
             // Add link to clipboard.
1059
-            navigator.clipboard.writeText("<?php echo $SETTINGS['cpassman_url'];?>/index.php?page=items&group="+store.get('teampassItem').folderId+"&id="+store.get('teampassItem').id);
1059
+            navigator.clipboard.writeText("<?php echo $SETTINGS['cpassman_url']; ?>/index.php?page=items&group="+store.get('teampassItem').folderId+"&id="+store.get('teampassItem').id);
1060 1060
 
1061 1061
             // Display message.
1062 1062
             toastr.remove();
@@ -2698,7 +2698,7 @@  discard block
 block discarded – undo
2698 2698
                 progress: "#form-item-password-strength",
2699 2699
                 score: "#form-item-password-strength"
2700 2700
             },
2701
-            scores: [<?php echo TP_PW_STRENGTH_1;?>, <?php echo TP_PW_STRENGTH_2;?>, <?php echo TP_PW_STRENGTH_3;?>, <?php echo TP_PW_STRENGTH_4;?>, <?php echo TP_PW_STRENGTH_5;?>],
2701
+            scores: [<?php echo TP_PW_STRENGTH_1; ?>, <?php echo TP_PW_STRENGTH_2; ?>, <?php echo TP_PW_STRENGTH_3; ?>, <?php echo TP_PW_STRENGTH_4; ?>, <?php echo TP_PW_STRENGTH_5; ?>],
2702 2702
         },
2703 2703
         i18n : {
2704 2704
             t: function (key) {
@@ -2725,7 +2725,7 @@  discard block
 block discarded – undo
2725 2725
     <?php
2726 2726
     $max_file_size = '';
2727 2727
     if (strrpos($SETTINGS['upload_maxfilesize'], 'mb') === false) {
2728
-        $max_file_size = $SETTINGS['upload_maxfilesize'] . 'mb';
2728
+        $max_file_size = $SETTINGS['upload_maxfilesize'].'mb';
2729 2729
     } else {
2730 2730
         $max_file_size = $SETTINGS['upload_maxfilesize'];
2731 2731
     }
@@ -4647,7 +4647,7 @@  discard block
 block discarded – undo
4647 4647
                         (retData.edition_locked_delay === null ? 
4648 4648
                         '' 
4649 4649
                         :
4650
-                        ' : ' + retData.edition_locked_delay + ' <?php echo $lang->get('seconds');?>'),
4650
+                        ' : ' + retData.edition_locked_delay + ' <?php echo $lang->get('seconds'); ?>'),
4651 4651
                     '', {
4652 4652
                         timeOut: 5000,
4653 4653
                         progressBar: true
@@ -4804,7 +4804,7 @@  discard block
 block discarded – undo
4804 4804
 
4805 4805
                             // Show passwords inputs and form
4806 4806
                             $('#dialog-ldap-user-change-password-info')
4807
-                                .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('ldap_user_has_changed_his_password');?>')
4807
+                                .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('ldap_user_has_changed_his_password'); ?>')
4808 4808
                                 .removeClass('hidden');
4809 4809
                             $('#dialog-ldap-user-change-password').removeClass('hidden');
4810 4810
                         } else if (data.error_type !== 'undefined') {
@@ -4823,7 +4823,7 @@  discard block
 block discarded – undo
4823 4823
 
4824 4824
                                 // Show passwords inputs and form
4825 4825
                                 $('#dialog-ldap-user-change-password-info')
4826
-                                    .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('ldap_user_has_changed_his_password');?>')
4826
+                                    .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('ldap_user_has_changed_his_password'); ?>')
4827 4827
                                     .removeClass('hidden');
4828 4828
                                 $('#dialog-ldap-user-change-password').removeClass('hidden');
4829 4829
                             });
Please login to merge, or discard this patch.