Passed
Push — teampass_3.0 ( ba9006...b28540 )
by Nils
10:11
created
pages/roles.js.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,11 +43,11 @@
 block discarded – undo
43 43
 }
44 44
 
45 45
 /* do checks */
46
-require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php';
46
+require_once $SETTINGS['cpassman_dir'].'/sources/checks.php';
47 47
 if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'profile', $SETTINGS) === false) {
48 48
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
49 49
     //not allowed page
50
-    include $SETTINGS['cpassman_dir'] . '/error.php';
50
+    include $SETTINGS['cpassman_dir'].'/error.php';
51 51
     exit;
52 52
 }
53 53
 ?>
Please login to merge, or discard this patch.
pages/import.js.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,11 +43,11 @@
 block discarded – undo
43 43
 }
44 44
 
45 45
 /* do checks */
46
-require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php';
46
+require_once $SETTINGS['cpassman_dir'].'/sources/checks.php';
47 47
 if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'profile', $SETTINGS) === false) {
48 48
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
49 49
     //not allowed page
50
-    include $SETTINGS['cpassman_dir'] . '/error.php';
50
+    include $SETTINGS['cpassman_dir'].'/error.php';
51 51
     exit;
52 52
 }
53 53
 ?>
Please login to merge, or discard this patch.
pages/options.js.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,11 +43,11 @@
 block discarded – undo
43 43
 }
44 44
 
45 45
 /* do checks */
46
-require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php';
46
+require_once $SETTINGS['cpassman_dir'].'/sources/checks.php';
47 47
 if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'profile', $SETTINGS) === false) {
48 48
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
49 49
     //not allowed page
50
-    include $SETTINGS['cpassman_dir'] . '/error.php';
50
+    include $SETTINGS['cpassman_dir'].'/error.php';
51 51
     exit;
52 52
 }
53 53
 ?>
Please login to merge, or discard this patch.
pages/offline.js.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,11 +43,11 @@
 block discarded – undo
43 43
 }
44 44
 
45 45
 /* do checks */
46
-require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php';
46
+require_once $SETTINGS['cpassman_dir'].'/sources/checks.php';
47 47
 if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'profile', $SETTINGS) === false) {
48 48
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
49 49
     //not allowed page
50
-    include $SETTINGS['cpassman_dir'] . '/error.php';
50
+    include $SETTINGS['cpassman_dir'].'/error.php';
51 51
     exit;
52 52
 }
53 53
 ?>
Please login to merge, or discard this patch.
pages/export.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,16 +43,16 @@
 block discarded – undo
43 43
 }
44 44
 
45 45
 /* do checks */
46
-require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php';
46
+require_once $SETTINGS['cpassman_dir'].'/sources/checks.php';
47 47
 if (checkUser($_SESSION['user_id'], $_SESSION['key'], curPage($SETTINGS), $SETTINGS) === false) {
48 48
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
49 49
     //not allowed page
50
-    include $SETTINGS['cpassman_dir'] . '/error.php';
50
+    include $SETTINGS['cpassman_dir'].'/error.php';
51 51
     exit;
52 52
 }
53 53
 
54 54
 // Load
55
-require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
55
+require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
56 56
 
57 57
 ?>
58 58
 
Please login to merge, or discard this patch.
sources/main.functions.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2226,7 +2226,7 @@
 block discarded – undo
2226 2226
  * <tt>exec("find ".$path." -type d -exec chmod 755 {} \;");</tt>
2227 2227
  *
2228 2228
  * @author Jeppe Toustrup (tenzer at tenzer dot dk)
2229
-  *
2229
+ *
2230 2230
  * @param string $path      An either relative or absolute path to a file or directory which should be processed.
2231 2231
  * @param int    $filePerm The permissions any found files should get.
2232 2232
  * @param int    $dirPerm  The permissions any found folder should get.
Please login to merge, or discard this 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,10 +582,10 @@  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 587
             (count($allowedFolders) > 0 ? ' AND id_tree NOT IN ('.implode(',', $allowedFolders).')' : ''),
588
-        $globalsUserId . ';',
588
+        $globalsUserId.';',
589 589
         '0'
590 590
     );
591 591
     foreach ($rows as $record) {
@@ -599,8 +599,8 @@  discard block
 block discarded – undo
599 599
     // Check for the users roles if some specific rights exist on items
600 600
     $rows = DB::query(
601 601
         'SELECT i.id_tree, r.item_id
602
-        FROM ' . prefixTable('items') . ' as i
603
-        INNER JOIN ' . prefixTable('restriction_to_roles') . ' as r ON (r.item_id=i.id)
602
+        FROM ' . prefixTable('items').' as i
603
+        INNER JOIN ' . prefixTable('restriction_to_roles').' as r ON (r.item_id=i.id)
604 604
         WHERE r.role_id IN %li AND i.id_tree <> ""
605 605
         ORDER BY i.id_tree ASC',
606 606
         $userRoles
@@ -621,7 +621,7 @@  discard block
 block discarded – undo
621 621
     ) {
622 622
         $persoFld = DB::queryfirstrow(
623 623
             'SELECT id
624
-            FROM ' . prefixTable('nested_tree') . '
624
+            FROM ' . prefixTable('nested_tree').'
625 625
             WHERE title = %s AND personal_folder = %i'.
626 626
             (count($allowedFolders) > 0 ? ' AND id NOT IN ('.implode(',', $allowedFolders).')' : ''),
627 627
             $globalsUserId,
@@ -655,7 +655,7 @@  discard block
 block discarded – undo
655 655
     }
656 656
     $persoFlds = DB::query(
657 657
         'SELECT id
658
-        FROM ' . prefixTable('nested_tree') . '
658
+        FROM ' . prefixTable('nested_tree').'
659 659
         WHERE %l',
660 660
         $where
661 661
     );
@@ -697,16 +697,16 @@  discard block
 block discarded – undo
697 697
         'SESSION'
698 698
     );
699 699
     // Folders and Roles numbers
700
-    DB::queryfirstrow('SELECT id FROM ' . prefixTable('nested_tree') . '');
700
+    DB::queryfirstrow('SELECT id FROM '.prefixTable('nested_tree').'');
701 701
     $superGlobal->put('nb_folders', DB::count(), 'SESSION');
702
-    DB::queryfirstrow('SELECT id FROM ' . prefixTable('roles_title'));
702
+    DB::queryfirstrow('SELECT id FROM '.prefixTable('roles_title'));
703 703
     $superGlobal->put('nb_roles', DB::count(), 'SESSION');
704 704
     // check if change proposals on User's items
705 705
     if (isset($SETTINGS['enable_suggestion']) === true && (int) $SETTINGS['enable_suggestion'] === 1) {
706 706
         DB::query(
707 707
             'SELECT *
708
-            FROM ' . prefixTable('items_change') . ' AS c
709
-            LEFT JOIN ' . prefixTable('log_items') . ' AS i ON (c.item_id = i.id_item)
708
+            FROM ' . prefixTable('items_change').' AS c
709
+            LEFT JOIN ' . prefixTable('log_items').' AS i ON (c.item_id = i.id_item)
710 710
             WHERE i.action = %s AND i.id_user = %i',
711 711
             'at_creation',
712 712
             $globalsUserId
@@ -750,9 +750,9 @@  discard block
 block discarded – undo
750 750
  */
751 751
 function cacheTableRefresh(array $SETTINGS): void
752 752
 {
753
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
753
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
754 754
     //Connect to DB
755
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
755
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
756 756
     if (defined('DB_PASSWD_CLEAR') === false) {
757 757
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
758 758
     }
@@ -767,12 +767,12 @@  discard block
 block discarded – undo
767 767
     $tree->register();
768 768
     $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title');
769 769
     // truncate table
770
-    DB::query('TRUNCATE TABLE ' . prefixTable('cache'));
770
+    DB::query('TRUNCATE TABLE '.prefixTable('cache'));
771 771
     // reload date
772 772
     $rows = DB::query(
773 773
         'SELECT *
774
-        FROM ' . prefixTable('items') . ' as i
775
-        INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id)
774
+        FROM ' . prefixTable('items').' as i
775
+        INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id)
776 776
         AND l.action = %s
777 777
         AND i.inactif = %i',
778 778
         'at_creation',
@@ -784,18 +784,18 @@  discard block
 block discarded – undo
784 784
             $tags = '';
785 785
             $itemTags = DB::query(
786 786
                 'SELECT tag
787
-                            FROM ' . prefixTable('tags') . '
787
+                            FROM ' . prefixTable('tags').'
788 788
                             WHERE item_id = %i AND tag != ""',
789 789
                 $record['id']
790 790
             );
791 791
             foreach ($itemTags as $itemTag) {
792
-                $tags .= $itemTag['tag'] . ' ';
792
+                $tags .= $itemTag['tag'].' ';
793 793
             }
794 794
 
795 795
             // Get renewal period
796 796
             $resNT = DB::queryfirstrow(
797 797
                 'SELECT renewal_period
798
-                FROM ' . prefixTable('nested_tree') . '
798
+                FROM ' . prefixTable('nested_tree').'
799 799
                 WHERE id = %i',
800 800
                 $record['id_tree']
801 801
             );
@@ -808,7 +808,7 @@  discard block
 block discarded – undo
808 808
                     // Is this a User id?
809 809
                     $user = DB::queryfirstrow(
810 810
                         'SELECT id, login
811
-                        FROM ' . prefixTable('users') . '
811
+                        FROM ' . prefixTable('users').'
812 812
                         WHERE id = %i',
813 813
                         $elem->title
814 814
                     );
@@ -826,11 +826,11 @@  discard block
 block discarded – undo
826 826
                     'id' => $record['id'],
827 827
                     'label' => $record['label'],
828 828
                     'description' => $record['description'] ?? '',
829
-                    'url' => isset($record['url']) && ! empty($record['url']) ? $record['url'] : '0',
829
+                    'url' => isset($record['url']) && !empty($record['url']) ? $record['url'] : '0',
830 830
                     'tags' => $tags,
831 831
                     'id_tree' => $record['id_tree'],
832 832
                     'perso' => $record['perso'],
833
-                    'restricted_to' => isset($record['restricted_to']) && ! empty($record['restricted_to']) ? $record['restricted_to'] : '0',
833
+                    'restricted_to' => isset($record['restricted_to']) && !empty($record['restricted_to']) ? $record['restricted_to'] : '0',
834 834
                     'login' => $record['login'] ?? '',
835 835
                     'folder' => implode(' > ', $folder),
836 836
                     'author' => $record['id_user'],
@@ -850,12 +850,12 @@  discard block
 block discarded – undo
850 850
  */
851 851
 function cacheTableUpdate(array $SETTINGS, ?int $ident = null): void
852 852
 {
853
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
853
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
854 854
     // Load superglobal
855
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
855
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
856 856
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
857 857
     //Connect to DB
858
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
858
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
859 859
     if (defined('DB_PASSWD_CLEAR') === false) {
860 860
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
861 861
     }
@@ -872,7 +872,7 @@  discard block
 block discarded – undo
872 872
     // get new value from db
873 873
     $data = DB::queryfirstrow(
874 874
         'SELECT label, description, id_tree, perso, restricted_to, login, url
875
-        FROM ' . prefixTable('items') . '
875
+        FROM ' . prefixTable('items').'
876 876
         WHERE id=%i',
877 877
         $ident
878 878
     );
@@ -880,12 +880,12 @@  discard block
 block discarded – undo
880 880
     $tags = '';
881 881
     $itemTags = DB::query(
882 882
         'SELECT tag
883
-            FROM ' . prefixTable('tags') . '
883
+            FROM ' . prefixTable('tags').'
884 884
             WHERE item_id = %i AND tag != ""',
885 885
         $ident
886 886
     );
887 887
     foreach ($itemTags as $itemTag) {
888
-        $tags .= $itemTag['tag'] . ' ';
888
+        $tags .= $itemTag['tag'].' ';
889 889
     }
890 890
     // form id_tree to full foldername
891 891
     $folder = [];
@@ -896,7 +896,7 @@  discard block
 block discarded – undo
896 896
             // Is this a User id?
897 897
             $user = DB::queryfirstrow(
898 898
                 'SELECT id, login
899
-                FROM ' . prefixTable('users') . '
899
+                FROM ' . prefixTable('users').'
900 900
                 WHERE id = %i',
901 901
                 $elem->title
902 902
             );
@@ -914,10 +914,10 @@  discard block
 block discarded – undo
914 914
             'label' => $data['label'],
915 915
             'description' => $data['description'],
916 916
             'tags' => $tags,
917
-            'url' => isset($data['url']) && ! empty($data['url']) ? $data['url'] : '0',
917
+            'url' => isset($data['url']) && !empty($data['url']) ? $data['url'] : '0',
918 918
             'id_tree' => $data['id_tree'],
919 919
             'perso' => $data['perso'],
920
-            'restricted_to' => isset($data['restricted_to']) && ! empty($data['restricted_to']) ? $data['restricted_to'] : '0',
920
+            'restricted_to' => isset($data['restricted_to']) && !empty($data['restricted_to']) ? $data['restricted_to'] : '0',
921 921
             'login' => $data['login'] ?? '',
922 922
             'folder' => implode(' » ', $folder),
923 923
             'author' => $superGlobal->get('user_id', 'SESSION'),
@@ -935,14 +935,14 @@  discard block
 block discarded – undo
935 935
  */
936 936
 function cacheTableAdd(array $SETTINGS, ?int $ident = null): void
937 937
 {
938
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
938
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
939 939
     // Load superglobal
940
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
940
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
941 941
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
942 942
     // Get superglobals
943 943
     $globalsUserId = $superGlobal->get('user_id', 'SESSION');
944 944
     //Connect to DB
945
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
945
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
946 946
     if (defined('DB_PASSWD_CLEAR') === false) {
947 947
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
948 948
     }
@@ -959,8 +959,8 @@  discard block
 block discarded – undo
959 959
     // get new value from db
960 960
     $data = DB::queryFirstRow(
961 961
         'SELECT i.label, i.description, i.id_tree as id_tree, i.perso, i.restricted_to, i.id, i.login, i.url, l.date
962
-        FROM ' . prefixTable('items') . ' as i
963
-        INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id)
962
+        FROM ' . prefixTable('items').' as i
963
+        INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id)
964 964
         WHERE i.id = %i
965 965
         AND l.action = %s',
966 966
         $ident,
@@ -970,12 +970,12 @@  discard block
 block discarded – undo
970 970
     $tags = '';
971 971
     $itemTags = DB::query(
972 972
         'SELECT tag
973
-            FROM ' . prefixTable('tags') . '
973
+            FROM ' . prefixTable('tags').'
974 974
             WHERE item_id = %i AND tag != ""',
975 975
         $ident
976 976
     );
977 977
     foreach ($itemTags as $itemTag) {
978
-        $tags .= $itemTag['tag'] . ' ';
978
+        $tags .= $itemTag['tag'].' ';
979 979
     }
980 980
     // form id_tree to full foldername
981 981
     $folder = [];
@@ -986,7 +986,7 @@  discard block
 block discarded – undo
986 986
             // Is this a User id?
987 987
             $user = DB::queryfirstrow(
988 988
                 'SELECT id, login
989
-                FROM ' . prefixTable('users') . '
989
+                FROM ' . prefixTable('users').'
990 990
                 WHERE id = %i',
991 991
                 $elem->title
992 992
             );
@@ -1005,7 +1005,7 @@  discard block
 block discarded – undo
1005 1005
             'label' => $data['label'],
1006 1006
             'description' => $data['description'],
1007 1007
             'tags' => isset($tags) && empty($tags) === false ? $tags : 'None',
1008
-            'url' => isset($data['url']) && ! empty($data['url']) ? $data['url'] : '0',
1008
+            'url' => isset($data['url']) && !empty($data['url']) ? $data['url'] : '0',
1009 1009
             'id_tree' => $data['id_tree'],
1010 1010
             'perso' => isset($data['perso']) && empty($data['perso']) === false && $data['perso'] !== 'None' ? $data['perso'] : '0',
1011 1011
             'restricted_to' => isset($data['restricted_to']) && empty($data['restricted_to']) === false ? $data['restricted_to'] : '0',
@@ -1027,52 +1027,52 @@  discard block
 block discarded – undo
1027 1027
 function getStatisticsData(array $SETTINGS): array
1028 1028
 {
1029 1029
     DB::query(
1030
-        'SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE personal_folder = %i',
1030
+        'SELECT id FROM '.prefixTable('nested_tree').' WHERE personal_folder = %i',
1031 1031
         0
1032 1032
     );
1033 1033
     $counter_folders = DB::count();
1034 1034
     DB::query(
1035
-        'SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE personal_folder = %i',
1035
+        'SELECT id FROM '.prefixTable('nested_tree').' WHERE personal_folder = %i',
1036 1036
         1
1037 1037
     );
1038 1038
     $counter_folders_perso = DB::count();
1039 1039
     DB::query(
1040
-        'SELECT id FROM ' . prefixTable('items') . ' WHERE perso = %i',
1040
+        'SELECT id FROM '.prefixTable('items').' WHERE perso = %i',
1041 1041
         0
1042 1042
     );
1043 1043
     $counter_items = DB::count();
1044 1044
         DB::query(
1045
-        'SELECT id FROM ' . prefixTable('items') . ' WHERE perso = %i',
1045
+        'SELECT id FROM '.prefixTable('items').' WHERE perso = %i',
1046 1046
         1
1047 1047
     );
1048 1048
     $counter_items_perso = DB::count();
1049 1049
         DB::query(
1050
-        'SELECT id FROM ' . prefixTable('users') . ''
1050
+        'SELECT id FROM '.prefixTable('users').''
1051 1051
     );
1052 1052
     $counter_users = DB::count();
1053 1053
         DB::query(
1054
-        'SELECT id FROM ' . prefixTable('users') . ' WHERE admin = %i',
1054
+        'SELECT id FROM '.prefixTable('users').' WHERE admin = %i',
1055 1055
         1
1056 1056
     );
1057 1057
     $admins = DB::count();
1058 1058
     DB::query(
1059
-        'SELECT id FROM ' . prefixTable('users') . ' WHERE gestionnaire = %i',
1059
+        'SELECT id FROM '.prefixTable('users').' WHERE gestionnaire = %i',
1060 1060
         1
1061 1061
     );
1062 1062
     $managers = DB::count();
1063 1063
     DB::query(
1064
-        'SELECT id FROM ' . prefixTable('users') . ' WHERE read_only = %i',
1064
+        'SELECT id FROM '.prefixTable('users').' WHERE read_only = %i',
1065 1065
         1
1066 1066
     );
1067 1067
     $readOnly = DB::count();
1068 1068
     // list the languages
1069 1069
     $usedLang = [];
1070 1070
     $tp_languages = DB::query(
1071
-        'SELECT name FROM ' . prefixTable('languages')
1071
+        'SELECT name FROM '.prefixTable('languages')
1072 1072
     );
1073 1073
     foreach ($tp_languages as $tp_language) {
1074 1074
         DB::query(
1075
-            'SELECT * FROM ' . prefixTable('users') . ' WHERE user_language = %s',
1075
+            'SELECT * FROM '.prefixTable('users').' WHERE user_language = %s',
1076 1076
             $tp_language['name']
1077 1077
         );
1078 1078
         $usedLang[$tp_language['name']] = round((DB::count() * 100 / $counter_users), 0);
@@ -1081,12 +1081,12 @@  discard block
 block discarded – undo
1081 1081
     // get list of ips
1082 1082
     $usedIp = [];
1083 1083
     $tp_ips = DB::query(
1084
-        'SELECT user_ip FROM ' . prefixTable('users')
1084
+        'SELECT user_ip FROM '.prefixTable('users')
1085 1085
     );
1086 1086
     foreach ($tp_ips as $ip) {
1087 1087
         if (array_key_exists($ip['user_ip'], $usedIp)) {
1088 1088
             $usedIp[$ip['user_ip']] += $usedIp[$ip['user_ip']];
1089
-        } elseif (! empty($ip['user_ip']) && $ip['user_ip'] !== 'none') {
1089
+        } elseif (!empty($ip['user_ip']) && $ip['user_ip'] !== 'none') {
1090 1090
             $usedIp[$ip['user_ip']] = 1;
1091 1091
         }
1092 1092
     }
@@ -1152,21 +1152,21 @@  discard block
 block discarded – undo
1152 1152
     }
1153 1153
 
1154 1154
     // Load settings
1155
-    include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
1155
+    include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
1156 1156
     // Load superglobal
1157
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1157
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1158 1158
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
1159 1159
     // Get user language
1160
-    include_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $superGlobal->get('user_language', 'SESSION') . '.php';
1160
+    include_once $SETTINGS['cpassman_dir'].'/includes/language/'.$superGlobal->get('user_language', 'SESSION').'.php';
1161 1161
     // Load library
1162
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
1162
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
1163 1163
     // load PHPMailer
1164 1164
     $mail = new SplClassLoader('PHPMailer\PHPMailer', '../includes/libraries');
1165 1165
     $mail->register();
1166 1166
     $mail = new PHPMailer\PHPMailer\PHPMailer(true);
1167 1167
     try {
1168 1168
         // send to user
1169
-        $mail->setLanguage('en', $SETTINGS['cpassman_dir'] . '/includes/libraries/PHPMailer/PHPMailer/language/');
1169
+        $mail->setLanguage('en', $SETTINGS['cpassman_dir'].'/includes/libraries/PHPMailer/PHPMailer/language/');
1170 1170
         $mail->SMTPDebug = 0;
1171 1171
         //value 1 can be used to debug - 4 for debuging connections
1172 1172
         $mail->Port = $SETTINGS['email_port'];
@@ -1258,7 +1258,7 @@  discard block
 block discarded – undo
1258 1258
         <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;">
1259 1259
         <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;">
1260 1260
         <br><div style="float:right;">' .
1261
-        $textMail .
1261
+        $textMail.
1262 1262
         '<br><br></td></tr></table>
1263 1263
     </td></tr></table>
1264 1264
     <br></body></html>';
@@ -1269,7 +1269,7 @@  discard block
 block discarded – undo
1269 1269
  */
1270 1270
 function generateKey(): string
1271 1271
 {
1272
-    return substr(md5(rand() . rand()), 0, 15);
1272
+    return substr(md5(rand().rand()), 0, 15);
1273 1273
 }
1274 1274
 
1275 1275
 /**
@@ -1340,7 +1340,7 @@  discard block
 block discarded – undo
1340 1340
 {
1341 1341
     array_walk_recursive(
1342 1342
         $array,
1343
-        static function (&$item): void {
1343
+        static function(&$item): void {
1344 1344
             if (mb_detect_encoding((string) $item, 'utf-8', true) === false) {
1345 1345
                 $item = utf8_encode($item);
1346 1346
             }
@@ -1375,7 +1375,7 @@  discard block
 block discarded – undo
1375 1375
     }
1376 1376
 
1377 1377
     // Load superglobal
1378
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1378
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1379 1379
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
1380 1380
     // Get superglobals
1381 1381
     if ($key !== null) {
@@ -1386,9 +1386,9 @@  discard block
 block discarded – undo
1386 1386
     }
1387 1387
 
1388 1388
     //load ClassLoader
1389
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
1389
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
1390 1390
     //Load AES
1391
-    $aes = new SplClassLoader('Encryption\Crypt', $SETTINGS['cpassman_dir'] . '/includes/libraries');
1391
+    $aes = new SplClassLoader('Encryption\Crypt', $SETTINGS['cpassman_dir'].'/includes/libraries');
1392 1392
     $aes->register();
1393 1393
     if ($type === 'encode' && is_array($data) === true) {
1394 1394
         // Ensure UTF8 format
@@ -1475,8 +1475,8 @@  discard block
 block discarded – undo
1475 1475
  */
1476 1476
 function prefixTable(string $table): string
1477 1477
 {
1478
-    $safeTable = htmlspecialchars(DB_PREFIX . $table);
1479
-    if (! empty($safeTable)) {
1478
+    $safeTable = htmlspecialchars(DB_PREFIX.$table);
1479
+    if (!empty($safeTable)) {
1480 1480
         // sanitize string
1481 1481
         return $safeTable;
1482 1482
     }
@@ -1504,13 +1504,13 @@  discard block
 block discarded – undo
1504 1504
     bool $lowercase = false,
1505 1505
     array $SETTINGS = []
1506 1506
 ): string {
1507
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
1508
-    $generator = new SplClassLoader('PasswordGenerator\Generator', $SETTINGS['cpassman_dir'] . '/includes/libraries');
1507
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
1508
+    $generator = new SplClassLoader('PasswordGenerator\Generator', $SETTINGS['cpassman_dir'].'/includes/libraries');
1509 1509
     $generator->register();
1510 1510
     $generator = new PasswordGenerator\Generator\ComputerPasswordGenerator();
1511 1511
     // Is PHP7 being used?
1512 1512
     if (version_compare(PHP_VERSION, '7.0.0', '>=')) {
1513
-        $php7generator = new SplClassLoader('PasswordGenerator\RandomGenerator', $SETTINGS['cpassman_dir'] . '/includes/libraries');
1513
+        $php7generator = new SplClassLoader('PasswordGenerator\RandomGenerator', $SETTINGS['cpassman_dir'].'/includes/libraries');
1514 1514
         $php7generator->register();
1515 1515
         $generator->setRandomGenerator(new PasswordGenerator\RandomGenerator\Php7RandomGenerator());
1516 1516
     }
@@ -1540,7 +1540,7 @@  discard block
 block discarded – undo
1540 1540
 function send_syslog($message, $host, $port, $component = 'teampass'): void
1541 1541
 {
1542 1542
     $sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
1543
-    $syslog_message = '<123>' . date('M d H:i:s ') . $component . ': ' . $message;
1543
+    $syslog_message = '<123>'.date('M d H:i:s ').$component.': '.$message;
1544 1544
     socket_sendto($sock, $syslog_message, strlen($syslog_message), 0, $host, $port);
1545 1545
     socket_close($sock);
1546 1546
 }
@@ -1562,7 +1562,7 @@  discard block
 block discarded – undo
1562 1562
     }
1563 1563
 
1564 1564
     // include librairies & connect to DB
1565
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
1565
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
1566 1566
     if (defined('DB_PASSWD_CLEAR') === false) {
1567 1567
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
1568 1568
     }
@@ -1586,14 +1586,14 @@  discard block
 block discarded – undo
1586 1586
     if (isset($SETTINGS['syslog_enable']) === true && (int) $SETTINGS['syslog_enable'] === 1) {
1587 1587
         if ($type === 'user_mngt') {
1588 1588
             send_syslog(
1589
-                'action=' . str_replace('at_', '', $label) . ' attribute=user user=' . $who . ' userid="' . $login . '" change="' . $field_1 . '" ',
1589
+                'action='.str_replace('at_', '', $label).' attribute=user user='.$who.' userid="'.$login.'" change="'.$field_1.'" ',
1590 1590
                 $SETTINGS['syslog_host'],
1591 1591
                 $SETTINGS['syslog_port'],
1592 1592
                 'teampass'
1593 1593
             );
1594 1594
         } else {
1595 1595
             send_syslog(
1596
-                'action=' . $type . ' attribute=' . $label . ' user=' . $who . ' userid="' . $login . '" ',
1596
+                'action='.$type.' attribute='.$label.' user='.$who.' userid="'.$login.'" ',
1597 1597
                 $SETTINGS['syslog_host'],
1598 1598
                 $SETTINGS['syslog_port'],
1599 1599
                 'teampass'
@@ -1625,7 +1625,7 @@  discard block
 block discarded – undo
1625 1625
     ?string $encryption_type = null
1626 1626
 ): void {
1627 1627
     // include librairies & connect to DB
1628
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
1628
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
1629 1629
     if (defined('DB_PASSWD_CLEAR') === false) {
1630 1630
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
1631 1631
     }
@@ -1669,7 +1669,7 @@  discard block
 block discarded – undo
1669 1669
         if (empty($item_label) === true) {
1670 1670
             $dataItem = DB::queryfirstrow(
1671 1671
                 'SELECT id, id_tree, label
1672
-                FROM ' . prefixTable('items') . '
1672
+                FROM ' . prefixTable('items').'
1673 1673
                 WHERE id = %i',
1674 1674
                 $item_id
1675 1675
             );
@@ -1677,11 +1677,11 @@  discard block
 block discarded – undo
1677 1677
         }
1678 1678
 
1679 1679
         send_syslog(
1680
-            'action=' . str_replace('at_', '', $action) .
1681
-                ' attribute=' . str_replace('at_', '', $attribute[0]) .
1682
-                ' itemno=' . $item_id .
1683
-                ' user=' . is_null($login) === true ? '' : addslashes((string) $login) .
1684
-                ' itemname="' . addslashes($item_label) . '"',
1680
+            'action='.str_replace('at_', '', $action).
1681
+                ' attribute='.str_replace('at_', '', $attribute[0]).
1682
+                ' itemno='.$item_id.
1683
+                ' user='.is_null($login) === true ? '' : addslashes((string) $login).
1684
+                ' itemname="'.addslashes($item_label).'"',
1685 1685
             $SETTINGS['syslog_host'],
1686 1686
             $SETTINGS['syslog_port'],
1687 1687
             'teampass'
@@ -1707,7 +1707,7 @@  discard block
 block discarded – undo
1707 1707
         && $action === 'at_shown'
1708 1708
     ) {
1709 1709
         // Load superglobal
1710
-        include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1710
+        include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1711 1711
         $superGlobal = new protect\SuperGlobal\SuperGlobal();
1712 1712
         // Get superglobals
1713 1713
         $globalsLastname = $superGlobal->get('lastname', 'SESSION');
@@ -1716,7 +1716,7 @@  discard block
 block discarded – undo
1716 1716
         // Get info about item
1717 1717
         $dataItem = DB::queryfirstrow(
1718 1718
             'SELECT id, id_tree, label
1719
-            FROM ' . prefixTable('items') . '
1719
+            FROM ' . prefixTable('items').'
1720 1720
             WHERE id = %i',
1721 1721
             $item_id
1722 1722
         );
@@ -1730,9 +1730,9 @@  discard block
 block discarded – undo
1730 1730
                 'body' => str_replace(
1731 1731
                     ['#tp_user#', '#tp_item#', '#tp_link#'],
1732 1732
                     [
1733
-                        addslashes($globalsName . ' ' . $globalsLastname),
1733
+                        addslashes($globalsName.' '.$globalsLastname),
1734 1734
                         addslashes($item_label),
1735
-                        $SETTINGS['cpassman_url'] . '/index.php?page=items&group=' . $dataItem['id_tree'] . '&id=' . $item_id,
1735
+                        $SETTINGS['cpassman_url'].'/index.php?page=items&group='.$dataItem['id_tree'].'&id='.$item_id,
1736 1736
                     ],
1737 1737
                     langHdl('email_on_open_notification_mail')
1738 1738
                 ),
@@ -1754,7 +1754,7 @@  discard block
 block discarded – undo
1754 1754
 function notifyChangesToSubscribers(int $item_id, string $label, array $changes, array $SETTINGS): void
1755 1755
 {
1756 1756
     // Load superglobal
1757
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1757
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1758 1758
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
1759 1759
     // Get superglobals
1760 1760
     $globalsUserId = $superGlobal->get('user_id', 'SESSION');
@@ -1764,8 +1764,8 @@  discard block
 block discarded – undo
1764 1764
     $notification = DB::queryOneColumn(
1765 1765
         'email',
1766 1766
         'SELECT *
1767
-        FROM ' . prefixTable('notification') . ' AS n
1768
-        INNER JOIN ' . prefixTable('users') . ' AS u ON (n.user_id = u.id)
1767
+        FROM ' . prefixTable('notification').' AS n
1768
+        INNER JOIN ' . prefixTable('users').' AS u ON (n.user_id = u.id)
1769 1769
         WHERE n.item_id = %i AND n.user_id != %i',
1770 1770
         $item_id,
1771 1771
         $globalsUserId
@@ -1776,7 +1776,7 @@  discard block
 block discarded – undo
1776 1776
         // Get list of changes
1777 1777
         $htmlChanges = '<ul>';
1778 1778
         foreach ($changes as $change) {
1779
-            $htmlChanges .= '<li>' . $change . '</li>';
1779
+            $htmlChanges .= '<li>'.$change.'</li>';
1780 1780
         }
1781 1781
         $htmlChanges .= '</ul>';
1782 1782
         // send email
@@ -1807,7 +1807,7 @@  discard block
 block discarded – undo
1807 1807
 function geItemReadablePath(int $id_tree, string $label, array $SETTINGS): string
1808 1808
 {
1809 1809
     // Class loader
1810
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
1810
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
1811 1811
     //Load Tree
1812 1812
     $tree = new SplClassLoader('Tree\NestedTree', '../includes/libraries');
1813 1813
     $tree->register();
@@ -1816,15 +1816,15 @@  discard block
 block discarded – undo
1816 1816
     $path = '';
1817 1817
     foreach ($arbo as $elem) {
1818 1818
         if (empty($path) === true) {
1819
-            $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES) . ' ';
1819
+            $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES).' ';
1820 1820
         } else {
1821
-            $path .= '&#8594; ' . htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
1821
+            $path .= '&#8594; '.htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
1822 1822
         }
1823 1823
     }
1824 1824
 
1825 1825
     // Build text to show user
1826 1826
     if (empty($label) === false) {
1827
-        return empty($path) === true ? addslashes($label) : addslashes($label) . ' (' . $path . ')';
1827
+        return empty($path) === true ? addslashes($label) : addslashes($label).' ('.$path.')';
1828 1828
     }
1829 1829
     return empty($path) === true ? '' : $path;
1830 1830
 }
@@ -1879,9 +1879,9 @@  discard block
 block discarded – undo
1879 1879
  */
1880 1880
 function handleConfigFile($action, $SETTINGS, $field = null, $value = null)
1881 1881
 {
1882
-    $tp_config_file = $SETTINGS['cpassman_dir'] . '/includes/config/tp.config.php';
1882
+    $tp_config_file = $SETTINGS['cpassman_dir'].'/includes/config/tp.config.php';
1883 1883
     // include librairies & connect to DB
1884
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
1884
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
1885 1885
     if (defined('DB_PASSWD_CLEAR') === false) {
1886 1886
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
1887 1887
     }
@@ -1894,8 +1894,8 @@  discard block
 block discarded – undo
1894 1894
     if (file_exists($tp_config_file) === false || $action === 'rebuild') {
1895 1895
         // perform a copy
1896 1896
         if (file_exists($tp_config_file)) {
1897
-            if (! copy($tp_config_file, $tp_config_file . '.' . date('Y_m_d_His', time()))) {
1898
-                return "ERROR: Could not copy file '" . $tp_config_file . "'";
1897
+            if (!copy($tp_config_file, $tp_config_file.'.'.date('Y_m_d_His', time()))) {
1898
+                return "ERROR: Could not copy file '".$tp_config_file."'";
1899 1899
             }
1900 1900
         }
1901 1901
 
@@ -1905,11 +1905,11 @@  discard block
 block discarded – undo
1905 1905
         $data[1] = "global \$SETTINGS;\n";
1906 1906
         $data[2] = "\$SETTINGS = array (\n";
1907 1907
         $rows = DB::query(
1908
-            'SELECT * FROM ' . prefixTable('misc') . ' WHERE type=%s',
1908
+            'SELECT * FROM '.prefixTable('misc').' WHERE type=%s',
1909 1909
             'admin'
1910 1910
         );
1911 1911
         foreach ($rows as $record) {
1912
-            array_push($data, "    '" . $record['intitule'] . "' => '" . $record['valeur'] . "',\n");
1912
+            array_push($data, "    '".$record['intitule']."' => '".$record['valeur']."',\n");
1913 1913
         }
1914 1914
         array_push($data, ");\n");
1915 1915
         $data = array_unique($data);
@@ -1923,15 +1923,15 @@  discard block
 block discarded – undo
1923 1923
                 break;
1924 1924
             }
1925 1925
 
1926
-            if (stristr($line, "'" . $field . "' => '")) {
1927
-                $data[$inc] = "    '" . $field . "' => '" . filter_var($value, FILTER_SANITIZE_STRING) . "',\n";
1926
+            if (stristr($line, "'".$field."' => '")) {
1927
+                $data[$inc] = "    '".$field."' => '".filter_var($value, FILTER_SANITIZE_STRING)."',\n";
1928 1928
                 $bFound = true;
1929 1929
                 break;
1930 1930
             }
1931 1931
             ++$inc;
1932 1932
         }
1933 1933
         if ($bFound === false) {
1934
-            $data[$inc] = "    '" . $field . "' => '" . filter_var($value, FILTER_SANITIZE_STRING) . "',\n);\n";
1934
+            $data[$inc] = "    '".$field."' => '".filter_var($value, FILTER_SANITIZE_STRING)."',\n);\n";
1935 1935
         }
1936 1936
     }
1937 1937
 
@@ -1957,7 +1957,7 @@  discard block
 block discarded – undo
1957 1957
 {
1958 1958
     global $SETTINGS;
1959 1959
     /* LOAD CPASSMAN SETTINGS */
1960
-    if (! isset($SETTINGS['loaded']) || $SETTINGS['loaded'] !== 1) {
1960
+    if (!isset($SETTINGS['loaded']) || $SETTINGS['loaded'] !== 1) {
1961 1961
         $SETTINGS = [];
1962 1962
         $SETTINGS['duplicate_folder'] = 0;
1963 1963
         //by default, this is set to 0;
@@ -1967,7 +1967,7 @@  discard block
 block discarded – undo
1967 1967
         //by default, this value is set to 5;
1968 1968
         $settings = [];
1969 1969
         $rows = DB::query(
1970
-            'SELECT * FROM ' . prefixTable('misc') . ' WHERE type=%s_type OR type=%s_type2',
1970
+            'SELECT * FROM '.prefixTable('misc').' WHERE type=%s_type OR type=%s_type2',
1971 1971
             [
1972 1972
                 'type' => 'admin',
1973 1973
                 'type2' => 'settings',
@@ -1994,7 +1994,7 @@  discard block
 block discarded – undo
1994 1994
     $source_cf = [];
1995 1995
     $rows = DB::QUERY(
1996 1996
         'SELECT id_category
1997
-            FROM ' . prefixTable('categories_folders') . '
1997
+            FROM ' . prefixTable('categories_folders').'
1998 1998
             WHERE id_folder = %i',
1999 1999
         $source_id
2000 2000
     );
@@ -2005,7 +2005,7 @@  discard block
 block discarded – undo
2005 2005
     $target_cf = [];
2006 2006
     $rows = DB::QUERY(
2007 2007
         'SELECT id_category
2008
-            FROM ' . prefixTable('categories_folders') . '
2008
+            FROM ' . prefixTable('categories_folders').'
2009 2009
             WHERE id_folder = %i',
2010 2010
         $target_id
2011 2011
     );
@@ -2040,9 +2040,9 @@  discard block
 block discarded – undo
2040 2040
     $password = null
2041 2041
 ) {
2042 2042
     // Load AntiXSS
2043
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/AntiXSS.php';
2044
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/ASCII.php';
2045
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/UTF8.php';
2043
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/AntiXSS.php';
2044
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/ASCII.php';
2045
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/UTF8.php';
2046 2046
     $antiXss = new voku\helper\AntiXSS();
2047 2047
     // Protect against bad inputs
2048 2048
     if (is_array($source_file) === true || is_array($target_file) === true) {
@@ -2054,7 +2054,7 @@  discard block
 block discarded – undo
2054 2054
     $target_file = $antiXss->xss_clean($target_file);
2055 2055
     if (empty($password) === true || is_null($password) === true) {
2056 2056
         // get KEY to define password
2057
-        $ascii_key = file_get_contents(SECUREPATH . '/teampass-seckey.txt');
2057
+        $ascii_key = file_get_contents(SECUREPATH.'/teampass-seckey.txt');
2058 2058
         $password = \Defuse\Crypto\Key::loadFromAsciiSafeString($ascii_key);
2059 2059
     }
2060 2060
 
@@ -2099,15 +2099,15 @@  discard block
 block discarded – undo
2099 2099
 ) {
2100 2100
     // load PhpEncryption library
2101 2101
     $path_to_encryption = '/includes/libraries/Encryption/Encryption/';
2102
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Crypto.php';
2103
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Encoding.php';
2104
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'DerivedKeys.php';
2105
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Key.php';
2106
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'KeyOrPassword.php';
2107
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'File.php';
2108
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'RuntimeTests.php';
2109
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'KeyProtectedByPassword.php';
2110
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Core.php';
2102
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Crypto.php';
2103
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Encoding.php';
2104
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'DerivedKeys.php';
2105
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Key.php';
2106
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'KeyOrPassword.php';
2107
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'File.php';
2108
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'RuntimeTests.php';
2109
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'KeyProtectedByPassword.php';
2110
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Core.php';
2111 2111
     try {
2112 2112
         \Defuse\Crypto\File::encryptFileWithPassword(
2113 2113
             $source_file,
@@ -2144,15 +2144,15 @@  discard block
 block discarded – undo
2144 2144
 ) {
2145 2145
     // load PhpEncryption library
2146 2146
     $path_to_encryption = '/includes/libraries/Encryption/Encryption/';
2147
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Crypto.php';
2148
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Encoding.php';
2149
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'DerivedKeys.php';
2150
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Key.php';
2151
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'KeyOrPassword.php';
2152
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'File.php';
2153
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'RuntimeTests.php';
2154
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'KeyProtectedByPassword.php';
2155
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Core.php';
2147
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Crypto.php';
2148
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Encoding.php';
2149
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'DerivedKeys.php';
2150
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Key.php';
2151
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'KeyOrPassword.php';
2152
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'File.php';
2153
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'RuntimeTests.php';
2154
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'KeyProtectedByPassword.php';
2155
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Core.php';
2156 2156
     try {
2157 2157
         \Defuse\Crypto\File::decryptFileWithPassword(
2158 2158
             $source_file,
@@ -2197,9 +2197,9 @@  discard block
 block discarded – undo
2197 2197
 function fileDelete(string $file, array $SETTINGS): void
2198 2198
 {
2199 2199
     // Load AntiXSS
2200
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/ASCII.php';
2201
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/UTF8.php';
2202
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/AntiXSS.php';
2200
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/ASCII.php';
2201
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/UTF8.php';
2202
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/AntiXSS.php';
2203 2203
     $antiXss = new voku\helper\AntiXSS();
2204 2204
     $file = $antiXss->xss_clean($file);
2205 2205
     if (is_file($file)) {
@@ -2243,7 +2243,7 @@  discard block
 block discarded – undo
2243 2243
 
2244 2244
 function recursiveChmod($path, $filePerm = 0644, $dirPerm = 0755) {
2245 2245
     // Check if the path exists
2246
-    if (! file_exists($path)) {
2246
+    if (!file_exists($path)) {
2247 2247
         return false;
2248 2248
     }
2249 2249
 
@@ -2278,7 +2278,7 @@  discard block
 block discarded – undo
2278 2278
  */
2279 2279
 function accessToItemIsGranted(int $item_id, $SETTINGS)
2280 2280
 {
2281
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
2281
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
2282 2282
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
2283 2283
     // Prepare superGlobal variables
2284 2284
     $session_groupes_visibles = $superGlobal->get('groupes_visibles', 'SESSION');
@@ -2286,7 +2286,7 @@  discard block
 block discarded – undo
2286 2286
     // Load item data
2287 2287
     $data = DB::queryFirstRow(
2288 2288
         'SELECT id_tree
2289
-        FROM ' . prefixTable('items') . '
2289
+        FROM ' . prefixTable('items').'
2290 2290
         WHERE id = %i',
2291 2291
         $item_id
2292 2292
     );
@@ -2359,8 +2359,8 @@  discard block
 block discarded – undo
2359 2359
 function performDBQuery(array $SETTINGS, string $fields, string $table): array
2360 2360
 {
2361 2361
     // include librairies & connect to DB
2362
-    include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
2363
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
2362
+    include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
2363
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
2364 2364
     if (defined('DB_PASSWD_CLEAR') === false) {
2365 2365
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
2366 2366
     }
@@ -2372,7 +2372,7 @@  discard block
 block discarded – undo
2372 2372
     DB::$encoding = DB_ENCODING;
2373 2373
     // Insert log in DB
2374 2374
     return DB::query(
2375
-        'SELECT ' . $fields . '
2375
+        'SELECT '.$fields.'
2376 2376
         FROM ' . prefixTable($table)
2377 2377
     );
2378 2378
 }
@@ -2385,11 +2385,11 @@  discard block
 block discarded – undo
2385 2385
 function formatSizeUnits(int $bytes): string
2386 2386
 {
2387 2387
     if ($bytes >= 1073741824) {
2388
-        $bytes = number_format($bytes / 1073741824, 2) . ' GB';
2388
+        $bytes = number_format($bytes / 1073741824, 2).' GB';
2389 2389
     } elseif ($bytes >= 1048576) {
2390
-        $bytes = number_format($bytes / 1048576, 2) . ' MB';
2390
+        $bytes = number_format($bytes / 1048576, 2).' MB';
2391 2391
     } elseif ($bytes >= 1024) {
2392
-        $bytes = number_format($bytes / 1024, 2) . ' KB';
2392
+        $bytes = number_format($bytes / 1024, 2).' KB';
2393 2393
     } elseif ($bytes > 1) {
2394 2394
         $bytes .= ' bytes';
2395 2395
     } elseif ($bytes === 1) {
@@ -2584,14 +2584,14 @@  discard block
 block discarded – undo
2584 2584
 
2585 2585
     // Encrypt the file content
2586 2586
     $plaintext = file_get_contents(
2587
-        filter_var($fileInPath . '/' . $fileInName, FILTER_SANITIZE_URL)
2587
+        filter_var($fileInPath.'/'.$fileInName, FILTER_SANITIZE_URL)
2588 2588
     );
2589 2589
     $ciphertext = $cipher->encrypt($plaintext);
2590 2590
     // Save new file
2591 2591
     $hash = md5($plaintext);
2592
-    $fileOut = $fileInPath . '/' . TP_FILE_PREFIX . $hash;
2592
+    $fileOut = $fileInPath.'/'.TP_FILE_PREFIX.$hash;
2593 2593
     file_put_contents($fileOut, $ciphertext);
2594
-    unlink($fileInPath . '/' . $fileInName);
2594
+    unlink($fileInPath.'/'.$fileInName);
2595 2595
     return [
2596 2596
         'fileHash' => base64_encode($hash),
2597 2597
         'objectKey' => base64_encode($objectKey),
@@ -2607,7 +2607,7 @@  discard block
 block discarded – undo
2607 2607
  */
2608 2608
 function decryptFile(string $fileName, string $filePath, string $key): string
2609 2609
 {
2610
-    if (! defined('FILE_BUFFER_SIZE')) {
2610
+    if (!defined('FILE_BUFFER_SIZE')) {
2611 2611
         define('FILE_BUFFER_SIZE', 128 * 1024);
2612 2612
     }
2613 2613
 
@@ -2626,7 +2626,7 @@  discard block
 block discarded – undo
2626 2626
     $cipher->enableContinuousBuffer();
2627 2627
     $cipher->disablePadding();
2628 2628
     // Get file content
2629
-    $ciphertext = file_get_contents($filePath . '/' . TP_FILE_PREFIX . $fileName);
2629
+    $ciphertext = file_get_contents($filePath.'/'.TP_FILE_PREFIX.$fileName);
2630 2630
     // Decrypt file content and return
2631 2631
     return base64_encode($cipher->decrypt($ciphertext));
2632 2632
 }
@@ -2676,8 +2676,8 @@  discard block
 block discarded – undo
2676 2676
     array $SETTINGS
2677 2677
 ): void {
2678 2678
     // include librairies & connect to DB
2679
-    include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
2680
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
2679
+    include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
2680
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
2681 2681
     if (defined('DB_PASSWD_CLEAR') === false) {
2682 2682
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
2683 2683
     }
@@ -2694,7 +2694,7 @@  discard block
 block discarded – undo
2694 2694
         $post_object_id
2695 2695
     );
2696 2696
     // Superglobals
2697
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
2697
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
2698 2698
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
2699 2699
     // Prepare superGlobal variables
2700 2700
     $sessionPpersonaFolders = $superGlobal->get('personal_folders', 'SESSION');
@@ -2719,8 +2719,8 @@  discard block
 block discarded – undo
2719 2719
         // Create sharekey for each user
2720 2720
         $users = DB::query(
2721 2721
             'SELECT id, public_key
2722
-            FROM ' . prefixTable('users') . '
2723
-            WHERE id NOT IN ("' . OTV_USER_ID . '","' . SSH_USER_ID . '","' . API_USER_ID . '")
2722
+            FROM ' . prefixTable('users').'
2723
+            WHERE id NOT IN ("' . OTV_USER_ID.'","'.SSH_USER_ID.'","'.API_USER_ID.'")
2724 2724
             AND public_key != ""'
2725 2725
         );
2726 2726
         foreach ($users as $user) {
@@ -2748,7 +2748,7 @@  discard block
 block discarded – undo
2748 2748
 function isBase64(string $str): bool
2749 2749
 {
2750 2750
     $str = (string) trim($str);
2751
-    if (! isset($str[0])) {
2751
+    if (!isset($str[0])) {
2752 2752
         return false;
2753 2753
     }
2754 2754
 
@@ -2816,13 +2816,13 @@  discard block
 block discarded – undo
2816 2816
         ],
2817 2817
     ];
2818 2818
     // Load expected libraries
2819
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Traits/Macroable.php';
2820
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Arr.php';
2821
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/DetectsErrors.php';
2822
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/Connection.php';
2823
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/LdapInterface.php';
2824
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/LdapBase.php';
2825
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/Ldap.php';
2819
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Traits/Macroable.php';
2820
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Arr.php';
2821
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/DetectsErrors.php';
2822
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/Connection.php';
2823
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/LdapInterface.php';
2824
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/LdapBase.php';
2825
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/Ldap.php';
2826 2826
     $ad = new SplClassLoader('LdapRecord', '../includes/libraries');
2827 2827
     $ad->register();
2828 2828
     $connection = new Connection($config);
@@ -2831,7 +2831,7 @@  discard block
 block discarded – undo
2831 2831
         $connection->connect();
2832 2832
     } catch (\LdapRecord\Auth\BindException $e) {
2833 2833
         $error = $e->getDetailedError();
2834
-        echo 'Error : '.$error->getErrorCode().' - '.$error->getErrorMessage(). '<br>'.$error->getDiagnosticMessage();
2834
+        echo 'Error : '.$error->getErrorCode().' - '.$error->getErrorMessage().'<br>'.$error->getDiagnosticMessage();
2835 2835
         return false;
2836 2836
     }
2837 2837
 
@@ -2840,7 +2840,7 @@  discard block
 block discarded – undo
2840 2840
         $connection->auth()->attempt($SETTINGS['ldap_user_attribute'].'='.$login.','.$SETTINGS['ldap_bdn'], $password, $stayAuthenticated = true);
2841 2841
     } catch (\LdapRecord\Auth\BindException $e) {
2842 2842
         $error = $e->getDetailedError();
2843
-        echo 'Error : '.$error->getErrorCode().' - '.$error->getErrorMessage(). '<br>'.$error->getDiagnosticMessage();
2843
+        echo 'Error : '.$error->getErrorCode().' - '.$error->getErrorMessage().'<br>'.$error->getDiagnosticMessage();
2844 2844
         return false;
2845 2845
     }
2846 2846
 
@@ -2858,8 +2858,8 @@  discard block
 block discarded – undo
2858 2858
 function deleteUserObjetsKeys(int $userId, array $SETTINGS): bool
2859 2859
 {
2860 2860
     // include librairies & connect to DB
2861
-    include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
2862
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
2861
+    include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
2862
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
2863 2863
     if (defined('DB_PASSWD_CLEAR') === false) {
2864 2864
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
2865 2865
     }
@@ -2917,7 +2917,7 @@  discard block
 block discarded – undo
2917 2917
         foreach (DateTimeZone::listIdentifiers() as $timezone) {
2918 2918
             $now->setTimezone(new DateTimeZone($timezone));
2919 2919
             $offsets[] = $offset = $now->getOffset();
2920
-            $timezones[$timezone] = '(' . format_GMT_offset($offset) . ') ' . format_timezone_name($timezone);
2920
+            $timezones[$timezone] = '('.format_GMT_offset($offset).') '.format_timezone_name($timezone);
2921 2921
         }
2922 2922
 
2923 2923
         array_multisort($offsets, $timezones);
@@ -2937,7 +2937,7 @@  discard block
 block discarded – undo
2937 2937
 {
2938 2938
     $hours = intval($offset / 3600);
2939 2939
     $minutes = abs(intval($offset % 3600 / 60));
2940
-    return 'GMT' . ($offset ? sprintf('%+03d:%02d', $hours, $minutes) : '');
2940
+    return 'GMT'.($offset ? sprintf('%+03d:%02d', $hours, $minutes) : '');
2941 2941
 }
2942 2942
 
2943 2943
 /**
Please login to merge, or discard this patch.
error.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -54,12 +54,12 @@  discard block
 block discarded – undo
54 54
     && filter_input(INPUT_POST, 'session', FILTER_SANITIZE_STRING) === 'expired'
55 55
 ) {
56 56
     //Include files
57
-    require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
58
-    require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
59
-    require_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
60
-    require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
57
+    require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
58
+    require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php';
59
+    require_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
60
+    require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
61 61
     // connect to DB
62
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
62
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
63 63
     if (defined('DB_PASSWD_CLEAR') === false) {
64 64
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
65 65
     }
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
     // Update table by deleting ID
70 70
     if (isset($_SESSION['user_id'])) {
71 71
         DB::update(
72
-            DB_PREFIX . 'users',
72
+            DB_PREFIX.'users',
73 73
             [
74 74
                 'key_tempo' => '',
75 75
             ],
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         logEvents($SETTINGS, 'user_connection', 'disconnection', (string) $_SESSION['user_id'], $_SESSION['login']);
84 84
     }
85 85
 } else {
86
-    require_once $SETTINGS['cpassman_dir'] . '/sources/main.queries.php';
86
+    require_once $SETTINGS['cpassman_dir'].'/sources/main.queries.php';
87 87
     $errorCode = '';
88 88
     if (@$_SESSION['error']['code'] === ERR_NOT_ALLOWED) {
89 89
         $errorCode = 'ERROR NOT ALLOWED';
Please login to merge, or discard this patch.
includes/core/load.js.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
                                     console.log('User has to regenerate keys')
91 91
                                     // HIde
92 92
                                     $('.content-header, .content').addClass('hidden');
93
-                                    $('#dialog-user-temporary-code-info').html('<i class="icon fas fa-info mr-2"></i><?php echo langHdl('renecyption_expected');?>');
93
+                                    $('#dialog-user-temporary-code-info').html('<i class="icon fas fa-info mr-2"></i><?php echo langHdl('renecyption_expected'); ?>');
94 94
 
95 95
                                     // Show passwords inputs and form
96 96
                                     $('#dialog-user-temporary-code').removeClass('hidden');
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 
105 105
                                     // Show passwords inputs and form
106 106
                                     $('#dialog-user-change-password-info')
107
-                                        .html('<i class="icon fas fa-info mr-2"></i><?php echo langHdl('user_has_to_change_password_info');?>')
107
+                                        .html('<i class="icon fas fa-info mr-2"></i><?php echo langHdl('user_has_to_change_password_info'); ?>')
108 108
                                         .removeClass('hidden');
109 109
                                     $('#dialog-user-change-password').removeClass('hidden');
110 110
 
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 
118 118
                                     // Show passwords inputs and form
119 119
                                     $('#dialog-ldap-user-change-password-info')
120
-                                        .html('<i class="icon fas fa-info mr-2"></i><?php echo langHdl('ldap_user_has_changed_his_password');?>')
120
+                                        .html('<i class="icon fas fa-info mr-2"></i><?php echo langHdl('ldap_user_has_changed_his_password'); ?>')
121 121
                                         .removeClass('hidden');
122 122
                                     $('#dialog-ldap-user-change-password').removeClass('hidden');
123 123
                                     
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
         console.log('User has to regenerate keys')
192 192
         // HIde
193 193
         $('.content-header, .content').addClass('hidden');
194
-        $('#dialog-user-temporary-code-info').html('<i class="icon fas fa-info mr-2"></i><?php echo langHdl('renecyption_expected');?>');
194
+        $('#dialog-user-temporary-code-info').html('<i class="icon fas fa-info mr-2"></i><?php echo langHdl('renecyption_expected'); ?>');
195 195
 
196 196
         // Show passwords inputs and form
197 197
         $('#dialog-user-temporary-code').removeClass('hidden');
@@ -764,15 +764,15 @@  discard block
 block discarded – undo
764 764
             // Prepare data
765 765
             var data = {
766 766
                 'receipt': $('#temp-user-email').val(),
767
-                'subject': '[Teampass] <?php echo langHdl('temporary_encryption_code');?>',
768
-                'body': '<?php echo langHdl('email_body_temporary_encryption_code');?>',
767
+                'subject': '[Teampass] <?php echo langHdl('temporary_encryption_code'); ?>',
768
+                'body': '<?php echo langHdl('email_body_temporary_encryption_code'); ?>',
769 769
                 'pre_replace' : {
770 770
                     '#enc_code#' : $('#temp-user-pwd').val(),
771 771
                 }
772 772
             }
773 773
 
774 774
             // Prepare form
775
-            $('#dialog-admin-change-user-password-info').html('<?php echo langHdl('sending_email_message');?>');
775
+            $('#dialog-admin-change-user-password-info').html('<?php echo langHdl('sending_email_message'); ?>');
776 776
 
777 777
             // Launch action
778 778
             $.post(
@@ -1234,7 +1234,7 @@  discard block
 block discarded – undo
1234 1234
             '#warningModal',
1235 1235
             '<i class="fas fa-clock fa-lg warning mr-2"></i><?php echo langHdl('index_add_one_hour'); ?>',
1236 1236
             '<div class="form-group">' +
1237
-            '<label for="warningModal-input" class="col-form-label"><?php echo langHdl('index_session_duration') . ' (' . langHdl('minutes') . ')'; ?>:</label>' +
1237
+            '<label for="warningModal-input" class="col-form-label"><?php echo langHdl('index_session_duration').' ('.langHdl('minutes').')'; ?>:</label>' +
1238 1238
             '<input type="text" class="form-control" id="warningModal-input" value="<?php echo isset($_SESSION['user']['session_duration']) === true ? (int) $_SESSION['user']['session_duration'] / 60 : 60; ?>">' +
1239 1239
             '</div>',
1240 1240
             '<?php echo langHdl('confirm'); ?>',
Please login to merge, or discard this patch.
pages/roles.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -43,15 +43,15 @@  discard block
 block discarded – undo
43 43
 }
44 44
 
45 45
 /* do checks */
46
-require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php';
46
+require_once $SETTINGS['cpassman_dir'].'/sources/checks.php';
47 47
 if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'roles', $SETTINGS) === false) {
48 48
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
49
-    include $SETTINGS['cpassman_dir'] . '/error.php';
49
+    include $SETTINGS['cpassman_dir'].'/error.php';
50 50
     exit;
51 51
 }
52 52
 
53 53
 // Load template
54
-require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
54
+require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
55 55
 
56 56
 ?>
57 57
 
@@ -94,17 +94,17 @@  discard block
 block discarded – undo
94 94
                                 $arrUserRoles = array_filter($_SESSION['user_roles']);
95 95
                                 $where = '';
96 96
                                 if (count($arrUserRoles) > 0 && (int) $_SESSION['is_admin'] !== 1) {
97
-                                    $where = ' WHERE id IN (' . implode(',', $arrUserRoles) . ')';
97
+                                    $where = ' WHERE id IN ('.implode(',', $arrUserRoles).')';
98 98
                                 }
99
-                                $rows = DB::query('SELECT * FROM ' . prefixTable('roles_title') . $where);
99
+                                $rows = DB::query('SELECT * FROM '.prefixTable('roles_title').$where);
100 100
                                 foreach ($rows as $reccord) {
101 101
                                     echo '
102
-                                    <option value="' . $reccord['id'] . '"
103
-                                        data-complexity-text="' . addslashes(TP_PW_COMPLEXITY[$reccord['complexity']][1]) . '"
104
-                                        data-complexity-icon="' . TP_PW_COMPLEXITY[$reccord['complexity']][2] . '"
105
-                                        data-complexity="' . TP_PW_COMPLEXITY[$reccord['complexity']][0] . '"
106
-                                        data-allow-edit-all="' . $reccord['allow_pw_change'] . '">'.
107
-                                        $reccord['title'] . '</option>';
102
+                                    <option value="' . $reccord['id'].'"
103
+                                        data-complexity-text="' . addslashes(TP_PW_COMPLEXITY[$reccord['complexity']][1]).'"
104
+                                        data-complexity-icon="' . TP_PW_COMPLEXITY[$reccord['complexity']][2].'"
105
+                                        data-complexity="' . TP_PW_COMPLEXITY[$reccord['complexity']][0].'"
106
+                                        data-allow-edit-all="' . $reccord['allow_pw_change'].'">'.
107
+                                        $reccord['title'].'</option>';
108 108
                                 }
109 109
                                 ?>
110 110
                             </select>
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
                                         <?php
126 126
                                         foreach (TP_PW_COMPLEXITY as $entry) {
127 127
                                             echo '
128
-                                        <option value="' . $entry[0] . '">' . addslashes($entry[1]) . '</option>';
128
+                                        <option value="' . $entry[0].'">'.addslashes($entry[1]).'</option>';
129 129
                                         }
130 130
                                         ?>
131 131
                                     </select>
Please login to merge, or discard this patch.