Passed
Push — teampass_3.0 ( 9ad4f0...66a471 )
by Nils
05:09
created
sources/main.functions.php 1 patch
Spacing   +217 added lines, -217 removed lines patch added patch discarded remove patch
@@ -119,24 +119,24 @@  discard block
 block discarded – undo
119 119
  */
120 120
 function cryption(string $message, string $ascii_key, string $type, array $SETTINGS): array
121 121
 {
122
-    $ascii_key = empty($ascii_key) === true ? file_get_contents(SECUREPATH . '/teampass-seckey.txt') : $ascii_key;
122
+    $ascii_key = empty($ascii_key) === true ? file_get_contents(SECUREPATH.'/teampass-seckey.txt') : $ascii_key;
123 123
     $err = false;
124 124
     // load PhpEncryption library
125 125
     if (isset($SETTINGS['cpassman_dir']) === false || empty($SETTINGS['cpassman_dir']) === true) {
126 126
         $path = '../includes/libraries/Encryption/Encryption/';
127 127
     } else {
128
-        $path = $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/Encryption/';
129
-    }
130
-
131
-    include_once $path . 'Crypto.php';
132
-    include_once $path . 'Encoding.php';
133
-    include_once $path . 'DerivedKeys.php';
134
-    include_once $path . 'Key.php';
135
-    include_once $path . 'KeyOrPassword.php';
136
-    include_once $path . 'File.php';
137
-    include_once $path . 'RuntimeTests.php';
138
-    include_once $path . 'KeyProtectedByPassword.php';
139
-    include_once $path . 'Core.php';
128
+        $path = $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/';
129
+    }
130
+
131
+    include_once $path.'Crypto.php';
132
+    include_once $path.'Encoding.php';
133
+    include_once $path.'DerivedKeys.php';
134
+    include_once $path.'Key.php';
135
+    include_once $path.'KeyOrPassword.php';
136
+    include_once $path.'File.php';
137
+    include_once $path.'RuntimeTests.php';
138
+    include_once $path.'KeyProtectedByPassword.php';
139
+    include_once $path.'Core.php';
140 140
     // convert KEY
141 141
     $key = \Defuse\Crypto\Key::loadFromAsciiSafeString($ascii_key);
142 142
     try {
@@ -180,15 +180,15 @@  discard block
 block discarded – undo
180 180
         $path = '../includes/libraries/Encryption/Encryption/';
181 181
     }
182 182
 
183
-    include_once $path . 'Crypto.php';
184
-    include_once $path . 'Encoding.php';
185
-    include_once $path . 'DerivedKeys.php';
186
-    include_once $path . 'Key.php';
187
-    include_once $path . 'KeyOrPassword.php';
188
-    include_once $path . 'File.php';
189
-    include_once $path . 'RuntimeTests.php';
190
-    include_once $path . 'KeyProtectedByPassword.php';
191
-    include_once $path . 'Core.php';
183
+    include_once $path.'Crypto.php';
184
+    include_once $path.'Encoding.php';
185
+    include_once $path.'DerivedKeys.php';
186
+    include_once $path.'Key.php';
187
+    include_once $path.'KeyOrPassword.php';
188
+    include_once $path.'File.php';
189
+    include_once $path.'RuntimeTests.php';
190
+    include_once $path.'KeyProtectedByPassword.php';
191
+    include_once $path.'Core.php';
192 192
     $key = \Defuse\Crypto\Key::createNewRandomKey();
193 193
     $key = $key->saveToAsciiSafeString();
194 194
     return $key;
@@ -210,15 +210,15 @@  discard block
 block discarded – undo
210 210
         $path = '../includes/libraries/Encryption/Encryption/';
211 211
     }
212 212
 
213
-    include_once $path . 'Crypto.php';
214
-    include_once $path . 'Encoding.php';
215
-    include_once $path . 'DerivedKeys.php';
216
-    include_once $path . 'Key.php';
217
-    include_once $path . 'KeyOrPassword.php';
218
-    include_once $path . 'File.php';
219
-    include_once $path . 'RuntimeTests.php';
220
-    include_once $path . 'KeyProtectedByPassword.php';
221
-    include_once $path . 'Core.php';
213
+    include_once $path.'Crypto.php';
214
+    include_once $path.'Encoding.php';
215
+    include_once $path.'DerivedKeys.php';
216
+    include_once $path.'Key.php';
217
+    include_once $path.'KeyOrPassword.php';
218
+    include_once $path.'File.php';
219
+    include_once $path.'RuntimeTests.php';
220
+    include_once $path.'KeyProtectedByPassword.php';
221
+    include_once $path.'Core.php';
222 222
     $protected_key = \Defuse\Crypto\KeyProtectedByPassword::createRandomPasswordProtectedKey($psk);
223 223
     return $protected_key->saveToAsciiSafeString(); // save this in user table
224 224
 }
@@ -240,15 +240,15 @@  discard block
 block discarded – undo
240 240
         $path = '../includes/libraries/Encryption/Encryption/';
241 241
     }
242 242
 
243
-    include_once $path . 'Crypto.php';
244
-    include_once $path . 'Encoding.php';
245
-    include_once $path . 'DerivedKeys.php';
246
-    include_once $path . 'Key.php';
247
-    include_once $path . 'KeyOrPassword.php';
248
-    include_once $path . 'File.php';
249
-    include_once $path . 'RuntimeTests.php';
250
-    include_once $path . 'KeyProtectedByPassword.php';
251
-    include_once $path . 'Core.php';
243
+    include_once $path.'Crypto.php';
244
+    include_once $path.'Encoding.php';
245
+    include_once $path.'DerivedKeys.php';
246
+    include_once $path.'Key.php';
247
+    include_once $path.'KeyOrPassword.php';
248
+    include_once $path.'File.php';
249
+    include_once $path.'RuntimeTests.php';
250
+    include_once $path.'KeyProtectedByPassword.php';
251
+    include_once $path.'Core.php';
252 252
     try {
253 253
         $protected_key = \Defuse\Crypto\KeyProtectedByPassword::loadFromAsciiSafeString($protected_key_encoded);
254 254
         $user_key = $protected_key->unlockKey($psk);
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
  */
288 288
 function trimElement($chaine, string $element): string
289 289
 {
290
-    if (! empty($chaine)) {
290
+    if (!empty($chaine)) {
291 291
         if (is_array($chaine) === true) {
292 292
             $chaine = implode(';', $chaine);
293 293
         }
@@ -333,8 +333,8 @@  discard block
 block discarded – undo
333 333
  */
334 334
 function db_error_handler(array $params): void
335 335
 {
336
-    echo 'Error: ' . $params['error'] . "<br>\n";
337
-    echo 'Query: ' . $params['query'] . "<br>\n";
336
+    echo 'Error: '.$params['error']."<br>\n";
337
+    echo 'Query: '.$params['query']."<br>\n";
338 338
     throw new Exception('Error - Query', 1);
339 339
 }
340 340
 
@@ -356,12 +356,12 @@  discard block
 block discarded – undo
356 356
     $SETTINGS
357 357
 ) {
358 358
     //load ClassLoader
359
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
359
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
360 360
     // Load superglobal
361
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
361
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
362 362
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
363 363
     //Connect to DB
364
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
364
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
365 365
     if (defined('DB_PASSWD_CLEAR') === false) {
366 366
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
367 367
     }
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
     DB::$port = DB_PORT;
373 373
     DB::$encoding = DB_ENCODING;
374 374
     //Build tree
375
-    $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries');
375
+    $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries');
376 376
     $tree->register();
377 377
     $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title');
378 378
     // Check if user is ADMINISTRATOR
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
 function identAdmin($idFonctions, $SETTINGS, $tree)
416 416
 {
417 417
     // Load superglobal
418
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
418
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
419 419
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
420 420
     // Init
421 421
     $groupesVisibles = [];
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
     $globalsVisibleFolders = $superGlobal->get('groupes_visibles', 'SESSION');
435 435
     $globalsPersonalVisibleFolders = $superGlobal->get('personal_visible_groups', 'SESSION');
436 436
     // Get list of Folders
437
-    $rows = DB::query('SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE personal_folder = %i', 0);
437
+    $rows = DB::query('SELECT id FROM '.prefixTable('nested_tree').' WHERE personal_folder = %i', 0);
438 438
     foreach ($rows as $record) {
439 439
         array_push($groupesVisibles, $record['id']);
440 440
     }
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
     }
454 454
     // Get ID of personal folder
455 455
     $persfld = DB::queryfirstrow(
456
-        'SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE title = %s',
456
+        'SELECT id FROM '.prefixTable('nested_tree').' WHERE title = %s',
457 457
         $globalsUserId
458 458
     );
459 459
     if (empty($persfld['id']) === false) {
@@ -474,20 +474,20 @@  discard block
 block discarded – undo
474 474
     // get complete list of ROLES
475 475
     $tmp = explode(';', $idFonctions);
476 476
     $rows = DB::query(
477
-        'SELECT * FROM ' . prefixTable('roles_title') . '
477
+        'SELECT * FROM '.prefixTable('roles_title').'
478 478
         ORDER BY title ASC'
479 479
     );
480 480
     foreach ($rows as $record) {
481
-        if (! empty($record['id']) && ! in_array($record['id'], $tmp)) {
481
+        if (!empty($record['id']) && !in_array($record['id'], $tmp)) {
482 482
             array_push($tmp, $record['id']);
483 483
         }
484 484
     }
485 485
     $superGlobal->put('fonction_id', implode(';', $tmp), 'SESSION');
486 486
     $superGlobal->put('is_admin', 1, 'SESSION');
487 487
     // Check if admin has created Folders and Roles
488
-    DB::query('SELECT * FROM ' . prefixTable('nested_tree') . '');
488
+    DB::query('SELECT * FROM '.prefixTable('nested_tree').'');
489 489
     $superGlobal->put('nb_folders', DB::count(), 'SESSION');
490
-    DB::query('SELECT * FROM ' . prefixTable('roles_title'));
490
+    DB::query('SELECT * FROM '.prefixTable('roles_title'));
491 491
     $superGlobal->put('nb_roles', DB::count(), 'SESSION');
492 492
 }
493 493
 
@@ -529,7 +529,7 @@  discard block
 block discarded – undo
529 529
     object $tree
530 530
 ) {
531 531
     // Load superglobal
532
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
532
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
533 533
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
534 534
     // Init
535 535
     $superGlobal->put('groupes_visibles', [], 'SESSION');
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
     // Get list of folders depending on Roles
558 558
     $rows = DB::query(
559 559
         'SELECT *
560
-        FROM ' . prefixTable('roles_values') . '
560
+        FROM ' . prefixTable('roles_values').'
561 561
         WHERE role_id IN %li AND type IN %ls',
562 562
         $userRoles,
563 563
         ['W', 'ND', 'NE', 'NDNE', 'R']
@@ -582,9 +582,9 @@  discard block
 block discarded – undo
582 582
     // Does this user is allowed to see other items
583 583
     $inc = 0;
584 584
     $rows = DB::query(
585
-        'SELECT id, id_tree FROM ' . prefixTable('items') . '
585
+        'SELECT id, id_tree FROM '.prefixTable('items').'
586 586
             WHERE restricted_to LIKE %ss AND inactif = %s',
587
-        $globalsUserId . ';',
587
+        $globalsUserId.';',
588 588
         '0'
589 589
     );
590 590
     foreach ($rows as $record) {
@@ -598,8 +598,8 @@  discard block
 block discarded – undo
598 598
     // Check for the users roles if some specific rights exist on items
599 599
     $rows = DB::query(
600 600
         'SELECT i.id_tree, r.item_id
601
-        FROM ' . prefixTable('items') . ' as i
602
-        INNER JOIN ' . prefixTable('restriction_to_roles') . ' as r ON (r.item_id=i.id)
601
+        FROM ' . prefixTable('items').' as i
602
+        INNER JOIN ' . prefixTable('restriction_to_roles').' as r ON (r.item_id=i.id)
603 603
         WHERE r.role_id IN %li
604 604
         ORDER BY i.id_tree ASC',
605 605
         $userRoles
@@ -620,7 +620,7 @@  discard block
 block discarded – undo
620 620
     ) {
621 621
         $persoFld = DB::queryfirstrow(
622 622
             'SELECT id
623
-            FROM ' . prefixTable('nested_tree') . '
623
+            FROM ' . prefixTable('nested_tree').'
624 624
             WHERE title = %s AND personal_folder = %i',
625 625
             $globalsUserId,
626 626
             1
@@ -653,7 +653,7 @@  discard block
 block discarded – undo
653 653
     }
654 654
     $persoFlds = DB::query(
655 655
         'SELECT id
656
-        FROM ' . prefixTable('nested_tree') . '
656
+        FROM ' . prefixTable('nested_tree').'
657 657
         WHERE %l',
658 658
         $where
659 659
     );
@@ -694,16 +694,16 @@  discard block
 block discarded – undo
694 694
         'SESSION'
695 695
     );
696 696
     // Folders and Roles numbers
697
-    DB::queryfirstrow('SELECT id FROM ' . prefixTable('nested_tree') . '');
697
+    DB::queryfirstrow('SELECT id FROM '.prefixTable('nested_tree').'');
698 698
     $superGlobal->put('nb_folders', DB::count(), 'SESSION');
699
-    DB::queryfirstrow('SELECT id FROM ' . prefixTable('roles_title'));
699
+    DB::queryfirstrow('SELECT id FROM '.prefixTable('roles_title'));
700 700
     $superGlobal->put('nb_roles', DB::count(), 'SESSION');
701 701
     // check if change proposals on User's items
702 702
     if (isset($SETTINGS['enable_suggestion']) === true && (int) $SETTINGS['enable_suggestion'] === 1) {
703 703
         DB::query(
704 704
             'SELECT *
705
-            FROM ' . prefixTable('items_change') . ' AS c
706
-            LEFT JOIN ' . prefixTable('log_items') . ' AS i ON (c.item_id = i.id_item)
705
+            FROM ' . prefixTable('items_change').' AS c
706
+            LEFT JOIN ' . prefixTable('log_items').' AS i ON (c.item_id = i.id_item)
707 707
             WHERE i.action = %s AND i.id_user = %i',
708 708
             'at_creation',
709 709
             $globalsUserId
@@ -747,9 +747,9 @@  discard block
 block discarded – undo
747 747
  */
748 748
 function cacheTableRefresh(array $SETTINGS): void
749 749
 {
750
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
750
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
751 751
     //Connect to DB
752
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
752
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
753 753
     if (defined('DB_PASSWD_CLEAR') === false) {
754 754
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
755 755
     }
@@ -764,12 +764,12 @@  discard block
 block discarded – undo
764 764
     $tree->register();
765 765
     $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title');
766 766
     // truncate table
767
-    DB::query('TRUNCATE TABLE ' . prefixTable('cache'));
767
+    DB::query('TRUNCATE TABLE '.prefixTable('cache'));
768 768
     // reload date
769 769
     $rows = DB::query(
770 770
         'SELECT *
771
-        FROM ' . prefixTable('items') . ' as i
772
-        INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id)
771
+        FROM ' . prefixTable('items').' as i
772
+        INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id)
773 773
         AND l.action = %s
774 774
         AND i.inactif = %i',
775 775
         'at_creation',
@@ -781,18 +781,18 @@  discard block
 block discarded – undo
781 781
             $tags = '';
782 782
             $itemTags = DB::query(
783 783
                 'SELECT tag
784
-                            FROM ' . prefixTable('tags') . '
784
+                            FROM ' . prefixTable('tags').'
785 785
                             WHERE item_id = %i AND tag != ""',
786 786
                 $record['id']
787 787
             );
788 788
             foreach ($itemTags as $itemTag) {
789
-                $tags .= $itemTag['tag'] . ' ';
789
+                $tags .= $itemTag['tag'].' ';
790 790
             }
791 791
 
792 792
             // Get renewal period
793 793
             $resNT = DB::queryfirstrow(
794 794
                 'SELECT renewal_period
795
-                FROM ' . prefixTable('nested_tree') . '
795
+                FROM ' . prefixTable('nested_tree').'
796 796
                 WHERE id = %i',
797 797
                 $record['id_tree']
798 798
             );
@@ -805,7 +805,7 @@  discard block
 block discarded – undo
805 805
                     // Is this a User id?
806 806
                     $user = DB::queryfirstrow(
807 807
                         'SELECT id, login
808
-                        FROM ' . prefixTable('users') . '
808
+                        FROM ' . prefixTable('users').'
809 809
                         WHERE id = %i',
810 810
                         $elem->title
811 811
                     );
@@ -823,11 +823,11 @@  discard block
 block discarded – undo
823 823
                     'id' => $record['id'],
824 824
                     'label' => $record['label'],
825 825
                     'description' => $record['description'] ?? '',
826
-                    'url' => isset($record['url']) && ! empty($record['url']) ? $record['url'] : '0',
826
+                    'url' => isset($record['url']) && !empty($record['url']) ? $record['url'] : '0',
827 827
                     'tags' => $tags,
828 828
                     'id_tree' => $record['id_tree'],
829 829
                     'perso' => $record['perso'],
830
-                    'restricted_to' => isset($record['restricted_to']) && ! empty($record['restricted_to']) ? $record['restricted_to'] : '0',
830
+                    'restricted_to' => isset($record['restricted_to']) && !empty($record['restricted_to']) ? $record['restricted_to'] : '0',
831 831
                     'login' => $record['login'] ?? '',
832 832
                     'folder' => implode(' > ', $folder),
833 833
                     'author' => $record['id_user'],
@@ -847,12 +847,12 @@  discard block
 block discarded – undo
847 847
  */
848 848
 function cacheTableUpdate(array $SETTINGS, ?int $ident = null): void
849 849
 {
850
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
850
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
851 851
     // Load superglobal
852
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
852
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
853 853
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
854 854
     //Connect to DB
855
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
855
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
856 856
     if (defined('DB_PASSWD_CLEAR') === false) {
857 857
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
858 858
     }
@@ -869,7 +869,7 @@  discard block
 block discarded – undo
869 869
     // get new value from db
870 870
     $data = DB::queryfirstrow(
871 871
         'SELECT label, description, id_tree, perso, restricted_to, login, url
872
-        FROM ' . prefixTable('items') . '
872
+        FROM ' . prefixTable('items').'
873 873
         WHERE id=%i',
874 874
         $ident
875 875
     );
@@ -877,12 +877,12 @@  discard block
 block discarded – undo
877 877
     $tags = '';
878 878
     $itemTags = DB::query(
879 879
         'SELECT tag
880
-            FROM ' . prefixTable('tags') . '
880
+            FROM ' . prefixTable('tags').'
881 881
             WHERE item_id = %i AND tag != ""',
882 882
         $ident
883 883
     );
884 884
     foreach ($itemTags as $itemTag) {
885
-        $tags .= $itemTag['tag'] . ' ';
885
+        $tags .= $itemTag['tag'].' ';
886 886
     }
887 887
     // form id_tree to full foldername
888 888
     $folder = [];
@@ -893,7 +893,7 @@  discard block
 block discarded – undo
893 893
             // Is this a User id?
894 894
             $user = DB::queryfirstrow(
895 895
                 'SELECT id, login
896
-                FROM ' . prefixTable('users') . '
896
+                FROM ' . prefixTable('users').'
897 897
                 WHERE id = %i',
898 898
                 $elem->title
899 899
             );
@@ -911,10 +911,10 @@  discard block
 block discarded – undo
911 911
             'label' => $data['label'],
912 912
             'description' => $data['description'],
913 913
             'tags' => $tags,
914
-            'url' => isset($data['url']) && ! empty($data['url']) ? $data['url'] : '0',
914
+            'url' => isset($data['url']) && !empty($data['url']) ? $data['url'] : '0',
915 915
             'id_tree' => $data['id_tree'],
916 916
             'perso' => $data['perso'],
917
-            'restricted_to' => isset($data['restricted_to']) && ! empty($data['restricted_to']) ? $data['restricted_to'] : '0',
917
+            'restricted_to' => isset($data['restricted_to']) && !empty($data['restricted_to']) ? $data['restricted_to'] : '0',
918 918
             'login' => $data['login'] ?? '',
919 919
             'folder' => implode(' » ', $folder),
920 920
             'author' => $superGlobal->get('user_id', 'SESSION'),
@@ -932,14 +932,14 @@  discard block
 block discarded – undo
932 932
  */
933 933
 function cacheTableAdd(array $SETTINGS, ?int $ident = null): void
934 934
 {
935
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
935
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
936 936
     // Load superglobal
937
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
937
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
938 938
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
939 939
     // Get superglobals
940 940
     $globalsUserId = $superGlobal->get('user_id', 'SESSION');
941 941
     //Connect to DB
942
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
942
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
943 943
     if (defined('DB_PASSWD_CLEAR') === false) {
944 944
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
945 945
     }
@@ -956,8 +956,8 @@  discard block
 block discarded – undo
956 956
     // get new value from db
957 957
     $data = DB::queryFirstRow(
958 958
         'SELECT i.label, i.description, i.id_tree as id_tree, i.perso, i.restricted_to, i.id, i.login, i.url, l.date
959
-        FROM ' . prefixTable('items') . ' as i
960
-        INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id)
959
+        FROM ' . prefixTable('items').' as i
960
+        INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id)
961 961
         WHERE i.id = %i
962 962
         AND l.action = %s',
963 963
         $ident,
@@ -967,12 +967,12 @@  discard block
 block discarded – undo
967 967
     $tags = '';
968 968
     $itemTags = DB::query(
969 969
         'SELECT tag
970
-            FROM ' . prefixTable('tags') . '
970
+            FROM ' . prefixTable('tags').'
971 971
             WHERE item_id = %i AND tag != ""',
972 972
         $ident
973 973
     );
974 974
     foreach ($itemTags as $itemTag) {
975
-        $tags .= $itemTag['tag'] . ' ';
975
+        $tags .= $itemTag['tag'].' ';
976 976
     }
977 977
     // form id_tree to full foldername
978 978
     $folder = [];
@@ -983,7 +983,7 @@  discard block
 block discarded – undo
983 983
             // Is this a User id?
984 984
             $user = DB::queryfirstrow(
985 985
                 'SELECT id, login
986
-                FROM ' . prefixTable('users') . '
986
+                FROM ' . prefixTable('users').'
987 987
                 WHERE id = %i',
988 988
                 $elem->title
989 989
             );
@@ -1002,7 +1002,7 @@  discard block
 block discarded – undo
1002 1002
             'label' => $data['label'],
1003 1003
             'description' => $data['description'],
1004 1004
             'tags' => isset($tags) && empty($tags) === false ? $tags : 'None',
1005
-            'url' => isset($data['url']) && ! empty($data['url']) ? $data['url'] : '0',
1005
+            'url' => isset($data['url']) && !empty($data['url']) ? $data['url'] : '0',
1006 1006
             'id_tree' => $data['id_tree'],
1007 1007
             'perso' => isset($data['perso']) && empty($data['perso']) === false && $data['perso'] !== 'None' ? $data['perso'] : '0',
1008 1008
             'restricted_to' => isset($data['restricted_to']) && empty($data['restricted_to']) === false ? $data['restricted_to'] : '0',
@@ -1024,52 +1024,52 @@  discard block
 block discarded – undo
1024 1024
 function getStatisticsData(array $SETTINGS): array
1025 1025
 {
1026 1026
     DB::query(
1027
-        'SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE personal_folder = %i',
1027
+        'SELECT id FROM '.prefixTable('nested_tree').' WHERE personal_folder = %i',
1028 1028
         0
1029 1029
     );
1030 1030
     $counter_folders = DB::count();
1031 1031
     DB::query(
1032
-        'SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE personal_folder = %i',
1032
+        'SELECT id FROM '.prefixTable('nested_tree').' WHERE personal_folder = %i',
1033 1033
         1
1034 1034
     );
1035 1035
     $counter_folders_perso = DB::count();
1036 1036
     DB::query(
1037
-        'SELECT id FROM ' . prefixTable('items') . ' WHERE perso = %i',
1037
+        'SELECT id FROM '.prefixTable('items').' WHERE perso = %i',
1038 1038
         0
1039 1039
     );
1040 1040
     $counter_items = DB::count();
1041 1041
         DB::query(
1042
-        'SELECT id FROM ' . prefixTable('items') . ' WHERE perso = %i',
1042
+        'SELECT id FROM '.prefixTable('items').' WHERE perso = %i',
1043 1043
         1
1044 1044
     );
1045 1045
     $counter_items_perso = DB::count();
1046 1046
         DB::query(
1047
-        'SELECT id FROM ' . prefixTable('users') . ''
1047
+        'SELECT id FROM '.prefixTable('users').''
1048 1048
     );
1049 1049
     $counter_users = DB::count();
1050 1050
         DB::query(
1051
-        'SELECT id FROM ' . prefixTable('users') . ' WHERE admin = %i',
1051
+        'SELECT id FROM '.prefixTable('users').' WHERE admin = %i',
1052 1052
         1
1053 1053
     );
1054 1054
     $admins = DB::count();
1055 1055
     DB::query(
1056
-        'SELECT id FROM ' . prefixTable('users') . ' WHERE gestionnaire = %i',
1056
+        'SELECT id FROM '.prefixTable('users').' WHERE gestionnaire = %i',
1057 1057
         1
1058 1058
     );
1059 1059
     $managers = DB::count();
1060 1060
     DB::query(
1061
-        'SELECT id FROM ' . prefixTable('users') . ' WHERE read_only = %i',
1061
+        'SELECT id FROM '.prefixTable('users').' WHERE read_only = %i',
1062 1062
         1
1063 1063
     );
1064 1064
     $readOnly = DB::count();
1065 1065
     // list the languages
1066 1066
     $usedLang = [];
1067 1067
     $tp_languages = DB::query(
1068
-        'SELECT name FROM ' . prefixTable('languages')
1068
+        'SELECT name FROM '.prefixTable('languages')
1069 1069
     );
1070 1070
     foreach ($tp_languages as $tp_language) {
1071 1071
         DB::query(
1072
-            'SELECT * FROM ' . prefixTable('users') . ' WHERE user_language = %s',
1072
+            'SELECT * FROM '.prefixTable('users').' WHERE user_language = %s',
1073 1073
             $tp_language['name']
1074 1074
         );
1075 1075
         $usedLang[$tp_language['name']] = round((DB::count() * 100 / $counter_users), 0);
@@ -1078,12 +1078,12 @@  discard block
 block discarded – undo
1078 1078
     // get list of ips
1079 1079
     $usedIp = [];
1080 1080
     $tp_ips = DB::query(
1081
-        'SELECT user_ip FROM ' . prefixTable('users')
1081
+        'SELECT user_ip FROM '.prefixTable('users')
1082 1082
     );
1083 1083
     foreach ($tp_ips as $ip) {
1084 1084
         if (array_key_exists($ip['user_ip'], $usedIp)) {
1085 1085
             $usedIp[$ip['user_ip']] += $usedIp[$ip['user_ip']];
1086
-        } elseif (! empty($ip['user_ip']) && $ip['user_ip'] !== 'none') {
1086
+        } elseif (!empty($ip['user_ip']) && $ip['user_ip'] !== 'none') {
1087 1087
             $usedIp[$ip['user_ip']] = 1;
1088 1088
         }
1089 1089
     }
@@ -1149,21 +1149,21 @@  discard block
 block discarded – undo
1149 1149
     }
1150 1150
 
1151 1151
     // Load settings
1152
-    include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
1152
+    include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
1153 1153
     // Load superglobal
1154
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1154
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1155 1155
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
1156 1156
     // Get user language
1157
-    include_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $superGlobal->get('user_language', 'SESSION') . '.php';
1157
+    include_once $SETTINGS['cpassman_dir'].'/includes/language/'.$superGlobal->get('user_language', 'SESSION').'.php';
1158 1158
     // Load library
1159
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
1159
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
1160 1160
     // load PHPMailer
1161 1161
     $mail = new SplClassLoader('PHPMailer\PHPMailer', '../includes/libraries');
1162 1162
     $mail->register();
1163 1163
     $mail = new PHPMailer\PHPMailer\PHPMailer(true);
1164 1164
     try {
1165 1165
         // send to user
1166
-        $mail->setLanguage('en', $SETTINGS['cpassman_dir'] . '/includes/libraries/PHPMailer/PHPMailer/language/');
1166
+        $mail->setLanguage('en', $SETTINGS['cpassman_dir'].'/includes/libraries/PHPMailer/PHPMailer/language/');
1167 1167
         $mail->SMTPDebug = 0;
1168 1168
         //value 1 can be used to debug - 4 for debuging connections
1169 1169
         $mail->Port = $SETTINGS['email_port'];
@@ -1255,7 +1255,7 @@  discard block
 block discarded – undo
1255 1255
         <table width="600" cellpadding="0" cellspacing="0" border="0" class="container" bgcolor="#ffffff" style="border-spacing: 0; border-bottom: 1px solid #e0e0e0; box-shadow: 0 0 3px #ddd; color: #434343; font-family: Helvetica, Verdana, sans-serif;">
1256 1256
         <tr><td class="container-padding" bgcolor="#ffffff" style="border-collapse: collapse; border-left: 1px solid #e0e0e0; background-color: #ffffff; padding-left: 30px; padding-right: 30px;">
1257 1257
         <br><div style="float:right;">' .
1258
-        $textMail .
1258
+        $textMail.
1259 1259
         '<br><br></td></tr></table>
1260 1260
     </td></tr></table>
1261 1261
     <br></body></html>';
@@ -1266,7 +1266,7 @@  discard block
 block discarded – undo
1266 1266
  */
1267 1267
 function generateKey(): string
1268 1268
 {
1269
-    return substr(md5(rand() . rand()), 0, 15);
1269
+    return substr(md5(rand().rand()), 0, 15);
1270 1270
 }
1271 1271
 
1272 1272
 /**
@@ -1337,7 +1337,7 @@  discard block
 block discarded – undo
1337 1337
 {
1338 1338
     array_walk_recursive(
1339 1339
         $array,
1340
-        static function (&$item): void {
1340
+        static function(&$item): void {
1341 1341
             if (mb_detect_encoding((string) $item, 'utf-8', true) === false) {
1342 1342
                 $item = utf8_encode($item);
1343 1343
             }
@@ -1372,7 +1372,7 @@  discard block
 block discarded – undo
1372 1372
     }
1373 1373
 
1374 1374
     // Load superglobal
1375
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1375
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1376 1376
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
1377 1377
     // Get superglobals
1378 1378
     if ($key !== null) {
@@ -1383,9 +1383,9 @@  discard block
 block discarded – undo
1383 1383
     }
1384 1384
 
1385 1385
     //load ClassLoader
1386
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
1386
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
1387 1387
     //Load AES
1388
-    $aes = new SplClassLoader('Encryption\Crypt', $SETTINGS['cpassman_dir'] . '/includes/libraries');
1388
+    $aes = new SplClassLoader('Encryption\Crypt', $SETTINGS['cpassman_dir'].'/includes/libraries');
1389 1389
     $aes->register();
1390 1390
     if ($type === 'encode' && is_array($data) === true) {
1391 1391
         // Ensure UTF8 format
@@ -1472,8 +1472,8 @@  discard block
 block discarded – undo
1472 1472
  */
1473 1473
 function prefixTable(string $table): string
1474 1474
 {
1475
-    $safeTable = htmlspecialchars(DB_PREFIX . $table);
1476
-    if (! empty($safeTable)) {
1475
+    $safeTable = htmlspecialchars(DB_PREFIX.$table);
1476
+    if (!empty($safeTable)) {
1477 1477
         // sanitize string
1478 1478
         return $safeTable;
1479 1479
     }
@@ -1501,13 +1501,13 @@  discard block
 block discarded – undo
1501 1501
     bool $lowercase = false,
1502 1502
     array $SETTINGS = []
1503 1503
 ): string {
1504
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
1505
-    $generator = new SplClassLoader('PasswordGenerator\Generator', $SETTINGS['cpassman_dir'] . '/includes/libraries');
1504
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
1505
+    $generator = new SplClassLoader('PasswordGenerator\Generator', $SETTINGS['cpassman_dir'].'/includes/libraries');
1506 1506
     $generator->register();
1507 1507
     $generator = new PasswordGenerator\Generator\ComputerPasswordGenerator();
1508 1508
     // Is PHP7 being used?
1509 1509
     if (version_compare(PHP_VERSION, '7.0.0', '>=')) {
1510
-        $php7generator = new SplClassLoader('PasswordGenerator\RandomGenerator', $SETTINGS['cpassman_dir'] . '/includes/libraries');
1510
+        $php7generator = new SplClassLoader('PasswordGenerator\RandomGenerator', $SETTINGS['cpassman_dir'].'/includes/libraries');
1511 1511
         $php7generator->register();
1512 1512
         $generator->setRandomGenerator(new PasswordGenerator\RandomGenerator\Php7RandomGenerator());
1513 1513
     }
@@ -1537,7 +1537,7 @@  discard block
 block discarded – undo
1537 1537
 function send_syslog($message, $host, $port, $component = 'teampass'): void
1538 1538
 {
1539 1539
     $sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
1540
-    $syslog_message = '<123>' . date('M d H:i:s ') . $component . ': ' . $message;
1540
+    $syslog_message = '<123>'.date('M d H:i:s ').$component.': '.$message;
1541 1541
     socket_sendto($sock, $syslog_message, strlen($syslog_message), 0, $host, $port);
1542 1542
     socket_close($sock);
1543 1543
 }
@@ -1559,7 +1559,7 @@  discard block
 block discarded – undo
1559 1559
     }
1560 1560
 
1561 1561
     // include librairies & connect to DB
1562
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
1562
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
1563 1563
     if (defined('DB_PASSWD_CLEAR') === false) {
1564 1564
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
1565 1565
     }
@@ -1583,14 +1583,14 @@  discard block
 block discarded – undo
1583 1583
     if (isset($SETTINGS['syslog_enable']) === true && (int) $SETTINGS['syslog_enable'] === 1) {
1584 1584
         if ($type === 'user_mngt') {
1585 1585
             send_syslog(
1586
-                'action=' . str_replace('at_', '', $label) . ' attribute=user user=' . $who . ' userid="' . $login . '" change="' . $field_1 . '" ',
1586
+                'action='.str_replace('at_', '', $label).' attribute=user user='.$who.' userid="'.$login.'" change="'.$field_1.'" ',
1587 1587
                 $SETTINGS['syslog_host'],
1588 1588
                 $SETTINGS['syslog_port'],
1589 1589
                 'teampass'
1590 1590
             );
1591 1591
         } else {
1592 1592
             send_syslog(
1593
-                'action=' . $type . ' attribute=' . $label . ' user=' . $who . ' userid="' . $login . '" ',
1593
+                'action='.$type.' attribute='.$label.' user='.$who.' userid="'.$login.'" ',
1594 1594
                 $SETTINGS['syslog_host'],
1595 1595
                 $SETTINGS['syslog_port'],
1596 1596
                 'teampass'
@@ -1622,7 +1622,7 @@  discard block
 block discarded – undo
1622 1622
     ?string $encryption_type = null
1623 1623
 ): void {
1624 1624
     // include librairies & connect to DB
1625
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
1625
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
1626 1626
     if (defined('DB_PASSWD_CLEAR') === false) {
1627 1627
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
1628 1628
     }
@@ -1666,7 +1666,7 @@  discard block
 block discarded – undo
1666 1666
         if (empty($item_label) === true) {
1667 1667
             $dataItem = DB::queryfirstrow(
1668 1668
                 'SELECT id, id_tree, label
1669
-                FROM ' . prefixTable('items') . '
1669
+                FROM ' . prefixTable('items').'
1670 1670
                 WHERE id = %i',
1671 1671
                 $item_id
1672 1672
             );
@@ -1674,11 +1674,11 @@  discard block
 block discarded – undo
1674 1674
         }
1675 1675
 
1676 1676
         send_syslog(
1677
-            'action=' . str_replace('at_', '', $action) .
1678
-                ' attribute=' . str_replace('at_', '', $attribute[0]) .
1679
-                ' itemno=' . $item_id .
1680
-                ' user=' . is_null($login) === true ? '' : addslashes((string) $login) .
1681
-                ' itemname="' . addslashes($item_label) . '"',
1677
+            'action='.str_replace('at_', '', $action).
1678
+                ' attribute='.str_replace('at_', '', $attribute[0]).
1679
+                ' itemno='.$item_id.
1680
+                ' user='.is_null($login) === true ? '' : addslashes((string) $login).
1681
+                ' itemname="'.addslashes($item_label).'"',
1682 1682
             $SETTINGS['syslog_host'],
1683 1683
             $SETTINGS['syslog_port'],
1684 1684
             'teampass'
@@ -1704,7 +1704,7 @@  discard block
 block discarded – undo
1704 1704
         && $action === 'at_shown'
1705 1705
     ) {
1706 1706
         // Load superglobal
1707
-        include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1707
+        include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1708 1708
         $superGlobal = new protect\SuperGlobal\SuperGlobal();
1709 1709
         // Get superglobals
1710 1710
         $globalsLastname = $superGlobal->get('lastname', 'SESSION');
@@ -1713,7 +1713,7 @@  discard block
 block discarded – undo
1713 1713
         // Get info about item
1714 1714
         $dataItem = DB::queryfirstrow(
1715 1715
             'SELECT id, id_tree, label
1716
-            FROM ' . prefixTable('items') . '
1716
+            FROM ' . prefixTable('items').'
1717 1717
             WHERE id = %i',
1718 1718
             $item_id
1719 1719
         );
@@ -1727,9 +1727,9 @@  discard block
 block discarded – undo
1727 1727
                 'body' => str_replace(
1728 1728
                     ['#tp_user#', '#tp_item#', '#tp_link#'],
1729 1729
                     [
1730
-                        addslashes($globalsName . ' ' . $globalsLastname),
1730
+                        addslashes($globalsName.' '.$globalsLastname),
1731 1731
                         addslashes($item_label),
1732
-                        $SETTINGS['cpassman_url'] . '/index.php?page=items&group=' . $dataItem['id_tree'] . '&id=' . $item_id,
1732
+                        $SETTINGS['cpassman_url'].'/index.php?page=items&group='.$dataItem['id_tree'].'&id='.$item_id,
1733 1733
                     ],
1734 1734
                     langHdl('email_on_open_notification_mail')
1735 1735
                 ),
@@ -1751,7 +1751,7 @@  discard block
 block discarded – undo
1751 1751
 function notifyChangesToSubscribers(int $item_id, string $label, array $changes, array $SETTINGS): void
1752 1752
 {
1753 1753
     // Load superglobal
1754
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1754
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1755 1755
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
1756 1756
     // Get superglobals
1757 1757
     $globalsUserId = $superGlobal->get('user_id', 'SESSION');
@@ -1761,8 +1761,8 @@  discard block
 block discarded – undo
1761 1761
     $notification = DB::queryOneColumn(
1762 1762
         'email',
1763 1763
         'SELECT *
1764
-        FROM ' . prefixTable('notification') . ' AS n
1765
-        INNER JOIN ' . prefixTable('users') . ' AS u ON (n.user_id = u.id)
1764
+        FROM ' . prefixTable('notification').' AS n
1765
+        INNER JOIN ' . prefixTable('users').' AS u ON (n.user_id = u.id)
1766 1766
         WHERE n.item_id = %i AND n.user_id != %i',
1767 1767
         $item_id,
1768 1768
         $globalsUserId
@@ -1773,7 +1773,7 @@  discard block
 block discarded – undo
1773 1773
         // Get list of changes
1774 1774
         $htmlChanges = '<ul>';
1775 1775
         foreach ($changes as $change) {
1776
-            $htmlChanges .= '<li>' . $change . '</li>';
1776
+            $htmlChanges .= '<li>'.$change.'</li>';
1777 1777
         }
1778 1778
         $htmlChanges .= '</ul>';
1779 1779
         // send email
@@ -1804,7 +1804,7 @@  discard block
 block discarded – undo
1804 1804
 function geItemReadablePath(int $id_tree, string $label, array $SETTINGS): string
1805 1805
 {
1806 1806
     // Class loader
1807
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
1807
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
1808 1808
     //Load Tree
1809 1809
     $tree = new SplClassLoader('Tree\NestedTree', '../includes/libraries');
1810 1810
     $tree->register();
@@ -1813,15 +1813,15 @@  discard block
 block discarded – undo
1813 1813
     $path = '';
1814 1814
     foreach ($arbo as $elem) {
1815 1815
         if (empty($path) === true) {
1816
-            $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES) . ' ';
1816
+            $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES).' ';
1817 1817
         } else {
1818
-            $path .= '&#8594; ' . htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
1818
+            $path .= '&#8594; '.htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
1819 1819
         }
1820 1820
     }
1821 1821
 
1822 1822
     // Build text to show user
1823 1823
     if (empty($label) === false) {
1824
-        return empty($path) === true ? addslashes($label) : addslashes($label) . ' (' . $path . ')';
1824
+        return empty($path) === true ? addslashes($label) : addslashes($label).' ('.$path.')';
1825 1825
     }
1826 1826
     return empty($path) === true ? '' : $path;
1827 1827
 }
@@ -1876,9 +1876,9 @@  discard block
 block discarded – undo
1876 1876
  */
1877 1877
 function handleConfigFile($action, $SETTINGS, $field = null, $value = null)
1878 1878
 {
1879
-    $tp_config_file = $SETTINGS['cpassman_dir'] . '/includes/config/tp.config.php';
1879
+    $tp_config_file = $SETTINGS['cpassman_dir'].'/includes/config/tp.config.php';
1880 1880
     // include librairies & connect to DB
1881
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
1881
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
1882 1882
     if (defined('DB_PASSWD_CLEAR') === false) {
1883 1883
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
1884 1884
     }
@@ -1891,8 +1891,8 @@  discard block
 block discarded – undo
1891 1891
     if (file_exists($tp_config_file) === false || $action === 'rebuild') {
1892 1892
         // perform a copy
1893 1893
         if (file_exists($tp_config_file)) {
1894
-            if (! copy($tp_config_file, $tp_config_file . '.' . date('Y_m_d_His', time()))) {
1895
-                return "ERROR: Could not copy file '" . $tp_config_file . "'";
1894
+            if (!copy($tp_config_file, $tp_config_file.'.'.date('Y_m_d_His', time()))) {
1895
+                return "ERROR: Could not copy file '".$tp_config_file."'";
1896 1896
             }
1897 1897
         }
1898 1898
 
@@ -1902,11 +1902,11 @@  discard block
 block discarded – undo
1902 1902
         $data[1] = "global \$SETTINGS;\n";
1903 1903
         $data[2] = "\$SETTINGS = array (\n";
1904 1904
         $rows = DB::query(
1905
-            'SELECT * FROM ' . prefixTable('misc') . ' WHERE type=%s',
1905
+            'SELECT * FROM '.prefixTable('misc').' WHERE type=%s',
1906 1906
             'admin'
1907 1907
         );
1908 1908
         foreach ($rows as $record) {
1909
-            array_push($data, "    '" . $record['intitule'] . "' => '" . $record['valeur'] . "',\n");
1909
+            array_push($data, "    '".$record['intitule']."' => '".$record['valeur']."',\n");
1910 1910
         }
1911 1911
         array_push($data, ");\n");
1912 1912
         $data = array_unique($data);
@@ -1920,15 +1920,15 @@  discard block
 block discarded – undo
1920 1920
                 break;
1921 1921
             }
1922 1922
 
1923
-            if (stristr($line, "'" . $field . "' => '")) {
1924
-                $data[$inc] = "    '" . $field . "' => '" . filter_var($value, FILTER_SANITIZE_STRING) . "',\n";
1923
+            if (stristr($line, "'".$field."' => '")) {
1924
+                $data[$inc] = "    '".$field."' => '".filter_var($value, FILTER_SANITIZE_STRING)."',\n";
1925 1925
                 $bFound = true;
1926 1926
                 break;
1927 1927
             }
1928 1928
             ++$inc;
1929 1929
         }
1930 1930
         if ($bFound === false) {
1931
-            $data[$inc] = "    '" . $field . "' => '" . filter_var($value, FILTER_SANITIZE_STRING) . "',\n);\n";
1931
+            $data[$inc] = "    '".$field."' => '".filter_var($value, FILTER_SANITIZE_STRING)."',\n);\n";
1932 1932
         }
1933 1933
     }
1934 1934
 
@@ -1954,7 +1954,7 @@  discard block
 block discarded – undo
1954 1954
 {
1955 1955
     global $SETTINGS;
1956 1956
     /* LOAD CPASSMAN SETTINGS */
1957
-    if (! isset($SETTINGS['loaded']) || $SETTINGS['loaded'] !== 1) {
1957
+    if (!isset($SETTINGS['loaded']) || $SETTINGS['loaded'] !== 1) {
1958 1958
         $SETTINGS = [];
1959 1959
         $SETTINGS['duplicate_folder'] = 0;
1960 1960
         //by default, this is set to 0;
@@ -1964,7 +1964,7 @@  discard block
 block discarded – undo
1964 1964
         //by default, this value is set to 5;
1965 1965
         $settings = [];
1966 1966
         $rows = DB::query(
1967
-            'SELECT * FROM ' . prefixTable('misc') . ' WHERE type=%s_type OR type=%s_type2',
1967
+            'SELECT * FROM '.prefixTable('misc').' WHERE type=%s_type OR type=%s_type2',
1968 1968
             [
1969 1969
                 'type' => 'admin',
1970 1970
                 'type2' => 'settings',
@@ -1991,7 +1991,7 @@  discard block
 block discarded – undo
1991 1991
     $source_cf = [];
1992 1992
     $rows = DB::QUERY(
1993 1993
         'SELECT id_category
1994
-            FROM ' . prefixTable('categories_folders') . '
1994
+            FROM ' . prefixTable('categories_folders').'
1995 1995
             WHERE id_folder = %i',
1996 1996
         $source_id
1997 1997
     );
@@ -2002,7 +2002,7 @@  discard block
 block discarded – undo
2002 2002
     $target_cf = [];
2003 2003
     $rows = DB::QUERY(
2004 2004
         'SELECT id_category
2005
-            FROM ' . prefixTable('categories_folders') . '
2005
+            FROM ' . prefixTable('categories_folders').'
2006 2006
             WHERE id_folder = %i',
2007 2007
         $target_id
2008 2008
     );
@@ -2037,9 +2037,9 @@  discard block
 block discarded – undo
2037 2037
     $password = null
2038 2038
 ) {
2039 2039
     // Load AntiXSS
2040
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/AntiXSS.php';
2041
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/ASCII.php';
2042
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/UTF8.php';
2040
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/AntiXSS.php';
2041
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/ASCII.php';
2042
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/UTF8.php';
2043 2043
     $antiXss = new voku\helper\AntiXSS();
2044 2044
     // Protect against bad inputs
2045 2045
     if (is_array($source_file) === true || is_array($target_file) === true) {
@@ -2051,7 +2051,7 @@  discard block
 block discarded – undo
2051 2051
     $target_file = $antiXss->xss_clean($target_file);
2052 2052
     if (empty($password) === true || is_null($password) === true) {
2053 2053
         // get KEY to define password
2054
-        $ascii_key = file_get_contents(SECUREPATH . '/teampass-seckey.txt');
2054
+        $ascii_key = file_get_contents(SECUREPATH.'/teampass-seckey.txt');
2055 2055
         $password = \Defuse\Crypto\Key::loadFromAsciiSafeString($ascii_key);
2056 2056
     }
2057 2057
 
@@ -2096,15 +2096,15 @@  discard block
 block discarded – undo
2096 2096
 ) {
2097 2097
     // load PhpEncryption library
2098 2098
     $path_to_encryption = '/includes/libraries/Encryption/Encryption/';
2099
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Crypto.php';
2100
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Encoding.php';
2101
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'DerivedKeys.php';
2102
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Key.php';
2103
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'KeyOrPassword.php';
2104
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'File.php';
2105
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'RuntimeTests.php';
2106
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'KeyProtectedByPassword.php';
2107
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Core.php';
2099
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Crypto.php';
2100
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Encoding.php';
2101
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'DerivedKeys.php';
2102
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Key.php';
2103
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'KeyOrPassword.php';
2104
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'File.php';
2105
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'RuntimeTests.php';
2106
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'KeyProtectedByPassword.php';
2107
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Core.php';
2108 2108
     try {
2109 2109
         \Defuse\Crypto\File::encryptFileWithPassword(
2110 2110
             $source_file,
@@ -2141,15 +2141,15 @@  discard block
 block discarded – undo
2141 2141
 ) {
2142 2142
     // load PhpEncryption library
2143 2143
     $path_to_encryption = '/includes/libraries/Encryption/Encryption/';
2144
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Crypto.php';
2145
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Encoding.php';
2146
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'DerivedKeys.php';
2147
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Key.php';
2148
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'KeyOrPassword.php';
2149
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'File.php';
2150
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'RuntimeTests.php';
2151
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'KeyProtectedByPassword.php';
2152
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Core.php';
2144
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Crypto.php';
2145
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Encoding.php';
2146
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'DerivedKeys.php';
2147
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Key.php';
2148
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'KeyOrPassword.php';
2149
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'File.php';
2150
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'RuntimeTests.php';
2151
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'KeyProtectedByPassword.php';
2152
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Core.php';
2153 2153
     try {
2154 2154
         \Defuse\Crypto\File::decryptFileWithPassword(
2155 2155
             $source_file,
@@ -2194,9 +2194,9 @@  discard block
 block discarded – undo
2194 2194
 function fileDelete(string $file, array $SETTINGS): void
2195 2195
 {
2196 2196
     // Load AntiXSS
2197
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/ASCII.php';
2198
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/UTF8.php';
2199
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/AntiXSS.php';
2197
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/ASCII.php';
2198
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/UTF8.php';
2199
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/AntiXSS.php';
2200 2200
     $antiXss = new voku\helper\AntiXSS();
2201 2201
     $file = $antiXss->xss_clean($file);
2202 2202
     if (is_file($file)) {
@@ -2240,7 +2240,7 @@  discard block
 block discarded – undo
2240 2240
 
2241 2241
 function recursiveChmod($path, $filePerm = 0644, $dirPerm = 0755) {
2242 2242
     // Check if the path exists
2243
-    if (! file_exists($path)) {
2243
+    if (!file_exists($path)) {
2244 2244
         return false;
2245 2245
     }
2246 2246
 
@@ -2275,7 +2275,7 @@  discard block
 block discarded – undo
2275 2275
  */
2276 2276
 function accessToItemIsGranted(int $item_id, $SETTINGS)
2277 2277
 {
2278
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
2278
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
2279 2279
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
2280 2280
     // Prepare superGlobal variables
2281 2281
     $session_groupes_visibles = $superGlobal->get('groupes_visibles', 'SESSION');
@@ -2283,7 +2283,7 @@  discard block
 block discarded – undo
2283 2283
     // Load item data
2284 2284
     $data = DB::queryFirstRow(
2285 2285
         'SELECT id_tree
2286
-        FROM ' . prefixTable('items') . '
2286
+        FROM ' . prefixTable('items').'
2287 2287
         WHERE id = %i',
2288 2288
         $item_id
2289 2289
     );
@@ -2356,8 +2356,8 @@  discard block
 block discarded – undo
2356 2356
 function performDBQuery(array $SETTINGS, string $fields, string $table): array
2357 2357
 {
2358 2358
     // include librairies & connect to DB
2359
-    include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
2360
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
2359
+    include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
2360
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
2361 2361
     if (defined('DB_PASSWD_CLEAR') === false) {
2362 2362
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
2363 2363
     }
@@ -2369,7 +2369,7 @@  discard block
 block discarded – undo
2369 2369
     DB::$encoding = DB_ENCODING;
2370 2370
     // Insert log in DB
2371 2371
     return DB::query(
2372
-        'SELECT ' . $fields . '
2372
+        'SELECT '.$fields.'
2373 2373
         FROM ' . prefixTable($table)
2374 2374
     );
2375 2375
 }
@@ -2382,11 +2382,11 @@  discard block
 block discarded – undo
2382 2382
 function formatSizeUnits(int $bytes): string
2383 2383
 {
2384 2384
     if ($bytes >= 1073741824) {
2385
-        $bytes = number_format($bytes / 1073741824, 2) . ' GB';
2385
+        $bytes = number_format($bytes / 1073741824, 2).' GB';
2386 2386
     } elseif ($bytes >= 1048576) {
2387
-        $bytes = number_format($bytes / 1048576, 2) . ' MB';
2387
+        $bytes = number_format($bytes / 1048576, 2).' MB';
2388 2388
     } elseif ($bytes >= 1024) {
2389
-        $bytes = number_format($bytes / 1024, 2) . ' KB';
2389
+        $bytes = number_format($bytes / 1024, 2).' KB';
2390 2390
     } elseif ($bytes > 1) {
2391 2391
         $bytes .= ' bytes';
2392 2392
     } elseif ($bytes === 1) {
@@ -2577,14 +2577,14 @@  discard block
 block discarded – undo
2577 2577
 
2578 2578
     // Encrypt the file content
2579 2579
     $plaintext = file_get_contents(
2580
-        filter_var($fileInPath . '/' . $fileInName, FILTER_SANITIZE_URL)
2580
+        filter_var($fileInPath.'/'.$fileInName, FILTER_SANITIZE_URL)
2581 2581
     );
2582 2582
     $ciphertext = $cipher->encrypt($plaintext);
2583 2583
     // Save new file
2584 2584
     $hash = md5($plaintext);
2585
-    $fileOut = $fileInPath . '/' . TP_FILE_PREFIX . $hash;
2585
+    $fileOut = $fileInPath.'/'.TP_FILE_PREFIX.$hash;
2586 2586
     file_put_contents($fileOut, $ciphertext);
2587
-    unlink($fileInPath . '/' . $fileInName);
2587
+    unlink($fileInPath.'/'.$fileInName);
2588 2588
     return [
2589 2589
         'fileHash' => base64_encode($hash),
2590 2590
         'objectKey' => base64_encode($objectKey),
@@ -2600,7 +2600,7 @@  discard block
 block discarded – undo
2600 2600
  */
2601 2601
 function decryptFile(string $fileName, string $filePath, string $key): string
2602 2602
 {
2603
-    if (! defined('FILE_BUFFER_SIZE')) {
2603
+    if (!defined('FILE_BUFFER_SIZE')) {
2604 2604
         define('FILE_BUFFER_SIZE', 128 * 1024);
2605 2605
     }
2606 2606
 
@@ -2619,7 +2619,7 @@  discard block
 block discarded – undo
2619 2619
     $cipher->enableContinuousBuffer();
2620 2620
     $cipher->disablePadding();
2621 2621
     // Get file content
2622
-    $ciphertext = file_get_contents($filePath . '/' . TP_FILE_PREFIX . $fileName);
2622
+    $ciphertext = file_get_contents($filePath.'/'.TP_FILE_PREFIX.$fileName);
2623 2623
     // Decrypt file content and return
2624 2624
     return base64_encode($cipher->decrypt($ciphertext));
2625 2625
 }
@@ -2669,8 +2669,8 @@  discard block
 block discarded – undo
2669 2669
     array $SETTINGS
2670 2670
 ): void {
2671 2671
     // include librairies & connect to DB
2672
-    include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
2673
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
2672
+    include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
2673
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
2674 2674
     if (defined('DB_PASSWD_CLEAR') === false) {
2675 2675
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
2676 2676
     }
@@ -2687,7 +2687,7 @@  discard block
 block discarded – undo
2687 2687
         $post_object_id
2688 2688
     );
2689 2689
     // Superglobals
2690
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
2690
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
2691 2691
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
2692 2692
     // Prepare superGlobal variables
2693 2693
     $sessionPpersonaFolders = $superGlobal->get('personal_folders', 'SESSION');
@@ -2712,8 +2712,8 @@  discard block
 block discarded – undo
2712 2712
         // Create sharekey for each user
2713 2713
         $users = DB::query(
2714 2714
             'SELECT id, public_key
2715
-            FROM ' . prefixTable('users') . '
2716
-            WHERE id NOT IN ("' . OTV_USER_ID . '","' . SSH_USER_ID . '","' . API_USER_ID . '")
2715
+            FROM ' . prefixTable('users').'
2716
+            WHERE id NOT IN ("' . OTV_USER_ID.'","'.SSH_USER_ID.'","'.API_USER_ID.'")
2717 2717
             AND public_key != ""'
2718 2718
         );
2719 2719
         foreach ($users as $user) {
@@ -2741,7 +2741,7 @@  discard block
 block discarded – undo
2741 2741
 function isBase64(string $str): bool
2742 2742
 {
2743 2743
     $str = (string) trim($str);
2744
-    if (! isset($str[0])) {
2744
+    if (!isset($str[0])) {
2745 2745
         return false;
2746 2746
     }
2747 2747
 
@@ -2809,13 +2809,13 @@  discard block
 block discarded – undo
2809 2809
         ],
2810 2810
     ];
2811 2811
     // Load expected libraries
2812
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Traits/Macroable.php';
2813
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Arr.php';
2814
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/DetectsErrors.php';
2815
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/Connection.php';
2816
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/LdapInterface.php';
2817
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/LdapBase.php';
2818
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/Ldap.php';
2812
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Traits/Macroable.php';
2813
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Arr.php';
2814
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/DetectsErrors.php';
2815
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/Connection.php';
2816
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/LdapInterface.php';
2817
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/LdapBase.php';
2818
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/Ldap.php';
2819 2819
     $ad = new SplClassLoader('LdapRecord', '../includes/libraries');
2820 2820
     $ad->register();
2821 2821
     $connection = new Connection($config);
@@ -2824,7 +2824,7 @@  discard block
 block discarded – undo
2824 2824
         $connection->connect();
2825 2825
     } catch (\LdapRecord\Auth\BindException $e) {
2826 2826
         $error = $e->getDetailedError();
2827
-        echo 'Error : '.$error->getErrorCode().' - '.$error->getErrorMessage(). '<br>'.$error->getDiagnosticMessage();
2827
+        echo 'Error : '.$error->getErrorCode().' - '.$error->getErrorMessage().'<br>'.$error->getDiagnosticMessage();
2828 2828
         return false;
2829 2829
     }
2830 2830
 
@@ -2833,7 +2833,7 @@  discard block
 block discarded – undo
2833 2833
         $connection->auth()->attempt($SETTINGS['ldap_user_attribute'].'='.$login.','.$SETTINGS['ldap_bdn'], $password, $stayAuthenticated = true);
2834 2834
     } catch (\LdapRecord\Auth\BindException $e) {
2835 2835
         $error = $e->getDetailedError();
2836
-        echo 'Error : '.$error->getErrorCode().' - '.$error->getErrorMessage(). '<br>'.$error->getDiagnosticMessage();
2836
+        echo 'Error : '.$error->getErrorCode().' - '.$error->getErrorMessage().'<br>'.$error->getDiagnosticMessage();
2837 2837
         return false;
2838 2838
     }
2839 2839
 
@@ -2851,8 +2851,8 @@  discard block
 block discarded – undo
2851 2851
 function deleteUserObjetsKeys(int $userId, array $SETTINGS): bool
2852 2852
 {
2853 2853
     // include librairies & connect to DB
2854
-    include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
2855
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
2854
+    include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
2855
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
2856 2856
     if (defined('DB_PASSWD_CLEAR') === false) {
2857 2857
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
2858 2858
     }
@@ -2910,7 +2910,7 @@  discard block
 block discarded – undo
2910 2910
         foreach (DateTimeZone::listIdentifiers() as $timezone) {
2911 2911
             $now->setTimezone(new DateTimeZone($timezone));
2912 2912
             $offsets[] = $offset = $now->getOffset();
2913
-            $timezones[$timezone] = '(' . format_GMT_offset($offset) . ') ' . format_timezone_name($timezone);
2913
+            $timezones[$timezone] = '('.format_GMT_offset($offset).') '.format_timezone_name($timezone);
2914 2914
         }
2915 2915
 
2916 2916
         array_multisort($offsets, $timezones);
@@ -2930,7 +2930,7 @@  discard block
 block discarded – undo
2930 2930
 {
2931 2931
     $hours = intval($offset / 3600);
2932 2932
     $minutes = abs(intval($offset % 3600 / 60));
2933
-    return 'GMT' . ($offset ? sprintf('%+03d:%02d', $hours, $minutes) : '');
2933
+    return 'GMT'.($offset ? sprintf('%+03d:%02d', $hours, $minutes) : '');
2934 2934
 }
2935 2935
 
2936 2936
 /**
Please login to merge, or discard this patch.
sources/identify.php 1 patch
Spacing   +93 added lines, -93 removed lines patch added patch discarded remove patch
@@ -44,23 +44,23 @@  discard block
 block discarded – undo
44 44
     throw new Exception("Error file '/includes/config/tp.config.php' not exists", 1);
45 45
 }
46 46
 
47
-if (! isset($SETTINGS['cpassman_dir']) || empty($SETTINGS['cpassman_dir']) === true || $SETTINGS['cpassman_dir'] === '.') {
47
+if (!isset($SETTINGS['cpassman_dir']) || empty($SETTINGS['cpassman_dir']) === true || $SETTINGS['cpassman_dir'] === '.') {
48 48
     $SETTINGS = [];
49 49
     $SETTINGS['cpassman_dir'] = '..';
50 50
 }
51 51
 
52
-require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
53
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
54
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
52
+require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
53
+require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php';
54
+require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
55 55
 
56 56
 // If Debug then clean the files
57 57
 if (DEBUGLDAP === true) {
58
-    define('DEBUGLDAPFILE', $SETTINGS['path_to_files_folder'] . '/ldap.debug.txt');
58
+    define('DEBUGLDAPFILE', $SETTINGS['path_to_files_folder'].'/ldap.debug.txt');
59 59
     $fp = fopen(DEBUGLDAPFILE, 'w');
60 60
     fclose($fp);
61 61
 }
62 62
 if (DEBUGDUO === true) {
63
-    define('DEBUGDUOFILE', $SETTINGS['path_to_files_folder'] . '/duo.debug.txt');
63
+    define('DEBUGDUOFILE', $SETTINGS['path_to_files_folder'].'/duo.debug.txt');
64 64
     $fp = fopen(DEBUGDUOFILE, 'w');
65 65
     fclose($fp);
66 66
 }
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 if (defined('DB_PASSWD_CLEAR') === false) {
77 77
     define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
78 78
 }
79
-require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
79
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
80 80
 if (defined('DB_PASSWD_CLEAR') === false) {
81 81
     define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
82 82
 }
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
     // Get DUO keys
96 96
     $duoData = DB::query(
97 97
         'SELECT intitule, valeur
98
-        FROM ' . prefixTable('misc') . '
98
+        FROM ' . prefixTable('misc').'
99 99
         WHERE type = %s',
100 100
         'duoSecurity'
101 101
     );
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
     }
106 106
 
107 107
     // load library
108
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/DuoSecurity/Duo.php';
108
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/DuoSecurity/Duo.php';
109 109
     $sig_request = Duo::signRequest(
110 110
         $_GLOBALS['IKEY'],
111 111
         $_GLOBALS['SKEY'],
@@ -116,16 +116,16 @@  discard block
 block discarded – undo
116 116
         debugIdentify(
117 117
             DEBUGDUO,
118 118
             DEBUGDUOFILE,
119
-            "\n\n-----\n\n" .
120
-                'sig request : ' . $post_login . "\n" .
121
-                'resp : ' . $sig_request . "\n"
119
+            "\n\n-----\n\n".
120
+                'sig request : '.$post_login."\n".
121
+                'resp : '.$sig_request."\n"
122 122
         );
123 123
     }
124 124
 
125 125
     // load csrfprotector
126
-    $csrfp_config = include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/csrfp/libs/csrfp.config.php';
126
+    $csrfp_config = include_once $SETTINGS['cpassman_dir'].'/includes/libraries/csrfp/libs/csrfp.config.php';
127 127
     // return result
128
-    echo '[{"sig_request" : "' . $sig_request . '" , "csrfp_token" : "' . $csrfp_config['CSRFP_TOKEN'] . '" , "csrfp_key" : "' . filter_var($_COOKIE[$csrfp_config['CSRFP_TOKEN']], FILTER_SANITIZE_STRING) . '"}]';
128
+    echo '[{"sig_request" : "'.$sig_request.'" , "csrfp_token" : "'.$csrfp_config['CSRFP_TOKEN'].'" , "csrfp_key" : "'.filter_var($_COOKIE[$csrfp_config['CSRFP_TOKEN']], FILTER_SANITIZE_STRING).'"}]';
129 129
 // ---
130 130
     // ---
131 131
 } elseif ($post_type === 'identify_duo_user_check') {
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
     //--------
136 136
 
137 137
     // load library
138
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/DuoSecurity/Duo.php';
138
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/DuoSecurity/Duo.php';
139 139
     $authenticated_username = Duo::verifyResponse(
140 140
         $SETTINGS['duo_ikey'],
141 141
         $SETTINGS['duo_skey'],
@@ -146,9 +146,9 @@  discard block
 block discarded – undo
146 146
         debugIdentify(
147 147
             DEBUGDUO,
148 148
             DEBUGDUOFILE,
149
-            "\n\n-----\n\n" .
150
-                'sig response : ' . $post_sig_response . "\n" .
151
-                'resp : ' . $authenticated_username . "\n"
149
+            "\n\n-----\n\n".
150
+                'sig response : '.$post_sig_response."\n".
151
+                'resp : '.$authenticated_username."\n"
152 152
         );
153 153
     }
154 154
 
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
             // is user in Teampass?
160 160
             DB::queryfirstrow(
161 161
                 'SELECT id
162
-                FROM ' . prefixTable('users') . '
162
+                FROM ' . prefixTable('users').'
163 163
                 WHERE login = %s',
164 164
                 $post_login
165 165
             );
@@ -169,9 +169,9 @@  discard block
 block discarded – undo
169 169
             }
170 170
         }
171 171
 
172
-        echo '[{"authenticated_username" : "' . $authenticated_username . '"}]';
172
+        echo '[{"authenticated_username" : "'.$authenticated_username.'"}]';
173 173
     } else {
174
-        echo '[{"authenticated_username" : "' . $authenticated_username . '"}]';
174
+        echo '[{"authenticated_username" : "'.$authenticated_username.'"}]';
175 175
     }
176 176
     // ---
177 177
     // ---
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
     //--------
182 182
 
183 183
     // Load superGlobals
184
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
184
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
185 185
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
186 186
     // Prepare GET variables
187 187
     $sessionPwdAttempts = $superGlobal->get('pwd_attempts', 'SESSION');
@@ -268,16 +268,16 @@  discard block
 block discarded – undo
268 268
     } else {
269 269
         throw new Exception("Error file '/includes/config/tp.config.php' not exists", 1);
270 270
     }
271
-    include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
271
+    include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
272 272
     header('Content-type: text/html; charset=utf-8');
273 273
     error_reporting(E_ERROR);
274
-    include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
275
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
274
+    include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
275
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
276 276
     // Load AntiXSS
277
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/AntiXSS.php';
277
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/AntiXSS.php';
278 278
     $antiXss = new voku\helper\AntiXSS();
279 279
     // Load superGlobals
280
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
280
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
281 281
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
282 282
     // Prepare GET variables
283 283
     $sessionUserLanguage = $superGlobal->get('user_language', 'SESSION');
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
     $server['PHP_AUTH_PW'] = $superGlobal->get('PHP_AUTH_PW', 'SERVER');
291 291
 
292 292
     // connect to the server
293
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
293
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
294 294
     if (defined('DB_PASSWD_CLEAR') === false) {
295 295
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
296 296
     }
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
     DB::$port = DB_PORT;
302 302
     DB::$encoding = DB_ENCODING;
303 303
     // User's language loading
304
-    include_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $sessionUserLanguage . '.php';
304
+    include_once $SETTINGS['cpassman_dir'].'/includes/language/'.$sessionUserLanguage.'.php';
305 305
     //echo $dataReceived." -->".empty($sessionKey)."<-- ".$sessionKey." ** " ;
306 306
     // decrypt and retreive data in JSON format
307 307
     if (empty($sessionKey) === true) {
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
     // Check if user exists
378 378
     $userInfo = DB::queryFirstRow(
379 379
         'SELECT *
380
-        FROM ' . prefixTable('users') . '
380
+        FROM ' . prefixTable('users').'
381 381
         WHERE login=%s',
382 382
         $username
383 383
     );
@@ -581,7 +581,7 @@  discard block
 block discarded – undo
581 581
         //$arrAttempts = array();
582 582
         $rows = DB::query(
583 583
             'SELECT date
584
-            FROM ' . prefixTable('log_system') . "
584
+            FROM ' . prefixTable('log_system')."
585 585
             WHERE field_1 = %s
586 586
             AND type = 'failed_auth'
587 587
             AND label = 'user_password_not_correct'
@@ -597,7 +597,7 @@  discard block
 block discarded – undo
597 597
             foreach ($rows as $record) {
598 598
                 array_push(
599 599
                     $arrAttempts,
600
-                    date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['date'])
600
+                    date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['date'])
601 601
                 );
602 602
             }
603 603
         }
@@ -633,7 +633,7 @@  discard block
 block discarded – undo
633 633
         $superGlobal->put('user_upgrade_needed', $userInfo['upgrade_needed'], 'SESSION');
634 634
         $superGlobal->put('user_force_relog', $userInfo['force-relog'], 'SESSION');
635 635
         // get personal settings
636
-        if (! isset($userInfo['treeloadstrategy']) || empty($userInfo['treeloadstrategy'])) {
636
+        if (!isset($userInfo['treeloadstrategy']) || empty($userInfo['treeloadstrategy'])) {
637 637
             $userInfo['treeloadstrategy'] = 'full';
638 638
         }
639 639
         $superGlobal->put('treeloadstrategy', $userInfo['treeloadstrategy'], 'SESSION', 'user');
@@ -735,7 +735,7 @@  discard block
 block discarded – undo
735 735
         foreach ($superGlobal->get('user_roles', 'SESSION') as $role) {
736 736
             $resRoles = DB::queryFirstRow(
737 737
                 'SELECT title, complexity
738
-                FROM ' . prefixTable('roles_title') . '
738
+                FROM ' . prefixTable('roles_title').'
739 739
                 WHERE id=%i',
740 740
                 $role
741 741
             );
@@ -756,7 +756,7 @@  discard block
 block discarded – undo
756 756
 
757 757
         // build complete array of roles
758 758
         $superGlobal->put('arr_roles_full', [], 'SESSION');
759
-        $rows = DB::query('SELECT id, title FROM ' . prefixTable('roles_title') . ' ORDER BY title ASC');
759
+        $rows = DB::query('SELECT id, title FROM '.prefixTable('roles_title').' ORDER BY title ASC');
760 760
         foreach ($rows as $record) {
761 761
             $superGlobal->put(
762 762
                 $record['id'],
@@ -845,10 +845,10 @@  discard block
 block discarded – undo
845 845
         $superGlobal->put('latest_items_tab', [], 'SESSION');
846 846
         $superGlobal->put('nb_roles', 0, 'SESSION');
847 847
         foreach ($superGlobal->get('latest_items', 'SESSION') as $item) {
848
-            if (! empty($item)) {
848
+            if (!empty($item)) {
849 849
                 $dataLastItems = DB::queryFirstRow(
850 850
                     'SELECT id,label,id_tree
851
-                    FROM ' . prefixTable('items') . '
851
+                    FROM ' . prefixTable('items').'
852 852
                     WHERE id=%i',
853 853
                     $item
854 854
                 );
@@ -857,7 +857,7 @@  discard block
 block discarded – undo
857 857
                     [
858 858
                         'id' => $item,
859 859
                         'label' => $dataLastItems['label'],
860
-                        'url' => 'index.php?page=items&amp;group=' . $dataLastItems['id_tree'] . '&amp;id=' . $item,
860
+                        'url' => 'index.php?page=items&amp;group='.$dataLastItems['id_tree'].'&amp;id='.$item,
861 861
                     ],
862 862
                     'SESSION',
863 863
                     'latest_items_tab'
@@ -874,12 +874,12 @@  discard block
 block discarded – undo
874 874
         ) {
875 875
             // get all Admin users
876 876
             $receivers = '';
877
-            $rows = DB::query('SELECT email FROM ' . prefixTable('users') . " WHERE admin = %i and email != ''", 1);
877
+            $rows = DB::query('SELECT email FROM '.prefixTable('users')." WHERE admin = %i and email != ''", 1);
878 878
             foreach ($rows as $record) {
879 879
                 if (empty($receivers)) {
880 880
                     $receivers = $record['email'];
881 881
                 } else {
882
-                    $receivers = ',' . $record['email'];
882
+                    $receivers = ','.$record['email'];
883 883
                 }
884 884
             }
885 885
             // Add email to table
@@ -895,7 +895,7 @@  discard block
 block discarded – undo
895 895
                             '#tp_time#',
896 896
                         ],
897 897
                         [
898
-                            ' ' . $superGlobal->get('login', 'SESSION') . ' (IP: ' . getClientIpServer() . ')',
898
+                            ' '.$superGlobal->get('login', 'SESSION').' (IP: '.getClientIpServer().')',
899 899
                             date($SETTINGS['date_format'], (int) $superGlobal->get('last_connection', 'SESSION')),
900 900
                             date($SETTINGS['time_format'], (int) $superGlobal->get('last_connection', 'SESSION')),
901 901
                         ],
@@ -1040,8 +1040,8 @@  discard block
 block discarded – undo
1040 1040
     debugIdentify(
1041 1041
         DEBUGDUO,
1042 1042
         DEBUGDUOFILE,
1043
-        "\n\n----\n" .
1044
-            'Identified : ' . filter_var($return, FILTER_SANITIZE_STRING) . "\n\n"
1043
+        "\n\n----\n".
1044
+            'Identified : '.filter_var($return, FILTER_SANITIZE_STRING)."\n\n"
1045 1045
     );
1046 1046
     echo prepareExchangedData(
1047 1047
         [
@@ -1107,44 +1107,44 @@  discard block
 block discarded – undo
1107 1107
         ],
1108 1108
     ];
1109 1109
     // Load expected libraries
1110
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Illuminate/Contracts/Auth/Authenticatable.php';
1111
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Traits/EnumeratesValues.php';
1112
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Traits/Macroable.php';
1113
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/helpers.php';
1114
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Arr.php';
1115
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Contracts/Support/Jsonable.php';
1116
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Contracts/Support/Arrayable.php';
1117
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Enumerable.php';
1118
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Collection.php';
1119
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/CarbonTimeZone.php';
1120
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Units.php';
1121
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Week.php';
1122
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Timestamp.php';
1123
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Test.php';
1124
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/ObjectInitialisation.php';
1125
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Serialization.php';
1126
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/IntervalRounding.php';
1127
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Rounding.php';
1128
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Localization.php';
1129
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Options.php';
1130
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Cast.php';
1131
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Mutability.php';
1132
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Modifiers.php';
1133
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Mixin.php';
1134
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Macro.php';
1135
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Difference.php';
1136
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Creator.php';
1137
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Converter.php';
1138
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Comparison.php';
1139
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Boundaries.php';
1140
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Date.php';
1141
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/CarbonInterface.php';
1142
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Carbon.php';
1143
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/DetectsErrors.php';
1144
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/Connection.php';
1145
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/LdapInterface.php';
1146
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/LdapBase.php';
1147
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/Ldap.php';
1110
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Illuminate/Contracts/Auth/Authenticatable.php';
1111
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Traits/EnumeratesValues.php';
1112
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Traits/Macroable.php';
1113
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/helpers.php';
1114
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Arr.php';
1115
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Contracts/Support/Jsonable.php';
1116
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Contracts/Support/Arrayable.php';
1117
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Enumerable.php';
1118
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Collection.php';
1119
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/CarbonTimeZone.php';
1120
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Units.php';
1121
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Week.php';
1122
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Timestamp.php';
1123
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Test.php';
1124
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/ObjectInitialisation.php';
1125
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Serialization.php';
1126
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/IntervalRounding.php';
1127
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Rounding.php';
1128
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Localization.php';
1129
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Options.php';
1130
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Cast.php';
1131
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Mutability.php';
1132
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Modifiers.php';
1133
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Mixin.php';
1134
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Macro.php';
1135
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Difference.php';
1136
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Creator.php';
1137
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Converter.php';
1138
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Comparison.php';
1139
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Boundaries.php';
1140
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Date.php';
1141
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/CarbonInterface.php';
1142
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Carbon.php';
1143
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/DetectsErrors.php';
1144
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/Connection.php';
1145
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/LdapInterface.php';
1146
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/LdapBase.php';
1147
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/Ldap.php';
1148 1148
     $ad = new SplClassLoader('LdapRecord', '../includes/libraries');
1149 1149
     $ad->register();
1150 1150
     $connection = new Connection($config);
@@ -1156,7 +1156,7 @@  discard block
 block discarded – undo
1156 1156
         $error = $e->getDetailedError();
1157 1157
         return [
1158 1158
             'error' => true,
1159
-            'message' => langHdl('error').' : '.$error->getErrorCode().' - '.$error->getErrorMessage(). '<br>'.$error->getDiagnosticMessage().' '.$config['username'],
1159
+            'message' => langHdl('error').' : '.$error->getErrorCode().' - '.$error->getErrorMessage().'<br>'.$error->getDiagnosticMessage().' '.$config['username'],
1160 1160
 
1161 1161
         ];
1162 1162
     }
@@ -1184,7 +1184,7 @@  discard block
 block discarded – undo
1184 1184
     }
1185 1185
 
1186 1186
     // load passwordLib library
1187
-    $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'] . '/includes/libraries');
1187
+    $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'].'/includes/libraries');
1188 1188
     $pwdlib->register();
1189 1189
     $pwdlib = new PasswordLib\PasswordLib();
1190 1190
     $hashedPassword = $pwdlib->createPasswordHash($passwordClear);
@@ -1249,7 +1249,7 @@  discard block
 block discarded – undo
1249 1249
 function yubicoMFACheck($dataReceived, string $userInfo, array $SETTINGS): array
1250 1250
 {
1251 1251
     // Load superGlobals
1252
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1252
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1253 1253
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
1254 1254
     $sessionAdmin = $superGlobal->get('user_admin', 'SESSION');
1255 1255
     $sessionUrl = $superGlobal->get('initial_url', 'SESSION');
@@ -1288,7 +1288,7 @@  discard block
 block discarded – undo
1288 1288
     }
1289 1289
 
1290 1290
     // Now check yubico validity
1291
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/Yubico/Yubico.php';
1291
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/Yubico/Yubico.php';
1292 1292
     $yubi = new Auth_Yubico($yubico_user_id, $yubico_user_key);
1293 1293
     $auth = $yubi->verify($yubico_key);
1294 1294
     //, null, null, null, 60
@@ -1340,7 +1340,7 @@  discard block
 block discarded – undo
1340 1340
             'gestionnaire' => '0',
1341 1341
             'can_manage_all_users' => '0',
1342 1342
             'personal_folder' => $SETTINGS['enable_pf_feature'] === '1' ? '1' : '0',
1343
-            'fonction_id' => (empty($retLDAP['user_info_from_ad'][0]['commonGroupsLdapVsTeampass']) === false ? $retLDAP['user_info_from_ad'][0]['commonGroupsLdapVsTeampass'] . ';' : '') . (isset($SETTINGS['ldap_new_user_role']) === true ? $SETTINGS['ldap_new_user_role'] : '0'),
1343
+            'fonction_id' => (empty($retLDAP['user_info_from_ad'][0]['commonGroupsLdapVsTeampass']) === false ? $retLDAP['user_info_from_ad'][0]['commonGroupsLdapVsTeampass'].';' : '').(isset($SETTINGS['ldap_new_user_role']) === true ? $SETTINGS['ldap_new_user_role'] : '0'),
1344 1344
             'groupes_interdits' => '',
1345 1345
             'groupes_visibles' => '',
1346 1346
             'last_pw_change' => (int) time(),
@@ -1365,7 +1365,7 @@  discard block
 block discarded – undo
1365 1365
             ]
1366 1366
         );
1367 1367
         // Rebuild tree
1368
-        $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries');
1368
+        $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries');
1369 1369
         $tree->register();
1370 1370
         $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title');
1371 1371
         $tree->rebuild();
@@ -1396,13 +1396,13 @@  discard block
 block discarded – undo
1396 1396
         && empty($dataReceived['GACode']) === false
1397 1397
     ) {
1398 1398
         // Load superGlobals
1399
-        include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1399
+        include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1400 1400
         $superGlobal = new protect\SuperGlobal\SuperGlobal();
1401 1401
         $sessionAdmin = $superGlobal->get('user_admin', 'SESSION');
1402 1402
         $sessionUrl = $superGlobal->get('initial_url', 'SESSION');
1403 1403
         $sessionPwdAttempts = $superGlobal->get('pwd_attempts', 'SESSION');
1404 1404
         // load library
1405
-        include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/TwoFactorAuth/TwoFactorAuth.php';
1405
+        include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/TwoFactorAuth/TwoFactorAuth.php';
1406 1406
         // create new instance
1407 1407
         $tfa = new Authentication\TwoFactorAuth\TwoFactorAuth($SETTINGS['ga_website_name']);
1408 1408
         // Init
@@ -1424,7 +1424,7 @@  discard block
 block discarded – undo
1424 1424
             $mfaMessage = langHdl('ga_flash_qr_and_login');
1425 1425
             // generate new QR
1426 1426
             $new_2fa_qr = $tfa->getQRCodeImageAsDataUri(
1427
-                'Teampass - ' . $username,
1427
+                'Teampass - '.$username,
1428 1428
                 $userInfo['ga']
1429 1429
             );
1430 1430
             // clear temporary code from DB
@@ -1437,7 +1437,7 @@  discard block
 block discarded – undo
1437 1437
                 $userInfo['id']
1438 1438
             );
1439 1439
             $firstTime = [
1440
-                'value' => '<img src="' . $new_2fa_qr . '">',
1440
+                'value' => '<img src="'.$new_2fa_qr.'">',
1441 1441
                 'user_admin' => isset($sessionAdmin) ? (int) $sessionAdmin : '',
1442 1442
                 'initial_url' => isset($sessionUrl) === true ? $sessionUrl : '',
1443 1443
                 'pwd_attempts' => (int) $sessionPwdAttempts,
@@ -1489,8 +1489,8 @@  discard block
 block discarded – undo
1489 1489
     // Set to false
1490 1490
     $userPasswordVerified = false;
1491 1491
     // load passwordLib library
1492
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
1493
-    $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'] . '/includes/libraries');
1492
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
1493
+    $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'].'/includes/libraries');
1494 1494
     $pwdlib->register();
1495 1495
     $pwdlib = new PasswordLib\PasswordLib();
1496 1496
     // Check if old encryption used
Please login to merge, or discard this patch.
sources/items.queries.php 2 patches
Spacing   +283 added lines, -283 removed lines patch added patch discarded remove patch
@@ -37,12 +37,12 @@  discard block
 block discarded – undo
37 37
 }
38 38
 
39 39
 // Do checks
40
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
41
-require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php';
40
+require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php';
41
+require_once $SETTINGS['cpassman_dir'].'/sources/checks.php';
42 42
 if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'items', $SETTINGS) === false) {
43 43
     // Not allowed page
44 44
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
45
-    include $SETTINGS['cpassman_dir'] . '/error.php';
45
+    include $SETTINGS['cpassman_dir'].'/error.php';
46 46
     exit;
47 47
 }
48 48
 
@@ -55,8 +55,8 @@  discard block
 block discarded – undo
55 55
     date_default_timezone_set('UTC');
56 56
 }
57 57
 
58
-require_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php';
59
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
58
+require_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php';
59
+require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
60 60
 header('Content-type: text/html; charset=utf-8');
61 61
 header('Cache-Control: no-cache, must-revalidate');
62 62
 require_once 'main.functions.php';
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 }
79 79
 
80 80
 // Connect to mysql server
81
-require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
81
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
82 82
 if (defined('DB_PASSWD_CLEAR') === false) {
83 83
     define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
84 84
 }
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 DB::$encoding = DB_ENCODING;
91 91
 
92 92
 // Class loader
93
-require_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
93
+require_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
94 94
 
95 95
 // Load Tree
96 96
 $tree = new SplClassLoader('Tree\NestedTree', '../includes/libraries');
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title');
99 99
 
100 100
 // Superglobal library
101
-require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
101
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
102 102
 $superGlobal = new protect\SuperGlobal\SuperGlobal();
103 103
 
104 104
 // Prepare POST variables
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
                 // About special settings
307 307
                 $dataFolderSettings = DB::queryFirstRow(
308 308
                     'SELECT bloquer_creation, bloquer_modification, personal_folder
309
-                    FROM ' . prefixTable('nested_tree') . ' 
309
+                    FROM ' . prefixTable('nested_tree').' 
310 310
                     WHERE id = %i',
311 311
                     $post_folder_id
312 312
                 );
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
                 // Get folder complexity
324 324
                 $folderComplexity = DB::queryfirstrow(
325 325
                     'SELECT valeur
326
-                    FROM ' . prefixTable('misc') . '
326
+                    FROM ' . prefixTable('misc').'
327 327
                     WHERE type = %s AND intitule = %i',
328 328
                     'complex',
329 329
                     $post_folder_id
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
                 $itemExists = 0;
349 349
                 $newID = '';
350 350
                 $data = DB::queryfirstrow(
351
-                    'SELECT * FROM ' . prefixTable('items') . '
351
+                    'SELECT * FROM '.prefixTable('items').'
352 352
                     WHERE label = %s AND inactif = %i',
353 353
                     $post_label,
354 354
                     0
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
                                 // should we encrypt the data
475 475
                                 $dataTmp = DB::queryFirstRow(
476 476
                                     'SELECT encrypted_data
477
-                                    FROM ' . prefixTable('categories') . '
477
+                                    FROM ' . prefixTable('categories').'
478 478
                                     WHERE id = %i',
479 479
                                     $field_data[0]
480 480
                                 );
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
                     ) {
531 531
                         DB::queryFirstRow(
532 532
                             'SELECT *
533
-                            FROM ' . prefixTable('templates') . '
533
+                            FROM ' . prefixTable('templates').'
534 534
                             WHERE item_id = %i',
535 535
                             $newID
536 536
                         );
@@ -599,11 +599,11 @@  discard block
 block discarded – undo
599 599
                     ) {
600 600
                         foreach ($post_restricted_to as $userRest) {
601 601
                             if (empty($userRest) === false) {
602
-                                $dataTmp = DB::queryfirstrow('SELECT login FROM ' . prefixTable('users') . ' WHERE id= %i', $userRest);
602
+                                $dataTmp = DB::queryfirstrow('SELECT login FROM '.prefixTable('users').' WHERE id= %i', $userRest);
603 603
                                 if (empty($listOfRestricted)) {
604 604
                                     $listOfRestricted = $dataTmp['login'];
605 605
                                 } else {
606
-                                    $listOfRestricted .= ';' . $dataTmp['login'];
606
+                                    $listOfRestricted .= ';'.$dataTmp['login'];
607 607
                                 }
608 608
                             }
609 609
                         }
@@ -617,11 +617,11 @@  discard block
 block discarded – undo
617 617
                         if (empty($data['restricted_to']) === false) {
618 618
                             foreach (explode(';', $data['restricted_to']) as $userRest) {
619 619
                                 if (empty($userRest) === false) {
620
-                                    $dataTmp = DB::queryfirstrow('SELECT login FROM ' . prefixTable('users') . ' WHERE id= ' . $userRest);
620
+                                    $dataTmp = DB::queryfirstrow('SELECT login FROM '.prefixTable('users').' WHERE id= '.$userRest);
621 621
                                     if (empty($oldRestrictionList) === true) {
622 622
                                         $oldRestrictionList = $dataTmp['login'];
623 623
                                     } else {
624
-                                        $oldRestrictionList .= ';' . $dataTmp['login'];
624
+                                        $oldRestrictionList .= ';'.$dataTmp['login'];
625 625
                                     }
626 626
                                 }
627 627
                             }
@@ -684,7 +684,7 @@  discard block
 block discarded – undo
684 684
                     if (empty($post_uploaded_file_id) === false) {
685 685
                         $rows = DB::query(
686 686
                             'SELECT id
687
-                            FROM ' . prefixTable('files') . '
687
+                            FROM ' . prefixTable('files').'
688 688
                             WHERE id_item = %s',
689 689
                             $post_uploaded_file_id
690 690
                         );
@@ -724,14 +724,14 @@  discard block
 block discarded – undo
724 724
                                     langHdl('email_subject'),
725 725
                                     str_replace(
726 726
                                         array('#label', '#link'),
727
-                                        array($path, $SETTINGS['email_server_url'] . '/index.php?page=items&group=' . $post_folder_id . '&id=' . $newID . $txt['email_body3']),
727
+                                        array($path, $SETTINGS['email_server_url'].'/index.php?page=items&group='.$post_folder_id.'&id='.$newID.$txt['email_body3']),
728 728
                                         langHdl('new_item_email_body')
729 729
                                     ),
730 730
                                     $emailAddress,
731 731
                                     $SETTINGS,
732 732
                                     str_replace(
733 733
                                         array('#label', '#link'),
734
-                                        array($path, $SETTINGS['email_server_url'] . '/index.php?page=items&group=' . $post_folder_id . '&id=' . $newID . $txt['email_body3']),
734
+                                        array($path, $SETTINGS['email_server_url'].'/index.php?page=items&group='.$post_folder_id.'&id='.$newID.$txt['email_body3']),
735 735
                                         langHdl('new_item_email_body')
736 736
                                     )
737 737
                                 );
@@ -894,7 +894,7 @@  discard block
 block discarded – undo
894 894
                 // About special settings
895 895
                 $dataFolderSettings = DB::queryFirstRow(
896 896
                     'SELECT bloquer_creation, bloquer_modification, personal_folder
897
-                    FROM ' . prefixTable('nested_tree') . ' 
897
+                    FROM ' . prefixTable('nested_tree').' 
898 898
                     WHERE id = %i',
899 899
                     $post_folder_id
900 900
                 );
@@ -910,7 +910,7 @@  discard block
 block discarded – undo
910 910
                 // Get folder complexity
911 911
                 $folderComplexity = DB::queryfirstrow(
912 912
                     'SELECT valeur
913
-                    FROM ' . prefixTable('misc') . '
913
+                    FROM ' . prefixTable('misc').'
914 914
                     WHERE type = %s AND intitule = %i',
915 915
                     'complex',
916 916
                     $post_folder_id
@@ -949,8 +949,8 @@  discard block
 block discarded – undo
949 949
                 // Get all informations for this item
950 950
                 $dataItem = DB::queryfirstrow(
951 951
                     'SELECT *
952
-                    FROM ' . prefixTable('items') . ' as i
953
-                    INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id)
952
+                    FROM ' . prefixTable('items').' as i
953
+                    INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id)
954 954
                     WHERE i.id=%i AND l.action = %s',
955 955
                     $post_item_id,
956 956
                     'at_creation'
@@ -960,7 +960,7 @@  discard block
 block discarded – undo
960 960
 				//db::debugmode(true);
961 961
                 DB::query(
962 962
                     'SELECT *
963
-                    FROM ' . prefixTable('sharekeys_items') . '
963
+                    FROM ' . prefixTable('sharekeys_items').'
964 964
                     WHERE object_id = %i AND user_id = %s',
965 965
                     $post_item_id,
966 966
                     $_SESSION['user_id']
@@ -1008,9 +1008,9 @@  discard block
 block discarded – undo
1008 1008
                         '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, 
1009 1009
                         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,
1010 1010
                         u.login as user_login, u.email as user_email
1011
-                        FROM ' . prefixTable('items') . ' as i
1012
-                        INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id=l.id_item)
1013
-                        INNER JOIN ' . prefixTable('users') . ' as u ON (u.id=l.id_user)
1011
+                        FROM ' . prefixTable('items').' as i
1012
+                        INNER JOIN ' . prefixTable('log_items').' as l ON (i.id=l.id_item)
1013
+                        INNER JOIN ' . prefixTable('users').' as u ON (u.id=l.id_user)
1014 1014
                         WHERE i.id=%i',
1015 1015
                         $post_item_id
1016 1016
                     );
@@ -1018,7 +1018,7 @@  discard block
 block discarded – undo
1018 1018
                     // Should we log a password change?
1019 1019
                     $userKey = DB::queryFirstRow(
1020 1020
                         'SELECT share_key
1021
-                        FROM ' . prefixTable('sharekeys_items') . '
1021
+                        FROM ' . prefixTable('sharekeys_items').'
1022 1022
                         WHERE user_id = %i AND object_id = %i',
1023 1023
                         $_SESSION['user_id'],
1024 1024
                         $post_item_id
@@ -1077,7 +1077,7 @@  discard block
 block discarded – undo
1077 1077
                     // Get list of tags
1078 1078
                     $itemTags = DB::queryFirstColumn(
1079 1079
                         'SELECT tag
1080
-                        FROM ' . prefixTable('tags') . '
1080
+                        FROM ' . prefixTable('tags').'
1081 1081
                         WHERE item_id = %i',
1082 1082
                         $post_item_id
1083 1083
                     );
@@ -1120,7 +1120,7 @@  discard block
 block discarded – undo
1120 1120
                             $_SESSION['user_id'],
1121 1121
                             'at_modification',
1122 1122
                             $_SESSION['login'],
1123
-                            'at_tag : ' . implode(' ', $itemTags) . ' => ' . $post_tags
1123
+                            'at_tag : '.implode(' ', $itemTags).' => '.$post_tags
1124 1124
                         );
1125 1125
                     }
1126 1126
 
@@ -1157,8 +1157,8 @@  discard block
 block discarded – undo
1157 1157
                                     'SELECT c.id AS id, c.title AS title, i.data AS data, i.data_iv AS data_iv,
1158 1158
                                     i.encryption_type AS encryption_type, c.encrypted_data AS encrypted_data,
1159 1159
                                     c.masked AS masked, i.id AS field_item_id
1160
-                                    FROM ' . prefixTable('categories_items') . ' AS i
1161
-                                    INNER JOIN ' . prefixTable('categories') . ' AS c ON (i.field_id=c.id)
1160
+                                    FROM ' . prefixTable('categories_items').' AS i
1161
+                                    INNER JOIN ' . prefixTable('categories').' AS c ON (i.field_id=c.id)
1162 1162
                                     WHERE i.field_id = %i AND i.item_id = %i',
1163 1163
                                     $field['id'],
1164 1164
                                     $post_item_id
@@ -1172,7 +1172,7 @@  discard block
 block discarded – undo
1172 1172
                                     // Perform new query
1173 1173
                                     $dataTmpCat = DB::queryFirstRow(
1174 1174
                                         'SELECT id, title, encrypted_data, masked
1175
-                                        FROM ' . prefixTable('categories') . '
1175
+                                        FROM ' . prefixTable('categories').'
1176 1176
                                         WHERE id = %i',
1177 1177
                                         $field['id']
1178 1178
                                     );
@@ -1244,7 +1244,7 @@  discard block
 block discarded – undo
1244 1244
                                         $_SESSION['user_id'],
1245 1245
                                         'at_modification',
1246 1246
                                         $_SESSION['login'],
1247
-                                        'at_field : ' . $dataTmpCat['title'] . ' : ' . $field['value']
1247
+                                        'at_field : '.$dataTmpCat['title'].' : '.$field['value']
1248 1248
                                     );
1249 1249
                                 } else {
1250 1250
                                     // compare the old and new value
@@ -1252,7 +1252,7 @@  discard block
 block discarded – undo
1252 1252
                                         // Get user sharekey for this field
1253 1253
                                         $userKey = DB::queryFirstRow(
1254 1254
                                             'SELECT share_key
1255
-                                            FROM ' . prefixTable('sharekeys_fields') . '
1255
+                                            FROM ' . prefixTable('sharekeys_fields').'
1256 1256
                                             WHERE user_id = %i AND object_id = %i',
1257 1257
                                             $_SESSION['user_id'],
1258 1258
                                             $dataTmpCat['field_item_id']
@@ -1322,7 +1322,7 @@  discard block
 block discarded – undo
1322 1322
                                             $_SESSION['user_id'],
1323 1323
                                             'at_modification',
1324 1324
                                             $_SESSION['login'],
1325
-                                            'at_field : ' . $dataTmpCat['title'] . ' => ' . $oldVal
1325
+                                            'at_field : '.$dataTmpCat['title'].' => '.$oldVal
1326 1326
                                         );
1327 1327
                                     }
1328 1328
                                 }
@@ -1347,7 +1347,7 @@  discard block
 block discarded – undo
1347 1347
                     ) {
1348 1348
                         DB::queryFirstRow(
1349 1349
                             'SELECT *
1350
-                            FROM ' . prefixTable('templates') . '
1350
+                            FROM ' . prefixTable('templates').'
1351 1351
                             WHERE item_id = %i',
1352 1352
                             $post_item_id
1353 1353
                         );
@@ -1390,7 +1390,7 @@  discard block
 block discarded – undo
1390 1390
                         // check if elem exists in Table. If not add it or update it.
1391 1391
                         DB::query(
1392 1392
                             'SELECT *
1393
-                            FROM ' . prefixTable('automatic_del') . '
1393
+                            FROM ' . prefixTable('automatic_del').'
1394 1394
                             WHERE item_id = %i',
1395 1395
                             $post_item_id
1396 1396
                         );
@@ -1417,7 +1417,7 @@  discard block
 block discarded – undo
1417 1417
                                 // Store updates performed
1418 1418
                                 array_push(
1419 1419
                                     $arrayOfChanges,
1420
-                                    langHdl('automatic_deletion_engaged') . ': ' . langHdl('enabled')
1420
+                                    langHdl('automatic_deletion_engaged').': '.langHdl('enabled')
1421 1421
                                 );
1422 1422
 
1423 1423
                                 // update LOG
@@ -1460,7 +1460,7 @@  discard block
 block discarded – undo
1460 1460
                                 // Store updates performed
1461 1461
                                 array_push(
1462 1462
                                     $arrayOfChanges,
1463
-                                    langHdl('automatic_deletion_engaged') . ': ' . langHdl('disabled')
1463
+                                    langHdl('automatic_deletion_engaged').': '.langHdl('disabled')
1464 1464
                                 );
1465 1465
 
1466 1466
                                 // update LOG
@@ -1493,7 +1493,7 @@  discard block
 block discarded – undo
1493 1493
                             if (empty($userId) === false) {
1494 1494
                                 $dataTmp = DB::queryfirstrow(
1495 1495
                                     'SELECT id, name, lastname
1496
-                                    FROM ' . prefixTable('users') . '
1496
+                                    FROM ' . prefixTable('users').'
1497 1497
                                     WHERE id= %i',
1498 1498
                                     $userId
1499 1499
                                 );
@@ -1501,7 +1501,7 @@  discard block
 block discarded – undo
1501 1501
                                 // Add to array
1502 1502
                                 array_push(
1503 1503
                                     $arrayOfUsersRestriction,
1504
-                                    $dataTmp['name'] . ' ' . $dataTmp['lastname']
1504
+                                    $dataTmp['name'].' '.$dataTmp['lastname']
1505 1505
                                 );
1506 1506
                                 array_push(
1507 1507
                                     $arrayOfUsersIdRestriction,
@@ -1532,8 +1532,8 @@  discard block
 block discarded – undo
1532 1532
                         // get values before deleting them
1533 1533
                         $rows = DB::query(
1534 1534
                             'SELECT t.title, t.id AS id
1535
-                            FROM ' . prefixTable('roles_title') . ' as t
1536
-                            INNER JOIN ' . prefixTable('restriction_to_roles') . ' as r ON (t.id=r.role_id)
1535
+                            FROM ' . prefixTable('roles_title').' as t
1536
+                            INNER JOIN ' . prefixTable('restriction_to_roles').' as r ON (t.id=r.role_id)
1537 1537
                             WHERE r.item_id = %i
1538 1538
                             ORDER BY t.title ASC',
1539 1539
                             $post_item_id
@@ -1567,7 +1567,7 @@  discard block
 block discarded – undo
1567 1567
                                 );
1568 1568
                                 $dataTmp = DB::queryfirstrow(
1569 1569
                                     'SELECT title
1570
-                                    FROM ' . prefixTable('roles_title') . '
1570
+                                    FROM ' . prefixTable('roles_title').'
1571 1571
                                     WHERE id = %i',
1572 1572
                                     $role
1573 1573
                                 );
@@ -1608,8 +1608,8 @@  discard block
 block discarded – undo
1608 1608
                             $_SESSION['user_id'],
1609 1609
                             'at_modification',
1610 1610
                             $_SESSION['login'],
1611
-                            'at_restriction : ' . (count($diffUsersRestiction) > 0 ?
1612
-                                implode(', ', $arrayOfUsersRestriction) . (count($diffRolesRestiction) > 0 ? ', ' : '') : '') . (count($diffRolesRestiction) > 0 ? implode(', ', $arrayOfRestrictionRoles) : '')
1611
+                            'at_restriction : '.(count($diffUsersRestiction) > 0 ?
1612
+                                implode(', ', $arrayOfUsersRestriction).(count($diffRolesRestiction) > 0 ? ', ' : '') : '').(count($diffRolesRestiction) > 0 ? implode(', ', $arrayOfRestrictionRoles) : '')
1613 1613
                         );
1614 1614
                     }
1615 1615
 
@@ -1629,7 +1629,7 @@  discard block
 block discarded – undo
1629 1629
                             $_SESSION['user_id'],
1630 1630
                             'at_modification',
1631 1631
                             $_SESSION['login'],
1632
-                            'at_label : ' . $data['label'] . ' => ' . $post_label
1632
+                            'at_label : '.$data['label'].' => '.$post_label
1633 1633
                         );
1634 1634
                     }
1635 1635
                     // LOGIN
@@ -1648,7 +1648,7 @@  discard block
 block discarded – undo
1648 1648
                             $_SESSION['user_id'],
1649 1649
                             'at_modification',
1650 1650
                             $_SESSION['login'],
1651
-                            'at_login : ' . $data['login'] . ' => ' . $post_login
1651
+                            'at_login : '.$data['login'].' => '.$post_login
1652 1652
                         );
1653 1653
                     }
1654 1654
                     // EMAIL
@@ -1667,7 +1667,7 @@  discard block
 block discarded – undo
1667 1667
                             $_SESSION['user_id'],
1668 1668
                             'at_modification',
1669 1669
                             $_SESSION['login'],
1670
-                            'at_email : ' . $data['email'] . ' => ' . $post_email
1670
+                            'at_email : '.$data['email'].' => '.$post_email
1671 1671
                         );
1672 1672
                     }
1673 1673
                     // URL
@@ -1686,7 +1686,7 @@  discard block
 block discarded – undo
1686 1686
                             $_SESSION['user_id'],
1687 1687
                             'at_modification',
1688 1688
                             $_SESSION['login'],
1689
-                            'at_url : ' . $data['url'] . ' => ' . $post_url
1689
+                            'at_url : '.$data['url'].' => '.$post_url
1690 1690
                         );
1691 1691
                     }
1692 1692
                     // DESCRIPTION
@@ -1711,7 +1711,7 @@  discard block
 block discarded – undo
1711 1711
                     // FOLDER
1712 1712
                     if ((int) $data['id_tree'] !== (int) $post_folder_id) {
1713 1713
                         // Get name of folders
1714
-                        $dataTmp = DB::query('SELECT title FROM ' . prefixTable('nested_tree') . ' WHERE id IN %li', array($data['id_tree'], $post_folder_id));
1714
+                        $dataTmp = DB::query('SELECT title FROM '.prefixTable('nested_tree').' WHERE id IN %li', array($data['id_tree'], $post_folder_id));
1715 1715
 
1716 1716
                         // Store updates performed
1717 1717
                         array_push(
@@ -1727,7 +1727,7 @@  discard block
 block discarded – undo
1727 1727
                             $_SESSION['user_id'],
1728 1728
                             'at_modification',
1729 1729
                             $_SESSION['login'],
1730
-                            'at_category : ' . $dataTmp[0]['title'] . ' => ' . $dataTmp[1]['title']
1730
+                            'at_category : '.$dataTmp[0]['title'].' => '.$dataTmp[1]['title']
1731 1731
                         );
1732 1732
                     }
1733 1733
                     // ANYONE_CAN_MODIFY
@@ -1735,7 +1735,7 @@  discard block
 block discarded – undo
1735 1735
                         // Store updates performed
1736 1736
                         array_push(
1737 1737
                             $arrayOfChanges,
1738
-                            langHdl('at_anyoneconmodify') . ': ' . ((int) $post_anyone_can_modify === 0 ? langHdl('disabled') : langHdl('enabled'))
1738
+                            langHdl('at_anyoneconmodify').': '.((int) $post_anyone_can_modify === 0 ? langHdl('disabled') : langHdl('enabled'))
1739 1739
                         );
1740 1740
 
1741 1741
                         // Log
@@ -1746,15 +1746,15 @@  discard block
 block discarded – undo
1746 1746
                             $_SESSION['user_id'],
1747 1747
                             'at_modification',
1748 1748
                             $_SESSION['login'],
1749
-                            'at_anyoneconmodify : ' . ((int) $post_anyone_can_modify === 0 ? 'disabled' : 'enabled')
1749
+                            'at_anyoneconmodify : '.((int) $post_anyone_can_modify === 0 ? 'disabled' : 'enabled')
1750 1750
                         );
1751 1751
                     }
1752 1752
 
1753 1753
                     // Reload new values
1754 1754
                     $dataItem = DB::queryfirstrow(
1755 1755
                         'SELECT *
1756
-                        FROM ' . prefixTable('items') . ' as i
1757
-                        INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id)
1756
+                        FROM ' . prefixTable('items').' as i
1757
+                        INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id)
1758 1758
                         WHERE i.id = %i AND l.action = %s',
1759 1759
                         $post_item_id,
1760 1760
                         'at_creation'
@@ -1763,8 +1763,8 @@  discard block
 block discarded – undo
1763 1763
                     $history = '';
1764 1764
                     $rows = DB::query(
1765 1765
                         'SELECT l.date as date, l.action as action, l.raison as raison, u.login as login
1766
-                        FROM ' . prefixTable('log_items') . ' as l
1767
-                        LEFT JOIN ' . prefixTable('users') . ' as u ON (l.id_user=u.id)
1766
+                        FROM ' . prefixTable('log_items').' as l
1767
+                        LEFT JOIN ' . prefixTable('users').' as u ON (l.id_user=u.id)
1768 1768
                         WHERE l.action <> %s AND id_item=%s',
1769 1769
                         'at_shown',
1770 1770
                         $post_item_id
@@ -1773,14 +1773,14 @@  discard block
 block discarded – undo
1773 1773
                         if ($record['raison'] === NULL) continue;
1774 1774
                         $reason = explode(':', $record['raison']);
1775 1775
                         if (count($reason) > 0) {
1776
-                            $sentence = date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['date']) . ' - '
1777
-                                . $record['login'] . ' - ' . langHdl($record['action']) . ' - '
1778
-                                . (empty($record['raison']) === false ? (count($reason) > 1 ? langHdl(trim($reason[0])) . ' : ' . $reason[1]
1776
+                            $sentence = date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['date']).' - '
1777
+                                . $record['login'].' - '.langHdl($record['action']).' - '
1778
+                                . (empty($record['raison']) === false ? (count($reason) > 1 ? langHdl(trim($reason[0])).' : '.$reason[1]
1779 1779
                                     : langHdl(trim($reason[0]))) : '');
1780 1780
                             if (empty($history)) {
1781 1781
                                 $history = $sentence;
1782 1782
                             } else {
1783
-                                $history .= '<br />' . $sentence;
1783
+                                $history .= '<br />'.$sentence;
1784 1784
                             }
1785 1785
                         }
1786 1786
                     }
@@ -1902,7 +1902,7 @@  discard block
 block discarded – undo
1902 1902
             ) {
1903 1903
                 // load the original record into an array
1904 1904
                 $originalRecord = DB::queryfirstrow(
1905
-                    'SELECT * FROM ' . prefixTable('items') . '
1905
+                    'SELECT * FROM '.prefixTable('items').'
1906 1906
                     WHERE id = %i',
1907 1907
                     $post_item_id
1908 1908
                 );
@@ -1921,7 +1921,7 @@  discard block
 block discarded – undo
1921 1921
 
1922 1922
                 // Load the destination folder record into an array
1923 1923
                 $dataDestination = DB::queryfirstrow(
1924
-                    'SELECT personal_folder FROM ' . prefixTable('nested_tree') . '
1924
+                    'SELECT personal_folder FROM '.prefixTable('nested_tree').'
1925 1925
                     WHERE id = %i',
1926 1926
                     $post_dest_id
1927 1927
                 );
@@ -1929,7 +1929,7 @@  discard block
 block discarded – undo
1929 1929
                 // Get the ITEM object key for the user
1930 1930
                 $userKey = DB::queryFirstRow(
1931 1931
                     'SELECT share_key
1932
-                    FROM ' . prefixTable('sharekeys_items') . '
1932
+                    FROM ' . prefixTable('sharekeys_items').'
1933 1933
                     WHERE user_id = %i AND object_id = %i',
1934 1934
                     $_SESSION['user_id'],
1935 1935
                     $post_item_id
@@ -2001,7 +2001,7 @@  discard block
 block discarded – undo
2001 2001
                 // Manage Custom Fields
2002 2002
                 $rows = DB::query(
2003 2003
                     'SELECT *
2004
-                    FROM ' . prefixTable('categories_items') . '
2004
+                    FROM ' . prefixTable('categories_items').'
2005 2005
                     WHERE item_id = %i',
2006 2006
                     $post_item_id
2007 2007
                 );
@@ -2049,15 +2049,15 @@  discard block
 block discarded – undo
2049 2049
                 $rows = DB::query(
2050 2050
                     'SELECT f.id AS id, f.file AS file, f.name AS name, f.status AS status, f.extension AS extension,
2051 2051
                     f.size AS size, f.type AS type, s.share_key AS share_key
2052
-                    FROM ' . prefixTable('files') . ' AS f
2053
-                    INNER JOIN ' . prefixTable('sharekeys_files') . ' AS s ON (f.id = s.object_id)
2052
+                    FROM ' . prefixTable('files').' AS f
2053
+                    INNER JOIN ' . prefixTable('sharekeys_files').' AS s ON (f.id = s.object_id)
2054 2054
                     WHERE s.user_id = %i AND f.id_item = %i',
2055 2055
                     $_SESSION['user_id'],
2056 2056
                     $post_item_id
2057 2057
                 );
2058 2058
                 foreach ($rows as $record) {
2059 2059
                     // Check if file still exists
2060
-                    if (file_exists($SETTINGS['path_to_upload_folder'] . DIRECTORY_SEPARATOR . TP_FILE_PREFIX . base64_decode($record['file'])) === true) {
2060
+                    if (file_exists($SETTINGS['path_to_upload_folder'].DIRECTORY_SEPARATOR.TP_FILE_PREFIX.base64_decode($record['file'])) === true) {
2061 2061
                         // Step1 - decrypt the file
2062 2062
                         $fileContent = decryptFile(
2063 2063
                             $record['file'],
@@ -2066,8 +2066,8 @@  discard block
 block discarded – undo
2066 2066
                         );
2067 2067
 
2068 2068
                         // Step2 - create file
2069
-                        $newFileName = md5(time() . '_' . $record['id']) . '.' . $record['extension'];
2070
-                        $outstream = fopen($SETTINGS['path_to_upload_folder'] . DIRECTORY_SEPARATOR . $newFileName, 'ab');
2069
+                        $newFileName = md5(time().'_'.$record['id']).'.'.$record['extension'];
2070
+                        $outstream = fopen($SETTINGS['path_to_upload_folder'].DIRECTORY_SEPARATOR.$newFileName, 'ab');
2071 2071
                         if ($outstream === false) {
2072 2072
                             echo prepareExchangedData(
2073 2073
                                 array(
@@ -2117,7 +2117,7 @@  discard block
 block discarded – undo
2117 2117
 
2118 2118
                 // -------------------------
2119 2119
                 // Add specific restrictions
2120
-                $rows = DB::query('SELECT * FROM ' . prefixTable('restriction_to_roles') . ' WHERE item_id = %i', $post_item_id);
2120
+                $rows = DB::query('SELECT * FROM '.prefixTable('restriction_to_roles').' WHERE item_id = %i', $post_item_id);
2121 2121
                 foreach ($rows as $record) {
2122 2122
                     DB::insert(
2123 2123
                         prefixTable('restriction_to_roles'),
@@ -2129,7 +2129,7 @@  discard block
 block discarded – undo
2129 2129
                 }
2130 2130
 
2131 2131
                 // Add Tags
2132
-                $rows = DB::query('SELECT * FROM ' . prefixTable('tags') . ' WHERE item_id = %i', $post_item_id);
2132
+                $rows = DB::query('SELECT * FROM '.prefixTable('tags').' WHERE item_id = %i', $post_item_id);
2133 2133
                 foreach ($rows as $record) {
2134 2134
                     DB::insert(
2135 2135
                         prefixTable('tags'),
@@ -2159,7 +2159,7 @@  discard block
 block discarded – undo
2159 2159
                     $_SESSION['login']
2160 2160
                 );
2161 2161
                 // reload cache table
2162
-                include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
2162
+                include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
2163 2163
                 updateCacheTable('reload', $SETTINGS, '');
2164 2164
 
2165 2165
                 echo (string) prepareExchangedData(
@@ -2227,7 +2227,7 @@  discard block
 block discarded – undo
2227 2227
             // then we can show it
2228 2228
             $item_deleted = DB::queryFirstRow(
2229 2229
                 'SELECT *
2230
-                FROM ' . prefixTable('log_items') . '
2230
+                FROM ' . prefixTable('log_items').'
2231 2231
                 WHERE id_item = %i AND action = %s
2232 2232
                 ORDER BY date DESC
2233 2233
                 LIMIT 0, 1',
@@ -2238,7 +2238,7 @@  discard block
 block discarded – undo
2238 2238
 
2239 2239
             $item_restored = DB::queryFirstRow(
2240 2240
                 'SELECT *
2241
-                FROM ' . prefixTable('log_items') . '
2241
+                FROM ' . prefixTable('log_items').'
2242 2242
                 WHERE id_item = %i AND action = %s
2243 2243
                 ORDER BY date DESC
2244 2244
                 LIMIT 0, 1',
@@ -2262,8 +2262,8 @@  discard block
 block discarded – undo
2262 2262
             // Get all informations for this item
2263 2263
             $dataItem = DB::queryfirstrow(
2264 2264
                 'SELECT *
2265
-                FROM ' . prefixTable('items') . ' as i
2266
-                INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id)
2265
+                FROM ' . prefixTable('items').' as i
2266
+                INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id)
2267 2267
                 WHERE i.id = %i AND l.action = %s',
2268 2268
                 $post_id,
2269 2269
                 'at_creation'
@@ -2272,7 +2272,7 @@  discard block
 block discarded – undo
2272 2272
             // Notification
2273 2273
             DB::queryfirstrow(
2274 2274
                 'SELECT *
2275
-                FROM ' . prefixTable('notification') . '
2275
+                FROM ' . prefixTable('notification').'
2276 2276
                 WHERE item_id = %i AND user_id = %i',
2277 2277
                 $post_id,
2278 2278
                 $_SESSION['user_id']
@@ -2319,13 +2319,13 @@  discard block
 block discarded – undo
2319 2319
                     && (int) $SETTINGS['enable_email_notification_on_item_shown'] === 1
2320 2320
                     && (int) $user['admin'] === 1
2321 2321
                 ) {
2322
-                    $_SESSION['listNotificationEmails'] .= $user['email'] . ',';
2322
+                    $_SESSION['listNotificationEmails'] .= $user['email'].',';
2323 2323
                 }
2324 2324
             }
2325 2325
 
2326 2326
             // manage case of API user
2327 2327
             if ($dataItem['id_user'] === API_USER_ID) {
2328
-                $arrData['author'] = 'API [' . $dataItem['description'] . ']';
2328
+                $arrData['author'] = 'API ['.$dataItem['description'].']';
2329 2329
                 $arrData['id_user'] = API_USER_ID;
2330 2330
                 $arrData['author_email'] = '';
2331 2331
                 $arrData['notification_status'] = false;
@@ -2335,7 +2335,7 @@  discard block
 block discarded – undo
2335 2335
             $tags = array();
2336 2336
             $rows = DB::query(
2337 2337
                 'SELECT tag
2338
-                FROM ' . prefixTable('tags') . '
2338
+                FROM ' . prefixTable('tags').'
2339 2339
                 WHERE item_id = %i',
2340 2340
                 $post_id
2341 2341
             );
@@ -2360,7 +2360,7 @@  discard block
 block discarded – undo
2360 2360
             // Check if user has a role that is accepted
2361 2361
             $rows_tmp = DB::query(
2362 2362
                 'SELECT role_id
2363
-                FROM ' . prefixTable('restriction_to_roles') . '
2363
+                FROM ' . prefixTable('restriction_to_roles').'
2364 2364
                 WHERE item_id=%i',
2365 2365
                 $post_id
2366 2366
             );
@@ -2374,7 +2374,7 @@  discard block
 block discarded – undo
2374 2374
             // Get the object key for the user
2375 2375
             $userKey = DB::queryFirstRow(
2376 2376
                 'SELECT share_key
2377
-                FROM ' . prefixTable('sharekeys_items') . '
2377
+                FROM ' . prefixTable('sharekeys_items').'
2378 2378
                 WHERE user_id = %i AND object_id = %i',
2379 2379
                 $_SESSION['user_id'],
2380 2380
                 $post_id
@@ -2459,8 +2459,8 @@  discard block
 block discarded – undo
2459 2459
                     // Add restriction if item is restricted to roles
2460 2460
                     $rows = DB::query(
2461 2461
                         'SELECT t.title, t.id
2462
-                        FROM ' . prefixTable('roles_title') . ' AS t
2463
-                        INNER JOIN ' . prefixTable('restriction_to_roles') . ' AS r ON (t.id=r.role_id)
2462
+                        FROM ' . prefixTable('roles_title').' AS t
2463
+                        INNER JOIN ' . prefixTable('restriction_to_roles').' AS r ON (t.id=r.role_id)
2464 2464
                         WHERE r.item_id = %i
2465 2465
                         ORDER BY t.title ASC',
2466 2466
                         $post_id
@@ -2476,8 +2476,8 @@  discard block
 block discarded – undo
2476 2476
                     $tmp = array();
2477 2477
                     $rows = DB::query(
2478 2478
                         'SELECT k.label, k.id
2479
-                        FROM ' . prefixTable('kb_items') . ' as i
2480
-                        INNER JOIN ' . prefixTable('kb') . ' as k ON (i.kb_id=k.id)
2479
+                        FROM ' . prefixTable('kb_items').' as i
2480
+                        INNER JOIN ' . prefixTable('kb').' as k ON (i.kb_id=k.id)
2481 2481
                         WHERE i.item_id = %i
2482 2482
                         ORDER BY k.label ASC',
2483 2483
                         $post_id
@@ -2557,7 +2557,7 @@  discard block
 block discarded – undo
2557 2557
                     $arrCatList = array();
2558 2558
                     $rows_tmp = DB::query(
2559 2559
                         'SELECT id_category
2560
-                        FROM ' . prefixTable('categories_folders') . '
2560
+                        FROM ' . prefixTable('categories_folders').'
2561 2561
                         WHERE id_folder=%i',
2562 2562
                         $post_folder_id
2563 2563
                     );
@@ -2572,8 +2572,8 @@  discard block
 block discarded – undo
2572 2572
                             'SELECT i.id AS id, i.field_id AS field_id, i.data AS data, i.item_id AS item_id,
2573 2573
                             i.encryption_type AS encryption_type, c.encrypted_data, c.parent_id AS parent_id,
2574 2574
                             c.type as field_type, c.masked AS field_masked, c.role_visibility AS role_visibility
2575
-                            FROM ' . prefixTable('categories_items') . ' AS i
2576
-                            INNER JOIN ' . prefixTable('categories') . ' AS c ON (i.field_id=c.id)
2575
+                            FROM ' . prefixTable('categories_items').' AS i
2576
+                            INNER JOIN ' . prefixTable('categories').' AS c ON (i.field_id=c.id)
2577 2577
                             WHERE i.item_id=%i AND c.parent_id IN %ls',
2578 2578
                             $post_id,
2579 2579
                             $arrCatList
@@ -2584,11 +2584,11 @@  discard block
 block discarded – undo
2584 2584
 							//db::debugmode(true);
2585 2585
                             $userKey = DB::queryFirstRow(
2586 2586
                                 'SELECT share_key
2587
-                                FROM ' . prefixTable('sharekeys_fields') . '
2587
+                                FROM ' . prefixTable('sharekeys_fields').'
2588 2588
                                 WHERE user_id = %i AND object_id = %i',
2589 2589
                                 $_SESSION['user_id'],
2590 2590
                                 $row['id']
2591
-                            );//db::debugmode(false);
2591
+                            ); //db::debugmode(false);
2592 2592
                             $fieldText = [];
2593 2593
                             if (DB::count() === 0) {
2594 2594
                                 // Not encrypted
@@ -2630,7 +2630,7 @@  discard block
 block discarded – undo
2630 2630
                 if (isset($SETTINGS['item_creation_templates']) && (int) $SETTINGS['item_creation_templates'] === 1) {
2631 2631
                     $rows_tmp = DB::queryfirstrow(
2632 2632
                         'SELECT category_id
2633
-                        FROM ' . prefixTable('templates') . '
2633
+                        FROM ' . prefixTable('templates').'
2634 2634
                         WHERE item_id = %i',
2635 2635
                         $post_id
2636 2636
                     );
@@ -2655,7 +2655,7 @@  discard block
 block discarded – undo
2655 2655
                     // Is the Item to be deleted?
2656 2656
                     $dataDelete = DB::queryfirstrow(
2657 2657
                         'SELECT * 
2658
-                        FROM ' . prefixTable('automatic_del') . '
2658
+                        FROM ' . prefixTable('automatic_del').'
2659 2659
                         WHERE item_id = %i',
2660 2660
                         $post_id
2661 2661
                     );
@@ -2737,11 +2737,11 @@  discard block
 block discarded – undo
2737 2737
                 if (empty($dataItem['restricted_to']) === false) {
2738 2738
                     foreach (explode(';', $dataItem['restricted_to']) as $userRest) {
2739 2739
                         if (empty($userRest) === false) {
2740
-                            $dataTmp = DB::queryfirstrow('SELECT login FROM ' . prefixTable('users') . ' WHERE id= ' . $userRest);
2740
+                            $dataTmp = DB::queryfirstrow('SELECT login FROM '.prefixTable('users').' WHERE id= '.$userRest);
2741 2741
                             if (empty($listOfRestricted)) {
2742 2742
                                 $listOfRestricted = $dataTmp['login'];
2743 2743
                             } else {
2744
-                                $listOfRestricted .= ';' . $dataTmp['login'];
2744
+                                $listOfRestricted .= ';'.$dataTmp['login'];
2745 2745
                             }
2746 2746
                         }
2747 2747
                     }
@@ -2798,8 +2798,8 @@  discard block
 block discarded – undo
2798 2798
             // Load item data
2799 2799
             $dataItem = DB::queryFirstRow(
2800 2800
                 'SELECT i.*, n.title AS folder_title
2801
-                FROM ' . prefixTable('items') . ' AS i
2802
-                INNER JOIN ' . prefixTable('nested_tree') . ' AS n ON (i.id_tree = n.id)
2801
+                FROM ' . prefixTable('items').' AS i
2802
+                INNER JOIN ' . prefixTable('nested_tree').' AS n ON (i.id_tree = n.id)
2803 2803
                 WHERE i.id = %i',
2804 2804
                 $post_id
2805 2805
             );
@@ -2821,7 +2821,7 @@  discard block
 block discarded – undo
2821 2821
             // Check if user has a role that is accepted
2822 2822
             $rows_tmp = DB::query(
2823 2823
                 'SELECT role_id
2824
-                FROM ' . prefixTable('restriction_to_roles') . '
2824
+                FROM ' . prefixTable('restriction_to_roles').'
2825 2825
                 WHERE item_id=%i',
2826 2826
                 $post_id
2827 2827
             );
@@ -2867,7 +2867,7 @@  discard block
 block discarded – undo
2867 2867
                 // launch query
2868 2868
                 $rows = DB::query(
2869 2869
                     'SELECT id, name, file, extension, size
2870
-                    FROM ' . prefixTable('files') . '
2870
+                    FROM ' . prefixTable('files').'
2871 2871
                     WHERE id_item = %i AND confirmed = 1',
2872 2872
                     $post_id
2873 2873
                 );
@@ -2876,7 +2876,7 @@  discard block
 block discarded – undo
2876 2876
                         $attachments,
2877 2877
                         array(
2878 2878
                             'icon' => fileFormatImage(strtolower($record['extension'])),
2879
-                            'filename' => basename($record['name'], '.' . $record['extension']),
2879
+                            'filename' => basename($record['name'], '.'.$record['extension']),
2880 2880
                             'extension' => $record['extension'],
2881 2881
                             'size' => formatSizeUnits((int) $record['size']),
2882 2882
                             'is_image' => in_array(strtolower($record['extension']), TP_IMAGE_FILE_EXT) === true ? 1 : 0,
@@ -2902,7 +2902,7 @@  discard block
 block discarded – undo
2902 2902
                         array(
2903 2903
                             'latest_items' => implode(';', $_SESSION['latest_items']),
2904 2904
                         ),
2905
-                        'id=' . $_SESSION['user_id']
2905
+                        'id='.$_SESSION['user_id']
2906 2906
                     );
2907 2907
                 }
2908 2908
 
@@ -2911,8 +2911,8 @@  discard block
 block discarded – undo
2911 2911
                 $listOptionsForRoles = array();
2912 2912
                 $rows = DB::query(
2913 2913
                     'SELECT r.role_id AS role_id, t.title AS title
2914
-                    FROM ' . prefixTable('roles_values') . ' AS r
2915
-                    INNER JOIN ' . prefixTable('roles_title') . ' AS t ON (r.role_id = t.id)
2914
+                    FROM ' . prefixTable('roles_values').' AS r
2915
+                    INNER JOIN ' . prefixTable('roles_title').' AS t ON (r.role_id = t.id)
2916 2916
                     WHERE r.folder_id = %i',
2917 2917
                     $dataItem['id_tree']
2918 2918
                 );
@@ -2926,9 +2926,9 @@  discard block
 block discarded – undo
2926 2926
                     );
2927 2927
                     $rows2 = DB::query(
2928 2928
                         'SELECT id, login, fonction_id, email, name, lastname
2929
-                        FROM ' . prefixTable('users') . '
2929
+                        FROM ' . prefixTable('users').'
2930 2930
                         WHERE fonction_id LIKE %s',
2931
-                        '%' . $record['role_id'] . '%'
2931
+                        '%'.$record['role_id'].'%'
2932 2932
                     );
2933 2933
                     foreach ($rows2 as $record2) {
2934 2934
                         foreach (explode(';', $record2['fonction_id']) as $role) {
@@ -2941,7 +2941,7 @@  discard block
 block discarded – undo
2941 2941
                                     array(
2942 2942
                                         'id' => (int) $record2['id'],
2943 2943
                                         'login' => $record2['login'],
2944
-                                        'name' => $record2['name'] . ' ' . $record2['lastname'],
2944
+                                        'name' => $record2['name'].' '.$record2['lastname'],
2945 2945
                                         'email' => $record2['email'],
2946 2946
                                     )
2947 2947
                                 );
@@ -2960,16 +2960,16 @@  discard block
 block discarded – undo
2960 2960
                     $path = '';
2961 2961
                     foreach ($arbo as $elem) {
2962 2962
                         if (empty($path) === true) {
2963
-                            $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES) . ' ';
2963
+                            $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES).' ';
2964 2964
                         } else {
2965
-                            $path .= '&#8594; ' . htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
2965
+                            $path .= '&#8594; '.htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
2966 2966
                         }
2967 2967
                     }
2968 2968
                     // Build text to show user
2969 2969
                     if (empty($path) === true) {
2970 2970
                         $path = addslashes($dataItem['label']);
2971 2971
                     } else {
2972
-                        $path = addslashes($dataItem['label']) . ' (' . $path . ')';
2972
+                        $path = addslashes($dataItem['label']).' ('.$path.')';
2973 2973
                     }
2974 2974
 
2975 2975
                     // send back infos
@@ -2983,7 +2983,7 @@  discard block
 block discarded – undo
2983 2983
                                 array(
2984 2984
                                     addslashes($_SESSION['login']),
2985 2985
                                     $path,
2986
-                                    $SETTINGS['cpassman_url'] . '/index.php?page=items&group=' . $dataItem['id_tree'] . '&id=' . $dataItem['id'],
2986
+                                    $SETTINGS['cpassman_url'].'/index.php?page=items&group='.$dataItem['id_tree'].'&id='.$dataItem['id'],
2987 2987
                                 ),
2988 2988
                                 langHdl('email_on_open_notification_mail')
2989 2989
                             ),
@@ -2994,7 +2994,7 @@  discard block
 block discarded – undo
2994 2994
                 }
2995 2995
 
2996 2996
                 // has this item a change proposal
2997
-                DB::query('SELECT * FROM ' . prefixTable('items_change') . ' WHERE item_id = %i', $post_id);
2997
+                DB::query('SELECT * FROM '.prefixTable('items_change').' WHERE item_id = %i', $post_id);
2998 2998
                 $returnArray['has_change_proposal'] = DB::count();
2999 2999
 
3000 3000
                 // Setting
@@ -3085,7 +3085,7 @@  discard block
 block discarded – undo
3085 3085
             // Load item data
3086 3086
             $data = DB::queryFirstRow(
3087 3087
                 'SELECT id_tree
3088
-                FROM ' . prefixTable('items') . '
3088
+                FROM ' . prefixTable('items').'
3089 3089
                 WHERE id = %i',
3090 3090
                 $post_item_id
3091 3091
             );
@@ -3155,13 +3155,13 @@  discard block
 block discarded – undo
3155 3155
 
3156 3156
             // Check if user is allowed to access this folder
3157 3157
             if (!in_array($post_folder_id, $_SESSION['groupes_visibles'])) {
3158
-                echo '[{"error" : "' . langHdl('error_not_allowed_to') . '"}]';
3158
+                echo '[{"error" : "'.langHdl('error_not_allowed_to').'"}]';
3159 3159
                 break;
3160 3160
             }
3161 3161
 
3162 3162
             // Check if title doesn't contains html codes
3163 3163
             if (preg_match_all('|<[^>]+>(.*)</[^>]+>|U', $title, $out)) {
3164
-                echo '[ { "error" : "' . langHdl('error_html_codes') . '" } ]';
3164
+                echo '[ { "error" : "'.langHdl('error_html_codes').'" } ]';
3165 3165
                 break;
3166 3166
             }
3167 3167
             // check that title is not numeric
@@ -3172,9 +3172,9 @@  discard block
 block discarded – undo
3172 3172
 
3173 3173
             // Check if duplicate folders name are allowed
3174 3174
             if (isset($SETTINGS['duplicate_folder']) && $SETTINGS['duplicate_folder'] === '0') {
3175
-                $data = DB::queryFirstRow('SELECT id, title FROM ' . prefixTable('nested_tree') . ' WHERE title = %s', $title);
3175
+                $data = DB::queryFirstRow('SELECT id, title FROM '.prefixTable('nested_tree').' WHERE title = %s', $title);
3176 3176
                 if (empty($data['id']) === false && $dataReceived['folder'] !== $data['id']) {
3177
-                    echo '[ { "error" : "' . langHdl('error_group_exist') . '" } ]';
3177
+                    echo '[ { "error" : "'.langHdl('error_group_exist').'" } ]';
3178 3178
                     break;
3179 3179
                 }
3180 3180
             }
@@ -3182,7 +3182,7 @@  discard block
 block discarded – undo
3182 3182
             // query on folder
3183 3183
             $data = DB::queryfirstrow(
3184 3184
                 'SELECT parent_id, personal_folder
3185
-                FROM ' . prefixTable('nested_tree') . '
3185
+                FROM ' . prefixTable('nested_tree').'
3186 3186
                 WHERE id = %i',
3187 3187
                 $post_folder_id
3188 3188
             );
@@ -3192,20 +3192,20 @@  discard block
 block discarded – undo
3192 3192
             if ($_SESSION['is_admin'] !== 1 && $_SESSION['user_manager'] !== 1 && $data['personal_folder'] === '0') {
3193 3193
                 $data = DB::queryfirstrow(
3194 3194
                     'SELECT valeur
3195
-                    FROM ' . prefixTable('misc') . '
3195
+                    FROM ' . prefixTable('misc').'
3196 3196
                     WHERE intitule = %i AND type = %s',
3197 3197
                     $data['parent_id'],
3198 3198
                     'complex'
3199 3199
                 );
3200 3200
                 if (intval($dataReceived['complexity']) < intval($data['valeur'])) {
3201
-                    echo '[ { "error" : "' . langHdl('error_folder_complexity_lower_than_top_folder') . ' [<b>' . TP_PW_COMPLEXITY[$data['valeur']][1] . '</b>]"} ]';
3201
+                    echo '[ { "error" : "'.langHdl('error_folder_complexity_lower_than_top_folder').' [<b>'.TP_PW_COMPLEXITY[$data['valeur']][1].'</b>]"} ]';
3202 3202
                     break;
3203 3203
                 }
3204 3204
             }
3205 3205
 
3206 3206
             // update Folders table
3207 3207
             $tmp = DB::queryFirstRow(
3208
-                'SELECT title, parent_id, personal_folder FROM ' . prefixTable('nested_tree') . ' WHERE id = %i',
3208
+                'SELECT title, parent_id, personal_folder FROM '.prefixTable('nested_tree').' WHERE id = %i',
3209 3209
                 $dataReceived['folder']
3210 3210
             );
3211 3211
             if ($tmp['parent_id'] !== 0 || $tmp['title'] !== $_SESSION['user_id'] || $tmp['personal_folder'] !== 1) {
@@ -3270,42 +3270,42 @@  discard block
 block discarded – undo
3270 3270
                     in_array($post_target_folder_id, $_SESSION['groupes_visibles']) === false) && ($post_target_folder_id === '0' &&
3271 3271
                     isset($SETTINGS['can_create_root_folder']) === true && (int) $SETTINGS['can_create_root_folder'] === 1)
3272 3272
             ) {
3273
-                $returnValues = '[{"error" : "' . langHdl('error_not_allowed_to') . '"}]';
3273
+                $returnValues = '[{"error" : "'.langHdl('error_not_allowed_to').'"}]';
3274 3274
                 echo $returnValues;
3275 3275
                 break;
3276 3276
             }
3277 3277
 
3278 3278
             $tmp_source = DB::queryFirstRow(
3279 3279
                 'SELECT title, parent_id, personal_folder
3280
-                FROM ' . prefixTable('nested_tree') . '
3280
+                FROM ' . prefixTable('nested_tree').'
3281 3281
                 WHERE id = %i',
3282 3282
                 $post_source_folder_id
3283 3283
             );
3284 3284
 
3285 3285
             $tmp_target = DB::queryFirstRow(
3286 3286
                 'SELECT title, parent_id, personal_folder
3287
-                FROM ' . prefixTable('nested_tree') . '
3287
+                FROM ' . prefixTable('nested_tree').'
3288 3288
                 WHERE id = %i',
3289 3289
                 $post_target_folder_id
3290 3290
             );
3291 3291
 
3292 3292
             // check if target is not a child of source
3293 3293
             if ($tree->isChildOf($post_target_folder_id, $post_source_folder_id) === true) {
3294
-                $returnValues = '[{"error" : "' . langHdl('error_not_allowed_to') . '"}]';
3294
+                $returnValues = '[{"error" : "'.langHdl('error_not_allowed_to').'"}]';
3295 3295
                 echo $returnValues;
3296 3296
                 break;
3297 3297
             }
3298 3298
 
3299 3299
             // check if source or target folder is PF. If Yes, then cancel operation
3300 3300
             if ((int) $tmp_source['personal_folder'] === 1 || (int) $tmp_target['personal_folder'] === 1) {
3301
-                $returnValues = '[{"error" : "' . langHdl('error_not_allowed_to') . '"}]';
3301
+                $returnValues = '[{"error" : "'.langHdl('error_not_allowed_to').'"}]';
3302 3302
                 echo $returnValues;
3303 3303
                 break;
3304 3304
             }
3305 3305
 
3306 3306
             // check if source or target folder is PF. If Yes, then cancel operation
3307 3307
             if ($tmp_source['title'] === $_SESSION['user_id'] || $tmp_target['title'] === $_SESSION['user_id']) {
3308
-                $returnValues = '[{"error" : "' . langHdl('error_not_allowed_to') . '"}]';
3308
+                $returnValues = '[{"error" : "'.langHdl('error_not_allowed_to').'"}]';
3309 3309
                 echo $returnValues;
3310 3310
                 break;
3311 3311
             }
@@ -3427,7 +3427,7 @@  discard block
 block discarded – undo
3427 3427
                 foreach ($_SESSION['user_roles'] as $role) {
3428 3428
                     $roleQ = DB::queryfirstrow(
3429 3429
                         'SELECT allow_pw_change
3430
-                        FROM ' . prefixTable('roles_title') . '
3430
+                        FROM ' . prefixTable('roles_title').'
3431 3431
                         WHERE id = %i',
3432 3432
                         $role
3433 3433
                     );
@@ -3452,11 +3452,11 @@  discard block
 block discarded – undo
3452 3452
                     
3453 3453
                     foreach ($_SESSION['user_roles'] as $role) {
3454 3454
                         $access = DB::queryFirstRow(
3455
-                            'SELECT type FROM ' . prefixTable('roles_values') . ' WHERE role_id = %i AND folder_id = %i',
3455
+                            'SELECT type FROM '.prefixTable('roles_values').' WHERE role_id = %i AND folder_id = %i',
3456 3456
                             $role,
3457 3457
                             $post_id
3458 3458
                         );
3459
-                        if (DB::count()>0) {
3459
+                        if (DB::count() > 0) {
3460 3460
                             if ($access['type'] === 'R') {
3461 3461
                                 array_push($arrTmp, 10);
3462 3462
                             } elseif ($access['type'] === 'W') {
@@ -3520,7 +3520,7 @@  discard block
 block discarded – undo
3520 3520
                 } else {
3521 3521
                     DB::query(
3522 3522
                         'SELECT *
3523
-                        FROM ' . prefixTable('items') . '
3523
+                        FROM ' . prefixTable('items').'
3524 3524
                         WHERE inactif = %i',
3525 3525
                         0
3526 3526
                     );
@@ -3530,7 +3530,7 @@  discard block
 block discarded – undo
3530 3530
 
3531 3531
                 // Get folder complexity
3532 3532
                 $folderComplexity = DB::queryFirstRow(
3533
-                    'SELECT valeur FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %i',
3533
+                    'SELECT valeur FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %i',
3534 3534
                     'complex',
3535 3535
                     $post_id
3536 3536
                 );
@@ -3542,7 +3542,7 @@  discard block
 block discarded – undo
3542 3542
                 if (isset($SETTINGS['item_extra_fields']) && (int) $SETTINGS['item_extra_fields'] === 1) {
3543 3543
                     $folderRow = DB::query(
3544 3544
                         'SELECT id_category
3545
-                        FROM ' . prefixTable('categories_folders') . '
3545
+                        FROM ' . prefixTable('categories_folders').'
3546 3546
                         WHERE id_folder = %i',
3547 3547
                         $post_id
3548 3548
                     );
@@ -3656,13 +3656,13 @@  discard block
 block discarded – undo
3656 3656
                 // List all ITEMS
3657 3657
                 if ($folderIsPf === false) {
3658 3658
                     $where->add('i.inactif=%i', 0);
3659
-                    $where->add('l.date=%l', '(SELECT date FROM ' . prefixTable('log_items') . " WHERE action IN ('at_creation', 'at_modification') AND id_item=i.id ORDER BY date DESC LIMIT 1)");
3659
+                    $where->add('l.date=%l', '(SELECT date FROM '.prefixTable('log_items')." WHERE action IN ('at_creation', 'at_modification') AND id_item=i.id ORDER BY date DESC LIMIT 1)");
3660 3660
                     if (empty($limited_to_items) === false) {
3661 3661
                         $where->add('i.id IN %ls', explode(',', $limited_to_items));
3662 3662
                     }
3663 3663
 
3664
-                    $query_limit = ' LIMIT ' .
3665
-                        $start . ',' .
3664
+                    $query_limit = ' LIMIT '.
3665
+                        $start.','.
3666 3666
                         $post_nb_items_to_display_once;
3667 3667
                     //db::debugmode(true);
3668 3668
                     $rows = DB::query(
@@ -3673,9 +3673,9 @@  discard block
 block discarded – undo
3673 3673
                         MIN(l.action) AS log_action,
3674 3674
                         l.id_user AS log_user,
3675 3675
                         i.url AS link
3676
-                        FROM ' . prefixTable('items') . ' AS i
3677
-                        INNER JOIN ' . prefixTable('nested_tree') . ' AS n ON (i.id_tree = n.id)
3678
-                        INNER JOIN ' . prefixTable('log_items') . ' AS l ON (i.id = l.id_item)
3676
+                        FROM ' . prefixTable('items').' AS i
3677
+                        INNER JOIN ' . prefixTable('nested_tree').' AS n ON (i.id_tree = n.id)
3678
+                        INNER JOIN ' . prefixTable('log_items').' AS l ON (i.id = l.id_item)
3679 3679
                         WHERE %l
3680 3680
                         GROUP BY i.id, l.date, l.id_user, l.action
3681 3681
                         ORDER BY i.label ASC, l.date DESC' . $query_limit,
@@ -3694,9 +3694,9 @@  discard block
 block discarded – undo
3694 3694
                         MIN(l.action) AS log_action,
3695 3695
                         l.id_user AS log_user,
3696 3696
                         i.url AS link
3697
-                        FROM ' . prefixTable('items') . ' AS i
3698
-                        INNER JOIN ' . prefixTable('nested_tree') . ' AS n ON (i.id_tree = n.id)
3699
-                        INNER JOIN ' . prefixTable('log_items') . ' AS l ON (i.id = l.id_item)
3697
+                        FROM ' . prefixTable('items').' AS i
3698
+                        INNER JOIN ' . prefixTable('nested_tree').' AS n ON (i.id_tree = n.id)
3699
+                        INNER JOIN ' . prefixTable('log_items').' AS l ON (i.id = l.id_item)
3700 3700
                         WHERE %l
3701 3701
                         GROUP BY i.id, l.date, l.id_user, l.action
3702 3702
                         ORDER BY i.label ASC, l.date DESC',
@@ -3726,7 +3726,7 @@  discard block
 block discarded – undo
3726 3726
                         $item_is_restricted_to_role = false;
3727 3727
                         DB::queryfirstrow(
3728 3728
                             'SELECT role_id
3729
-                            FROM ' . prefixTable('restriction_to_roles') . '
3729
+                            FROM ' . prefixTable('restriction_to_roles').'
3730 3730
                             WHERE item_id = %i',
3731 3731
                             $record['id']
3732 3732
                         );
@@ -3738,7 +3738,7 @@  discard block
 block discarded – undo
3738 3738
                         $user_is_included_in_role = false;
3739 3739
                         DB::query(
3740 3740
                             'SELECT role_id
3741
-                            FROM ' . prefixTable('restriction_to_roles') . '
3741
+                            FROM ' . prefixTable('restriction_to_roles').'
3742 3742
                             WHERE item_id = %i AND role_id IN %ls',
3743 3743
                             $record['id'],
3744 3744
                             $_SESSION['user_roles']
@@ -3942,9 +3942,9 @@  discard block
 block discarded – undo
3942 3942
             if ((int) $start === 0) {
3943 3943
                 DB::query(
3944 3944
                     'SELECT i.id
3945
-                    FROM ' . prefixTable('items') . ' as i
3946
-                    INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree = n.id)
3947
-                    INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id = l.id_item)
3945
+                    FROM ' . prefixTable('items').' as i
3946
+                    INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree = n.id)
3947
+                    INNER JOIN ' . prefixTable('log_items').' as l ON (i.id = l.id_item)
3948 3948
                     WHERE %l
3949 3949
                     ORDER BY i.label ASC, l.date DESC',
3950 3950
                     $where
@@ -4008,8 +4008,8 @@  discard block
 block discarded – undo
4008 4008
             // Run query
4009 4009
             $dataItem = DB::queryfirstrow(
4010 4010
                 'SELECT i.pw AS pw, s.share_key AS share_key
4011
-                FROM ' . prefixTable('items') . ' AS i
4012
-                INNER JOIN ' . prefixTable('sharekeys_items') . ' AS s ON (s.object_id = i.id)
4011
+                FROM ' . prefixTable('items').' AS i
4012
+                INNER JOIN ' . prefixTable('sharekeys_items').' AS s ON (s.object_id = i.id)
4013 4013
                 WHERE user_id = %i AND i.id = %i',
4014 4014
                 $_SESSION['user_id'],
4015 4015
                 $post_item_id
@@ -4052,7 +4052,7 @@  discard block
 block discarded – undo
4052 4052
             if (null !== $post_item_id && empty($post_item_id) === false) {
4053 4053
                 $dataItem = DB::queryfirstrow(
4054 4054
                     'SELECT perso, anyone_can_modify
4055
-                    FROM ' . prefixTable('items') . '
4055
+                    FROM ' . prefixTable('items').'
4056 4056
                     WHERE id=%i',
4057 4057
                     $post_item_id
4058 4058
                 );
@@ -4089,7 +4089,7 @@  discard block
 block discarded – undo
4089 4089
                 */
4090 4090
 
4091 4091
                 // Lock Item (if already locked), go back and warn
4092
-                $dataTmp = DB::queryFirstRow('SELECT timestamp, user_id FROM ' . prefixTable('items_edition') . ' WHERE item_id = %i', $post_item_id);
4092
+                $dataTmp = DB::queryFirstRow('SELECT timestamp, user_id FROM '.prefixTable('items_edition').' WHERE item_id = %i', $post_item_id);
4093 4093
 
4094 4094
                 // If token is taken for this Item and delay is passed then delete it.
4095 4095
                 if (
@@ -4100,7 +4100,7 @@  discard block
 block discarded – undo
4100 4100
                     DB::delete(prefixTable('items_edition'), 'item_id = %i', $post_item_id);
4101 4101
                     //reload the previous data
4102 4102
                     $dataTmp = DB::queryFirstRow(
4103
-                        'SELECT timestamp, user_id FROM ' . prefixTable('items_edition') . ' WHERE item_id = %i',
4103
+                        'SELECT timestamp, user_id FROM '.prefixTable('items_edition').' WHERE item_id = %i',
4104 4104
                         $post_item_id
4105 4105
                     );
4106 4106
                 }
@@ -4140,7 +4140,7 @@  discard block
 block discarded – undo
4140 4140
             // do query on this folder
4141 4141
             $data_this_folder = DB::queryFirstRow(
4142 4142
                 'SELECT id, personal_folder, title
4143
-                FROM ' . prefixTable('nested_tree') . '
4143
+                FROM ' . prefixTable('nested_tree').'
4144 4144
                 WHERE id = %s',
4145 4145
                 $post_groupe
4146 4146
             );
@@ -4177,8 +4177,8 @@  discard block
 block discarded – undo
4177 4177
             $visibilite = '';
4178 4178
             $data = DB::queryFirstRow(
4179 4179
                 'SELECT m.valeur, n.personal_folder
4180
-                FROM ' . prefixTable('misc') . ' AS m
4181
-                INNER JOIN ' . prefixTable('nested_tree') . ' AS n ON (m.intitule = n.id)
4180
+                FROM ' . prefixTable('misc').' AS m
4181
+                INNER JOIN ' . prefixTable('nested_tree').' AS n ON (m.intitule = n.id)
4182 4182
                 WHERE type=%s AND intitule = %s',
4183 4183
                 'complex',
4184 4184
                 $post_groupe
@@ -4191,8 +4191,8 @@  discard block
 block discarded – undo
4191 4191
                 // Prepare Item actual visibility (what Users/Roles can see it)
4192 4192
                 $rows = DB::query(
4193 4193
                     'SELECT t.title
4194
-                    FROM ' . prefixTable('roles_values') . ' as v
4195
-                    INNER JOIN ' . prefixTable('roles_title') . ' as t ON (v.role_id = t.id)
4194
+                    FROM ' . prefixTable('roles_values').' as v
4195
+                    INNER JOIN ' . prefixTable('roles_title').' as t ON (v.role_id = t.id)
4196 4196
                     WHERE v.folder_id = %i
4197 4197
                     GROUP BY title',
4198 4198
                     $post_groupe
@@ -4201,7 +4201,7 @@  discard block
 block discarded – undo
4201 4201
                     if (empty($visibilite)) {
4202 4202
                         $visibilite = $record['title'];
4203 4203
                     } else {
4204
-                        $visibilite .= ' - ' . $record['title'];
4204
+                        $visibilite .= ' - '.$record['title'];
4205 4205
                     }
4206 4206
                 }
4207 4207
             } else {
@@ -4211,14 +4211,14 @@  discard block
 block discarded – undo
4211 4211
                 // do new query to know if current folder is pf
4212 4212
                 $data_pf = DB::queryFirstRow(
4213 4213
                     'SELECT personal_folder
4214
-                    FROM ' . prefixTable('nested_tree') . '
4214
+                    FROM ' . prefixTable('nested_tree').'
4215 4215
                     WHERE id = %s',
4216 4216
                     $post_groupe
4217 4217
                 );
4218 4218
                 
4219 4219
                 $folder_is_personal = $data_pf !== null ? (int) $data_pf['personal_folder'] : 0;
4220 4220
                 
4221
-                $visibilite = $_SESSION['name'] . ' ' . $_SESSION['lastname'] . ' (' . $_SESSION['login'] . ')';
4221
+                $visibilite = $_SESSION['name'].' '.$_SESSION['lastname'].' ('.$_SESSION['login'].')';
4222 4222
             }
4223 4223
 
4224 4224
             recupDroitCreationSansComplexite($post_groupe);
@@ -4228,8 +4228,8 @@  discard block
 block discarded – undo
4228 4228
             $listOptionsForRoles = array();
4229 4229
             $rows = DB::query(
4230 4230
                 'SELECT r.role_id AS role_id, t.title AS title
4231
-                FROM ' . prefixTable('roles_values') . ' AS r
4232
-                INNER JOIN ' . prefixTable('roles_title') . ' AS t ON (r.role_id = t.id)
4231
+                FROM ' . prefixTable('roles_values').' AS r
4232
+                INNER JOIN ' . prefixTable('roles_title').' AS t ON (r.role_id = t.id)
4233 4233
                 WHERE r.folder_id = %i',
4234 4234
                 $post_groupe
4235 4235
             );
@@ -4243,7 +4243,7 @@  discard block
 block discarded – undo
4243 4243
                 );
4244 4244
                 $rows2 = DB::query(
4245 4245
                     'SELECT id, login, fonction_id, email, name, lastname
4246
-                    FROM ' . prefixTable('users') . '
4246
+                    FROM ' . prefixTable('users').'
4247 4247
                     WHERE admin = 0'
4248 4248
                 );
4249 4249
                 foreach ($rows2 as $record2) {
@@ -4257,7 +4257,7 @@  discard block
 block discarded – undo
4257 4257
                                 array(
4258 4258
                                     'id' => $record2['id'],
4259 4259
                                     'login' => $record2['login'],
4260
-                                    'name' => $record2['name'] . ' ' . $record2['lastname'],
4260
+                                    'name' => $record2['name'].' '.$record2['lastname'],
4261 4261
                                     'email' => $record2['email'],
4262 4262
                                 )
4263 4263
                             );
@@ -4274,13 +4274,13 @@  discard block
 block discarded – undo
4274 4274
 					//db::debugmode(true);
4275 4275
 					$access = DB::queryFirstRow(
4276 4276
 						'SELECT type
4277
-						FROM ' . prefixTable('roles_values') . '
4277
+						FROM ' . prefixTable('roles_values').'
4278 4278
 						WHERE role_id = %i AND folder_id = %i',
4279 4279
 						$role,
4280 4280
 						$post_groupe
4281 4281
 					);
4282 4282
 					//db::debugmode(false);
4283
-                    if (DB::count()>0) {
4283
+                    if (DB::count() > 0) {
4284 4284
                         if ($access['type'] === 'R') {
4285 4285
                             array_push($arrTmp, 10);
4286 4286
                         } elseif ($access['type'] === 'W') {
@@ -4350,7 +4350,7 @@  discard block
 block discarded – undo
4350 4350
             // Get some info before deleting
4351 4351
             $data = DB::queryFirstRow(
4352 4352
                 'SELECT name, id_item, file
4353
-                FROM ' . prefixTable('files') . '
4353
+                FROM ' . prefixTable('files').'
4354 4354
                 WHERE id = %i',
4355 4355
                 $fileId
4356 4356
             );
@@ -4358,7 +4358,7 @@  discard block
 block discarded – undo
4358 4358
             // Load item data
4359 4359
             $data_item = DB::queryFirstRow(
4360 4360
                 'SELECT id_tree
4361
-                FROM ' . prefixTable('items') . '
4361
+                FROM ' . prefixTable('items').'
4362 4362
                 WHERE id = %i',
4363 4363
                 $data['id_item']
4364 4364
             );
@@ -4385,7 +4385,7 @@  discard block
 block discarded – undo
4385 4385
                     $_SESSION['user_id'],
4386 4386
                     'at_modification',
4387 4387
                     $_SESSION['login'],
4388
-                    'at_del_file : ' . $data['name']
4388
+                    'at_del_file : '.$data['name']
4389 4389
                 );
4390 4390
 
4391 4391
                 // DElete sharekeys
@@ -4396,7 +4396,7 @@  discard block
 block discarded – undo
4396 4396
                 );
4397 4397
 
4398 4398
                 // Delete file from server
4399
-                fileDelete($SETTINGS['path_to_upload_folder'] . '/' . TP_FILE_PREFIX . base64_decode($data['file']), $SETTINGS);
4399
+                fileDelete($SETTINGS['path_to_upload_folder'].'/'.TP_FILE_PREFIX.base64_decode($data['file']), $SETTINGS);
4400 4400
             }
4401 4401
 
4402 4402
             echo (string) prepareExchangedData(
@@ -4415,7 +4415,7 @@  discard block
 block discarded – undo
4415 4415
         case 'clear_html_tags':
4416 4416
             // Get information for this item
4417 4417
             $dataItem = DB::queryfirstrow(
4418
-                'SELECT description FROM ' . prefixTable('items') . ' WHERE id=%i',
4418
+                'SELECT description FROM '.prefixTable('items').' WHERE id=%i',
4419 4419
                 filter_input(INPUT_POST, 'id_item', FILTER_SANITIZE_NUMBER_INT)
4420 4420
             );
4421 4421
             // Clean up the string
@@ -4453,12 +4453,12 @@  discard block
 block discarded – undo
4453 4453
                 // Update SESSION with this new favourite
4454 4454
                 $data = DB::queryfirstrow(
4455 4455
                     'SELECT label,id_tree
4456
-                    FROM ' . prefixTable('items') . '
4456
+                    FROM ' . prefixTable('items').'
4457 4457
                     WHERE id = ' . mysqli_real_escape_string($link, $post_item_id)
4458 4458
                 );
4459 4459
                 $_SESSION['favourites_tab'][$post_item_id] = array(
4460 4460
                     'label' => $data['label'],
4461
-                    'url' => 'index.php?page=items&amp;group=' . $data['id_tree'] . '&amp;id=' . $post_item_id,
4461
+                    'url' => 'index.php?page=items&amp;group='.$data['id_tree'].'&amp;id='.$post_item_id,
4462 4462
                 );
4463 4463
             } elseif ((int) filter_input(INPUT_POST, 'action', FILTER_SANITIZE_NUMBER_INT) === 1) {
4464 4464
                 // delete from session
@@ -4527,8 +4527,8 @@  discard block
 block discarded – undo
4527 4527
             // get data about item
4528 4528
             $dataSource = DB::queryfirstrow(
4529 4529
                 'SELECT i.pw, f.personal_folder,i.id_tree, f.title,i.label
4530
-                FROM ' . prefixTable('items') . ' as i
4531
-                INNER JOIN ' . prefixTable('nested_tree') . ' as f ON (i.id_tree=f.id)
4530
+                FROM ' . prefixTable('items').' as i
4531
+                INNER JOIN ' . prefixTable('nested_tree').' as f ON (i.id_tree=f.id)
4532 4532
                 WHERE i.id=%i',
4533 4533
                 $post_item_id
4534 4534
             );
@@ -4536,7 +4536,7 @@  discard block
 block discarded – undo
4536 4536
             // get data about new folder
4537 4537
             $dataDestination = DB::queryfirstrow(
4538 4538
                 'SELECT personal_folder, title
4539
-                FROM ' . prefixTable('nested_tree') . '
4539
+                FROM ' . prefixTable('nested_tree').'
4540 4540
                 WHERE id = %i',
4541 4541
                 $post_folder_id
4542 4542
             );
@@ -4588,7 +4588,7 @@  discard block
 block discarded – undo
4588 4588
                 // Get fields for this Item
4589 4589
                 $rows = DB::query(
4590 4590
                     'SELECT id
4591
-                    FROM ' . prefixTable('categories_items') . '
4591
+                    FROM ' . prefixTable('categories_items').'
4592 4592
                     WHERE item_id = %i',
4593 4593
                     $post_item_id
4594 4594
                 );
@@ -4605,7 +4605,7 @@  discard block
 block discarded – undo
4605 4605
                 // Get FILES for this Item
4606 4606
                 $rows = DB::query(
4607 4607
                     'SELECT id
4608
-                    FROM ' . prefixTable('files') . '
4608
+                    FROM ' . prefixTable('files').'
4609 4609
                     WHERE id_item = %i',
4610 4610
                     $post_item_id
4611 4611
                 );
@@ -4650,7 +4650,7 @@  discard block
 block discarded – undo
4650 4650
                 // Get the ITEM object key for the user
4651 4651
                 $userKey = DB::queryFirstRow(
4652 4652
                     'SELECT share_key
4653
-                    FROM ' . prefixTable('sharekeys_items') . '
4653
+                    FROM ' . prefixTable('sharekeys_items').'
4654 4654
                     WHERE user_id = %i AND object_id = %i',
4655 4655
                     $_SESSION['user_id'],
4656 4656
                     $post_item_id
@@ -4661,8 +4661,8 @@  discard block
 block discarded – undo
4661 4661
                     // This is a public object
4662 4662
                     $users = DB::query(
4663 4663
                         'SELECT id, public_key
4664
-                        FROM ' . prefixTable('users') . '
4665
-                        WHERE id NOT IN ("' . OTV_USER_ID . '","' . SSH_USER_ID . '","' . API_USER_ID . '","' . $_SESSION['user_id'] . '")
4664
+                        FROM ' . prefixTable('users').'
4665
+                        WHERE id NOT IN ("' . OTV_USER_ID.'","'.SSH_USER_ID.'","'.API_USER_ID.'","'.$_SESSION['user_id'].'")
4666 4666
                         AND public_key != ""'
4667 4667
                     );
4668 4668
                     foreach ($users as $user) {
@@ -4682,14 +4682,14 @@  discard block
 block discarded – undo
4682 4682
                 // Get fields for this Item
4683 4683
                 $rows = DB::query(
4684 4684
                     'SELECT id
4685
-                    FROM ' . prefixTable('categories_items') . '
4685
+                    FROM ' . prefixTable('categories_items').'
4686 4686
                     WHERE item_id = %i',
4687 4687
                     $post_item_id
4688 4688
                 );
4689 4689
                 foreach ($rows as $field) {
4690 4690
                     $userKey = DB::queryFirstRow(
4691 4691
                         'SELECT share_key
4692
-                        FROM ' . prefixTable('sharekeys_fields') . '
4692
+                        FROM ' . prefixTable('sharekeys_fields').'
4693 4693
                         WHERE user_id = %i AND object_id = %i',
4694 4694
                         $_SESSION['user_id'],
4695 4695
                         $field['id']
@@ -4700,8 +4700,8 @@  discard block
 block discarded – undo
4700 4700
                         // This is a public object
4701 4701
                         $users = DB::query(
4702 4702
                             'SELECT id, public_key
4703
-                            FROM ' . prefixTable('users') . '
4704
-                            WHERE id NOT IN ("' . OTV_USER_ID . '","' . SSH_USER_ID . '","' . API_USER_ID . '","' . $_SESSION['user_id'] . '")
4703
+                            FROM ' . prefixTable('users').'
4704
+                            WHERE id NOT IN ("' . OTV_USER_ID.'","'.SSH_USER_ID.'","'.API_USER_ID.'","'.$_SESSION['user_id'].'")
4705 4705
                             AND public_key != ""'
4706 4706
                         );
4707 4707
                         foreach ($users as $user) {
@@ -4722,14 +4722,14 @@  discard block
 block discarded – undo
4722 4722
                 // Get FILES for this Item
4723 4723
                 $rows = DB::query(
4724 4724
                     'SELECT id
4725
-                    FROM ' . prefixTable('files') . '
4725
+                    FROM ' . prefixTable('files').'
4726 4726
                     WHERE id_item = %i',
4727 4727
                     $post_item_id
4728 4728
                 );
4729 4729
                 foreach ($rows as $attachment) {
4730 4730
                     $userKey = DB::queryFirstRow(
4731 4731
                         'SELECT share_key
4732
-                        FROM ' . prefixTable('sharekeys_files') . '
4732
+                        FROM ' . prefixTable('sharekeys_files').'
4733 4733
                         WHERE user_id = %i AND object_id = %i',
4734 4734
                         $_SESSION['user_id'],
4735 4735
                         $attachment['id']
@@ -4740,8 +4740,8 @@  discard block
 block discarded – undo
4740 4740
                         // This is a public object
4741 4741
                         $users = DB::query(
4742 4742
                             'SELECT id, public_key
4743
-                            FROM ' . prefixTable('users') . '
4744
-                            WHERE id NOT IN ("' . OTV_USER_ID . '","' . SSH_USER_ID . '","' . API_USER_ID . '","' . $_SESSION['user_id'] . '")
4743
+                            FROM ' . prefixTable('users').'
4744
+                            WHERE id NOT IN ("' . OTV_USER_ID.'","'.SSH_USER_ID.'","'.API_USER_ID.'","'.$_SESSION['user_id'].'")
4745 4745
                             AND public_key != ""'
4746 4746
                         );
4747 4747
                         foreach ($users as $user) {
@@ -4778,7 +4778,7 @@  discard block
 block discarded – undo
4778 4778
                 $_SESSION['user_id'],
4779 4779
                 'at_modification',
4780 4780
                 $_SESSION['login'],
4781
-                'at_moved : ' . $dataSource['title'] . ' -> ' . $dataDestination['title']
4781
+                'at_moved : '.$dataSource['title'].' -> '.$dataDestination['title']
4782 4782
             );
4783 4783
 
4784 4784
             $returnValues = array(
@@ -4831,8 +4831,8 @@  discard block
 block discarded – undo
4831 4831
                     // get data about item
4832 4832
                     $dataSource = DB::queryfirstrow(
4833 4833
                         'SELECT i.pw, f.personal_folder,i.id_tree, f.title,i.label
4834
-                        FROM ' . prefixTable('items') . ' as i
4835
-                        INNER JOIN ' . prefixTable('nested_tree') . ' as f ON (i.id_tree=f.id)
4834
+                        FROM ' . prefixTable('items').' as i
4835
+                        INNER JOIN ' . prefixTable('nested_tree').' as f ON (i.id_tree=f.id)
4836 4836
                         WHERE i.id=%i',
4837 4837
                         $item_id
4838 4838
                     );
@@ -4854,7 +4854,7 @@  discard block
 block discarded – undo
4854 4854
 
4855 4855
                     // get data about new folder
4856 4856
                     $dataDestination = DB::queryfirstrow(
4857
-                        'SELECT personal_folder, title FROM ' . prefixTable('nested_tree') . ' WHERE id = %i',
4857
+                        'SELECT personal_folder, title FROM '.prefixTable('nested_tree').' WHERE id = %i',
4858 4858
                         $post_folder_id
4859 4859
                     );
4860 4860
 
@@ -4895,7 +4895,7 @@  discard block
 block discarded – undo
4895 4895
                         // Get fields for this Item
4896 4896
                         $rows = DB::query(
4897 4897
                             'SELECT id
4898
-                            FROM ' . prefixTable('categories_items') . '
4898
+                            FROM ' . prefixTable('categories_items').'
4899 4899
                             WHERE item_id = %i',
4900 4900
                             $item_id
4901 4901
                         );
@@ -4912,7 +4912,7 @@  discard block
 block discarded – undo
4912 4912
                         // Get FILES for this Item
4913 4913
                         $rows = DB::query(
4914 4914
                             'SELECT id
4915
-                            FROM ' . prefixTable('files') . '
4915
+                            FROM ' . prefixTable('files').'
4916 4916
                             WHERE id_item = %i',
4917 4917
                             $item_id
4918 4918
                         );
@@ -4965,7 +4965,7 @@  discard block
 block discarded – undo
4965 4965
                         // Get the ITEM object key for the user
4966 4966
                         $userKey = DB::queryFirstRow(
4967 4967
                             'SELECT share_key
4968
-                            FROM ' . prefixTable('sharekeys_items') . '
4968
+                            FROM ' . prefixTable('sharekeys_items').'
4969 4969
                             WHERE user_id = %i AND object_id = %i',
4970 4970
                             $_SESSION['user_id'],
4971 4971
                             $item_id
@@ -4976,8 +4976,8 @@  discard block
 block discarded – undo
4976 4976
                             // This is a public object
4977 4977
                             $users = DB::query(
4978 4978
                                 'SELECT id, public_key
4979
-                                FROM ' . prefixTable('users') . '
4980
-                                WHERE id NOT IN ("' . OTV_USER_ID . '","' . SSH_USER_ID . '","' . API_USER_ID . '","' . $_SESSION['user_id'] . '")
4979
+                                FROM ' . prefixTable('users').'
4980
+                                WHERE id NOT IN ("' . OTV_USER_ID.'","'.SSH_USER_ID.'","'.API_USER_ID.'","'.$_SESSION['user_id'].'")
4981 4981
                                 AND public_key != ""'
4982 4982
                             );
4983 4983
                             foreach ($users as $user) {
@@ -4997,14 +4997,14 @@  discard block
 block discarded – undo
4997 4997
                         // Get fields for this Item
4998 4998
                         $rows = DB::query(
4999 4999
                             'SELECT id
5000
-                            FROM ' . prefixTable('categories_items') . '
5000
+                            FROM ' . prefixTable('categories_items').'
5001 5001
                             WHERE item_id = %i',
5002 5002
                             $item_id
5003 5003
                         );
5004 5004
                         foreach ($rows as $field) {
5005 5005
                             $userKey = DB::queryFirstRow(
5006 5006
                                 'SELECT share_key
5007
-                                FROM ' . prefixTable('sharekeys_fields') . '
5007
+                                FROM ' . prefixTable('sharekeys_fields').'
5008 5008
                                 WHERE user_id = %i AND object_id = %i',
5009 5009
                                 $_SESSION['user_id'],
5010 5010
                                 $field['id']
@@ -5015,8 +5015,8 @@  discard block
 block discarded – undo
5015 5015
                                 // This is a public object
5016 5016
                                 $users = DB::query(
5017 5017
                                     'SELECT id, public_key
5018
-                                    FROM ' . prefixTable('users') . '
5019
-                                    WHERE id NOT IN ("' . OTV_USER_ID . '","' . SSH_USER_ID . '","' . API_USER_ID . '","' . $_SESSION['user_id'] . '")
5018
+                                    FROM ' . prefixTable('users').'
5019
+                                    WHERE id NOT IN ("' . OTV_USER_ID.'","'.SSH_USER_ID.'","'.API_USER_ID.'","'.$_SESSION['user_id'].'")
5020 5020
                                     AND public_key != ""'
5021 5021
                                 );
5022 5022
                                 foreach ($users as $user) {
@@ -5037,14 +5037,14 @@  discard block
 block discarded – undo
5037 5037
                         // Get FILES for this Item
5038 5038
                         $rows = DB::query(
5039 5039
                             'SELECT id
5040
-                            FROM ' . prefixTable('files') . '
5040
+                            FROM ' . prefixTable('files').'
5041 5041
                             WHERE id_item = %i',
5042 5042
                             $item_id
5043 5043
                         );
5044 5044
                         foreach ($rows as $attachment) {
5045 5045
                             $userKey = DB::queryFirstRow(
5046 5046
                                 'SELECT share_key
5047
-                                FROM ' . prefixTable('sharekeys_files') . '
5047
+                                FROM ' . prefixTable('sharekeys_files').'
5048 5048
                                 WHERE user_id = %i AND object_id = %i',
5049 5049
                                 $_SESSION['user_id'],
5050 5050
                                 $attachment['id']
@@ -5055,8 +5055,8 @@  discard block
 block discarded – undo
5055 5055
                                 // This is a public object
5056 5056
                                 $users = DB::query(
5057 5057
                                     'SELECT id, public_key
5058
-                                    FROM ' . prefixTable('users') . '
5059
-                                    WHERE id NOT IN ("' . OTV_USER_ID . '","' . SSH_USER_ID . '","' . API_USER_ID . '","' . $_SESSION['user_id'] . '")
5058
+                                    FROM ' . prefixTable('users').'
5059
+                                    WHERE id NOT IN ("' . OTV_USER_ID.'","'.SSH_USER_ID.'","'.API_USER_ID.'","'.$_SESSION['user_id'].'")
5060 5060
                                     AND public_key != ""'
5061 5061
                                 );
5062 5062
                                 foreach ($users as $user) {
@@ -5092,13 +5092,13 @@  discard block
 block discarded – undo
5092 5092
                         $_SESSION['user_id'],
5093 5093
                         'at_modification',
5094 5094
                         $_SESSION['login'],
5095
-                        'at_moved : ' . $dataSource['title'] . ' -> ' . $dataDestination['title']
5095
+                        'at_moved : '.$dataSource['title'].' -> '.$dataDestination['title']
5096 5096
                     );
5097 5097
                 }
5098 5098
             }
5099 5099
 
5100 5100
             // reload cache table
5101
-            require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
5101
+            require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
5102 5102
             updateCacheTable('reload', $SETTINGS, '');
5103 5103
 
5104 5104
             echo (string) prepareExchangedData(
@@ -5162,7 +5162,7 @@  discard block
 block discarded – undo
5162 5162
                     // get info
5163 5163
                     $dataSource = DB::queryfirstrow(
5164 5164
                         'SELECT label, id_tree
5165
-                        FROM ' . prefixTable('items') . '
5165
+                        FROM ' . prefixTable('items').'
5166 5166
                         WHERE id=%i',
5167 5167
                         $item_id
5168 5168
                     );
@@ -5262,8 +5262,8 @@  discard block
 block discarded – undo
5262 5262
                     $content = explode(',', filter_input(INPUT_POST, 'content', FILTER_SANITIZE_STRING));
5263 5263
                 }
5264 5264
                 // Variables
5265
-                $dataAuthor = DB::queryfirstrow('SELECT email,login FROM ' . prefixTable('users') . ' WHERE id= ' . $content[1]);
5266
-                $dataItem = DB::queryfirstrow('SELECT label, id_tree FROM ' . prefixTable('items') . ' WHERE id= ' . $content[0]);
5265
+                $dataAuthor = DB::queryfirstrow('SELECT email,login FROM '.prefixTable('users').' WHERE id= '.$content[1]);
5266
+                $dataItem = DB::queryfirstrow('SELECT label, id_tree FROM '.prefixTable('items').' WHERE id= '.$content[0]);
5267 5267
 
5268 5268
                 // Get path
5269 5269
                 $path = geItemReadablePath(
@@ -5277,7 +5277,7 @@  discard block
 block discarded – undo
5277 5277
                         langHdl('email_request_access_subject'),
5278 5278
                         str_replace(
5279 5279
                             array('#tp_item_author#', '#tp_user#', '#tp_item#'),
5280
-                            array(' ' . addslashes($dataAuthor['login']), addslashes($_SESSION['login']), $path),
5280
+                            array(' '.addslashes($dataAuthor['login']), addslashes($_SESSION['login']), $path),
5281 5281
                             langHdl('email_request_access_mail')
5282 5282
                         ),
5283 5283
                         $dataAuthor['email'],
@@ -5288,7 +5288,7 @@  discard block
 block discarded – undo
5288 5288
             } elseif ($post_cat === 'share_this_item') {
5289 5289
                 $dataItem = DB::queryfirstrow(
5290 5290
                     'SELECT label,id_tree
5291
-                    FROM ' . prefixTable('items') . '
5291
+                    FROM ' . prefixTable('items').'
5292 5292
                     WHERE id= %i',
5293 5293
                     $post_id
5294 5294
                 );
@@ -5312,7 +5312,7 @@  discard block
 block discarded – undo
5312 5312
                             ),
5313 5313
                             array(
5314 5314
                                 empty($SETTINGS['email_server_url']) === false ?
5315
-                                    $SETTINGS['email_server_url'] . '/index.php?page=items&group=' . $dataItem['id_tree'] . '&id=' . $post_id : $SETTINGS['cpassman_url'] . '/index.php?page=items&group=' . $dataItem['id_tree'] . '&id=' . $post_id,
5315
+                                    $SETTINGS['email_server_url'].'/index.php?page=items&group='.$dataItem['id_tree'].'&id='.$post_id : $SETTINGS['cpassman_url'].'/index.php?page=items&group='.$dataItem['id_tree'].'&id='.$post_id,
5316 5316
                                 addslashes($_SESSION['login']),
5317 5317
                                 addslashes($path),
5318 5318
                             ),
@@ -5347,7 +5347,7 @@  discard block
 block discarded – undo
5347 5347
             if (filter_input(INPUT_POST, 'notify_type', FILTER_SANITIZE_STRING) === 'on_show') {
5348 5348
                 // Check if values already exist
5349 5349
                 $data = DB::queryfirstrow(
5350
-                    'SELECT notification FROM ' . prefixTable('items') . ' WHERE id = %i',
5350
+                    'SELECT notification FROM '.prefixTable('items').' WHERE id = %i',
5351 5351
                     $post_item_id
5352 5352
                 );
5353 5353
                 $notifiedUsers = explode(';', $data['notification']);
@@ -5358,8 +5358,8 @@  discard block
 block discarded – undo
5358 5358
                         prefixTable('items'),
5359 5359
                         array(
5360 5360
                             'notification' => empty($data['notification']) ?
5361
-                                filter_input(INPUT_POST, 'user_id', FILTER_SANITIZE_NUMBER_INT) . ';'
5362
-                                : $data['notification'] . filter_input(INPUT_POST, 'user_id', FILTER_SANITIZE_NUMBER_INT),
5361
+                                filter_input(INPUT_POST, 'user_id', FILTER_SANITIZE_NUMBER_INT).';'
5362
+                                : $data['notification'].filter_input(INPUT_POST, 'user_id', FILTER_SANITIZE_NUMBER_INT),
5363 5363
                         ),
5364 5364
                         'id=%i',
5365 5365
                         $post_item_id
@@ -5375,7 +5375,7 @@  discard block
 block discarded – undo
5375 5375
                         array(
5376 5376
                             'notification' => empty($data['notification']) ?
5377 5377
                                 filter_input(INPUT_POST, 'user_id', FILTER_SANITIZE_NUMBER_INT)
5378
-                                : $data['notification'] . ';' . filter_input(INPUT_POST, 'user_id', FILTER_SANITIZE_NUMBER_INT),
5378
+                                : $data['notification'].';'.filter_input(INPUT_POST, 'user_id', FILTER_SANITIZE_NUMBER_INT),
5379 5379
                         ),
5380 5380
                         'id=%i',
5381 5381
                         $post_item_id
@@ -5400,8 +5400,8 @@  discard block
 block discarded – undo
5400 5400
             // Get all informations for this item
5401 5401
             $dataItem = DB::queryfirstrow(
5402 5402
                 'SELECT *
5403
-                FROM ' . prefixTable('items') . ' as i
5404
-                INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id)
5403
+                FROM ' . prefixTable('items').' as i
5404
+                INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id)
5405 5405
                 WHERE i.id=%i AND l.action = %s',
5406 5406
                 $dataReceived['item_id'],
5407 5407
                 'at_creation'
@@ -5432,14 +5432,14 @@  discard block
 block discarded – undo
5432 5432
                 );
5433 5433
                 // Prepare new line
5434 5434
                 $data = DB::queryfirstrow(
5435
-                    'SELECT * FROM ' . prefixTable('log_items') . ' WHERE id_item = %i ORDER BY date DESC',
5435
+                    'SELECT * FROM '.prefixTable('log_items').' WHERE id_item = %i ORDER BY date DESC',
5436 5436
                     $dataReceived['item_id']
5437 5437
                 );
5438
-                $historic = date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], $data['date']) . ' - ' . $_SESSION['login'] . ' - ' . langHdl($data['action']) . ' - ' . $data['raison'];
5438
+                $historic = date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], $data['date']).' - '.$_SESSION['login'].' - '.langHdl($data['action']).' - '.$data['raison'];
5439 5439
                 // send back
5440 5440
                 $data = array(
5441 5441
                     'error' => '',
5442
-                    'new_line' => '<br>' . addslashes($historic),
5442
+                    'new_line' => '<br>'.addslashes($historic),
5443 5443
                 );
5444 5444
                 echo (string) prepareExchangedData($data, 'encode');
5445 5445
             } else {
@@ -5473,7 +5473,7 @@  discard block
 block discarded – undo
5473 5473
         */
5474 5474
         case 'is_item_changed':
5475 5475
             $data = DB::queryFirstRow(
5476
-                'SELECT date FROM ' . prefixTable('log_items') . ' WHERE action = %s AND id_item = %i ORDER BY date DESC',
5476
+                'SELECT date FROM '.prefixTable('log_items').' WHERE action = %s AND id_item = %i ORDER BY date DESC',
5477 5477
                 'at_modification',
5478 5478
                 $post_item_id
5479 5479
             );
@@ -5497,7 +5497,7 @@  discard block
 block discarded – undo
5497 5497
             }
5498 5498
 
5499 5499
             // delete all existing old otv codes
5500
-            $rows = DB::query('SELECT id FROM ' . prefixTable('otv') . ' WHERE timestamp < ' . (time() - $SETTINGS['otv_expiration_period'] * 86400));
5500
+            $rows = DB::query('SELECT id FROM '.prefixTable('otv').' WHERE timestamp < '.(time() - $SETTINGS['otv_expiration_period'] * 86400));
5501 5501
             foreach ($rows as $record) {
5502 5502
                 DB::delete(prefixTable('otv'), 'id=%i', $record['id']);
5503 5503
             }
@@ -5519,8 +5519,8 @@  discard block
 block discarded – undo
5519 5519
             // Should we log a password change?
5520 5520
             $itemQ = DB::queryFirstRow(
5521 5521
                 'SELECT s.share_key, i.pw
5522
-                FROM ' . prefixTable('items') . ' AS i
5523
-                INNER JOIN ' . prefixTable('sharekeys_items') . ' AS s ON (i.id = s.object_id)
5522
+                FROM ' . prefixTable('items').' AS i
5523
+                INNER JOIN ' . prefixTable('sharekeys_items').' AS s ON (i.id = s.object_id)
5524 5524
                 WHERE s.user_id = %i AND s.object_id = %i',
5525 5525
                 $_SESSION['user_id'],
5526 5526
                 $post_id
@@ -5570,7 +5570,7 @@  discard block
 block discarded – undo
5570 5570
             if (isset($SETTINGS['otv_expiration_period']) === false) {
5571 5571
                 $SETTINGS['otv_expiration_period'] = 7;
5572 5572
             }
5573
-            $url = $SETTINGS['cpassman_url'] . '/index.php?otv=true&' . http_build_query($otv_session);
5573
+            $url = $SETTINGS['cpassman_url'].'/index.php?otv=true&'.http_build_query($otv_session);
5574 5574
             //$exp_date = date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], time() + (intval($SETTINGS['otv_expiration_period']) * 86400));
5575 5575
 
5576 5576
             echo json_encode(
@@ -5608,8 +5608,8 @@  discard block
 block discarded – undo
5608 5608
                 'SELECT f.id AS id, f.file AS file, f.name AS name, f.status AS status,
5609 5609
                 f.extension AS extension, f.type AS type,
5610 5610
                 s.share_key AS share_key
5611
-                FROM ' . prefixTable('files') . ' AS f
5612
-                INNER JOIN ' . prefixTable('sharekeys_files') . ' AS s ON (f.id = s.object_id)
5611
+                FROM ' . prefixTable('files').' AS f
5612
+                INNER JOIN ' . prefixTable('sharekeys_files').' AS s ON (f.id = s.object_id)
5613 5613
                 WHERE s.user_id = %i AND s.object_id = %i',
5614 5614
                 $_SESSION['user_id'],
5615 5615
                 $post_id
@@ -5630,7 +5630,7 @@  discard block
 block discarded – undo
5630 5630
             //$fileName = basename($file_info['name'], '.'.$file_info['extension']);
5631 5631
 
5632 5632
             // prepare image info
5633
-            $post_title = basename($file_info['name'], '.' . $file_info['extension']);
5633
+            $post_title = basename($file_info['name'], '.'.$file_info['extension']);
5634 5634
             $post_title = isBase64($post_title) === true ?
5635 5635
                 base64_decode($post_title) : $post_title;
5636 5636
             $image_code = $file_info['file'];
@@ -5647,7 +5647,7 @@  discard block
 block discarded – undo
5647 5647
             echo (string) prepareExchangedData(
5648 5648
                 array(
5649 5649
                     'error' => false,
5650
-                    'filename' => $post_title . '.' . $file_info['extension'],
5650
+                    'filename' => $post_title.'.'.$file_info['extension'],
5651 5651
                     'file_type' => $file_info['type'],
5652 5652
                     'file_content' => $fileContent,
5653 5653
                 ),
@@ -5668,11 +5668,11 @@  discard block
 block discarded – undo
5668 5668
 
5669 5669
             // get file info
5670 5670
             $result = DB::queryfirstrow(
5671
-                'SELECT file FROM ' . prefixTable('files') . ' WHERE id=%i',
5671
+                'SELECT file FROM '.prefixTable('files').' WHERE id=%i',
5672 5672
                 intval(substr(filter_input(INPUT_POST, 'uri', FILTER_SANITIZE_STRING), 1))
5673 5673
             );
5674 5674
 
5675
-            fileDelete($SETTINGS['path_to_upload_folder'] . '/' . $result['file'] . filter_input(INPUT_POST, 'file_suffix', FILTER_SANITIZE_STRING), $SETTINGS);
5675
+            fileDelete($SETTINGS['path_to_upload_folder'].'/'.$result['file'].filter_input(INPUT_POST, 'file_suffix', FILTER_SANITIZE_STRING), $SETTINGS);
5676 5676
 
5677 5677
             break;
5678 5678
 
@@ -5695,16 +5695,16 @@  discard block
 block discarded – undo
5695 5695
             $idFolder = $dataReceived['idFolder'];
5696 5696
 
5697 5697
             // don't check if Personal Folder
5698
-            $data = DB::queryFirstRow('SELECT title FROM ' . prefixTable('nested_tree') . ' WHERE id = %i', $idFolder);
5698
+            $data = DB::queryFirstRow('SELECT title FROM '.prefixTable('nested_tree').' WHERE id = %i', $idFolder);
5699 5699
             if ($data['title'] === $_SESSION['user_id']) {
5700 5700
                 // send data
5701
-                echo '[{"duplicate" : "' . $duplicate . '" , error" : ""}]';
5701
+                echo '[{"duplicate" : "'.$duplicate.'" , error" : ""}]';
5702 5702
             } else {
5703 5703
                 if (filter_input(INPUT_POST, 'option', FILTER_SANITIZE_STRING) === 'same_folder') {
5704 5704
                     // case unique folder
5705 5705
                     DB::query(
5706 5706
                         'SELECT label
5707
-                        FROM ' . prefixTable('items') . '
5707
+                        FROM ' . prefixTable('items').'
5708 5708
                         WHERE id_tree = %i AND label = %s',
5709 5709
                         $idFolder,
5710 5710
                         $label
@@ -5716,7 +5716,7 @@  discard block
 block discarded – undo
5716 5716
                     $arrayPf = array();
5717 5717
                     if (empty($row['id']) === false) {
5718 5718
                         $rows = DB::query(
5719
-                            'SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE personal_folder = %i',
5719
+                            'SELECT id FROM '.prefixTable('nested_tree').' WHERE personal_folder = %i',
5720 5720
                             '1'
5721 5721
                         );
5722 5722
                         foreach ($rows as $record) {
@@ -5731,12 +5731,12 @@  discard block
 block discarded – undo
5731 5731
                     $where->add('id_tree = %i', $idFolder);
5732 5732
                     $where->add('label = %s', $label);
5733 5733
                     if (empty($arrayPf) === false) {
5734
-                        $where->add('id_tree NOT IN (' . implode(',', $arrayPf) . ')');
5734
+                        $where->add('id_tree NOT IN ('.implode(',', $arrayPf).')');
5735 5735
                     }
5736 5736
 
5737 5737
                     DB::query(
5738 5738
                         'SELECT label
5739
-                        FROM ' . prefixTable('items') . '
5739
+                        FROM ' . prefixTable('items').'
5740 5740
                         WHERE %l',
5741 5741
                         $where
5742 5742
                     );
@@ -5748,7 +5748,7 @@  discard block
 block discarded – undo
5748 5748
                 }
5749 5749
 
5750 5750
                 // send data
5751
-                echo '[{"duplicate" : "' . $duplicate . '" , "error" : ""}]';
5751
+                echo '[{"duplicate" : "'.$duplicate.'" , "error" : ""}]';
5752 5752
             }
5753 5753
             break;
5754 5754
 
@@ -5805,7 +5805,7 @@  discard block
 block discarded – undo
5805 5805
             }
5806 5806
 
5807 5807
             //Build tree
5808
-            $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries');
5808
+            $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries');
5809 5809
             $tree->register();
5810 5810
             $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title');
5811 5811
             $tree->rebuild();
@@ -5856,7 +5856,7 @@  discard block
 block discarded – undo
5856 5856
                             if (empty($arr_data['folders'][$inc]['path']) === true) {
5857 5857
                                 $arr_data['folders'][$inc]['path'] = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
5858 5858
                             } else {
5859
-                                $arr_data['folders'][$inc]['path'] .= ' / ' . htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
5859
+                                $arr_data['folders'][$inc]['path'] .= ' / '.htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
5860 5860
                             }
5861 5861
                         }
5862 5862
 
@@ -5922,8 +5922,8 @@  discard block
 block discarded – undo
5922 5922
                     $rows_tmp = DB::query(
5923 5923
                         'SELECT c.id, c.title, c.level, c.type, c.masked, c.order, c.encrypted_data, c.role_visibility, c.is_mandatory,
5924 5924
                         f.id_category AS category_id
5925
-                        FROM ' . prefixTable('categories_folders') . ' AS f
5926
-                        INNER JOIN ' . prefixTable('categories') . ' AS c ON (f.id_category = c.parent_id)
5925
+                        FROM ' . prefixTable('categories_folders').' AS f
5926
+                        INNER JOIN ' . prefixTable('categories').' AS c ON (f.id_category = c.parent_id)
5927 5927
                         WHERE id_folder=%i',
5928 5928
                         $folder
5929 5929
                     );
@@ -5950,7 +5950,7 @@  discard block
 block discarded – undo
5950 5950
                 $valTemp = '';
5951 5951
                 $data = DB::queryFirstRow(
5952 5952
                     'SELECT valeur
5953
-                    FROM ' . prefixTable('misc') . '
5953
+                    FROM ' . prefixTable('misc').'
5954 5954
                     WHERE type = %s AND intitule=%i',
5955 5955
                     'complex',
5956 5956
                     $folder
@@ -5967,14 +5967,14 @@  discard block
 block discarded – undo
5967 5967
                 $valTemp = '';
5968 5968
                 $rows_tmp = DB::query(
5969 5969
                     'SELECT t.title
5970
-                    FROM ' . prefixTable('roles_values') . ' as v
5971
-                    INNER JOIN ' . prefixTable('roles_title') . ' as t ON (v.role_id = t.id)
5970
+                    FROM ' . prefixTable('roles_values').' as v
5971
+                    INNER JOIN ' . prefixTable('roles_title').' as t ON (v.role_id = t.id)
5972 5972
                     WHERE v.folder_id = %i
5973 5973
                     GROUP BY title',
5974 5974
                     $folder
5975 5975
                 );
5976 5976
                 foreach ($rows_tmp as $record) {
5977
-                    $valTemp .= (empty($valTemp) === true ? '' : ' - ') . $record['title'];
5977
+                    $valTemp .= (empty($valTemp) === true ? '' : ' - ').$record['title'];
5978 5978
                 }
5979 5979
                 $arr_data[$folder]['visibilityRoles'] = $valTemp;
5980 5980
             }
@@ -6002,7 +6002,7 @@  discard block
 block discarded – undo
6002 6002
             // get item info
6003 6003
             $dataItem = DB::queryFirstRow(
6004 6004
                 'SELECT *
6005
-                FROM ' . prefixTable('items') . '
6005
+                FROM ' . prefixTable('items').'
6006 6006
                 WHERE id=%i',
6007 6007
                 $post_item_id
6008 6008
             );
@@ -6012,8 +6012,8 @@  discard block
 block discarded – undo
6012 6012
             $rows = DB::query(
6013 6013
                 'SELECT l.date as date, l.action as action, l.raison as raison, l.raison_iv AS raison_iv,
6014 6014
                 u.login as login, u.avatar_thumb as avatar_thumb, u.name as name, u.lastname as lastname
6015
-                FROM ' . prefixTable('log_items') . ' as l
6016
-                LEFT JOIN ' . prefixTable('users') . ' as u ON (l.id_user=u.id)
6015
+                FROM ' . prefixTable('log_items').' as l
6016
+                LEFT JOIN ' . prefixTable('users').' as u ON (l.id_user=u.id)
6017 6017
                 WHERE id_item=%i AND action <> %s
6018 6018
                 ORDER BY date DESC',
6019 6019
                 $post_item_id,
@@ -6028,7 +6028,7 @@  discard block
 block discarded – undo
6028 6028
                 
6029 6029
                 // imported via API
6030 6030
                 if (empty($record['login'])) {
6031
-                    $record['login'] = langHdl('imported_via_api') . ' [' . $record['raison'] . ']';
6031
+                    $record['login'] = langHdl('imported_via_api').' ['.$record['raison'].']';
6032 6032
                 }
6033 6033
 
6034 6034
                 if (
@@ -6039,13 +6039,13 @@  discard block
 block discarded – undo
6039 6039
                 ) {
6040 6040
                     // Prepare avatar
6041 6041
                     if (isset($record['avatar_thumb']) && empty($record['avatar_thumb']) === false) {
6042
-                        if (file_exists($SETTINGS['cpassman_dir'] . '/includes/avatars/' . $record['avatar_thumb'])) {
6043
-                            $avatar = $SETTINGS['cpassman_url'] . '/includes/avatars/' . $record['avatar_thumb'];
6042
+                        if (file_exists($SETTINGS['cpassman_dir'].'/includes/avatars/'.$record['avatar_thumb'])) {
6043
+                            $avatar = $SETTINGS['cpassman_url'].'/includes/avatars/'.$record['avatar_thumb'];
6044 6044
                         } else {
6045
-                            $avatar = $SETTINGS['cpassman_url'] . '/includes/images/photo.jpg';
6045
+                            $avatar = $SETTINGS['cpassman_url'].'/includes/images/photo.jpg';
6046 6046
                         }
6047 6047
                     } else {
6048
-                        $avatar = $SETTINGS['cpassman_url'] . '/includes/images/photo.jpg';
6048
+                        $avatar = $SETTINGS['cpassman_url'].'/includes/images/photo.jpg';
6049 6049
                     }
6050 6050
 
6051 6051
                     // Prepare action
@@ -6062,19 +6062,19 @@  discard block
 block discarded – undo
6062 6062
                         $action = langHdl($reason[0]);
6063 6063
                         if ($reason[0] === 'at_moved') {
6064 6064
                             $tmp = explode(' -> ', $reason[1]);
6065
-                            $detail = langHdl('from') . ' <span class="font-weight-light">' . $tmp[0] . '</span> ' . langHdl('to') . ' <span class="font-weight-light">' . $tmp[1] . ' </span>';
6065
+                            $detail = langHdl('from').' <span class="font-weight-light">'.$tmp[0].'</span> '.langHdl('to').' <span class="font-weight-light">'.$tmp[1].' </span>';
6066 6066
                         } elseif ($reason[0] === 'at_field') {
6067 6067
                             $tmp = explode(' => ', $reason[1]);
6068 6068
                             if (count($tmp) > 1) {
6069
-                                $detail = '<b>' . trim($tmp[0]) . '</b> | ' . langHdl('previous_value') .
6070
-                                    ': <span class="font-weight-light">' . trim($tmp[1]) . '</span>';
6069
+                                $detail = '<b>'.trim($tmp[0]).'</b> | '.langHdl('previous_value').
6070
+                                    ': <span class="font-weight-light">'.trim($tmp[1]).'</span>';
6071 6071
                             } else {
6072 6072
                                 $detail = trim($reason[1]);
6073 6073
                             }
6074 6074
                         } elseif (in_array($reason[0], array('at_restriction', 'at_email', 'at_login', 'at_label', 'at_url', 'at_tag')) === true) {
6075 6075
                             $tmp = explode(' => ', $reason[1]);
6076 6076
                             $detail = empty(trim($tmp[0])) === true ?
6077
-                                langHdl('no_previous_value') : langHdl('previous_value') . ': <span class="font-weight-light">' . $tmp[0] . ' </span>';
6077
+                                langHdl('no_previous_value') : langHdl('previous_value').': <span class="font-weight-light">'.$tmp[0].' </span>';
6078 6078
                         } elseif ($reason[0] === 'at_automatic_del') {
6079 6079
                             $detail = langHdl($reason[1]);
6080 6080
                         } elseif ($reason[0] === 'at_anyoneconmodify') {
@@ -6083,7 +6083,7 @@  discard block
 block discarded – undo
6083 6083
                             $tmp = explode(':', $reason[1]);
6084 6084
                             $tmp = explode('.', $tmp[0]);
6085 6085
                             $detail = isBase64($tmp[0]) === true ?
6086
-                                base64_decode($tmp[0]) . '.' . $tmp[1] : $tmp[0];
6086
+                                base64_decode($tmp[0]).'.'.$tmp[1] : $tmp[0];
6087 6087
                         } elseif ($reason[0] === 'at_import') {
6088 6088
                             $detail = '';
6089 6089
                         } elseif (in_array($reason[0], array('csv', 'pdf')) === true) {
@@ -6102,8 +6102,8 @@  discard block
 block discarded – undo
6102 6102
                         array(
6103 6103
                             'avatar' => $avatar,
6104 6104
                             'login' => $record['login'],
6105
-                            'name' => $record['name'] . ' ' . $record['lastname'],
6106
-                            'date' => date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['date']),
6105
+                            'name' => $record['name'].' '.$record['lastname'],
6106
+                            'date' => date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['date']),
6107 6107
                             'action' => $action,
6108 6108
                             'detail' => $detail,
6109 6109
                         )
@@ -6184,18 +6184,18 @@  discard block
 block discarded – undo
6184 6184
 
6185 6185
             // get some info to add to the notification email
6186 6186
             $resp_user = DB::queryfirstrow(
6187
-                'SELECT login FROM ' . prefixTable('users') . ' WHERE id = %i',
6187
+                'SELECT login FROM '.prefixTable('users').' WHERE id = %i',
6188 6188
                 $_SESSION['user_id']
6189 6189
             );
6190 6190
             $resp_folder = DB::queryfirstrow(
6191
-                'SELECT title FROM ' . prefixTable('nested_tree') . ' WHERE id = %i',
6191
+                'SELECT title FROM '.prefixTable('nested_tree').' WHERE id = %i',
6192 6192
                 $folder
6193 6193
             );
6194 6194
 
6195 6195
             // notify Managers
6196 6196
             $rows = DB::query(
6197 6197
                 'SELECT email
6198
-                FROM ' . prefixTable('users') . '
6198
+                FROM ' . prefixTable('users').'
6199 6199
                 WHERE `gestionnaire` = %i AND `email` IS NOT NULL',
6200 6200
                 1
6201 6201
             );
@@ -6226,14 +6226,14 @@  discard block
 block discarded – undo
6226 6226
             // Get list of users
6227 6227
             $usersList = array();
6228 6228
             $usersString = '';
6229
-            $rows = DB::query('SELECT id,login,email FROM ' . prefixTable('users') . ' ORDER BY login ASC');
6229
+            $rows = DB::query('SELECT id,login,email FROM '.prefixTable('users').' ORDER BY login ASC');
6230 6230
             foreach ($rows as $record) {
6231 6231
                 $usersList[$record['login']] = array(
6232 6232
                     'id' => $record['id'],
6233 6233
                     'login' => $record['login'],
6234 6234
                     'email' => $record['email'],
6235 6235
                 );
6236
-                $usersString .= $record['id'] . '#' . $record['login'] . ';';
6236
+                $usersString .= $record['id'].'#'.$record['login'].';';
6237 6237
             }
6238 6238
 
6239 6239
             $data = array(
@@ -6267,7 +6267,7 @@  discard block
 block discarded – undo
6267 6267
             // Send email
6268 6268
             $dataItem = DB::queryfirstrow(
6269 6269
                 'SELECT label, id_tree
6270
-                FROM ' . prefixTable('items') . '
6270
+                FROM ' . prefixTable('items').'
6271 6271
                 WHERE id = %i',
6272 6272
                 $post_item_id
6273 6273
             );
@@ -6361,7 +6361,7 @@  discard block
 block discarded – undo
6361 6361
 
6362 6362
             DB::query(
6363 6363
                 'SELECT *
6364
-                FROM ' . prefixTable('notification') . '
6364
+                FROM ' . prefixTable('notification').'
6365 6365
                 WHERE item_id = %i AND user_id = %i',
6366 6366
                 $post_item_id,
6367 6367
                 $_SESSION['user_id']
@@ -6427,7 +6427,7 @@  discard block
 block discarded – undo
6427 6427
             // And related logs
6428 6428
             $rows = DB::query(
6429 6429
                 'SELECT id, file AS filename
6430
-                FROM ' . prefixTable('files') . '
6430
+                FROM ' . prefixTable('files').'
6431 6431
                 WHERE id_item = %i AND confirmed = %i',
6432 6432
                 $post_item_id,
6433 6433
                 0
@@ -6441,12 +6441,12 @@  discard block
 block discarded – undo
6441 6441
                 );
6442 6442
 
6443 6443
                 // Delete file on server
6444
-                unlink($SETTINGS['path_to_upload_folder'] . '/' . TP_FILE_PREFIX . base64_decode($file['filename']));
6444
+                unlink($SETTINGS['path_to_upload_folder'].'/'.TP_FILE_PREFIX.base64_decode($file['filename']));
6445 6445
 
6446 6446
                 // Delete related logs
6447 6447
                 $logFile = DB::query(
6448 6448
                     'SELECT increment_id, raison
6449
-                    FROM ' . prefixTable('log_items') . '
6449
+                    FROM ' . prefixTable('log_items').'
6450 6450
                     WHERE id_item = %i AND id_user = %i AND action = %s AND raison LIKE "at_add_file :%"',
6451 6451
                     $post_item_id,
6452 6452
                     $_SESSION['user_id'],
@@ -6499,7 +6499,7 @@  discard block
 block discarded – undo
6499 6499
             // Confirm attachments
6500 6500
             $rows = DB::query(
6501 6501
                 'SELECT id, file AS filename
6502
-                FROM ' . prefixTable('files') . '
6502
+                FROM ' . prefixTable('files').'
6503 6503
                 WHERE id_item = %i AND confirmed = %i',
6504 6504
                 $post_item_id,
6505 6505
                 0
@@ -6536,15 +6536,15 @@  discard block
 block discarded – undo
6536 6536
         case 'autocomplete_tags':
6537 6537
             // Get a list off all existing TAGS
6538 6538
             $listOfTags = '';
6539
-            $rows = DB::query('SELECT tag FROM ' . prefixTable('tags') . ' WHERE tag LIKE %ss GROUP BY tag', $get['term']);
6539
+            $rows = DB::query('SELECT tag FROM '.prefixTable('tags').' WHERE tag LIKE %ss GROUP BY tag', $get['term']);
6540 6540
             foreach ($rows as $record) {
6541 6541
                 if (empty($listOfTags)) {
6542
-                    $listOfTags = '"' . $record['tag'] . '"';
6542
+                    $listOfTags = '"'.$record['tag'].'"';
6543 6543
                 } else {
6544
-                    $listOfTags .= ', "' . $record['tag'] . '"';
6544
+                    $listOfTags .= ', "'.$record['tag'].'"';
6545 6545
                 }
6546 6546
             }
6547
-            echo '[' . $listOfTags . ']';
6547
+            echo '['.$listOfTags.']';
6548 6548
             break;
6549 6549
     }
6550 6550
 }
@@ -6560,7 +6560,7 @@  discard block
 block discarded – undo
6560 6560
 {
6561 6561
     $data = DB::queryFirstRow(
6562 6562
         'SELECT bloquer_creation, bloquer_modification, personal_folder
6563
-        FROM ' . prefixTable('nested_tree') . ' WHERE id = %i',
6563
+        FROM ' . prefixTable('nested_tree').' WHERE id = %i',
6564 6564
         $groupe
6565 6565
     );
6566 6566
     // Check if it's in a personal folder. If yes, then force complexity overhead.
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1770,7 +1770,9 @@
 block discarded – undo
1770 1770
                         $post_item_id
1771 1771
                     );
1772 1772
                     foreach ($rows as $record) {
1773
-                        if ($record['raison'] === NULL) continue;
1773
+                        if ($record['raison'] === NULL) {
1774
+                            continue;
1775
+                        }
1774 1776
                         $reason = explode(':', $record['raison']);
1775 1777
                         if (count($reason) > 0) {
1776 1778
                             $sentence = date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['date']) . ' - '
Please login to merge, or discard this patch.
sources/utilities.queries.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -37,12 +37,12 @@  discard block
 block discarded – undo
37 37
 }
38 38
 
39 39
 // Do checks
40
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
41
-require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php';
40
+require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php';
41
+require_once $SETTINGS['cpassman_dir'].'/sources/checks.php';
42 42
 if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'utilities.database', $SETTINGS) === false) {
43 43
     // Not allowed page
44 44
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
45
-    include $SETTINGS['cpassman_dir'] . '/error.php';
45
+    include $SETTINGS['cpassman_dir'].'/error.php';
46 46
     exit();
47 47
 }
48 48
 
@@ -55,14 +55,14 @@  discard block
 block discarded – undo
55 55
     date_default_timezone_set('UTC');
56 56
 }
57 57
 
58
-require_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php';
59
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
58
+require_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php';
59
+require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
60 60
 header('Content-type: text/html; charset=utf-8');
61 61
 header('Cache-Control: no-cache, must-revalidate');
62 62
 require_once 'main.functions.php';
63 63
 
64 64
 //Connect to DB
65
-require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
65
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
66 66
 if (defined('DB_PASSWD_CLEAR') === false) {
67 67
     define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
68 68
 }
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
             $arrFolders = array();
103 103
             $rows = DB::query(
104 104
                 'SELECT valeur, intitule
105
-                FROM ' . prefixTable('misc') . '
105
+                FROM ' . prefixTable('misc').'
106 106
                 WHERE type  = %s',
107 107
                 'folder_deleted'
108 108
             );
@@ -123,10 +123,10 @@  discard block
 block discarded – undo
123 123
                 'SELECT u.login as login, u.name as name, u.lastname as lastname,
124 124
                 i.id as id, i.label as label,
125 125
                 i.id_tree as id_tree, l.date as date, n.title as folder_title
126
-                FROM ' . prefixTable('log_items') . ' as l
127
-                INNER JOIN ' . prefixTable('items') . ' as i ON (l.id_item=i.id)
128
-                INNER JOIN ' . prefixTable('users') . ' as u ON (l.id_user=u.id)
129
-                INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree=n.id)
126
+                FROM ' . prefixTable('log_items').' as l
127
+                INNER JOIN ' . prefixTable('items').' as i ON (l.id_item=i.id)
128
+                INNER JOIN ' . prefixTable('users').' as u ON (l.id_user=u.id)
129
+                INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree=n.id)
130 130
                 WHERE i.inactif = %i
131 131
                 AND l.action = %s',
132 132
                 1,
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
                             'label' => $record['label'],
149 149
                             'date' => date($SETTINGS['date_format'], (int) $record['date']),
150 150
                             'login' => $record['login'],
151
-                            'name' => $record['name'] . ' ' . $record['lastname'],
151
+                            'name' => $record['name'].' '.$record['lastname'],
152 152
                             'folder_label' => $record['folder_title'],
153 153
                             'folder_deleted' => $thisFolder,
154 154
                         )
@@ -203,10 +203,10 @@  discard block
 block discarded – undo
203 203
             foreach ($post_folders as $folderId) {
204 204
                 $data = DB::queryfirstrow(
205 205
                     'SELECT valeur
206
-                    FROM ' . prefixTable('misc') . "
206
+                    FROM ' . prefixTable('misc')."
207 207
                     WHERE type = 'folder_deleted'
208 208
                     AND intitule = %s",
209
-                    'f' . $folderId
209
+                    'f'.$folderId
210 210
                 );
211 211
                 if ((int) $data['valeur'] !== 0) {
212 212
                     $folderData = explode(', ', $data['valeur']);
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
                         prefixTable('misc'),
233 233
                         'type = %s AND intitule = %s',
234 234
                         'folder_deleted',
235
-                        'f' . $folderId
235
+                        'f'.$folderId
236 236
                     );
237 237
 
238 238
                     // Restore all items in this folder
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
                     // Get list of all items in thos folder
249 249
                     $items = DB::query(
250 250
                         'SELECT id
251
-                        FROM ' . prefixTable('items') . '
251
+                        FROM ' . prefixTable('items').'
252 252
                         WHERE id_tree = %i',
253 253
                         $folderId
254 254
                     );
@@ -333,10 +333,10 @@  discard block
 block discarded – undo
333 333
             foreach ($post_folders as $folderId) {
334 334
                 $data = DB::queryfirstrow(
335 335
                     'SELECT valeur
336
-                    FROM ' . prefixTable('misc') . "
336
+                    FROM ' . prefixTable('misc')."
337 337
                     WHERE type = 'folder_deleted'
338 338
                     AND intitule = %s",
339
-                    'f' . $folderId
339
+                    'f'.$folderId
340 340
                 );
341 341
                 if ((int) $data['valeur'] !== 0) {
342 342
                     $folderData = explode(', ', $data['valeur']);
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
                         prefixTable('misc'),
369 369
                         'type = %s AND intitule = %s',
370 370
                         'folder_deleted',
371
-                        'f' . $folderData[0]
371
+                        'f'.$folderData[0]
372 372
                     );
373 373
 
374 374
                     // Delete all items in this folder
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
                     // Get list of all items in thos folder
383 383
                     $items = DB::query(
384 384
                         'SELECT id
385
-                        FROM ' . prefixTable('items') . '
385
+                        FROM ' . prefixTable('items').'
386 386
                         WHERE id_tree = %i',
387 387
                         $folderData[0]
388 388
                     );
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
             ) {
479 479
                 if ($post_log_type === 'items') {
480 480
                     DB::query(
481
-                        'SELECT * FROM ' . prefixTable('log_items') . '
481
+                        'SELECT * FROM '.prefixTable('log_items').'
482 482
                         WHERE action=%s ' .  'AND date BETWEEN %i AND %i'
483 483
                         . ($post_filter_action === 'all' ? '' : ' AND action = %s')
484 484
                         . ($post_filter_user === -1 ? '' : ' AND id_user = %i'),
@@ -500,7 +500,7 @@  discard block
 block discarded – undo
500 500
                 } elseif ($post_log_type === 'connections') {
501 501
                     db::debugmode(true);
502 502
                     DB::query(
503
-                        'SELECT * FROM ' . prefixTable('log_system') . ' WHERE type=%s ' .
503
+                        'SELECT * FROM '.prefixTable('log_system').' WHERE type=%s '.
504 504
                             'AND date BETWEEN %i AND %i',
505 505
                         'user_connection',
506 506
                         $post_date_from,
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
                     );
518 518
                 } elseif ($post_log_type === 'errors') {
519 519
                     DB::query(
520
-                        'SELECT * FROM ' . prefixTable('log_system') . ' WHERE type=%s ' .
520
+                        'SELECT * FROM '.prefixTable('log_system').' WHERE type=%s '.
521 521
                             'AND date BETWEEN %i AND %i',
522 522
                         'error',
523 523
                         $post_date_from,
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
                     );
535 535
                 } elseif ($post_log_type === 'copy') {
536 536
                     DB::query(
537
-                        'SELECT * FROM ' . prefixTable('log_items') . ' WHERE action=%s ' .
537
+                        'SELECT * FROM '.prefixTable('log_items').' WHERE action=%s '.
538 538
                             'AND date BETWEEN %i AND %i',
539 539
                         'at_copy',
540 540
                         $post_date_from,
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
                     );
552 552
                 } elseif ($post_log_type === 'admin') {
553 553
                     DB::query(
554
-                        'SELECT * FROM ' . prefixTable('log_system') . ' WHERE type=%s ' .
554
+                        'SELECT * FROM '.prefixTable('log_system').' WHERE type=%s '.
555 555
                             'AND date BETWEEN %i AND %i',
556 556
                         'admin_action',
557 557
                         $post_date_from,
@@ -568,7 +568,7 @@  discard block
 block discarded – undo
568 568
                     );
569 569
                 } elseif ($post_log_type === 'failed') {
570 570
                     DB::query(
571
-                        'SELECT * FROM ' . prefixTable('log_system') . ' WHERE type=%s ' .
571
+                        'SELECT * FROM '.prefixTable('log_system').' WHERE type=%s '.
572 572
                             'AND date BETWEEN %i AND %i',
573 573
                         'failed_auth',
574 574
                         $post_date_from,
Please login to merge, or discard this patch.
sources/main.queries.php 1 patch
Spacing   +143 added lines, -143 removed lines patch added patch discarded remove patch
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
 }
43 43
 
44 44
 // DO CHECKS
45
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
46
-require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php';
45
+require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php';
46
+require_once $SETTINGS['cpassman_dir'].'/sources/checks.php';
47 47
 $post_type = filter_input(INPUT_POST, 'type', FILTER_SANITIZE_STRING);
48 48
 if (
49 49
     isset($post_type) === true
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
     && checkUser($_SESSION['user_id'], $_SESSION['key'], 'home', $SETTINGS) === false
60 60
 ) {
61 61
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED; //not allowed page
62
-    include $SETTINGS['cpassman_dir'] . '/error.php';
62
+    include $SETTINGS['cpassman_dir'].'/error.php';
63 63
     exit();
64 64
 } elseif ((isset($_SESSION['user_id']) === true
65 65
         && isset($_SESSION['key'])) === true
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
     mainQuery($SETTINGS);
71 71
 } else {
72 72
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED; //not allowed page
73
-    include $SETTINGS['cpassman_dir'] . '/error.php';
73
+    include $SETTINGS['cpassman_dir'].'/error.php';
74 74
     exit();
75 75
 }
76 76
 
@@ -101,15 +101,15 @@  discard block
 block discarded – undo
101 101
         date_default_timezone_set('UTC');
102 102
     }
103 103
 
104
-    include_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php';
105
-    include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
104
+    include_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php';
105
+    include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
106 106
 
107 107
     // Includes
108
-    include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
109
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
108
+    include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
109
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
110 110
 
111 111
     // Connect to mysql server
112
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
112
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
113 113
     if (defined('DB_PASSWD_CLEAR') === false) {
114 114
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
115 115
     }
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
     DB::$encoding = DB_ENCODING;
122 122
 
123 123
     // User's language loading
124
-    include_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php';
124
+    include_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php';
125 125
 
126 126
     // Prepare post variables
127 127
     $post_key = filter_input(INPUT_POST, 'key', FILTER_SANITIZE_STRING);
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
                     echo prepareExchangedData(
191 191
                         array(
192 192
                             'error' => true,
193
-                            'message' => '<div style="margin:10px 0 10px 15px;">' . langHdl('error_not_allowed_to') . '</div>',
193
+                            'message' => '<div style="margin:10px 0 10px 15px;">'.langHdl('error_not_allowed_to').'</div>',
194 194
                         ),
195 195
                         'encode'
196 196
                     );
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
                 // check if expected security level is reached
201 201
                 $dataUser = DB::queryfirstrow(
202 202
                     'SELECT *
203
-                    FROM ' . prefixTable('users') . '
203
+                    FROM ' . prefixTable('users').'
204 204
                     WHERE id = %i',
205 205
                     $post_user_id
206 206
                 );
@@ -222,8 +222,8 @@  discard block
 block discarded – undo
222 222
                 if (empty($dataUser['fonction_id']) === false) {
223 223
                     $data = DB::queryFirstRow(
224 224
                         'SELECT complexity
225
-                        FROM ' . prefixTable('roles_title') . '
226
-                        WHERE id IN (' . $dataUser['fonction_id'] . ')
225
+                        FROM ' . prefixTable('roles_title').'
226
+                        WHERE id IN (' . $dataUser['fonction_id'].')
227 227
                         ORDER BY complexity DESC'
228 228
                     );
229 229
                 } else {
@@ -236,8 +236,8 @@  discard block
 block discarded – undo
236 236
                     echo prepareExchangedData(
237 237
                         array(
238 238
                             'error' => true,
239
-                            'message' => '<div style="margin:10px 0 10px 15px;">' . langHdl('complexity_level_not_reached') . '.<br>' .
240
-                                langHdl('expected_complexity_level') . ': <b>' . TP_PW_COMPLEXITY[$data['complexity']][1] . '</b></div>',
239
+                            'message' => '<div style="margin:10px 0 10px 15px;">'.langHdl('complexity_level_not_reached').'.<br>'.
240
+                                langHdl('expected_complexity_level').': <b>'.TP_PW_COMPLEXITY[$data['complexity']][1].'</b></div>',
241 241
                         ),
242 242
                         'encode'
243 243
                     );
@@ -437,14 +437,14 @@  discard block
 block discarded – undo
437 437
                 // Get data about user
438 438
                 $data = DB::queryfirstrow(
439 439
                     'SELECT id, email, pw
440
-                    FROM ' . prefixTable('users') . '
440
+                    FROM ' . prefixTable('users').'
441 441
                     WHERE login = %s',
442 442
                     $post_login
443 443
                 );
444 444
             } else {
445 445
                 $data = DB::queryfirstrow(
446 446
                     'SELECT id, login, email, pw
447
-                    FROM ' . prefixTable('users') . '
447
+                    FROM ' . prefixTable('users').'
448 448
                     WHERE id = %i',
449 449
                     $post_id
450 450
                 );
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
             $counter = DB::count();
456 456
 
457 457
             // load passwordLib library
458
-            $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'] . '/includes/libraries');
458
+            $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'].'/includes/libraries');
459 459
             $pwdlib->register();
460 460
             $pwdlib = new PasswordLib\PasswordLib();
461 461
 
@@ -501,7 +501,7 @@  discard block
 block discarded – undo
501 501
                     );
502 502
                 } else {
503 503
                     // generate new GA user code
504
-                    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/TwoFactorAuth/TwoFactorAuth.php';
504
+                    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/TwoFactorAuth/TwoFactorAuth.php';
505 505
                     $tfa = new Authentication\TwoFactorAuth\TwoFactorAuth($SETTINGS['ga_website_name']);
506 506
                     $gaSecretKey = $tfa->createSecret();
507 507
                     $gaTemporaryCode = GenerateCryptKey(12, false, true, true, false, true, $SETTINGS);
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
                                 'email' => $data['email'],
544 544
                                 'email_result' => str_replace(
545 545
                                     '#email#',
546
-                                    '<b>' . obfuscateEmail($data['email']) . '</b>',
546
+                                    '<b>'.obfuscateEmail($data['email']).'</b>',
547 547
                                     addslashes(langHdl('admin_email_result_ok'))
548 548
                                 ),
549 549
                             ),
@@ -558,7 +558,7 @@  discard block
 block discarded – undo
558 558
                                 'email' => $data['email'],
559 559
                                 'email_result' => str_replace(
560 560
                                     '#email#',
561
-                                    '<b>' . obfuscateEmail($data['email']) . '</b>',
561
+                                    '<b>'.obfuscateEmail($data['email']).'</b>',
562 562
                                     addslashes(langHdl('admin_email_result_ok'))
563 563
                                 ),
564 564
                             ),
@@ -586,7 +586,7 @@  discard block
 block discarded – undo
586 586
                     $_SESSION['user_id']
587 587
                 );
588 588
                 // Return data
589
-                echo '[{"new_value":"' . $_SESSION['sessionDuration'] . '"}]';
589
+                echo '[{"new_value":"'.$_SESSION['sessionDuration'].'"}]';
590 590
             } else {
591 591
                 echo '[{"new_value":"expired"}]';
592 592
             }
@@ -611,26 +611,26 @@  discard block
 block discarded – undo
611 611
             // Get account and pw associated to email
612 612
             DB::query(
613 613
                 'SELECT *
614
-                FROM ' . prefixTable('users') . '
614
+                FROM ' . prefixTable('users').'
615 615
                 WHERE login = %s',
616 616
                 $post_login
617 617
             );
618 618
             $counter = DB::count();
619 619
             if ($counter != 0) {
620 620
                 $data = DB::queryFirstRow(
621
-                    'SELECT login, pw, email FROM ' . prefixTable('users') . ' WHERE login = %s',
621
+                    'SELECT login, pw, email FROM '.prefixTable('users').' WHERE login = %s',
622 622
                     $post_login
623 623
                 );
624
-                $textMail = langHdl('forgot_pw_email_body_1') . ' <a href="' .
625
-                    $SETTINGS['cpassman_url'] . '/index.php?action=password_recovery&key=' . $key .
626
-                    '&login=' . $post_login . '">' . $SETTINGS['cpassman_url'] .
627
-                    '/index.php?action=password_recovery&key=' . $key . '&login=' . $post_login . '</a>.<br><br>' . langHdl('thku');
628
-                $textMailAlt = langHdl('forgot_pw_email_altbody_1') . ' ' . langHdl('at_login') . ' : ' . $post_login . ' - ' .
629
-                    langHdl('index_password') . ' : ' . md5($data['pw']);
624
+                $textMail = langHdl('forgot_pw_email_body_1').' <a href="'.
625
+                    $SETTINGS['cpassman_url'].'/index.php?action=password_recovery&key='.$key.
626
+                    '&login='.$post_login.'">'.$SETTINGS['cpassman_url'].
627
+                    '/index.php?action=password_recovery&key='.$key.'&login='.$post_login.'</a>.<br><br>'.langHdl('thku');
628
+                $textMailAlt = langHdl('forgot_pw_email_altbody_1').' '.langHdl('at_login').' : '.$post_login.' - '.
629
+                    langHdl('index_password').' : '.md5($data['pw']);
630 630
 
631 631
                 // Check if email has already a key in DB
632 632
                 DB::query(
633
-                    'SELECT * FROM ' . prefixTable('misc') . ' WHERE intitule = %s AND type = %s',
633
+                    'SELECT * FROM '.prefixTable('misc').' WHERE intitule = %s AND type = %s',
634 634
                     $post_login,
635 635
                     'password_recovery'
636 636
                 );
@@ -668,10 +668,10 @@  discard block
 block discarded – undo
668 668
                     true
669 669
                 );
670 670
 
671
-                echo '[{"error":"' . $ret['error'] . '" , "message":"' . $ret['message'] . '"}]';
671
+                echo '[{"error":"'.$ret['error'].'" , "message":"'.$ret['message'].'"}]';
672 672
             } else {
673 673
                 // no one has this email ... alert
674
-                echo '[{"error":"error_email" , "message":"' . langHdl('forgot_my_pw_error_email_not_exist') . '"}]';
674
+                echo '[{"error":"error_email" , "message":"'.langHdl('forgot_my_pw_error_email_not_exist').'"}]';
675 675
             }
676 676
             break;
677 677
 
@@ -690,7 +690,7 @@  discard block
 block discarded – undo
690 690
             // check if key is okay
691 691
             $data = DB::queryFirstRow(
692 692
                 'SELECT valeur
693
-                FROM ' . prefixTable('misc') . '
693
+                FROM ' . prefixTable('misc').'
694 694
                 WHERE intitule = %s AND type = %s',
695 695
                 $login,
696 696
                 'password_recovery'
@@ -726,7 +726,7 @@  discard block
 block discarded – undo
726 726
                 );
727 727
                 // Get email
728 728
                 $dataUser = DB::queryFirstRow(
729
-                    'SELECT email FROM ' . prefixTable('users') . ' WHERE login = %s',
729
+                    'SELECT email FROM '.prefixTable('users').' WHERE login = %s',
730 730
                     $login
731 731
                 );
732 732
 
@@ -735,10 +735,10 @@  discard block
 block discarded – undo
735 735
                 $ret = json_decode(
736 736
                     sendEmail(
737 737
                         langHdl('forgot_pw_email_subject_confirm'),
738
-                        langHdl('forgot_pw_email_body') . ' ' . $newPwNotCrypted,
738
+                        langHdl('forgot_pw_email_body').' '.$newPwNotCrypted,
739 739
                         $dataUser['email'],
740 740
                         $SETTINGS,
741
-                        strip_tags(langHdl('forgot_pw_email_body')) . ' ' . $newPwNotCrypted
741
+                        strip_tags(langHdl('forgot_pw_email_body')).' '.$newPwNotCrypted
742 742
                     ),
743 743
                     true
744 744
                 );
@@ -847,7 +847,7 @@  discard block
 block discarded – undo
847 847
                     // Store PSK
848 848
                     $_SESSION['user']['session_psk'] = $user_key_encoded;
849 849
                     setcookie(
850
-                        'TeamPass_PFSK_' . md5($_SESSION['user_id']),
850
+                        'TeamPass_PFSK_'.md5($_SESSION['user_id']),
851 851
                         $user_key_encoded,
852 852
                         (!isset($SETTINGS['personal_saltkey_cookie_duration']) || $SETTINGS['personal_saltkey_cookie_duration'] == 0) ? time() + 60 * 60 * 24 : time() + 60 * 60 * 24 * $SETTINGS['personal_saltkey_cookie_duration'],
853 853
                         '/'
@@ -895,7 +895,7 @@  discard block
 block discarded – undo
895 895
             // Get key from user
896 896
             $userInfo = DB::queryfirstrow(
897 897
                 'SELECT encrypted_psk
898
-                FROM ' . prefixTable('users') . '
898
+                FROM ' . prefixTable('users').'
899 899
                 WHERE id = %i',
900 900
                 $_SESSION['user_id']
901 901
             );
@@ -990,8 +990,8 @@  discard block
 block discarded – undo
990 990
             // Build list of items to be re-encrypted
991 991
             $rows = DB::query(
992 992
                 'SELECT i.id as id, i.pw as pw
993
-                FROM ' . prefixTable('items') . ' as i
994
-                INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id=l.id_item)
993
+                FROM ' . prefixTable('items').' as i
994
+                INNER JOIN ' . prefixTable('log_items').' as l ON (i.id=l.id_item)
995 995
                 WHERE i.perso = %i AND l.id_user= %i AND l.action = %s',
996 996
                 '1',
997 997
                 $_SESSION['user_id'],
@@ -1003,14 +1003,14 @@  discard block
 block discarded – undo
1003 1003
                     if (empty($list)) {
1004 1004
                         $list = $record['id'];
1005 1005
                     } else {
1006
-                        $list .= ',' . $record['id'];
1006
+                        $list .= ','.$record['id'];
1007 1007
                     }
1008 1008
                 }
1009 1009
             }
1010 1010
 
1011 1011
             // change salt
1012 1012
             setcookie(
1013
-                'TeamPass_PFSK_' . md5($_SESSION['user_id']),
1013
+                'TeamPass_PFSK_'.md5($_SESSION['user_id']),
1014 1014
                 $_SESSION['user']['session_psk'],
1015 1015
                 time() + 60 * 60 * 24 * $SETTINGS['personal_saltkey_cookie_duration'],
1016 1016
                 '/'
@@ -1057,8 +1057,8 @@  discard block
 block discarded – undo
1057 1057
                     // delete all previous items of this user
1058 1058
                     $rows = DB::query(
1059 1059
                         'SELECT i.id as id
1060
-                        FROM ' . prefixTable('items') . ' as i
1061
-                        INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id=l.id_item)
1060
+                        FROM ' . prefixTable('items').' as i
1061
+                        INNER JOIN ' . prefixTable('log_items').' as l ON (i.id=l.id_item)
1062 1062
                         WHERE i.perso = %i AND l.id_user= %i AND l.action = %s',
1063 1063
                         '1',
1064 1064
                         $_SESSION['user_id'],
@@ -1103,7 +1103,7 @@  discard block
 block discarded – undo
1103 1103
 
1104 1104
                     // change salt
1105 1105
                     setcookie(
1106
-                        'TeamPass_PFSK_' . md5($_SESSION['user_id']),
1106
+                        'TeamPass_PFSK_'.md5($_SESSION['user_id']),
1107 1107
                         $_SESSION['user']['session_psk'],
1108 1108
                         time() + 60 * 60 * 24 * $SETTINGS['personal_saltkey_cookie_duration'],
1109 1109
                         '/'
@@ -1156,7 +1156,7 @@  discard block
 block discarded – undo
1156 1156
                 && $SETTINGS['enable_send_email_on_user_login'] === '1'
1157 1157
             ) {
1158 1158
                 $row = DB::queryFirstRow(
1159
-                    'SELECT valeur FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s',
1159
+                    'SELECT valeur FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s',
1160 1160
                     'cron',
1161 1161
                     'sending_emails'
1162 1162
                 );
@@ -1164,12 +1164,12 @@  discard block
 block discarded – undo
1164 1164
                 if ((int) (time() - $row['valeur']) >= 300 || (int) $row['valeur'] === 0) {
1165 1165
                     $rows = DB::query(
1166 1166
                         'SELECT *
1167
-                        FROM ' . prefixTable('emails') .
1167
+                        FROM ' . prefixTable('emails').
1168 1168
                             ' WHERE status != %s',
1169 1169
                         'sent'
1170 1170
                     );
1171 1171
                     foreach ($rows as $record) {
1172
-                        echo $record['increment_id'] . " >> ";
1172
+                        echo $record['increment_id']." >> ";
1173 1173
                         // Send email
1174 1174
                         $ret = json_decode(
1175 1175
                             sendEmail(
@@ -1287,7 +1287,7 @@  discard block
 block discarded – undo
1287 1287
          */
1288 1288
         case 'check_login_exists':
1289 1289
             $data = DB::query(
1290
-                'SELECT login, psk FROM ' . prefixTable('users') . '
1290
+                'SELECT login, psk FROM '.prefixTable('users').'
1291 1291
                 WHERE login = %i',
1292 1292
                 stripslashes(filter_input(INPUT_POST, 'userId', FILTER_SANITIZE_NUMBER_INT))
1293 1293
             );
@@ -1297,7 +1297,7 @@  discard block
 block discarded – undo
1297 1297
                 $userOk = true;
1298 1298
             }
1299 1299
 
1300
-            echo '[{"login" : "' . $userOk . '", "psk":"0"}]';
1300
+            echo '[{"login" : "'.$userOk.'", "psk":"0"}]';
1301 1301
             break;
1302 1302
             /*
1303 1303
          * Make statistics on item
@@ -1308,7 +1308,7 @@  discard block
 block discarded – undo
1308 1308
                 && filter_input(INPUT_POST, 'scope', FILTER_SANITIZE_STRING) === 'item'
1309 1309
             ) {
1310 1310
                 $data = DB::queryfirstrow(
1311
-                    'SELECT view FROM ' . prefixTable('statistics') . ' WHERE scope = %s AND item_id = %i',
1311
+                    'SELECT view FROM '.prefixTable('statistics').' WHERE scope = %s AND item_id = %i',
1312 1312
                     'item',
1313 1313
                     filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT)
1314 1314
                 );
@@ -1349,8 +1349,8 @@  discard block
 block discarded – undo
1349 1349
             $arr_html = array();
1350 1350
             $rows = DB::query(
1351 1351
                 'SELECT i.id AS id, i.label AS label, i.id_tree AS id_tree, l.date, i.perso AS perso, i.restricted_to AS restricted
1352
-                FROM ' . prefixTable('log_items') . ' AS l
1353
-                RIGHT JOIN ' . prefixTable('items') . ' AS i ON (l.id_item = i.id)
1352
+                FROM ' . prefixTable('log_items').' AS l
1353
+                RIGHT JOIN ' . prefixTable('items').' AS i ON (l.id_item = i.id)
1354 1354
                 WHERE l.action = %s AND l.id_user = %i
1355 1355
                 ORDER BY l.date DESC
1356 1356
                 LIMIT 0, 100',
@@ -1383,7 +1383,7 @@  discard block
 block discarded – undo
1383 1383
                 isset($SETTINGS['enable_suggestion']) && $SETTINGS['enable_suggestion'] == 1
1384 1384
                 && ($_SESSION['user_admin'] == 1 || $_SESSION['user_manager'] == 1)
1385 1385
             ) {
1386
-                DB::query('SELECT * FROM ' . prefixTable('suggestion'));
1386
+                DB::query('SELECT * FROM '.prefixTable('suggestion'));
1387 1387
                 $nb_suggestions_waiting = DB::count();
1388 1388
             }
1389 1389
 
@@ -1407,7 +1407,7 @@  discard block
 block discarded – undo
1407 1407
             $pwdlib = new PasswordLib\PasswordLib();
1408 1408
             // generate key
1409 1409
             $key = $pwdlib->getRandomToken(filter_input(INPUT_POST, 'size', FILTER_SANITIZE_NUMBER_INT));
1410
-            echo '[{"key" : "' . htmlentities($key, ENT_QUOTES) . '"}]';
1410
+            echo '[{"key" : "'.htmlentities($key, ENT_QUOTES).'"}]';
1411 1411
             break;
1412 1412
 
1413 1413
             /*
@@ -1436,7 +1436,7 @@  discard block
 block discarded – undo
1436 1436
                 )
1437 1437
             );
1438 1438
 
1439
-            echo '[{"token" : "' . $token . '"}]';
1439
+            echo '[{"token" : "'.$token.'"}]';
1440 1440
             break;
1441 1441
 
1442 1442
 
@@ -1451,14 +1451,14 @@  discard block
 block discarded – undo
1451 1451
 
1452 1452
             if ($_SESSION['user_manager'] === '1' || $_SESSION['is_admin'] === '1') {
1453 1453
                 $count = 0;
1454
-                DB::query('SELECT * FROM ' . prefixTable('items_change'));
1454
+                DB::query('SELECT * FROM '.prefixTable('items_change'));
1455 1455
                 $count += DB::count();
1456
-                DB::query('SELECT * FROM ' . prefixTable('suggestion'));
1456
+                DB::query('SELECT * FROM '.prefixTable('suggestion'));
1457 1457
                 $count += DB::count();
1458 1458
 
1459
-                echo '[ { "error" : "" , "count" : "' . $count . '" , "show_sug_in_menu" : "0"} ]';
1459
+                echo '[ { "error" : "" , "count" : "'.$count.'" , "show_sug_in_menu" : "0"} ]';
1460 1460
             } elseif (isset($_SESSION['nb_item_change_proposals']) && $_SESSION['nb_item_change_proposals'] > 0) {
1461
-                echo '[ { "error" : "" , "count" : "' . $_SESSION['nb_item_change_proposals'] . '" , "show_sug_in_menu" : "1"} ]';
1461
+                echo '[ { "error" : "" , "count" : "'.$_SESSION['nb_item_change_proposals'].'" , "show_sug_in_menu" : "1"} ]';
1462 1462
             } else {
1463 1463
                 echo '[ { "error" : "" , "count" : "" , "show_sug_in_menu" : "0"} ]';
1464 1464
             }
@@ -1493,9 +1493,9 @@  discard block
 block discarded – undo
1493 1493
                         $tmp = '';
1494 1494
                         foreach ($stats_data[$data] as $key => $value) {
1495 1495
                             if (empty($tmp)) {
1496
-                                $tmp = $key . '-' . $value;
1496
+                                $tmp = $key.'-'.$value;
1497 1497
                             } else {
1498
-                                $tmp .= ',' . $key . '-' . $value;
1498
+                                $tmp .= ','.$key.'-'.$value;
1499 1499
                             }
1500 1500
                         }
1501 1501
                         $statsToSend[$data] = $tmp;
@@ -1503,9 +1503,9 @@  discard block
 block discarded – undo
1503 1503
                         $tmp = '';
1504 1504
                         foreach ($stats_data[$data] as $key => $value) {
1505 1505
                             if (empty($tmp)) {
1506
-                                $tmp = $key . '-' . $value;
1506
+                                $tmp = $key.'-'.$value;
1507 1507
                             } else {
1508
-                                $tmp .= ',' . $key . '-' . $value;
1508
+                                $tmp .= ','.$key.'-'.$value;
1509 1509
                             }
1510 1510
                         }
1511 1511
                         $statsToSend[$data] = $tmp;
@@ -1602,8 +1602,8 @@  discard block
 block discarded – undo
1602 1602
                     if (strpos($line, 'cpassman_url') > 0 && empty($url_found) === true) {
1603 1603
                         $url_found = substr($line, 19, strlen($line) - 22);
1604 1604
                         $tmp = parse_url($url_found);
1605
-                        $anonym_url = $tmp['scheme'] . '://<anonym_url>' . $tmp['path'];
1606
-                        $line = "'cpassman_url' => '" . $anonym_url . "\n";
1605
+                        $anonym_url = $tmp['scheme'].'://<anonym_url>'.$tmp['path'];
1606
+                        $line = "'cpassman_url' => '".$anonym_url."\n";
1607 1607
                     }
1608 1608
 
1609 1609
                     // Anonymize all urls
@@ -1631,7 +1631,7 @@  discard block
 block discarded – undo
1631 1631
             $teampass_errors = '';
1632 1632
             $rows = DB::query(
1633 1633
                 'SELECT label, date AS error_date
1634
-                FROM ' . prefixTable('log_system') . "
1634
+                FROM ' . prefixTable('log_system')."
1635 1635
                 WHERE `type` LIKE 'error'
1636 1636
                 ORDER BY `date` DESC
1637 1637
                 LIMIT 0, 10"
@@ -1639,9 +1639,9 @@  discard block
 block discarded – undo
1639 1639
             if (DB::count() > 0) {
1640 1640
                 foreach ($rows as $record) {
1641 1641
                     if (empty($teampass_errors) === true) {
1642
-                        $teampass_errors = ' * ' . date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['error_date']) . ' - ' . $record['label'];
1642
+                        $teampass_errors = ' * '.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['error_date']).' - '.$record['label'];
1643 1643
                     } else {
1644
-                        $teampass_errors .= ' * ' . date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['error_date']) . ' - ' . $record['label'];
1644
+                        $teampass_errors .= ' * '.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['error_date']).' - '.$record['label'];
1645 1645
                     }
1646 1646
                 }
1647 1647
             }
@@ -1650,7 +1650,7 @@  discard block
 block discarded – undo
1650 1650
 
1651 1651
             // Now prepare text
1652 1652
             $txt = '### Page on which it happened
1653
-' . $post_data['current_page'] . '
1653
+' . $post_data['current_page'].'
1654 1654
 
1655 1655
 ### Steps to reproduce
1656 1656
 1.
@@ -1665,39 +1665,39 @@  discard block
 block discarded – undo
1665 1665
 Tell us what happens instead
1666 1666
 
1667 1667
 ### Server configuration
1668
-**Operating system**: ' . php_uname() . '
1668
+**Operating system**: ' . php_uname().'
1669 1669
 
1670
-**Web server:** ' . $_SERVER['SERVER_SOFTWARE'] . '
1670
+**Web server:** ' . $_SERVER['SERVER_SOFTWARE'].'
1671 1671
 
1672
-**Database:** ' . ($link === false ? langHdl('undefined') : mysqli_get_server_info($link)) . '
1672
+**Database:** ' . ($link === false ? langHdl('undefined') : mysqli_get_server_info($link)).'
1673 1673
 
1674
-**PHP version:** ' . PHP_VERSION . '
1674
+**PHP version:** ' . PHP_VERSION.'
1675 1675
 
1676
-**Teampass version:** ' . TP_VERSION_FULL . '
1676
+**Teampass version:** ' . TP_VERSION_FULL.'
1677 1677
 
1678 1678
 **Teampass configuration file:**
1679 1679
 ```
1680
-' . $list_of_options . '
1680
+' . $list_of_options.'
1681 1681
 ```
1682 1682
 
1683 1683
 **Updated from an older Teampass or fresh install:**
1684 1684
 
1685 1685
 ### Client configuration
1686 1686
 
1687
-**Browser:** ' . $post_data['browser_name'] . ' - ' . $post_data['browser_version'] . '
1687
+**Browser:** ' . $post_data['browser_name'].' - '.$post_data['browser_version'].'
1688 1688
 
1689
-**Operating system:** ' . $post_data['os'] . ' - ' . $post_data['os_archi'] . 'bits
1689
+**Operating system:** ' . $post_data['os'].' - '.$post_data['os_archi'].'bits
1690 1690
 
1691 1691
 ### Logs
1692 1692
 
1693 1693
 #### Web server error log
1694 1694
 ```
1695
-' . $err['message'] . ' - ' . $err['file'] . ' (' . $err['line'] . ')
1695
+' . $err['message'].' - '.$err['file'].' ('.$err['line'].')
1696 1696
 ```
1697 1697
 
1698 1698
 #### Teampass 10 last system errors
1699 1699
 ```
1700
-' . $teampass_errors . '
1700
+' . $teampass_errors.'
1701 1701
 ```
1702 1702
 
1703 1703
 #### Log from the web-browser developer console (CTRL + SHIFT + i)
@@ -1802,7 +1802,7 @@  discard block
 block discarded – undo
1802 1802
                 // Check if user exists
1803 1803
                 $userInfo = DB::queryFirstRow(
1804 1804
                     'SELECT public_key, private_key, pw
1805
-                    FROM ' . prefixTable('users') . '
1805
+                    FROM ' . prefixTable('users').'
1806 1806
                     WHERE id = %i',
1807 1807
                     $post_user_id
1808 1808
                 );
@@ -1810,14 +1810,14 @@  discard block
 block discarded – undo
1810 1810
                     // Get one item
1811 1811
                     $record = DB::queryFirstRow(
1812 1812
                         'SELECT id, pw
1813
-                        FROM ' . prefixTable('items') . '
1813
+                        FROM ' . prefixTable('items').'
1814 1814
                         WHERE perso = 0'
1815 1815
                     );
1816 1816
 
1817 1817
                     // Get itemKey from current user
1818 1818
                     $currentUserKey = DB::queryFirstRow(
1819 1819
                         'SELECT share_key, increment_id
1820
-                        FROM ' . prefixTable('sharekeys_items') . '
1820
+                        FROM ' . prefixTable('sharekeys_items').'
1821 1821
                         WHERE object_id = %i AND user_id = %i',
1822 1822
                         $record['id'],
1823 1823
                         $post_user_id
@@ -1846,7 +1846,7 @@  discard block
 block discarded – undo
1846 1846
                     } else {
1847 1847
                         // Use the password check
1848 1848
                         // load passwordLib library
1849
-                        $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'] . '/includes/libraries');
1849
+                        $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'].'/includes/libraries');
1850 1850
                         $pwdlib->register();
1851 1851
                         $pwdlib = new PasswordLib\PasswordLib();
1852 1852
                         
@@ -2027,7 +2027,7 @@  discard block
 block discarded – undo
2027 2027
                 // Get user info
2028 2028
                 $userData = DB::queryFirstRow(
2029 2029
                     'SELECT private_key
2030
-                    FROM ' . prefixTable('users') . '
2030
+                    FROM ' . prefixTable('users').'
2031 2031
                     WHERE id = %i',
2032 2032
                     $post_user_id
2033 2033
                 );
@@ -2048,7 +2048,7 @@  discard block
 block discarded – undo
2048 2048
                     );
2049 2049
 
2050 2050
                     // Load superGlobals
2051
-                    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
2051
+                    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
2052 2052
                     $superGlobal = new protect\SuperGlobal\SuperGlobal();
2053 2053
 
2054 2054
                     $superGlobal->put('private_key', $privateKey, 'SESSION', 'user');
@@ -2110,7 +2110,7 @@  discard block
 block discarded – undo
2110 2110
                 // Get user info
2111 2111
                 $userData = DB::queryFirstRow(
2112 2112
                     'SELECT email, auth_type, login
2113
-                    FROM ' . prefixTable('users') . '
2113
+                    FROM ' . prefixTable('users').'
2114 2114
                     WHERE id = %i',
2115 2115
                     $post_user_id
2116 2116
                 );
@@ -2315,7 +2315,7 @@  discard block
 block discarded – undo
2315 2315
                     // Get user info
2316 2316
                     $userData = DB::queryFirstRow(
2317 2317
                         'SELECT email, auth_type, login
2318
-                        FROM ' . prefixTable('users') . '
2318
+                        FROM ' . prefixTable('users').'
2319 2319
                         WHERE id = %i',
2320 2320
                         $post_user_id
2321 2321
                     );
@@ -2384,13 +2384,13 @@  discard block
 block discarded – undo
2384 2384
                 // Check if user exists
2385 2385
                 DB::queryFirstRow(
2386 2386
                     'SELECT *
2387
-                    FROM ' . prefixTable('users') . '
2387
+                    FROM ' . prefixTable('users').'
2388 2388
                     WHERE id = %i',
2389 2389
                     $post_user_id
2390 2390
                 );
2391 2391
                 if (DB::count() > 0) {
2392 2392
                     // Include libraries
2393
-                    include_once $SETTINGS['cpassman_dir'] . '/sources/aes.functions.php';
2393
+                    include_once $SETTINGS['cpassman_dir'].'/sources/aes.functions.php';
2394 2394
 
2395 2395
                     // CLear old sharekeys
2396 2396
                     if ($post_self_change === false) {
@@ -2459,13 +2459,13 @@  discard block
 block discarded – undo
2459 2459
                 // Check if user exists
2460 2460
                 $userInfo = DB::queryFirstRow(
2461 2461
                     'SELECT public_key
2462
-                    FROM ' . prefixTable('users') . '
2462
+                    FROM ' . prefixTable('users').'
2463 2463
                     WHERE id = %i',
2464 2464
                     $post_user_id
2465 2465
                 );
2466 2466
                 if (DB::count() > 0) {
2467 2467
                     // Include libraries
2468
-                    include_once $SETTINGS['cpassman_dir'] . '/sources/aes.functions.php';
2468
+                    include_once $SETTINGS['cpassman_dir'].'/sources/aes.functions.php';
2469 2469
 
2470 2470
                     // WHAT STEP TO PERFORM?
2471 2471
                     if ($post_action === 'step0') {
@@ -2481,15 +2481,15 @@  discard block
 block discarded – undo
2481 2481
                         // Loop on items
2482 2482
                         $rows = DB::query(
2483 2483
                             'SELECT id, pw
2484
-                            FROM ' . prefixTable('items') . '
2484
+                            FROM ' . prefixTable('items').'
2485 2485
                             WHERE perso = 0
2486
-                            LIMIT ' . $post_start . ', ' . $post_length
2486
+                            LIMIT ' . $post_start.', '.$post_length
2487 2487
                         );
2488 2488
                         foreach ($rows as $record) {
2489 2489
                             // Get itemKey from current user
2490 2490
                             $currentUserKey = DB::queryFirstRow(
2491 2491
                                 'SELECT share_key, increment_id
2492
-                                FROM ' . prefixTable('sharekeys_items') . '
2492
+                                FROM ' . prefixTable('sharekeys_items').'
2493 2493
                                 WHERE object_id = %i AND user_id = %i',
2494 2494
                                 $record['id'],
2495 2495
                                 $_SESSION['user_id']
@@ -2516,7 +2516,7 @@  discard block
 block discarded – undo
2516 2516
                                 if ((int) $post_user_id !== (int) $_SESSION['user_id']) {
2517 2517
                                     $currentUserKey = DB::queryFirstRow(
2518 2518
                                         'SELECT increment_id
2519
-                                        FROM ' . prefixTable('sharekeys_items') . '
2519
+                                        FROM ' . prefixTable('sharekeys_items').'
2520 2520
                                         WHERE object_id = %i AND user_id = %i',
2521 2521
                                         $record['id'],
2522 2522
                                         $post_user_id
@@ -2549,7 +2549,7 @@  discard block
 block discarded – undo
2549 2549
                         // SHould we change step?
2550 2550
                         DB::query(
2551 2551
                             'SELECT *
2552
-                            FROM ' . prefixTable('items') . '
2552
+                            FROM ' . prefixTable('items').'
2553 2553
                             WHERE perso = 0'
2554 2554
                         );
2555 2555
                         $next_start = (int) $post_start + (int) $post_length;
@@ -2565,15 +2565,15 @@  discard block
 block discarded – undo
2565 2565
                         // Loop on logs
2566 2566
                         $rows = DB::query(
2567 2567
                             'SELECT increment_id
2568
-                            FROM ' . prefixTable('log_items') . '
2568
+                            FROM ' . prefixTable('log_items').'
2569 2569
                             WHERE raison LIKE "at_pw :%" AND encryption_type = "teampass_aes"
2570
-                            LIMIT ' . $post_start . ', ' . $post_length
2570
+                            LIMIT ' . $post_start.', '.$post_length
2571 2571
                         );
2572 2572
                         foreach ($rows as $record) {
2573 2573
                             // Get itemKey from current user
2574 2574
                             $currentUserKey = DB::queryFirstRow(
2575 2575
                                 'SELECT share_key
2576
-                                FROM ' . prefixTable('sharekeys_logs') . '
2576
+                                FROM ' . prefixTable('sharekeys_logs').'
2577 2577
                                 WHERE object_id = %i AND user_id = %i',
2578 2578
                                 $record['increment_id'],
2579 2579
                                 $_SESSION['user_id']
@@ -2600,7 +2600,7 @@  discard block
 block discarded – undo
2600 2600
                                 if ((int) $post_user_id !== (int) $_SESSION['user_id']) {
2601 2601
                                     $currentUserKey = DB::queryFirstRow(
2602 2602
                                         'SELECT increment_id
2603
-                                        FROM ' . prefixTable('sharekeys_items') . '
2603
+                                        FROM ' . prefixTable('sharekeys_items').'
2604 2604
                                         WHERE object_id = %i AND user_id = %i',
2605 2605
                                         $record['id'],
2606 2606
                                         $post_user_id
@@ -2622,7 +2622,7 @@  discard block
 block discarded – undo
2622 2622
                         // SHould we change step?
2623 2623
                         DB::query(
2624 2624
                             'SELECT increment_id
2625
-                            FROM ' . prefixTable('log_items') . '
2625
+                            FROM ' . prefixTable('log_items').'
2626 2626
                             WHERE raison LIKE "at_pw :%" AND encryption_type = "teampass_aes"'
2627 2627
                         );
2628 2628
                         $next_start = (int) $post_start + (int) $post_length;
@@ -2638,15 +2638,15 @@  discard block
 block discarded – undo
2638 2638
                         // Loop on fields
2639 2639
                         $rows = DB::query(
2640 2640
                             'SELECT id
2641
-                            FROM ' . prefixTable('categories_items') . '
2641
+                            FROM ' . prefixTable('categories_items').'
2642 2642
                             WHERE encryption_type = "teampass_aes"
2643
-                            LIMIT ' . $post_start . ', ' . $post_length
2643
+                            LIMIT ' . $post_start.', '.$post_length
2644 2644
                         );
2645 2645
                         foreach ($rows as $record) {
2646 2646
                             // Get itemKey from current user
2647 2647
                             $currentUserKey = DB::queryFirstRow(
2648 2648
                                 'SELECT share_key
2649
-                                FROM ' . prefixTable('sharekeys_fields') . '
2649
+                                FROM ' . prefixTable('sharekeys_fields').'
2650 2650
                                 WHERE object_id = %i AND user_id = %i',
2651 2651
                                 $record['id'],
2652 2652
                                 $_SESSION['user_id']
@@ -2673,7 +2673,7 @@  discard block
 block discarded – undo
2673 2673
                                 if ((int) $post_user_id !== (int) $_SESSION['user_id']) {
2674 2674
                                     $currentUserKey = DB::queryFirstRow(
2675 2675
                                         'SELECT increment_id
2676
-                                        FROM ' . prefixTable('sharekeys_items') . '
2676
+                                        FROM ' . prefixTable('sharekeys_items').'
2677 2677
                                         WHERE object_id = %i AND user_id = %i',
2678 2678
                                         $record['id'],
2679 2679
                                         $post_user_id
@@ -2695,7 +2695,7 @@  discard block
 block discarded – undo
2695 2695
                         // SHould we change step?
2696 2696
                         DB::query(
2697 2697
                             'SELECT *
2698
-                            FROM ' . prefixTable('categories_items') . '
2698
+                            FROM ' . prefixTable('categories_items').'
2699 2699
                             WHERE encryption_type = "teampass_aes"'
2700 2700
                         );
2701 2701
                         $next_start = (int) $post_start + (int) $post_length;
@@ -2711,14 +2711,14 @@  discard block
 block discarded – undo
2711 2711
                         // Loop on suggestions
2712 2712
                         $rows = DB::query(
2713 2713
                             'SELECT id
2714
-                            FROM ' . prefixTable('suggestion') . '
2715
-                            LIMIT ' . $post_start . ', ' . $post_length
2714
+                            FROM ' . prefixTable('suggestion').'
2715
+                            LIMIT ' . $post_start.', '.$post_length
2716 2716
                         );
2717 2717
                         foreach ($rows as $record) {
2718 2718
                             // Get itemKey from current user
2719 2719
                             $currentUserKey = DB::queryFirstRow(
2720 2720
                                 'SELECT share_key
2721
-                                FROM ' . prefixTable('sharekeys_suggestions') . '
2721
+                                FROM ' . prefixTable('sharekeys_suggestions').'
2722 2722
                                 WHERE object_id = %i AND user_id = %i',
2723 2723
                                 $record['id'],
2724 2724
                                 $_SESSION['user_id']
@@ -2745,7 +2745,7 @@  discard block
 block discarded – undo
2745 2745
                                 if ((int) $post_user_id !== (int) $_SESSION['user_id']) {
2746 2746
                                     $currentUserKey = DB::queryFirstRow(
2747 2747
                                         'SELECT increment_id
2748
-                                        FROM ' . prefixTable('sharekeys_items') . '
2748
+                                        FROM ' . prefixTable('sharekeys_items').'
2749 2749
                                         WHERE object_id = %i AND user_id = %i',
2750 2750
                                         $record['id'],
2751 2751
                                         $post_user_id
@@ -2782,15 +2782,15 @@  discard block
 block discarded – undo
2782 2782
                         // Loop on files
2783 2783
                         $rows = DB::query(
2784 2784
                             'SELECT id
2785
-                            FROM ' . prefixTable('files') . '
2786
-                            WHERE status = "' . TP_ENCRYPTION_NAME . '"
2787
-                            LIMIT ' . $post_start . ', ' . $post_length
2785
+                            FROM ' . prefixTable('files').'
2786
+                            WHERE status = "' . TP_ENCRYPTION_NAME.'"
2787
+                            LIMIT ' . $post_start.', '.$post_length
2788 2788
                         ); //aes_encryption
2789 2789
                         foreach ($rows as $record) {
2790 2790
                             // Get itemKey from current user
2791 2791
                             $currentUserKey = DB::queryFirstRow(
2792 2792
                                 'SELECT share_key
2793
-                                FROM ' . prefixTable('sharekeys_files') . '
2793
+                                FROM ' . prefixTable('sharekeys_files').'
2794 2794
                                 WHERE object_id = %i AND user_id = %i',
2795 2795
                                 $record['id'],
2796 2796
                                 $_SESSION['user_id']
@@ -2817,7 +2817,7 @@  discard block
 block discarded – undo
2817 2817
                                 if ((int) $post_user_id !== (int) $_SESSION['user_id']) {
2818 2818
                                     $currentUserKey = DB::queryFirstRow(
2819 2819
                                         'SELECT increment_id
2820
-                                        FROM ' . prefixTable('sharekeys_items') . '
2820
+                                        FROM ' . prefixTable('sharekeys_items').'
2821 2821
                                         WHERE object_id = %i AND user_id = %i',
2822 2822
                                         $record['id'],
2823 2823
                                         $post_user_id
@@ -2839,8 +2839,8 @@  discard block
 block discarded – undo
2839 2839
                         // SHould we change step?
2840 2840
                         DB::query(
2841 2841
                             'SELECT *
2842
-                            FROM ' . prefixTable('files') . '
2843
-                            WHERE status = "' . TP_ENCRYPTION_NAME . '"'
2842
+                            FROM ' . prefixTable('files').'
2843
+                            WHERE status = "' . TP_ENCRYPTION_NAME.'"'
2844 2844
                         );
2845 2845
                         $next_start = (int) $post_start + (int) $post_length;
2846 2846
                         if ($next_start > DB::count()) {
@@ -2860,16 +2860,16 @@  discard block
 block discarded – undo
2860 2860
                             if (count($_SESSION['personal_folders']) > 0) {
2861 2861
                                 $rows = DB::query(
2862 2862
                                     'SELECT id, pw
2863
-                                    FROM ' . prefixTable('items') . '
2863
+                                    FROM ' . prefixTable('items').'
2864 2864
                                     WHERE perso = 1 AND id_tree IN %ls
2865
-                                    LIMIT ' . $post_start . ', ' . $post_length,
2865
+                                    LIMIT ' . $post_start.', '.$post_length,
2866 2866
                                     $_SESSION['personal_folders']
2867 2867
                                 );
2868 2868
                                 foreach ($rows as $record) {
2869 2869
                                     // Get itemKey from current user
2870 2870
                                     $currentUserKey = DB::queryFirstRow(
2871 2871
                                         'SELECT share_key, increment_id
2872
-                                        FROM ' . prefixTable('sharekeys_items') . '
2872
+                                        FROM ' . prefixTable('sharekeys_items').'
2873 2873
                                         WHERE object_id = %i AND user_id = %i',
2874 2874
                                         $record['id'],
2875 2875
                                         $_SESSION['user_id']
@@ -2896,7 +2896,7 @@  discard block
 block discarded – undo
2896 2896
                                         if ((int) $post_user_id !== (int) $_SESSION['user_id']) {
2897 2897
                                             $currentUserKey = DB::queryFirstRow(
2898 2898
                                                 'SELECT increment_id
2899
-                                                FROM ' . prefixTable('sharekeys_items') . '
2899
+                                                FROM ' . prefixTable('sharekeys_items').'
2900 2900
                                                 WHERE object_id = %i AND user_id = %i',
2901 2901
                                                 $record['id'],
2902 2902
                                                 $post_user_id
@@ -2919,7 +2919,7 @@  discard block
 block discarded – undo
2919 2919
                             // SHould we change step?
2920 2920
                             DB::query(
2921 2921
                                 'SELECT *
2922
-                                FROM ' . prefixTable('items') . '
2922
+                                FROM ' . prefixTable('items').'
2923 2923
                                 WHERE perso = 0'
2924 2924
                             );
2925 2925
                             $next_start = (int) $post_start + (int) $post_length;
@@ -3006,7 +3006,7 @@  discard block
 block discarded – undo
3006 3006
                 // Check if user exists
3007 3007
                 $userInfo = DB::queryFirstRow(
3008 3008
                     'SELECT public_key, encrypted_psk
3009
-                    FROM ' . prefixTable('users') . '
3009
+                    FROM ' . prefixTable('users').'
3010 3010
                     WHERE id = %i',
3011 3011
                     $post_user_id
3012 3012
                 );
@@ -3031,9 +3031,9 @@  discard block
 block discarded – undo
3031 3031
                             // Loop on persoanl items
3032 3032
                             $rows = DB::query(
3033 3033
                                 'SELECT id, pw
3034
-                                FROM ' . prefixTable('items') . '
3034
+                                FROM ' . prefixTable('items').'
3035 3035
                                 WHERE perso = 1 AND id_tree IN %ls
3036
-                                LIMIT ' . $post_start . ', ' . $post_length,
3036
+                                LIMIT ' . $post_start.', '.$post_length,
3037 3037
                                 $_SESSION['personal_folders']
3038 3038
                             );
3039 3039
                             $countUserPersonalItems = DB::count();
@@ -3076,7 +3076,7 @@  discard block
 block discarded – undo
3076 3076
                                     // Loop on files
3077 3077
                                     $rows = DB::query(
3078 3078
                                         'SELECT id, file
3079
-                                        FROM ' . prefixTable('files') . '
3079
+                                        FROM ' . prefixTable('files').'
3080 3080
                                         WHERE status != %s
3081 3081
                                         AND id_item = %i',
3082 3082
                                         TP_ENCRYPTION_NAME,
@@ -3087,13 +3087,13 @@  discard block
 block discarded – undo
3087 3087
                                         // Now decrypt the file
3088 3088
                                         prepareFileWithDefuse(
3089 3089
                                             'decrypt',
3090
-                                            $SETTINGS['path_to_upload_folder'] . '/' . $record2['file'],
3091
-                                            $SETTINGS['path_to_upload_folder'] . '/' . $record2['file'] . '.delete',
3090
+                                            $SETTINGS['path_to_upload_folder'].'/'.$record2['file'],
3091
+                                            $SETTINGS['path_to_upload_folder'].'/'.$record2['file'].'.delete',
3092 3092
                                             $dataReceived['userPsk']
3093 3093
                                         );
3094 3094
 
3095 3095
                                         // Encrypt the file
3096
-                                        $encryptedFile = encryptFile($record2['file'] . '.delete', $SETTINGS['path_to_upload_folder']);
3096
+                                        $encryptedFile = encryptFile($record2['file'].'.delete', $SETTINGS['path_to_upload_folder']);
3097 3097
 
3098 3098
                                         DB::update(
3099 3099
                                             prefixTable('files'),
@@ -3116,7 +3116,7 @@  discard block
 block discarded – undo
3116 3116
                                         );
3117 3117
 
3118 3118
                                         // Unlink original file
3119
-                                        unlink($SETTINGS['path_to_upload_folder'] . '/' . $record2['file']);
3119
+                                        unlink($SETTINGS['path_to_upload_folder'].'/'.$record2['file']);
3120 3120
                                     }
3121 3121
                                 }
3122 3122
                             }
@@ -3209,7 +3209,7 @@  discard block
 block discarded – undo
3209 3209
                     // Get user info
3210 3210
                     $userData = DB::queryFirstRow(
3211 3211
                         'SELECT '.$post_fields.'
3212
-                        FROM ' . prefixTable('users') . '
3212
+                        FROM ' . prefixTable('users').'
3213 3213
                         WHERE id = %i',
3214 3214
                         $post_user_id
3215 3215
                     );
@@ -3269,7 +3269,7 @@  discard block
 block discarded – undo
3269 3269
                         // Get user info
3270 3270
                         $userData = DB::queryFirstRow(
3271 3271
                             'SELECT auth_type, login, private_key
3272
-                            FROM ' . prefixTable('users') . '
3272
+                            FROM ' . prefixTable('users').'
3273 3273
                             WHERE id = %i',
3274 3274
                             $post_user_id
3275 3275
                         );
@@ -3280,7 +3280,7 @@  discard block
 block discarded – undo
3280 3280
                             $privateKey = decryptPrivateKey($post_current_pwd, $userData['private_key']);
3281 3281
 
3282 3282
                             // Load superGlobals
3283
-                            include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
3283
+                            include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
3284 3284
                             $superGlobal = new protect\SuperGlobal\SuperGlobal();
3285 3285
 
3286 3286
                             if ($superGlobal->get('private_key', 'SESSION', 'user') === $privateKey) {
@@ -3313,7 +3313,7 @@  discard block
 block discarded – undo
3313 3313
                                 echo prepareExchangedData(
3314 3314
                                     array(
3315 3315
                                         'error' => false,
3316
-                                        'message' => langHdl('done'),'',
3316
+                                        'message' => langHdl('done'), '',
3317 3317
                                     ),
3318 3318
                                     'encode'
3319 3319
                                 );
@@ -3375,7 +3375,7 @@  discard block
 block discarded – undo
3375 3375
                         // Get user info
3376 3376
                         $userData = DB::queryFirstRow(
3377 3377
                             'SELECT auth_type, login, private_key, special
3378
-                            FROM ' . prefixTable('users') . '
3378
+                            FROM ' . prefixTable('users').'
3379 3379
                             WHERE id = %i',
3380 3380
                             $post_user_id
3381 3381
                         );
@@ -3405,14 +3405,14 @@  discard block
 block discarded – undo
3405 3405
                                 );
3406 3406
 
3407 3407
                                 // Load superGlobals
3408
-                                include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
3408
+                                include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
3409 3409
                                 $superGlobal = new protect\SuperGlobal\SuperGlobal();
3410 3410
                                 $superGlobal->put('private_key', $privateKey, 'SESSION', 'user');
3411 3411
 
3412 3412
                                 echo prepareExchangedData(
3413 3413
                                     array(
3414 3414
                                         'error' => false,
3415
-                                        'message' => langHdl('done'),'',
3415
+                                        'message' => langHdl('done'), '',
3416 3416
                                     ),
3417 3417
                                     'encode'
3418 3418
                                 );
@@ -3439,14 +3439,14 @@  discard block
 block discarded – undo
3439 3439
                                 // Get one item
3440 3440
                                 $record = DB::queryFirstRow(
3441 3441
                                     'SELECT id, pw
3442
-                                    FROM ' . prefixTable('items') . '
3442
+                                    FROM ' . prefixTable('items').'
3443 3443
                                     WHERE perso = 0'
3444 3444
                                 );
3445 3445
 
3446 3446
                                 // Get itemKey from current user
3447 3447
                                 $currentUserKey = DB::queryFirstRow(
3448 3448
                                     'SELECT share_key, increment_id
3449
-                                    FROM ' . prefixTable('sharekeys_items') . '
3449
+                                    FROM ' . prefixTable('sharekeys_items').'
3450 3450
                                     WHERE object_id = %i AND user_id = %i',
3451 3451
                                     $record['id'],
3452 3452
                                     $post_user_id
@@ -3474,7 +3474,7 @@  discard block
 block discarded – undo
3474 3474
                                         );
3475 3475
                                         
3476 3476
                                         // Load superGlobals
3477
-                                        include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
3477
+                                        include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
3478 3478
                                         $superGlobal = new protect\SuperGlobal\SuperGlobal();
3479 3479
                                         $superGlobal->put('private_key', $privateKey, 'SESSION', 'user');
3480 3480
     
Please login to merge, or discard this patch.
sources/export.queries.php 1 patch
Spacing   +78 added lines, -78 removed lines patch added patch discarded remove patch
@@ -50,26 +50,26 @@  discard block
 block discarded – undo
50 50
 }
51 51
 
52 52
 // Do checks
53
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
54
-require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php';
53
+require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php';
54
+require_once $SETTINGS['cpassman_dir'].'/sources/checks.php';
55 55
 if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'items', $SETTINGS) === false) {
56 56
     // Not allowed page
57 57
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
58
-    include $SETTINGS['cpassman_dir'] . '/error.php';
58
+    include $SETTINGS['cpassman_dir'].'/error.php';
59 59
     exit();
60 60
 }
61 61
 
62 62
 // No time limit
63 63
 set_time_limit(0);
64 64
 
65
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
65
+require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
66 66
 header('Content-type: text/html; charset=utf-8');
67 67
 error_reporting(E_ERROR);
68
-require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
69
-require_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
68
+require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
69
+require_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
70 70
 
71 71
 // Connect to mysql server
72
-require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
72
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
73 73
 if (defined('DB_PASSWD_CLEAR') === false) {
74 74
     define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
75 75
 }
@@ -81,12 +81,12 @@  discard block
 block discarded – undo
81 81
 DB::$encoding = DB_ENCODING;
82 82
 
83 83
 // Build tree
84
-$tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries');
84
+$tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries');
85 85
 $tree->register();
86
-$tree = new Tree\NestedTree\NestedTree($pre . 'nested_tree', 'id', 'parent_id', 'title');
86
+$tree = new Tree\NestedTree\NestedTree($pre.'nested_tree', 'id', 'parent_id', 'title');
87 87
 
88 88
 // User's language loading
89
-require_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php';
89
+require_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php';
90 90
 
91 91
 // Prepare POST variables
92 92
 $id = filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT);
@@ -137,9 +137,9 @@  discard block
 block discarded – undo
137 137
                         'SELECT i.id as id, i.id_tree as id_tree, i.restricted_to as restricted_to, i.perso as perso,
138 138
                             i.label as label, i.description as description, i.pw as pw, i.login as login, i.url as url,
139 139
                             i.email as email,l.date as date, i.pw_iv as pw_iv,n.renewal_period as renewal_period
140
-                        FROM ' . prefixTable('items') . ' as i
141
-                        INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree = n.id)
142
-                        INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id = l.id_item)
140
+                        FROM ' . prefixTable('items').' as i
141
+                        INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree = n.id)
142
+                        INNER JOIN ' . prefixTable('log_items').' as l ON (i.id = l.id_item)
143 143
                         WHERE i.inactif = %i
144 144
                         AND i.id_tree= %i
145 145
                         AND (l.action = %s OR (l.action = %s AND l.raison LIKE %s))
@@ -162,8 +162,8 @@  discard block
 block discarded – undo
162 162
                                 // Run query
163 163
                                 $dataItem = DB::queryfirstrow(
164 164
                                     'SELECT i.pw AS pw, s.share_key AS share_key
165
-                                    FROM ' . prefixTable('items') . ' AS i
166
-                                    INNER JOIN ' . prefixTable('sharekeys_items') . ' AS s ON (s.object_id = i.id)
165
+                                    FROM ' . prefixTable('items').' AS i
166
+                                    INNER JOIN ' . prefixTable('sharekeys_items').' AS s ON (s.object_id = i.id)
167 167
                                     WHERE user_id = %i AND i.id = %i',
168 168
                                     $_SESSION['user_id'],
169 169
                                     $record['id']
@@ -187,8 +187,8 @@  discard block
 block discarded – undo
187 187
                                 $arr_kbs = [];
188 188
                                 $rows_kb = DB::query(
189 189
                                     'SELECT b.label, b.id
190
-                                    FROM ' . prefixTable('kb_items') . ' AS a
191
-                                    INNER JOIN ' . prefixTable('kb') . ' AS b ON (a.kb_id = b.id)
190
+                                    FROM ' . prefixTable('kb_items').' AS a
191
+                                    INNER JOIN ' . prefixTable('kb').' AS b ON (a.kb_id = b.id)
192 192
                                     WHERE a.item_id = %i',
193 193
                                     $record['id']
194 194
                                 );
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
                                 $arr_tags = [];
201 201
                                 $rows_tag = DB::query(
202 202
                                     'SELECT tag
203
-                                    FROM ' . prefixTable('tags') . '
203
+                                    FROM ' . prefixTable('tags').'
204 204
                                     WHERE item_id = %i',
205 205
                                     $record['id']
206 206
                                 );
@@ -247,14 +247,14 @@  discard block
 block discarded – undo
247 247
                 $tmp .= array2csv($value);
248 248
             }
249 249
 
250
-            echo '[{"content":"' . base64_encode($tmp) . '"}]';
250
+            echo '[{"content":"'.base64_encode($tmp).'"}]';
251 251
             break;
252 252
 
253 253
             /*
254 254
          * PDF - step 1 - Prepare database
255 255
          */
256 256
         case 'initialize_export_table':
257
-            DB::query('TRUNCATE TABLE ' . prefixTable('export'));
257
+            DB::query('TRUNCATE TABLE '.prefixTable('export'));
258 258
             break;
259 259
 
260 260
             /*
@@ -298,9 +298,9 @@  discard block
 block discarded – undo
298 298
                     'SELECT i.id as id, i.restricted_to as restricted_to, i.perso as perso, i.label as label, i.description as description, i.pw as pw, i.login as login, i.url as url, i.email as email,
299 299
                         l.date as date, i.pw_iv as pw_iv,
300 300
                         n.renewal_period as renewal_period
301
-                        FROM ' . prefixTable('items') . ' as i
302
-                        INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree = n.id)
303
-                        INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id = l.id_item)
301
+                        FROM ' . prefixTable('items').' as i
302
+                        INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree = n.id)
303
+                        INNER JOIN ' . prefixTable('log_items').' as l ON (i.id = l.id_item)
304 304
                         WHERE i.inactif = %i
305 305
                         AND i.id_tree= %i
306 306
                         AND (l.action = %s OR (l.action = %s AND l.raison LIKE %s))
@@ -326,8 +326,8 @@  discard block
 block discarded – undo
326 326
                             // Run query
327 327
                             $dataItem = DB::queryfirstrow(
328 328
                                 'SELECT i.pw AS pw, s.share_key AS share_key
329
-                                FROM ' . prefixTable('items') . ' AS i
330
-                                INNER JOIN ' . prefixTable('sharekeys_items') . ' AS s ON (s.object_id = i.id)
329
+                                FROM ' . prefixTable('items').' AS i
330
+                                INNER JOIN ' . prefixTable('sharekeys_items').' AS s ON (s.object_id = i.id)
331 331
                                 WHERE user_id = %i AND i.id = %i',
332 332
                                 $_SESSION['user_id'],
333 333
                                 $record['id']
@@ -351,8 +351,8 @@  discard block
 block discarded – undo
351 351
                             $arr_kbs = '';
352 352
                             $rows_kb = DB::query(
353 353
                                 'SELECT b.label, b.id
354
-                                FROM ' . prefixTable('kb_items') . ' AS a
355
-                                INNER JOIN ' . prefixTable('kb') . ' AS b ON (a.kb_id = b.id)
354
+                                FROM ' . prefixTable('kb_items').' AS a
355
+                                INNER JOIN ' . prefixTable('kb').' AS b ON (a.kb_id = b.id)
356 356
                                 WHERE a.item_id = %i',
357 357
                                 $record['id']
358 358
                             );
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
                                 if (empty($arr_kbs)) {
361 361
                                     $arr_kbs = $rec_kb['label'];
362 362
                                 } else {
363
-                                    $arr_kbs .= ' | ' . $rec_kb['label'];
363
+                                    $arr_kbs .= ' | '.$rec_kb['label'];
364 364
                                 }
365 365
                             }
366 366
 
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
                             $arr_tags = '';
369 369
                             $rows_tag = DB::query(
370 370
                                 'SELECT tag
371
-                                FROM ' . prefixTable('tags') . '
371
+                                FROM ' . prefixTable('tags').'
372 372
                                 WHERE item_id = %i',
373 373
                                 $record['id']
374 374
                             );
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
                                 if (empty($arr_tags)) {
377 377
                                     $arr_tags = $rec_tag['tag'];
378 378
                                 } else {
379
-                                    $arr_tags .= ' ' . $rec_tag['tag'];
379
+                                    $arr_tags .= ' '.$rec_tag['tag'];
380 380
                                 }
381 381
                             }
382 382
 
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
             header('Content-type: application/pdf');
445 445
 
446 446
             // query
447
-            $rows = DB::query('SELECT * FROM ' . prefixTable('export'));
447
+            $rows = DB::query('SELECT * FROM '.prefixTable('export'));
448 448
             $counter = DB::count();
449 449
             if ($counter > 0) {
450 450
                 // print
@@ -452,8 +452,8 @@  discard block
 block discarded – undo
452 452
                 $prev_path = '';
453 453
 
454 454
                 //Prepare the PDF file
455
-                require_once($SETTINGS['cpassman_dir'] . '/includes/libraries/Pdf/tcpdf/config/tcpdf_config.php');
456
-                include $SETTINGS['cpassman_dir'] . '/includes/libraries/Pdf/tcpdf/tcpdf.php';
455
+                require_once($SETTINGS['cpassman_dir'].'/includes/libraries/Pdf/tcpdf/config/tcpdf_config.php');
456
+                include $SETTINGS['cpassman_dir'].'/includes/libraries/Pdf/tcpdf/tcpdf.php';
457 457
 
458 458
                 $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
459 459
                 $pdf->SetProtection(array('print'), $dataReceived['pdf_password'], null);
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
 
466 466
                 // set default header data
467 467
                 $pdf->SetHeaderData(
468
-                    $SETTINGS['cpassman_dir'] . '/includes/images/teampass-logo2-home.png',
468
+                    $SETTINGS['cpassman_dir'].'/includes/images/teampass-logo2-home.png',
469 469
                     PDF_HEADER_LOGO_WIDTH,
470 470
                     'Teampass export',
471 471
                     $_SESSION['lastname']." ".$_SESSION['name'].' @ '.date($SETTINGS['date_format']." ".$SETTINGS['time_format'], (int) time())
@@ -569,7 +569,7 @@  discard block
 block discarded – undo
569 569
                 logEvents($SETTINGS, 'pdf_export', '', (string) $_SESSION['user_id'], $_SESSION['login']);
570 570
 
571 571
                 //clean table
572
-                DB::query('TRUNCATE TABLE ' . prefixTable('export'));
572
+                DB::query('TRUNCATE TABLE '.prefixTable('export'));
573 573
 
574 574
                 // Send back the file in Blob
575 575
                 echo $pdf->Output(null, 'I');
@@ -581,8 +581,8 @@  discard block
 block discarded – undo
581 581
             // step 1:
582 582
             // - prepare export file
583 583
             // - get full list of objects id to export
584
-            include $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
585
-            include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/GibberishAES/GibberishAES.php';
584
+            include $SETTINGS['cpassman_dir'].'/includes/config/include.php';
585
+            include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/GibberishAES/GibberishAES.php';
586 586
             $idsList = array();
587 587
 
588 588
             foreach (explode(';', $post_ids) as $id) {
@@ -594,9 +594,9 @@  discard block
 block discarded – undo
594 594
                     // count elements to display
595 595
                     $result = DB::query(
596 596
                         'SELECT i.id AS id, i.label AS label, i.restricted_to AS restricted_to, i.perso AS perso
597
-                    FROM ' . prefixTable('items') . ' as i
598
-                    INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree = n.id)
599
-                    INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id = l.id_item)
597
+                    FROM ' . prefixTable('items').' as i
598
+                    INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree = n.id)
599
+                    INNER JOIN ' . prefixTable('log_items').' as l ON (i.id = l.id_item)
600 600
                     WHERE i.inactif = %i
601 601
                     AND i.id_tree= %i
602 602
                     AND (l.action = %s OR (l.action = %s AND l.raison LIKE %s))
@@ -624,9 +624,9 @@  discard block
 block discarded – undo
624 624
 
625 625
             // prepare export file
626 626
             //save the file
627
-            $html_file = '/teampass_export_' . time() . '_' . generateKey() . '.html';
627
+            $html_file = '/teampass_export_'.time().'_'.generateKey().'.html';
628 628
             //print_r($full_listing);
629
-            $outstream = fopen($SETTINGS['path_to_files_folder'] . $html_file, 'w');
629
+            $outstream = fopen($SETTINGS['path_to_files_folder'].$html_file, 'w');
630 630
             if ($outstream === false) {
631 631
                 echo '[{"error":"true"}]';
632 632
                 break;
@@ -650,12 +650,12 @@  discard block
 block discarded – undo
650 650
     </style>
651 651
     </head>
652 652
     <body>
653
-    <input type="hidden" id="generation_date" value="' . GibberishAES::enc(/** @scrutinizer ignore-type */ (string) time(), $post_pdf_password) . '" />
653
+    <input type="hidden" id="generation_date" value="' . GibberishAES::enc(/** @scrutinizer ignore-type */ (string) time(), $post_pdf_password).'" />
654 654
     <div id="header">
655
-    ' . TP_TOOL_NAME . ' - Off Line mode
655
+    ' . TP_TOOL_NAME.' - Off Line mode
656 656
     </div>
657 657
     <div style="margin:10px; font-size:9px;">
658
-    <i>This page was generated by <b>' . $_SESSION['name'] . ' ' . $_SESSION['lastname'] . '</b>, the ' . date('Y/m/d H:i:s') . '.</i>
658
+    <i>This page was generated by <b>' . $_SESSION['name'].' '.$_SESSION['lastname'].'</b>, the '.date('Y/m/d H:i:s').'.</i>
659 659
     <span id="info_page" style="margin-left:20px; font-weight:bold; font-size: 14px; color:red;"></span>
660 660
     </div>
661 661
     <div id="information"></div>
@@ -666,11 +666,11 @@  discard block
 block discarded – undo
666 666
     <div>
667 667
     <table id="itemsTable">
668 668
         <thead><tr>
669
-            <th style="width:15%;">' . $LANG['label'] . '</th>
670
-            <th style="width:10%;">' . $LANG['pw'] . '</th>
671
-            <th style="width:30%;">' . $LANG['description'] . '</th>
672
-            <th style="width:5%;">' . $LANG['user_login'] . '</th>
673
-            <th style="width:20%;">' . $LANG['url'] . '</th>
669
+            <th style="width:15%;">' . $LANG['label'].'</th>
670
+            <th style="width:10%;">' . $LANG['pw'].'</th>
671
+            <th style="width:30%;">' . $LANG['description'].'</th>
672
+            <th style="width:5%;">' . $LANG['user_login'].'</th>
673
+            <th style="width:20%;">' . $LANG['url'].'</th>
674 674
         </tr></thead>
675 675
         <tbody id="itemsTable_tbody">'
676 676
             );
@@ -695,22 +695,22 @@  discard block
 block discarded – undo
695 695
                 || in_array($post_idTree, $_SESSION['groupes_visibles']) === false
696 696
                 || (in_array($post_idTree, $_SESSION['no_access_folders']) === true)
697 697
             ) {
698
-                echo '[{"loop":"true", "number":"' . $post_number . '", "cpt":"' . $post_cpt . '", "file":"' . $post_file . '", "idsList":"' . $post_idsList . '" , "file_link":"' . $post_file_link . '"}]';
698
+                echo '[{"loop":"true", "number":"'.$post_number.'", "cpt":"'.$post_cpt.'", "file":"'.$post_file.'", "idsList":"'.$post_idsList.'" , "file_link":"'.$post_file_link.'"}]';
699 699
                 break;
700 700
             }
701 701
 
702 702
             $full_listing = array();
703 703
             $items_id_list = array();
704
-            include $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
705
-            include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/GibberishAES/GibberishAES.php';
704
+            include $SETTINGS['cpassman_dir'].'/includes/config/include.php';
705
+            include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/GibberishAES/GibberishAES.php';
706 706
 
707 707
             $rows = DB::query(
708 708
                 'SELECT i.id as id, i.url as url, i.perso as perso, i.label as label, i.description as description, i.pw as pw, i.login as login, i.id_tree as id_tree,
709 709
                 l.date as date, i.pw_iv as pw_iv,
710 710
                 n.renewal_period as renewal_period
711
-            FROM ' . prefixTable('items') . ' as i
712
-            INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree = n.id)
713
-            INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id = l.id_item)
711
+            FROM ' . prefixTable('items').' as i
712
+            INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree = n.id)
713
+            INNER JOIN ' . prefixTable('log_items').' as l ON (i.id = l.id_item)
714 714
             WHERE i.inactif = %i
715 715
             AND i.id_tree= %i
716 716
             AND (l.action = %s OR (l.action = %s AND l.raison LIKE %s))
@@ -770,7 +770,7 @@  discard block
 block discarded – undo
770 770
             }
771 771
 
772 772
             //save in export file
773
-            $outstream = fopen($post_file . '.txt', 'a');
773
+            $outstream = fopen($post_file.'.txt', 'a');
774 774
             if ($outstream === false) {
775 775
                 echo '[{"error":"true"}]';
776 776
                 break;
@@ -808,13 +808,13 @@  discard block
 block discarded – undo
808 808
                         if (empty($arboHtml)) {
809 809
                             $arboHtml = $arboHtml_tmp;
810 810
                         } else {
811
-                            $arboHtml .= ' » ' . $arboHtml_tmp;
811
+                            $arboHtml .= ' » '.$arboHtml_tmp;
812 812
                         }
813 813
                     }
814 814
                     fputs(
815 815
                         $outstream,
816 816
                         '
817
-        <tr class="path"><td colspan="5">' . $arboHtml . '</td></tr>'
817
+        <tr class="path"><td colspan="5">' . $arboHtml.'</td></tr>'
818 818
                     );
819 819
                     $idTree = $elem['id_tree'];
820 820
                 }
@@ -823,12 +823,12 @@  discard block
 block discarded – undo
823 823
                 fputs(
824 824
                     $outstream,
825 825
                     '
826
-        <tr class="' . $lineType . '">
827
-            <td>' . addslashes($elem['label']) . '</td>
828
-            <td align="center"><span class="span_pw" id="span_' . $elem['id'] . '"><a href="#" onclick="decryptme(' . $elem['id'] . ', \'' . $encPw . '\');return false;">Decrypt </a></span><input type="hidden" id="hide_' . $elem['id'] . '" value="' . $encPw . '" /></td>
829
-            <td>' . $desc . '</td>
830
-            <td align="center">' . $login . '</td>
831
-            <td align="center">' . $url . '</td>
826
+        <tr class="' . $lineType.'">
827
+            <td>' . addslashes($elem['label']).'</td>
828
+            <td align="center"><span class="span_pw" id="span_' . $elem['id'].'"><a href="#" onclick="decryptme('.$elem['id'].', \''.$encPw.'\');return false;">Decrypt </a></span><input type="hidden" id="hide_'.$elem['id'].'" value="'.$encPw.'" /></td>
829
+            <td>' . $desc.'</td>
830
+            <td align="center">' . $login.'</td>
831
+            <td align="center">' . $url.'</td>
832 832
             </tr>'
833 833
                 );
834 834
             }
@@ -836,29 +836,29 @@  discard block
 block discarded – undo
836 836
             fclose($outstream);
837 837
 
838 838
             // send back and continue
839
-            echo '[{"loop":"true", "number":"' . $post_number . '", "cpt":"' . $post_cpt . '", "file":"' . $post_file . '", "idsList":"' . $post_idsList . '" , "file_link":"' . $post_file_link . '"}]';
839
+            echo '[{"loop":"true", "number":"'.$post_number.'", "cpt":"'.$post_cpt.'", "file":"'.$post_file.'", "idsList":"'.$post_idsList.'" , "file_link":"'.$post_file_link.'"}]';
840 840
             break;
841 841
 
842 842
             //CASE export in HTML format - Iteration loop
843 843
         case 'export_to_html_format_finalize':
844 844
             // Load includes
845
-            include $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
846
-            require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/GibberishAES/GibberishAES.php';
845
+            include $SETTINGS['cpassman_dir'].'/includes/config/include.php';
846
+            require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/GibberishAES/GibberishAES.php';
847 847
 
848 848
             // read the content of the temporary file
849
-            $handle = fopen($post_file . '.txt', 'r');
849
+            $handle = fopen($post_file.'.txt', 'r');
850 850
             if ($handle === false) {
851 851
                 echo '[{"error":"true"}]';
852 852
                 break;
853 853
             }
854
-            $contents = fread($handle, filesize($post_file . '.txt'));
854
+            $contents = fread($handle, filesize($post_file.'.txt'));
855 855
             if ($contents === false) {
856 856
                 echo '[{"error":"true"}]';
857 857
                 break;
858 858
             }
859 859
             fclose($handle);
860
-            if (is_file($post_file . '.txt')) {
861
-                unlink($post_file . '.txt');
860
+            if (is_file($post_file.'.txt')) {
861
+                unlink($post_file.'.txt');
862 862
             }
863 863
 
864 864
             // Encrypt its content
@@ -869,7 +869,7 @@  discard block
 block discarded – undo
869 869
                 if (empty($encrypted_text) === true) {
870 870
                     $encrypted_text = GibberishAES::enc(/** @scrutinizer ignore-type */ $chunk, $post_pdf_password);
871 871
                 } else {
872
-                    $encrypted_text .= '|#|#|' . GibberishAES::enc(/** @scrutinizer ignore-type */ $chunk, $post_pdf_password);
872
+                    $encrypted_text .= '|#|#|'.GibberishAES::enc(/** @scrutinizer ignore-type */ $chunk, $post_pdf_password);
873 873
                 }
874 874
             }
875 875
 
@@ -886,9 +886,9 @@  discard block
 block discarded – undo
886 886
         </table></div>
887 887
         <input type="button" value="Hide all" onclick="hideAll()" />
888 888
         <div id="footer" style="text-align:center;">
889
-            <a href="https://teampass.net/about/" target="_blank" style="">' . TP_TOOL_NAME . '&nbsp;' . TP_VERSION_FULL . '&nbsp;' . TP_COPYRIGHT . '</a>
889
+            <a href="https://teampass.net/about/" target="_blank" style="">' . TP_TOOL_NAME.'&nbsp;'.TP_VERSION_FULL.'&nbsp;'.TP_COPYRIGHT.'</a>
890 890
         </div>
891
-        <div id="enc_html" style="display:none;">' . $encrypted_text . '</div>
891
+        <div id="enc_html" style="display:none;">' . $encrypted_text.'</div>
892 892
         </body>
893 893
     </html>
894 894
     <script type="text/javascript">
@@ -994,9 +994,9 @@  discard block
 block discarded – undo
994 994
 
995 995
             fclose($outstream);
996 996
 
997
-            echo '[{"text":"<a href=\'' .
998
-                $post_file_link .
999
-                '\' target=\'_blank\'>' . $LANG['pdf_download'] . '</a>"}]';
997
+            echo '[{"text":"<a href=\''.
998
+                $post_file_link.
999
+                '\' target=\'_blank\'>'.$LANG['pdf_download'].'</a>"}]';
1000 1000
             break;
1001 1001
     }
1002 1002
 }
Please login to merge, or discard this patch.
sources/tree.php 1 patch
Spacing   +46 added lines, -51 removed lines patch added patch discarded remove patch
@@ -42,11 +42,11 @@  discard block
 block discarded – undo
42 42
 }
43 43
 
44 44
 // includes
45
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
46
-require_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
47
-require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
48
-require_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php';
49
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
45
+require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php';
46
+require_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
47
+require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
48
+require_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php';
49
+require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
50 50
 
51 51
 // header
52 52
 header('Content-type: text/html; charset=utf-8');
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 }
61 61
 
62 62
 // Connect to mysql server
63
-require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
63
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
64 64
 if (defined('DB_PASSWD_CLEAR') === false) {
65 65
     define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
66 66
 }
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 DB::$encoding = DB_ENCODING;
73 73
 
74 74
 // Superglobal load
75
-require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
75
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
76 76
 $superGlobal = new protect\SuperGlobal\SuperGlobal();
77 77
 $get = [];
78 78
 $get['user_tree_structure'] = $superGlobal->get('user_tree_structure', 'GET');
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 
94 94
 
95 95
 $lastFolderChange = DB::query(
96
-    'SELECT * FROM ' . prefixTable('misc') . '
96
+    'SELECT * FROM '.prefixTable('misc').'
97 97
     WHERE type = %s AND intitule = %s',
98 98
     'timestamp',
99 99
     'last_folder_change'
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
     || (isset($get['force_refresh']) === true && (int) $get['force_refresh'] === 1)
105 105
 ) {
106 106
     // Build tree
107
-    $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries');
107
+    $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries');
108 108
     $tree->register();
109 109
     $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title');
110 110
 
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
     $SETTINGS
213 213
 ) {
214 214
     // Load library
215
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
215
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
216 216
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
217 217
 
218 218
     // Prepare superGlobal variables
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
                 // get count of Items in this folder
267 267
                 DB::query(
268 268
                     'SELECT *
269
-                    FROM ' . prefixTable('items') . '
269
+                    FROM ' . prefixTable('items').'
270 270
                     WHERE inactif=%i AND id_tree = %i',
271 271
                     0,
272 272
                     $node->id
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
                 // get info about current folder
277 277
                 DB::query(
278 278
                     'SELECT *
279
-                    FROM ' . prefixTable('nested_tree') . '
279
+                    FROM ' . prefixTable('nested_tree').'
280 280
                     WHERE parent_id = %i',
281 281
                     $node->id
282 282
                 );
@@ -284,11 +284,10 @@  discard block
 block discarded – undo
284 284
 
285 285
                 // If personal Folder, convert id into user name
286 286
                 $node->title = $node->title === $session_user_id && (int) $node->nlevel === 1 ?
287
-                    $session_login :
288
-                    ($node->title === null ? '' : htmlspecialchars_decode($node->title, ENT_QUOTES));
287
+                    $session_login : ($node->title === null ? '' : htmlspecialchars_decode($node->title, ENT_QUOTES));
289 288
 
290 289
                 // prepare json return for current node
291
-                $parent = $node->parent_id === 0 ? '#' : 'li_' . $node->parent_id;
290
+                $parent = $node->parent_id === 0 ? '#' : 'li_'.$node->parent_id;
292 291
 
293 292
                 // special case for READ-ONLY folder
294 293
                 $title = $session_user_read_only === true && in_array($node->id, $session_personal_folders) === false ? langHdl('read_only_account') : $title;
@@ -298,33 +297,30 @@  discard block
 block discarded – undo
298 297
 
299 298
                 if (in_array($node->id, $session_groupes_visibles)) {
300 299
                     if (in_array($node->id, $session_read_only_folders)) {
301
-                        $text = "<i class='far fa-eye fa-xs mr-1'></i>" . $text;
300
+                        $text = "<i class='far fa-eye fa-xs mr-1'></i>".$text;
302 301
                         $title = langHdl('read_only_account');
303 302
                         $restricted = 1;
304 303
                         $folderClass = 'folder_not_droppable';
305 304
                     } elseif ($session_user_read_only === true && !in_array($node->id, $session_personal_visible_groups)) {
306
-                        $text = "<i class='far fa-eye fa-xs mr-1'></i>" . $text;
305
+                        $text = "<i class='far fa-eye fa-xs mr-1'></i>".$text;
307 306
                     }
308 307
                     $text .=
309
-                        ' <span class=\'badge badge-danger ml-2 items_count\' id=\'itcount_' . $node->id . '\'>' . $itemsNb . '</span>'
308
+                        ' <span class=\'badge badge-danger ml-2 items_count\' id=\'itcount_'.$node->id.'\'>'.$itemsNb.'</span>'
310 309
                         .(isset($SETTINGS['tree_counters']) && $SETTINGS['tree_counters'] === 1 ?
311
-                            '/'.$nbChildrenItems .'/'.(count($nodeDescendants) - 1)  :
312
-                            '')
310
+                            '/'.$nbChildrenItems.'/'.(count($nodeDescendants) - 1) : '')
313 311
                         .'</span>';
314 312
                 } elseif (in_array($node->id, $listFoldersLimitedKeys)) {
315 313
                     $restricted = 1;
316 314
                     $text .= 
317 315
                         $session_user_read_only === true ?
318
-                            "<i class='far fa-eye fa-xs mr-1'></i>" :
319
-                            '<span class="badge badge-danger ml-2 items_count" id="itcount_' . $node->id . '">' . count($session_list_folders_limited[$node->id]) . '</span>';
316
+                            "<i class='far fa-eye fa-xs mr-1'></i>" : '<span class="badge badge-danger ml-2 items_count" id="itcount_'.$node->id.'">'.count($session_list_folders_limited[$node->id]).'</span>';
320 317
                 } elseif (in_array($node->id, $listRestrictedFoldersForItemsKeys)) {
321 318
                     $restricted = 1;
322 319
                     if ($session_user_read_only === true) {
323
-                        $text = "<i class='far fa-eye fa-xs mr-1'></i>" . $text;
320
+                        $text = "<i class='far fa-eye fa-xs mr-1'></i>".$text;
324 321
                     }
325 322
                     $text .= $session_user_read_only === true ? 
326
-                        "<i class='far fa-eye fa-xs mr-1'></i>" :
327
-                        '<span class="badge badge-danger ml-2 items_count" id="itcount_' . $node->id . '">' . count($session_list_restricted_folders_for_items[$node->id]) . '</span>';
323
+                        "<i class='far fa-eye fa-xs mr-1'></i>" : '<span class="badge badge-danger ml-2 items_count" id="itcount_'.$node->id.'">'.count($session_list_restricted_folders_for_items[$node->id]).'</span>';
328 324
                 } else {
329 325
                     $restricted = 1;
330 326
                     $folderClass = 'folder_not_droppable';
@@ -350,18 +346,18 @@  discard block
 block discarded – undo
350 346
                     array_push(
351 347
                         $ret_json,
352 348
                         array(
353
-                            'id' => 'li_' . $node->id,
349
+                            'id' => 'li_'.$node->id,
354 350
                             'parent' => $parent,
355 351
                             'text' => $text,
356 352
                             'children' => $childrenNb === 0 ? false : true,
357 353
                             'li_attr' => array(
358 354
                                 'class' => 'jstreeopen',
359
-                                'title' => 'ID [' . $node->id . '] ' . $title,
355
+                                'title' => 'ID ['.$node->id.'] '.$title,
360 356
                             ),
361 357
                             'a_attr' => array(
362
-                                'id' => 'fld_' . $node->id,
358
+                                'id' => 'fld_'.$node->id,
363 359
                                 'class' => $folderClass,
364
-                                'onclick' => 'ListerItems(' . $node->id . ', ' . $restricted . ', 0, 1)',
360
+                                'onclick' => 'ListerItems('.$node->id.', '.$restricted.', 0, 1)',
365 361
                                 'data-title' => $node->title,
366 362
                             ),
367 363
                         )
@@ -370,13 +366,13 @@  discard block
 block discarded – undo
370 366
                     array_push(
371 367
                         $ret_json,
372 368
                         array(
373
-                            'id' => 'li_' . $node->id,
369
+                            'id' => 'li_'.$node->id,
374 370
                             'parent' =>  $parent,
375 371
                             'children' => $childrenNb === 0 ? false : true,
376
-                            'text' => '<i class="fas fa-times fa-xs text-danger mr-1"></i>' . $text,
372
+                            'text' => '<i class="fas fa-times fa-xs text-danger mr-1"></i>'.$text,
377 373
                             'li_attr' => array(
378 374
                                 'class' => '',
379
-                                'title' => 'ID [' . $node->id . '] ' . langHdl('no_access'),
375
+                                'title' => 'ID ['.$node->id.'] '.langHdl('no_access'),
380 376
                             ),
381 377
                         )
382 378
                     );
@@ -469,7 +465,7 @@  discard block
 block discarded – undo
469 465
                 ) === true
470 466
             ) {
471 467
                 DB::query(
472
-                    'SELECT * FROM ' . prefixTable('items') . '
468
+                    'SELECT * FROM '.prefixTable('items').'
473 469
                     WHERE inactif=%i AND id_tree = %i',
474 470
                     0,
475 471
                     $node
@@ -561,7 +557,7 @@  discard block
 block discarded – undo
561 557
 {
562 558
     // get info about current folder
563 559
     DB::query(
564
-        'SELECT * FROM ' . prefixTable('items') . '
560
+        'SELECT * FROM '.prefixTable('items').'
565 561
         WHERE inactif=%i AND id_tree = %i',
566 562
         0,
567 563
         $completTree[$nodeId]->id
@@ -589,7 +585,7 @@  discard block
 block discarded – undo
589 585
 
590 586
     if (in_array($completTree[$nodeId]->id, $session_groupes_visibles) === true) {
591 587
         if (in_array($completTree[$nodeId]->id, $session_read_only_folders) === true) {
592
-            $text = "<i class='far fa-eye fa-xs mr-1'></i>" . $text;
588
+            $text = "<i class='far fa-eye fa-xs mr-1'></i>".$text;
593 589
             $title = langHdl('read_only_account');
594 590
             $restricted = 1;
595 591
             $folderClass = 'folder_not_droppable';
@@ -597,26 +593,25 @@  discard block
 block discarded – undo
597 593
             $session_user_read_only === true
598 594
             && in_array($completTree[$nodeId]->id, $session_personal_visible_groups) === false
599 595
         ) {
600
-            $text = "<i class='far fa-eye fa-xs mr-1'></i>" . $text;
596
+            $text = "<i class='far fa-eye fa-xs mr-1'></i>".$text;
601 597
         }
602 598
         $text .= 
603
-            '<span class=\'badge badge-pill badge-light ml-2 items_count\' id=\'itcount_' . $completTree[$nodeId]->id . '\'>' . $itemsNb .
599
+            '<span class=\'badge badge-pill badge-light ml-2 items_count\' id=\'itcount_'.$completTree[$nodeId]->id.'\'>'.$itemsNb.
604 600
             ((isset($SETTINGS['tree_counters']) === true && (int) $SETTINGS['tree_counters'] === 1) ?
605
-                '/'.$nbChildrenItems .'/'.(count($nodeDescendants) - 1)  :
606
-                '')
601
+                '/'.$nbChildrenItems.'/'.(count($nodeDescendants) - 1) : '')
607 602
             . '</span>';
608 603
     } elseif (in_array($completTree[$nodeId]->id, $listFoldersLimitedKeys) === true) {
609 604
         $restricted = 1;
610 605
         if ($session_user_read_only === true) {
611
-            $text = "<i class='far fa-eye fa-xs mr-1'></i>" . $text;
606
+            $text = "<i class='far fa-eye fa-xs mr-1'></i>".$text;
612 607
         }
613
-        $text .= '<span class=\'badge badge-pill badge-light ml-2 items_count\' id=\'itcount_' . $completTree[$nodeId]->id . '\'>' . count($session_list_folders_limited[$completTree[$nodeId]->id]);
608
+        $text .= '<span class=\'badge badge-pill badge-light ml-2 items_count\' id=\'itcount_'.$completTree[$nodeId]->id.'\'>'.count($session_list_folders_limited[$completTree[$nodeId]->id]);
614 609
     } elseif (in_array($completTree[$nodeId]->id, $listRestrictedFoldersForItemsKeys) === true) {
615 610
         $restricted = 1;
616 611
         if ($session_user_read_only === true) {
617
-            $text = "<i class='far fa-eye fa-xs mr-1'></i>" . $text;
612
+            $text = "<i class='far fa-eye fa-xs mr-1'></i>".$text;
618 613
         }
619
-        $text .= '<span class=\'badge badge-pill badge-light ml-2 items_count\' id=\'itcount_' . $completTree[$nodeId]->id . '\'>' . count($session_list_restricted_folders_for_items[$completTree[$nodeId]->id]) . '</span>';
614
+        $text .= '<span class=\'badge badge-pill badge-light ml-2 items_count\' id=\'itcount_'.$completTree[$nodeId]->id.'\'>'.count($session_list_restricted_folders_for_items[$completTree[$nodeId]->id]).'</span>';
620 615
     } else {
621 616
         $restricted = 1;
622 617
         $folderClass = 'folder_not_droppable';
@@ -653,7 +648,7 @@  discard block
 block discarded – undo
653 648
     }
654 649
 
655 650
     // prepare json return for current node
656
-    $parent = $completTree[$nodeId]->parent_id === '0' ? '#' : 'li_' . $completTree[$nodeId]->parent_id;
651
+    $parent = $completTree[$nodeId]->parent_id === '0' ? '#' : 'li_'.$completTree[$nodeId]->parent_id;
657 652
 
658 653
     // handle displaying
659 654
     if (
@@ -673,17 +668,17 @@  discard block
 block discarded – undo
673 668
         array_push(
674 669
             $ret_json,
675 670
             array(
676
-                'id' => 'li_' . $completTree[$nodeId]->id,
671
+                'id' => 'li_'.$completTree[$nodeId]->id,
677 672
                 'parent' => $last_visible_parent === -1 ? $parent : $last_visible_parent,
678 673
                 'text' => $text,
679 674
                 'li_attr' => array(
680 675
                     'class' => 'jstreeopen',
681
-                    'title' => 'ID [' . $completTree[$nodeId]->id . '] ' . $title,
676
+                    'title' => 'ID ['.$completTree[$nodeId]->id.'] '.$title,
682 677
                 ),
683 678
                 'a_attr' => array(
684
-                    'id' => 'fld_' . $completTree[$nodeId]->id,
679
+                    'id' => 'fld_'.$completTree[$nodeId]->id,
685 680
                     'class' => $folderClass,
686
-                    'onclick' => 'ListerItems(' . $completTree[$nodeId]->id . ', ' . $restricted . ', 0, 1)',
681
+                    'onclick' => 'ListerItems('.$completTree[$nodeId]->id.', '.$restricted.', 0, 1)',
687 682
                     'data-title' => $completTree[$nodeId]->title,
688 683
                 ),
689 684
             )
@@ -692,12 +687,12 @@  discard block
 block discarded – undo
692 687
         array_push(
693 688
             $ret_json,
694 689
             array(
695
-                'id' => 'li_' . $completTree[$nodeId]->id,
690
+                'id' => 'li_'.$completTree[$nodeId]->id,
696 691
                 'parent' => $last_visible_parent === -1 ? $parent : $last_visible_parent,
697
-                'text' => '<i class="fas fa-times fa-xs text-danger mr-1"></i>' . $text,
692
+                'text' => '<i class="fas fa-times fa-xs text-danger mr-1"></i>'.$text,
698 693
                 'li_attr' => array(
699 694
                     'class' => '',
700
-                    'title' => 'ID [' . $completTree[$nodeId]->id . '] ' . langHdl('no_access'),
695
+                    'title' => 'ID ['.$completTree[$nodeId]->id.'] '.langHdl('no_access'),
701 696
                 ),
702 697
             )
703 698
         );
Please login to merge, or discard this patch.
index.php 1 patch
Spacing   +82 added lines, -82 removed lines patch added patch discarded remove patch
@@ -72,8 +72,8 @@  discard block
 block discarded – undo
72 72
 }
73 73
 
74 74
 // Include files
75
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
76
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
75
+require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
76
+require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php';
77 77
 // Quick major version check -> upgrade needed?
78 78
 if (isset($SETTINGS['cpassman_version']) === true && version_compare(TP_VERSION, $SETTINGS['cpassman_version']) > 0) {
79 79
     // Perform redirection
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
     exit;
87 87
 }
88 88
 
89
-require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
89
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
90 90
 $superGlobal = new protect\SuperGlobal\SuperGlobal();
91 91
 
92 92
 if (isset($SETTINGS['cpassman_url']) === false || $SETTINGS['cpassman_url'] === '') {
@@ -94,8 +94,8 @@  discard block
 block discarded – undo
94 94
 }
95 95
 
96 96
 // Include files
97
-require_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
98
-require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
97
+require_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
98
+require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
99 99
 // Open MYSQL database connection
100 100
 require_once './includes/libraries/Database/Meekrodb/db.class.php';
101 101
 if (defined('DB_PASSWD_CLEAR') === false) {
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 DB::$port = DB_PORT;
109 109
 DB::$encoding = DB_ENCODING;
110 110
 // Load Core library
111
-require_once $SETTINGS['cpassman_dir'] . '/sources/core.php';
111
+require_once $SETTINGS['cpassman_dir'].'/sources/core.php';
112 112
 // Prepare POST variables
113 113
 $post_language = filter_input(INPUT_POST, 'language', FILTER_SANITIZE_STRING);
114 114
 // Prepare superGlobal variables
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
     // case of user has change language in the login page
139 139
     $dataLanguage = DB::queryFirstRow(
140 140
         'SELECT flag, name
141
-        FROM ' . prefixTable('languages') . '
141
+        FROM ' . prefixTable('languages').'
142 142
         WHERE name = %s',
143 143
         $get['language']
144 144
     );
@@ -148,8 +148,8 @@  discard block
 block discarded – undo
148 148
     //get default language
149 149
     $dataLanguage = DB::queryFirstRow(
150 150
         'SELECT m.valeur AS valeur, l.flag AS flag
151
-        FROM ' . prefixTable('misc') . ' AS m
152
-        INNER JOIN ' . prefixTable('languages') . ' AS l ON (m.valeur = l.name)
151
+        FROM ' . prefixTable('misc').' AS m
152
+        INNER JOIN ' . prefixTable('languages').' AS l ON (m.valeur = l.name)
153 153
         WHERE m.type=%s_type AND m.intitule=%s_intitule',
154 154
         [
155 155
             'type' => 'admin',
@@ -191,23 +191,23 @@  discard block
 block discarded – undo
191 191
 
192 192
 // Load user languages files
193 193
 if (in_array($session_user_language, $languagesList) === true) {
194
-    if (file_exists($SETTINGS['cpassman_dir'] . '/includes/language/' . $session_user_language . '.php') === true) {
195
-        $_SESSION['teampass']['lang'] = include $SETTINGS['cpassman_dir'] . '/includes/language/' . $session_user_language . '.php';
194
+    if (file_exists($SETTINGS['cpassman_dir'].'/includes/language/'.$session_user_language.'.php') === true) {
195
+        $_SESSION['teampass']['lang'] = include $SETTINGS['cpassman_dir'].'/includes/language/'.$session_user_language.'.php';
196 196
     }
197 197
 } else {
198 198
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
199 199
     //not allowed page
200
-    include $SETTINGS['cpassman_dir'] . '/error.php';
200
+    include $SETTINGS['cpassman_dir'].'/error.php';
201 201
 }
202 202
 
203 203
 // load 2FA Google
204 204
 if (isset($SETTINGS['google_authentication']) === true && $SETTINGS['google_authentication'] === '1') {
205
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/TwoFactorAuth/TwoFactorAuth.php';
205
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/TwoFactorAuth/TwoFactorAuth.php';
206 206
 }
207 207
 
208 208
 // load 2FA Yubico
209 209
 if (isset($SETTINGS['yubico_authentication']) === true && $SETTINGS['yubico_authentication'] === '1') {
210
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/Yubico/Yubico.php';
210
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/Yubico/Yubico.php';
211 211
 }
212 212
 
213 213
 // Some template adjust
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
     <!-- Toastr -->
265 265
     <link rel="stylesheet" href="plugins/toastr/toastr.min.css" />
266 266
     <!-- favicon -->
267
-    <link rel="shortcut icon" type="image/png" href="<?php echo $SETTINGS['favicon'];?>"/>
267
+    <link rel="shortcut icon" type="image/png" href="<?php echo $SETTINGS['favicon']; ?>"/>
268 268
 </head>
269 269
 
270 270
 
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
             ),
296 296
             'SESSION'
297 297
         );
298
-        include $SETTINGS['cpassman_dir'] . '/error.php';
298
+        include $SETTINGS['cpassman_dir'].'/error.php';
299 299
     }
300 300
 } elseif (
301 301
     $session_validite_pw !== null
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
                         <div class="dropdown show">
340 340
                             <a class="btn btn-primary dropdown-toggle" href="#" data-toggle="dropdown">
341 341
                                 <?php
342
-                                    echo $session_name . '&nbsp;' . $session_lastname; ?>
342
+                                    echo $session_name.'&nbsp;'.$session_lastname; ?>
343 343
                             </a>
344 344
 
345 345
                             <div class="dropdown-menu dropdown-menu-right">
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
             <!-- Main Sidebar Container -->
378 378
             <aside class="main-sidebar sidebar-dark-primary elevation-4">
379 379
                 <!-- Brand Logo -->
380
-                <a href="<?php echo $SETTINGS['cpassman_url'] . '/index.php?page=items'; ?>" class="brand-link">
380
+                <a href="<?php echo $SETTINGS['cpassman_url'].'/index.php?page=items'; ?>" class="brand-link">
381 381
                     <img src="includes/images/teampass-logo2-home.png" alt="Teampass Logo" class="brand-image">
382 382
                     <span class="brand-text font-weight-light"><?php echo TP_TOOL_NAME; ?></span>
383 383
                 </a>
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
                         <a href="#" data-name="items" class="nav-link', $get['page'] === 'items' ? ' active' : '', '">
396 396
                         <i class="nav-icon fas fa-key"></i>
397 397
                         <p>
398
-                            ' . langHdl('pw') . '
398
+                            ' . langHdl('pw').'
399 399
                         </p>
400 400
                         </a>
401 401
                     </li>';
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
                         <a href="#" data-name="import" class="nav-link', $get['page'] === 'import' ? ' active' : '', '">
412 412
                         <i class="nav-icon fas fa-file-import"></i>
413 413
                         <p>
414
-                            ' . langHdl('import') . '
414
+                            ' . langHdl('import').'
415 415
                         </p>
416 416
                         </a>
417 417
                     </li>';
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
                         <a href="#" data-name="export" class="nav-link', $get['page'] === 'export' ? ' active' : '', '">
433 433
                         <i class="nav-icon fas fa-file-export"></i>
434 434
                         <p>
435
-                            ' . langHdl('export') . '
435
+                            ' . langHdl('export').'
436 436
                         </p>
437 437
                         </a>
438 438
                     </li>';
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
                         <a href="#" data-name="search" class="nav-link', $get['page'] === 'search' ? ' active' : '', '">
460 460
                         <i class="nav-icon fas fa-search"></i>
461 461
                         <p>
462
-                            ' . langHdl('find') . '
462
+                            ' . langHdl('find').'
463 463
                         </p>
464 464
                         </a>
465 465
                     </li>';
@@ -476,7 +476,7 @@  discard block
 block discarded – undo
476 476
                         <a href="#" data-name="favourites" class="nav-link', $get['page'] === 'admin' ? ' favourites' : '', '">
477 477
                         <i class="nav-icon fas fa-star"></i>
478 478
                         <p>
479
-                            ' . langHdl('favorites') . '
479
+                            ' . langHdl('favorites').'
480 480
                         </p>
481 481
                         </a>
482 482
                     </li>';
@@ -506,7 +506,7 @@  discard block
 block discarded – undo
506 506
                         <a href="#" data-name="suggestion" class="nav-link', $get['page'] === 'suggestion' ? ' active' : '', '">
507 507
                         <i class="nav-icon fas fa-lightbulb"></i>
508 508
                         <p>
509
-                            ' . langHdl('suggestion_menu') . '
509
+                            ' . langHdl('suggestion_menu').'
510 510
                         </p>
511 511
                         </a>
512 512
                     </li>';
@@ -519,7 +519,7 @@  discard block
 block discarded – undo
519 519
                         <a href="#" data-name="admin" class="nav-link', $get['page'] === 'admin' ? ' active' : '', '">
520 520
                         <i class="nav-icon fas fa-info"></i>
521 521
                         <p>
522
-                            ' . langHdl('admin_main') . '
522
+                            ' . langHdl('admin_main').'
523 523
                         </p>
524 524
                         </a>
525 525
                     </li>
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
                         <a href="#" class="nav-link">
528 528
                             <i class="nav-icon fas fa-wrench"></i>
529 529
                             <p>
530
-                                ' . langHdl('admin_settings') . '
530
+                                ' . langHdl('admin_settings').'
531 531
                                 <i class="fas fa-angle-left right"></i>
532 532
                             </p>
533 533
                         </a>
@@ -535,55 +535,55 @@  discard block
 block discarded – undo
535 535
                             <li class="nav-item">
536 536
                                 <a href="#" data-name="options" class="nav-link', $get['page'] === 'options' ? ' active' : '', '">
537 537
                                     <i class="fas fa-check-double nav-icon"></i>
538
-                                    <p>' . langHdl('options') . '</p>
538
+                                    <p>' . langHdl('options').'</p>
539 539
                                 </a>
540 540
                             </li>
541 541
                             <li class="nav-item">
542 542
                                 <a href="#" data-name="2fa" class="nav-link', $get['page'] === '2fa' ? ' active' : '', '">
543 543
                                     <i class="fas fa-qrcode nav-icon"></i>
544
-                                    <p>' . langHdl('mfa_short') . '</p>
544
+                                    <p>' . langHdl('mfa_short').'</p>
545 545
                                 </a>
546 546
                             </li>
547 547
                             <li class="nav-item">
548 548
                                 <a href="#" data-name="api" class="nav-link', $get['page'] === 'api' ? ' active' : '', '">
549 549
                                     <i class="fas fa-cubes nav-icon"></i>
550
-                                    <p>' . langHdl('api') . '</p>
550
+                                    <p>' . langHdl('api').'</p>
551 551
                                 </a>
552 552
                             </li>
553 553
                             <li class="nav-item">
554 554
                                 <a href="#" data-name="backups" class="nav-link', $get['page'] === 'backups' ? ' active' : '', '">
555 555
                                     <i class="fas fa-database nav-icon"></i>
556
-                                    <p>' . langHdl('backups') . '</p>
556
+                                    <p>' . langHdl('backups').'</p>
557 557
                                 </a>
558 558
                             </li>
559 559
                             <li class="nav-item">
560 560
                                 <a href="#" data-name="emails" class="nav-link', $get['page'] === 'emails' ? ' active' : '', '">
561 561
                                     <i class="fas fa-envelope nav-icon"></i>
562
-                                    <p>' . langHdl('emails') . '</p>
562
+                                    <p>' . langHdl('emails').'</p>
563 563
                                 </a>
564 564
                             </li>
565 565
                             <li class="nav-item">
566 566
                                 <a href="#" data-name="fields" class="nav-link', $get['page'] === 'fields' ? ' active' : '', '">
567 567
                                     <i class="fas fa-keyboard nav-icon"></i>
568
-                                    <p>' . langHdl('fields') . '</p>
568
+                                    <p>' . langHdl('fields').'</p>
569 569
                                 </a>
570 570
                             </li>
571 571
                             <li class="nav-item">
572 572
                                 <a href="#" data-name="ldap" class="nav-link', $get['page'] === 'ldap' ? ' active' : '', '">
573 573
                                     <i class="fas fa-id-card nav-icon"></i>
574
-                                    <p>' . langHdl('ldap') . '</p>
574
+                                    <p>' . langHdl('ldap').'</p>
575 575
                                 </a>
576 576
                             </li>
577 577
                             <li class="nav-item">
578 578
                                 <a href="#" data-name="uploads" class="nav-link', $get['page'] === 'uploads' ? ' active' : '', '">
579 579
                                     <i class="fas fa-file-upload nav-icon"></i>
580
-                                    <p>' . langHdl('uploads') . '</p>
580
+                                    <p>' . langHdl('uploads').'</p>
581 581
                                 </a>
582 582
                             </li>
583 583
                             <li class="nav-item">
584 584
                                 <a href="#" data-name="statistics" class="nav-link', $get['page'] === 'statistics' ? ' active' : '', '">
585 585
                                     <i class="fas fa-chart-bar nav-icon"></i>
586
-                                    <p>' . langHdl('statistics') . '</p>
586
+                                    <p>' . langHdl('statistics').'</p>
587 587
                                 </a>
588 588
                             </li>
589 589
                         </ul>
@@ -592,7 +592,7 @@  discard block
 block discarded – undo
592 592
                         <a href="#" data-name="actions" class="nav-link', $get['page'] === 'actions' ? ' active' : '', '">
593 593
                         <i class="nav-icon fas fa-cogs"></i>
594 594
                         <p>
595
-                            ' . langHdl('actions') . '
595
+                            ' . langHdl('actions').'
596 596
                         </p>
597 597
                         </a>
598 598
                     </li>';
@@ -608,7 +608,7 @@  discard block
 block discarded – undo
608 608
                         <a href="#" data-name="folders" class="nav-link', $get['page'] === 'folders' ? ' active' : '', '">
609 609
                         <i class="nav-icon fas fa-folder-open"></i>
610 610
                         <p>
611
-                            ' . langHdl('folders') . '
611
+                            ' . langHdl('folders').'
612 612
                         </p>
613 613
                         </a>
614 614
                     </li>
@@ -616,7 +616,7 @@  discard block
 block discarded – undo
616 616
                         <a href="#" data-name="roles" class="nav-link', $get['page'] === 'roles' ? ' active' : '', '">
617 617
                         <i class="nav-icon fas fa-graduation-cap"></i>
618 618
                         <p>
619
-                            ' . langHdl('roles') . '
619
+                            ' . langHdl('roles').'
620 620
                         </p>
621 621
                         </a>
622 622
                     </li>
@@ -624,38 +624,38 @@  discard block
 block discarded – undo
624 624
                         <a href="#" data-name="users" class="nav-link', $get['page'] === 'users' ? ' active' : '', '">
625 625
                         <i class="nav-icon fas fa-users"></i>
626 626
                         <p>
627
-                            ' . langHdl('users') . '
627
+                            ' . langHdl('users').'
628 628
                         </p>
629 629
                         </a>
630 630
                     </li>
631 631
                     <li class="nav-item has-treeview', $menuUtilities === true ? ' menu-open' : '', '">
632 632
                         <a href="#" class="nav-link">
633 633
                         <i class="nav-icon fas fa-cubes"></i>
634
-                        <p>' . langHdl('admin_views') . '<i class="fas fa-angle-left right"></i></p>
634
+                        <p>' . langHdl('admin_views').'<i class="fas fa-angle-left right"></i></p>
635 635
                         </a>
636 636
                         <ul class="nav nav-treeview">
637 637
                           <li class="nav-item">
638 638
                             <a href="#" data-name="utilities.renewal" class="nav-link', $get['page'] === 'utilities.renewal' ? ' active' : '', '">
639 639
                               <i class="far fa-calendar-alt nav-icon"></i>
640
-                              <p>' . langHdl('renewal') . '</p>
640
+                              <p>' . langHdl('renewal').'</p>
641 641
                             </a>
642 642
                           </li>
643 643
                           <li class="nav-item">
644 644
                             <a href="#" data-name="utilities.deletion" class="nav-link', $get['page'] === 'utilities.deletion' ? ' active' : '', '">
645 645
                               <i class="fas fa-trash-alt nav-icon"></i>
646
-                              <p>' . langHdl('deletion') . '</p>
646
+                              <p>' . langHdl('deletion').'</p>
647 647
                             </a>
648 648
                           </li>
649 649
                           <li class="nav-item">
650 650
                             <a href="#" data-name="utilities.logs" class="nav-link', $get['page'] === 'utilities.logs' ? ' active' : '', '">
651 651
                               <i class="fas fa-history nav-icon"></i>
652
-                              <p>' . langHdl('logs') . '</p>
652
+                              <p>' . langHdl('logs').'</p>
653 653
                             </a>
654 654
                           </li>
655 655
                           <li class="nav-item">
656 656
                             <a href="#" data-name="utilities.database" class="nav-link', $get['page'] === 'utilities.database' ? ' active' : '', '">
657 657
                               <i class="fas fa-database nav-icon"></i>
658
-                              <p>' . langHdl('database') . '</p>
658
+                              <p>' . langHdl('database').'</p>
659 659
                             </a>
660 660
                           </li>
661 661
                         </ul>
@@ -666,10 +666,10 @@  discard block
 block discarded – undo
666 666
                     <!-- /.sidebar-menu -->
667 667
                 <div class="menu-footer">
668 668
                     <div class="" id="sidebar-footer">
669
-                        <i class="fas fa-clock-o mr-2 infotip text-info pointer" title="<?php echo langHdl('server_time') . ' ' .
670
-                            date($SETTINGS['date_format'], (int) $server['request_time']) . ' - ' .
669
+                        <i class="fas fa-clock-o mr-2 infotip text-info pointer" title="<?php echo langHdl('server_time').' '.
670
+                            date($SETTINGS['date_format'], (int) $server['request_time']).' - '.
671 671
                             date($SETTINGS['time_format'], (int) $server['request_time']); ?>"></i>
672
-                        <i class="fas fa-users mr-2 infotip text-info pointer" title="<?php echo $session_nb_users_online . ' ' . langHdl('users_online'); ?>"></i>
672
+                        <i class="fas fa-users mr-2 infotip text-info pointer" title="<?php echo $session_nb_users_online.' '.langHdl('users_online'); ?>"></i>
673 673
                         <a href="<?php echo READTHEDOC_URL; ?>" target="_blank" class="text-info"><i class="fas fa-book mr-2 infotip" title="<?php echo langHdl('documentation_canal'); ?> ReadTheDocs"></i></a>
674 674
                         <a href="<?php echo REDDIT_URL; ?>" target="_blank" class="text-info"><i class="fab fa-reddit-alien mr-2 infotip" title="<?php echo langHdl('admin_help'); ?>"></i></a>
675 675
                         <i class="fas fa-bug infotip pointer text-info" title="<?php echo langHdl('bugs_page'); ?>" onclick="generateBugReport()"></i>
@@ -972,18 +972,18 @@  discard block
 block discarded – undo
972 972
                     } elseif ($get['page'] === 'items') {
973 973
                         // SHow page with Items
974 974
                         if ((int) $session_user_admin !== 1) {
975
-                            include $SETTINGS['cpassman_dir'] . '/pages/items.php';
975
+                            include $SETTINGS['cpassman_dir'].'/pages/items.php';
976 976
                         } elseif ((int) $session_user_admin === 1) {
977
-                            include $SETTINGS['cpassman_dir'] . '/pages/admin.php';
977
+                            include $SETTINGS['cpassman_dir'].'/pages/admin.php';
978 978
                         } else {
979 979
                             $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
980 980
                             //not allowed page
981
-                            include $SETTINGS['cpassman_dir'] . '/error.php';
981
+                            include $SETTINGS['cpassman_dir'].'/error.php';
982 982
                         }
983 983
                     } elseif (in_array($get['page'], array_keys($mngPages)) === true) {
984 984
                         // Define if user is allowed to see management pages
985 985
                         if ($session_user_admin === 1) {
986
-                            include $SETTINGS['cpassman_dir'] . '/pages/' . $mngPages[$get['page']];
986
+                            include $SETTINGS['cpassman_dir'].'/pages/'.$mngPages[$get['page']];
987 987
                         } elseif ($session_user_manager === 1 || $session_user_human_resources === 1) {
988 988
                             if ($get['page'] !== 'manage_main'
989 989
                                 && $get['page'] !== 'manage_settings'
@@ -992,15 +992,15 @@  discard block
 block discarded – undo
992 992
                             } else {
993 993
                                 $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
994 994
                                 //not allowed page
995
-                                include $SETTINGS['cpassman_dir'] . '/error.php';
995
+                                include $SETTINGS['cpassman_dir'].'/error.php';
996 996
                             }
997 997
                         } else {
998 998
                             $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
999 999
                             //not allowed page
1000
-                            include $SETTINGS['cpassman_dir'] . '/error.php';
1000
+                            include $SETTINGS['cpassman_dir'].'/error.php';
1001 1001
                         }
1002 1002
                     } elseif (empty($get['page']) === false) {
1003
-                        include $SETTINGS['cpassman_dir'] . '/pages/' . $get['page'] . '.php';
1003
+                        include $SETTINGS['cpassman_dir'].'/pages/'.$get['page'].'.php';
1004 1004
                     } else {
1005 1005
                         $_SESSION['error']['code'] = ERR_NOT_EXIST;
1006 1006
                         //page doesn't exist
@@ -1090,7 +1090,7 @@  discard block
 block discarded – undo
1090 1090
     $superGlobal->put('initialUrl', '', 'SESSION');
1091 1091
 
1092 1092
     // LOGIN form
1093
-    include $SETTINGS['cpassman_dir'] . '/includes/core/login.php';
1093
+    include $SETTINGS['cpassman_dir'].'/includes/core/login.php';
1094 1094
 }
1095 1095
 
1096 1096
     ?>
@@ -1280,61 +1280,61 @@  discard block
 block discarded – undo
1280 1280
     isset($_SESSION['CPM']) === true
1281 1281
     && isset($SETTINGS['cpassman_dir']) === true
1282 1282
 ) {
1283
-    include_once $SETTINGS['cpassman_dir'] . '/includes/core/load.js.php';
1283
+    include_once $SETTINGS['cpassman_dir'].'/includes/core/load.js.php';
1284 1284
     if ($menuAdmin === true) {
1285
-        include_once $SETTINGS['cpassman_dir'] . '/pages/admin.js.php';
1285
+        include_once $SETTINGS['cpassman_dir'].'/pages/admin.js.php';
1286 1286
         if ($get['page'] === '2fa') {
1287
-            include_once $SETTINGS['cpassman_dir'] . '/pages/2fa.js.php';
1287
+            include_once $SETTINGS['cpassman_dir'].'/pages/2fa.js.php';
1288 1288
         } elseif ($get['page'] === 'api') {
1289
-            include_once $SETTINGS['cpassman_dir'] . '/pages/api.js.php';
1289
+            include_once $SETTINGS['cpassman_dir'].'/pages/api.js.php';
1290 1290
         } elseif ($get['page'] === 'backups') {
1291
-            include_once $SETTINGS['cpassman_dir'] . '/pages/backups.js.php';
1291
+            include_once $SETTINGS['cpassman_dir'].'/pages/backups.js.php';
1292 1292
         } elseif ($get['page'] === 'emails') {
1293
-            include_once $SETTINGS['cpassman_dir'] . '/pages/emails.js.php';
1293
+            include_once $SETTINGS['cpassman_dir'].'/pages/emails.js.php';
1294 1294
         } elseif ($get['page'] === 'ldap') {
1295
-            include_once $SETTINGS['cpassman_dir'] . '/pages/ldap.js.php';
1295
+            include_once $SETTINGS['cpassman_dir'].'/pages/ldap.js.php';
1296 1296
         } elseif ($get['page'] === 'uploads') {
1297
-            include_once $SETTINGS['cpassman_dir'] . '/pages/uploads.js.php';
1297
+            include_once $SETTINGS['cpassman_dir'].'/pages/uploads.js.php';
1298 1298
         } elseif ($get['page'] === 'actions') {
1299
-            include_once $SETTINGS['cpassman_dir'] . '/pages/actions.js.php';
1299
+            include_once $SETTINGS['cpassman_dir'].'/pages/actions.js.php';
1300 1300
         } elseif ($get['page'] === 'fields') {
1301
-            include_once $SETTINGS['cpassman_dir'] . '/pages/fields.js.php';
1301
+            include_once $SETTINGS['cpassman_dir'].'/pages/fields.js.php';
1302 1302
         } elseif ($get['page'] === 'options') {
1303
-            include_once $SETTINGS['cpassman_dir'] . '/pages/options.js.php';
1303
+            include_once $SETTINGS['cpassman_dir'].'/pages/options.js.php';
1304 1304
         } elseif ($get['page'] === 'statistics') {
1305
-            include_once $SETTINGS['cpassman_dir'] . '/pages/statistics.js.php';
1305
+            include_once $SETTINGS['cpassman_dir'].'/pages/statistics.js.php';
1306 1306
         }
1307 1307
     } elseif (isset($get['page']) === true && $get['page'] !== '') {
1308 1308
         if ($get['page'] === 'items') {
1309
-            include_once $SETTINGS['cpassman_dir'] . '/pages/items.js.php';
1309
+            include_once $SETTINGS['cpassman_dir'].'/pages/items.js.php';
1310 1310
         } elseif ($get['page'] === 'import') {
1311
-            include_once $SETTINGS['cpassman_dir'] . '/pages/import.js.php';
1311
+            include_once $SETTINGS['cpassman_dir'].'/pages/import.js.php';
1312 1312
         } elseif ($get['page'] === 'export') {
1313
-            include_once $SETTINGS['cpassman_dir'] . '/pages/export.js.php';
1313
+            include_once $SETTINGS['cpassman_dir'].'/pages/export.js.php';
1314 1314
         } elseif ($get['page'] === 'offline') {
1315
-            include_once $SETTINGS['cpassman_dir'] . '/pages/offline.js.php';
1315
+            include_once $SETTINGS['cpassman_dir'].'/pages/offline.js.php';
1316 1316
         } elseif ($get['page'] === 'search') {
1317
-            include_once $SETTINGS['cpassman_dir'] . '/pages/search.js.php';
1317
+            include_once $SETTINGS['cpassman_dir'].'/pages/search.js.php';
1318 1318
         } elseif ($get['page'] === 'profile') {
1319
-            include_once $SETTINGS['cpassman_dir'] . '/pages/profile.js.php';
1319
+            include_once $SETTINGS['cpassman_dir'].'/pages/profile.js.php';
1320 1320
         } elseif ($get['page'] === 'favourites') {
1321
-            include_once $SETTINGS['cpassman_dir'] . '/pages/favorites.js.php';
1321
+            include_once $SETTINGS['cpassman_dir'].'/pages/favorites.js.php';
1322 1322
         } elseif ($get['page'] === 'folders') {
1323
-            include_once $SETTINGS['cpassman_dir'] . '/pages/folders.js.php';
1323
+            include_once $SETTINGS['cpassman_dir'].'/pages/folders.js.php';
1324 1324
         } elseif ($get['page'] === 'users') {
1325
-            include_once $SETTINGS['cpassman_dir'] . '/pages/users.js.php';
1325
+            include_once $SETTINGS['cpassman_dir'].'/pages/users.js.php';
1326 1326
         } elseif ($get['page'] === 'roles') {
1327
-            include_once $SETTINGS['cpassman_dir'] . '/pages/roles.js.php';
1327
+            include_once $SETTINGS['cpassman_dir'].'/pages/roles.js.php';
1328 1328
         } elseif ($get['page'] === 'utilities.deletion') {
1329
-            include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.deletion.js.php';
1329
+            include_once $SETTINGS['cpassman_dir'].'/pages/utilities.deletion.js.php';
1330 1330
         } elseif ($get['page'] === 'utilities.logs') {
1331
-            include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.logs.js.php';
1331
+            include_once $SETTINGS['cpassman_dir'].'/pages/utilities.logs.js.php';
1332 1332
         } elseif ($get['page'] === 'utilities.database') {
1333
-            include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.database.js.php';
1333
+            include_once $SETTINGS['cpassman_dir'].'/pages/utilities.database.js.php';
1334 1334
         } elseif ($get['page'] === 'utilities.renewal') {
1335
-            include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.renewal.js.php';
1335
+            include_once $SETTINGS['cpassman_dir'].'/pages/utilities.renewal.js.php';
1336 1336
         }
1337 1337
     } else {
1338
-        include_once $SETTINGS['cpassman_dir'] . '/includes/core/login.js.php';
1338
+        include_once $SETTINGS['cpassman_dir'].'/includes/core/login.js.php';
1339 1339
     }
1340 1340
 }
Please login to merge, or discard this patch.