Passed
Push — wip_sessions ( 384f5b...1d74a2 )
by Nils
05:09
created
api/Model/Operation.php 2 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
                 "error" => '',
39 39
             );
40 40
     
41
-        }catch (Exception $e) {    
41
+        } catch (Exception $e) {    
42 42
             return false;
43 43
         }
44 44
     }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
                 "error" => '',
41 41
             );
42 42
     
43
-        }catch (Exception $e) {    
43
+        } catch (Exception $e) {    
44 44
             return false;
45 45
         }
46 46
     }
Please login to merge, or discard this patch.
api/Model/UserModel.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
  *
22 22
  * @see       https://www.teampass.net
23 23
  */
24
-require_once API_ROOT_PATH . "/Model/Database.php";
24
+require_once API_ROOT_PATH."/Model/Database.php";
25 25
 
26 26
 class UserModel extends Database
27 27
 {
Please login to merge, or discard this patch.
api/Model/FolderModel.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
         $ret = [];
35 35
 
36 36
         foreach ($rows as $row) {
37
-			$isVisible = in_array((int) $row['id'], $foldersId);
37
+            $isVisible = in_array((int) $row['id'], $foldersId);
38 38
             $childrens = $this->getFoldersChildren($row['id'], $foldersId);
39 39
 
40 40
             if ($isVisible || count($childrens) > 0) {
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
                     [
44 44
                         'id' => (int) $row['id'],
45 45
                         'title' => $row['title'],
46
-						'isVisible' => $isVisible,
46
+                        'isVisible' => $isVisible,
47 47
                         'childrens' => $childrens
48 48
                     ]
49 49
                 );
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 
64 64
         if ( count($childrens) > 0) {
65 65
             foreach ($childrens as $children) {
66
-				$isVisible = in_array((int) $children['id'], $foldersId);
66
+                $isVisible = in_array((int) $children['id'], $foldersId);
67 67
                 $childs = $this->getFoldersChildren($children['id'], $foldersId);
68 68
 
69 69
                 if (in_array((int) $children['id'], $foldersId) || count($childs) > 0) {
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
                         [
73 73
                             'id' => (int) $children['id'],
74 74
                             'title' => $children['title'],
75
-							'isVisible' => $isVisible,
75
+                            'isVisible' => $isVisible,
76 76
                             'childrens' => $childs
77 77
                         ]
78 78
                     );
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,13 +22,13 @@  discard block
 block discarded – undo
22 22
  *
23 23
  * @see       https://www.teampass.net
24 24
  */
25
-require_once API_ROOT_PATH . "/Model/Database.php";
25
+require_once API_ROOT_PATH."/Model/Database.php";
26 26
  
27 27
 class FolderModel extends Database
28 28
 {
29 29
     public function getFoldersInfo(array $foldersId): array
30 30
     {
31
-        $rows = $this->select( "SELECT id, title FROM " . prefixTable('nested_tree') . " WHERE nlevel=1" );
31
+        $rows = $this->select("SELECT id, title FROM ".prefixTable('nested_tree')." WHERE nlevel=1");
32 32
 
33 33
         $ret = [];
34 34
 
@@ -55,9 +55,9 @@  discard block
 block discarded – undo
55 55
     private function getFoldersChildren(int $parentId, array $foldersId): array
56 56
     {
57 57
         $ret = [];
58
-        $childrens = $this->select('SELECT id, title FROM ' . prefixTable('nested_tree') . ' WHERE parent_id=' . $parentId);
58
+        $childrens = $this->select('SELECT id, title FROM '.prefixTable('nested_tree').' WHERE parent_id='.$parentId);
59 59
 
60
-        if ( count($childrens) > 0) {
60
+        if (count($childrens) > 0) {
61 61
             foreach ($childrens as $children) {
62 62
 				$isVisible = in_array((int) $children['id'], $foldersId);
63 63
                 $childs = $this->getFoldersChildren($children['id'], $foldersId);
Please login to merge, or discard this patch.
api/Controller/Api/ItemController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
             // SQL where clause with folders list
53 53
             if (isset($arrQueryStringParams['folders']) === true) {
54 54
                 // convert the folders to an array
55
-                $arrQueryStringParams['folders'] = explode(',', str_replace( array('[',']') , ''  , $arrQueryStringParams['folders']));
55
+                $arrQueryStringParams['folders'] = explode(',', str_replace(array('[', ']'), '', $arrQueryStringParams['folders']));
56 56
 
57 57
                 // ensure to only use the intersection
58 58
                 $foldersList = implode(',', array_intersect($arrQueryStringParams['folders'], $userData['folders_list']));
@@ -126,10 +126,10 @@  discard block
 block discarded – undo
126 126
             // SQL where clause with item id
127 127
             if (isset($arrQueryStringParams['id']) === true) {
128 128
                 // build sql where clause by ID
129
-                $sqlExtra = ' WHERE i.id = '.$arrQueryStringParams['id'] . $sql_constraint;
129
+                $sqlExtra = ' WHERE i.id = '.$arrQueryStringParams['id'].$sql_constraint;
130 130
             } else if (isset($arrQueryStringParams['label']) === true) {
131 131
                 // build sql where clause by LABEL
132
-                $sqlExtra = ' WHERE i.label '.(isset($arrQueryStringParams['like']) === true && (int) $arrQueryStringParams['like'] === 1 ? ' LIKE '.$arrQueryStringParams['label'] : ' = '.$arrQueryStringParams['label']) . $sql_constraint;
132
+                $sqlExtra = ' WHERE i.label '.(isset($arrQueryStringParams['like']) === true && (int) $arrQueryStringParams['like'] === 1 ? ' LIKE '.$arrQueryStringParams['label'] : ' = '.$arrQueryStringParams['label']).$sql_constraint;
133 133
             } else if (isset($arrQueryStringParams['description']) === true) {
134 134
                 // build sql where clause by LABEL
135 135
                 $sqlExtra = ' WHERE i.description '.(isset($arrQueryStringParams['like']) === true && (int) $arrQueryStringParams['like'] === 1 ? ' LIKE '.$arrQueryStringParams['description'] : ' = '.$arrQueryStringParams['description']).$sql_constraint;
Please login to merge, or discard this patch.
sources/main.functions.php 3 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3886,7 +3886,9 @@
 block discarded – undo
3886 3886
     );
3887 3887
     
3888 3888
     // if not exists then error
3889
-    if (is_null($val) === true || count($val) === 0 || defined('UPGRADE_MIN_DATE') === false) return true;
3889
+    if (is_null($val) === true || count($val) === 0 || defined('UPGRADE_MIN_DATE') === false) {
3890
+        return true;
3891
+    }
3890 3892
 
3891 3893
     // if empty or too old then error
3892 3894
     if (empty($val['valeur']) === true || (int) $val['valeur'] < (int) UPGRADE_MIN_DATE) {
Please login to merge, or discard this patch.
Indentation   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2225,7 +2225,7 @@  discard block
 block discarded – undo
2225 2225
  * <tt>exec("find ".$path." -type d -exec chmod 755 {} \;");</tt>
2226 2226
  *
2227 2227
  * @author Jeppe Toustrup (tenzer at tenzer dot dk)
2228
-  *
2228
+ *
2229 2229
  * @param string $path      An either relative or absolute path to a file or directory which should be processed.
2230 2230
  * @param int    $filePerm The permissions any found files should get.
2231 2231
  * @param int    $dirPerm  The permissions any found folder should get.
@@ -3848,7 +3848,6 @@  discard block
 block discarded – undo
3848 3848
  * @param integer $processId
3849 3849
  * @param integer $nbItemsToTreat
3850 3850
  * @return void
3851
- 
3852 3851
  */
3853 3852
 function createUserTasks($processId, $nbItemsToTreat): void
3854 3853
 {
Please login to merge, or discard this patch.
Spacing   +149 added lines, -152 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 
51 51
 // Load config if $SETTINGS not defined
52 52
 if (isset($SETTINGS['cpassman_dir']) === false || empty($SETTINGS['cpassman_dir']) === true) {
53
-    include_once __DIR__ . '/../includes/config/tp.config.php';
53
+    include_once __DIR__.'/../includes/config/tp.config.php';
54 54
 }
55 55
 
56 56
 header('Content-type: text/html; charset=utf-8');
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
  */
220 220
 function trimElement($chaine, string $element): string
221 221
 {
222
-    if (! empty($chaine)) {
222
+    if (!empty($chaine)) {
223 223
         if (is_array($chaine) === true) {
224 224
             $chaine = implode(';', $chaine);
225 225
         }
@@ -267,8 +267,8 @@  discard block
 block discarded – undo
267 267
  */
268 268
 function db_error_handler(array $params): void
269 269
 {
270
-    echo 'Error: ' . $params['error'] . "<br>\n";
271
-    echo 'Query: ' . $params['query'] . "<br>\n";
270
+    echo 'Error: '.$params['error']."<br>\n";
271
+    echo 'Query: '.$params['query']."<br>\n";
272 272
     throw new Exception('Error - Query', 1);
273 273
 }
274 274
 
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
     $globalsVisibleFolders = $session->get('user-accessible_folders');
349 349
     $globalsPersonalVisibleFolders = $session->get('user-personal_visible_folders');
350 350
     // Get list of Folders
351
-    $rows = DB::query('SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE personal_folder = %i', 0);
351
+    $rows = DB::query('SELECT id FROM '.prefixTable('nested_tree').' WHERE personal_folder = %i', 0);
352 352
     foreach ($rows as $record) {
353 353
         array_push($groupesVisibles, $record['id']);
354 354
     }
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
     }
368 368
     // Get ID of personal folder
369 369
     $persfld = DB::queryfirstrow(
370
-        'SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE title = %s',
370
+        'SELECT id FROM '.prefixTable('nested_tree').' WHERE title = %s',
371 371
         $globalsUserId
372 372
     );
373 373
     if (empty($persfld['id']) === false) {
@@ -387,20 +387,20 @@  discard block
 block discarded – undo
387 387
     // get complete list of ROLES
388 388
     $tmp = explode(';', $idFonctions);
389 389
     $rows = DB::query(
390
-        'SELECT * FROM ' . prefixTable('roles_title') . '
390
+        'SELECT * FROM '.prefixTable('roles_title').'
391 391
         ORDER BY title ASC'
392 392
     );
393 393
     foreach ($rows as $record) {
394
-        if (! empty($record['id']) && ! in_array($record['id'], $tmp)) {
394
+        if (!empty($record['id']) && !in_array($record['id'], $tmp)) {
395 395
             array_push($tmp, $record['id']);
396 396
         }
397 397
     }
398 398
     $session->set('user-roles', implode(';', $tmp));
399 399
     $session->set('user-admin', 1);
400 400
     // Check if admin has created Folders and Roles
401
-    DB::query('SELECT * FROM ' . prefixTable('nested_tree') . '');
401
+    DB::query('SELECT * FROM '.prefixTable('nested_tree').'');
402 402
     $session->set('user-nb_folders', DB::count());
403
-    DB::query('SELECT * FROM ' . prefixTable('roles_title'));
403
+    DB::query('SELECT * FROM '.prefixTable('roles_title'));
404 404
     $session->set('user-nb_roles', DB::count());
405 405
 
406 406
     return true;
@@ -483,7 +483,7 @@  discard block
 block discarded – undo
483 483
     // Does this user is allowed to see other items
484 484
     $inc = 0;
485 485
     $rows = DB::query(
486
-        'SELECT id, id_tree FROM ' . prefixTable('items') . '
486
+        'SELECT id, id_tree FROM '.prefixTable('items').'
487 487
             WHERE restricted_to LIKE %ss AND inactif = %s'.
488 488
             (count($allowedFolders) > 0 ? ' AND id_tree NOT IN ('.implode(',', $allowedFolders).')' : ''),
489 489
         $globalsUserId,
@@ -500,8 +500,8 @@  discard block
 block discarded – undo
500 500
     // Check for the users roles if some specific rights exist on items
501 501
     $rows = DB::query(
502 502
         'SELECT i.id_tree, r.item_id
503
-        FROM ' . prefixTable('items') . ' as i
504
-        INNER JOIN ' . prefixTable('restriction_to_roles') . ' as r ON (r.item_id=i.id)
503
+        FROM ' . prefixTable('items').' as i
504
+        INNER JOIN ' . prefixTable('restriction_to_roles').' as r ON (r.item_id=i.id)
505 505
         WHERE i.id_tree <> "" '.
506 506
         (count($userRoles) > 0 ? 'AND r.role_id IN %li ' : '').
507 507
         'ORDER BY i.id_tree ASC',
@@ -555,16 +555,16 @@  discard block
 block discarded – undo
555 555
         ), SORT_NUMERIC)
556 556
     );
557 557
     // Folders and Roles numbers
558
-    DB::queryfirstrow('SELECT id FROM ' . prefixTable('nested_tree') . '');
558
+    DB::queryfirstrow('SELECT id FROM '.prefixTable('nested_tree').'');
559 559
     $session->set('user-nb_folders', DB::count());
560
-    DB::queryfirstrow('SELECT id FROM ' . prefixTable('roles_title'));
560
+    DB::queryfirstrow('SELECT id FROM '.prefixTable('roles_title'));
561 561
     $session->set('user-nb_roles', DB::count());
562 562
     // check if change proposals on User's items
563 563
     if (isset($SETTINGS['enable_suggestion']) === true && (int) $SETTINGS['enable_suggestion'] === 1) {
564 564
         $countNewItems = DB::query(
565 565
             'SELECT COUNT(*)
566
-            FROM ' . prefixTable('items_change') . ' AS c
567
-            LEFT JOIN ' . prefixTable('log_items') . ' AS i ON (c.item_id = i.id_item)
566
+            FROM ' . prefixTable('items_change').' AS c
567
+            LEFT JOIN ' . prefixTable('log_items').' AS i ON (c.item_id = i.id_item)
568 568
             WHERE i.action = %s AND i.id_user = %i',
569 569
             'at_creation',
570 570
             $globalsUserId
@@ -591,7 +591,7 @@  discard block
 block discarded – undo
591 591
 {
592 592
     $rows = DB::query(
593 593
         'SELECT *
594
-        FROM ' . prefixTable('roles_values') . '
594
+        FROM ' . prefixTable('roles_values').'
595 595
         WHERE type IN %ls'.(count($userRoles) > 0 ? ' AND role_id IN %li' : ''),
596 596
         ['W', 'ND', 'NE', 'NDNE', 'R'],
597 597
         $userRoles,
@@ -658,7 +658,7 @@  discard block
 block discarded – undo
658 658
     ) {
659 659
         $persoFld = DB::queryfirstrow(
660 660
             'SELECT id
661
-            FROM ' . prefixTable('nested_tree') . '
661
+            FROM ' . prefixTable('nested_tree').'
662 662
             WHERE title = %s AND personal_folder = %i'.
663 663
             (count($allowedFolders) > 0 ? ' AND id NOT IN ('.implode(',', $allowedFolders).')' : ''),
664 664
             $globalsUserId,
@@ -691,7 +691,7 @@  discard block
 block discarded – undo
691 691
     }
692 692
     $persoFlds = DB::query(
693 693
         'SELECT id
694
-        FROM ' . prefixTable('nested_tree') . '
694
+        FROM ' . prefixTable('nested_tree').'
695 695
         WHERE %l',
696 696
         $where
697 697
     );
@@ -759,12 +759,12 @@  discard block
 block discarded – undo
759 759
     //Load Tree
760 760
     $tree = new NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title');
761 761
     // truncate table
762
-    DB::query('TRUNCATE TABLE ' . prefixTable('cache'));
762
+    DB::query('TRUNCATE TABLE '.prefixTable('cache'));
763 763
     // reload date
764 764
     $rows = DB::query(
765 765
         'SELECT *
766
-        FROM ' . prefixTable('items') . ' as i
767
-        INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id)
766
+        FROM ' . prefixTable('items').' as i
767
+        INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id)
768 768
         AND l.action = %s
769 769
         AND i.inactif = %i',
770 770
         'at_creation',
@@ -776,18 +776,18 @@  discard block
 block discarded – undo
776 776
             $tags = '';
777 777
             $itemTags = DB::query(
778 778
                 'SELECT tag
779
-                FROM ' . prefixTable('tags') . '
779
+                FROM ' . prefixTable('tags').'
780 780
                 WHERE item_id = %i AND tag != ""',
781 781
                 $record['id']
782 782
             );
783 783
             foreach ($itemTags as $itemTag) {
784
-                $tags .= $itemTag['tag'] . ' ';
784
+                $tags .= $itemTag['tag'].' ';
785 785
             }
786 786
 
787 787
             // Get renewal period
788 788
             $resNT = DB::queryfirstrow(
789 789
                 'SELECT renewal_period
790
-                FROM ' . prefixTable('nested_tree') . '
790
+                FROM ' . prefixTable('nested_tree').'
791 791
                 WHERE id = %i',
792 792
                 $record['id_tree']
793 793
             );
@@ -800,7 +800,7 @@  discard block
 block discarded – undo
800 800
                     // Is this a User id?
801 801
                     $user = DB::queryfirstrow(
802 802
                         'SELECT id, login
803
-                        FROM ' . prefixTable('users') . '
803
+                        FROM ' . prefixTable('users').'
804 804
                         WHERE id = %i',
805 805
                         $elem->title
806 806
                     );
@@ -818,11 +818,11 @@  discard block
 block discarded – undo
818 818
                     'id' => $record['id'],
819 819
                     'label' => $record['label'],
820 820
                     'description' => $record['description'] ?? '',
821
-                    'url' => isset($record['url']) && ! empty($record['url']) ? $record['url'] : '0',
821
+                    'url' => isset($record['url']) && !empty($record['url']) ? $record['url'] : '0',
822 822
                     'tags' => $tags,
823 823
                     'id_tree' => $record['id_tree'],
824 824
                     'perso' => $record['perso'],
825
-                    'restricted_to' => isset($record['restricted_to']) && ! empty($record['restricted_to']) ? $record['restricted_to'] : '0',
825
+                    'restricted_to' => isset($record['restricted_to']) && !empty($record['restricted_to']) ? $record['restricted_to'] : '0',
826 826
                     'login' => $record['login'] ?? '',
827 827
                     'folder' => implode(' > ', $folder),
828 828
                     'author' => $record['id_user'],
@@ -851,7 +851,7 @@  discard block
 block discarded – undo
851 851
     // get new value from db
852 852
     $data = DB::queryfirstrow(
853 853
         'SELECT label, description, id_tree, perso, restricted_to, login, url
854
-        FROM ' . prefixTable('items') . '
854
+        FROM ' . prefixTable('items').'
855 855
         WHERE id=%i',
856 856
         $ident
857 857
     );
@@ -859,12 +859,12 @@  discard block
 block discarded – undo
859 859
     $tags = '';
860 860
     $itemTags = DB::query(
861 861
         'SELECT tag
862
-            FROM ' . prefixTable('tags') . '
862
+            FROM ' . prefixTable('tags').'
863 863
             WHERE item_id = %i AND tag != ""',
864 864
         $ident
865 865
     );
866 866
     foreach ($itemTags as $itemTag) {
867
-        $tags .= $itemTag['tag'] . ' ';
867
+        $tags .= $itemTag['tag'].' ';
868 868
     }
869 869
     // form id_tree to full foldername
870 870
     $folder = [];
@@ -875,7 +875,7 @@  discard block
 block discarded – undo
875 875
             // Is this a User id?
876 876
             $user = DB::queryfirstrow(
877 877
                 'SELECT id, login
878
-                FROM ' . prefixTable('users') . '
878
+                FROM ' . prefixTable('users').'
879 879
                 WHERE id = %i',
880 880
                 $elem->title
881 881
             );
@@ -893,10 +893,10 @@  discard block
 block discarded – undo
893 893
             'label' => $data['label'],
894 894
             'description' => $data['description'],
895 895
             'tags' => $tags,
896
-            'url' => isset($data['url']) && ! empty($data['url']) ? $data['url'] : '0',
896
+            'url' => isset($data['url']) && !empty($data['url']) ? $data['url'] : '0',
897 897
             'id_tree' => $data['id_tree'],
898 898
             'perso' => $data['perso'],
899
-            'restricted_to' => isset($data['restricted_to']) && ! empty($data['restricted_to']) ? $data['restricted_to'] : '0',
899
+            'restricted_to' => isset($data['restricted_to']) && !empty($data['restricted_to']) ? $data['restricted_to'] : '0',
900 900
             'login' => $data['login'] ?? '',
901 901
             'folder' => implode(' » ', $folder),
902 902
             'author' => $session->get('user-id'),
@@ -926,8 +926,8 @@  discard block
 block discarded – undo
926 926
     // get new value from db
927 927
     $data = DB::queryFirstRow(
928 928
         'SELECT i.label, i.description, i.id_tree as id_tree, i.perso, i.restricted_to, i.id, i.login, i.url, l.date
929
-        FROM ' . prefixTable('items') . ' as i
930
-        INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id)
929
+        FROM ' . prefixTable('items').' as i
930
+        INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id)
931 931
         WHERE i.id = %i
932 932
         AND l.action = %s',
933 933
         $ident,
@@ -937,12 +937,12 @@  discard block
 block discarded – undo
937 937
     $tags = '';
938 938
     $itemTags = DB::query(
939 939
         'SELECT tag
940
-            FROM ' . prefixTable('tags') . '
940
+            FROM ' . prefixTable('tags').'
941 941
             WHERE item_id = %i AND tag != ""',
942 942
         $ident
943 943
     );
944 944
     foreach ($itemTags as $itemTag) {
945
-        $tags .= $itemTag['tag'] . ' ';
945
+        $tags .= $itemTag['tag'].' ';
946 946
     }
947 947
     // form id_tree to full foldername
948 948
     $folder = [];
@@ -953,7 +953,7 @@  discard block
 block discarded – undo
953 953
             // Is this a User id?
954 954
             $user = DB::queryfirstrow(
955 955
                 'SELECT id, login
956
-                FROM ' . prefixTable('users') . '
956
+                FROM ' . prefixTable('users').'
957 957
                 WHERE id = %i',
958 958
                 $elem->title
959 959
             );
@@ -972,7 +972,7 @@  discard block
 block discarded – undo
972 972
             'label' => $data['label'],
973 973
             'description' => $data['description'],
974 974
             'tags' => isset($tags) && empty($tags) === false ? $tags : 'None',
975
-            'url' => isset($data['url']) && ! empty($data['url']) ? $data['url'] : '0',
975
+            'url' => isset($data['url']) && !empty($data['url']) ? $data['url'] : '0',
976 976
             'id_tree' => $data['id_tree'],
977 977
             'perso' => isset($data['perso']) && empty($data['perso']) === false && $data['perso'] !== 'None' ? $data['perso'] : '0',
978 978
             'restricted_to' => isset($data['restricted_to']) && empty($data['restricted_to']) === false ? $data['restricted_to'] : '0',
@@ -994,52 +994,52 @@  discard block
 block discarded – undo
994 994
 function getStatisticsData(array $SETTINGS): array
995 995
 {
996 996
     DB::query(
997
-        'SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE personal_folder = %i',
997
+        'SELECT id FROM '.prefixTable('nested_tree').' WHERE personal_folder = %i',
998 998
         0
999 999
     );
1000 1000
     $counter_folders = DB::count();
1001 1001
     DB::query(
1002
-        'SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE personal_folder = %i',
1002
+        'SELECT id FROM '.prefixTable('nested_tree').' WHERE personal_folder = %i',
1003 1003
         1
1004 1004
     );
1005 1005
     $counter_folders_perso = DB::count();
1006 1006
     DB::query(
1007
-        'SELECT id FROM ' . prefixTable('items') . ' WHERE perso = %i',
1007
+        'SELECT id FROM '.prefixTable('items').' WHERE perso = %i',
1008 1008
         0
1009 1009
     );
1010 1010
     $counter_items = DB::count();
1011 1011
         DB::query(
1012
-        'SELECT id FROM ' . prefixTable('items') . ' WHERE perso = %i',
1012
+        'SELECT id FROM '.prefixTable('items').' WHERE perso = %i',
1013 1013
         1
1014 1014
     );
1015 1015
     $counter_items_perso = DB::count();
1016 1016
         DB::query(
1017
-        'SELECT id FROM ' . prefixTable('users') . ''
1017
+        'SELECT id FROM '.prefixTable('users').''
1018 1018
     );
1019 1019
     $counter_users = DB::count();
1020 1020
         DB::query(
1021
-        'SELECT id FROM ' . prefixTable('users') . ' WHERE admin = %i',
1021
+        'SELECT id FROM '.prefixTable('users').' WHERE admin = %i',
1022 1022
         1
1023 1023
     );
1024 1024
     $admins = DB::count();
1025 1025
     DB::query(
1026
-        'SELECT id FROM ' . prefixTable('users') . ' WHERE gestionnaire = %i',
1026
+        'SELECT id FROM '.prefixTable('users').' WHERE gestionnaire = %i',
1027 1027
         1
1028 1028
     );
1029 1029
     $managers = DB::count();
1030 1030
     DB::query(
1031
-        'SELECT id FROM ' . prefixTable('users') . ' WHERE read_only = %i',
1031
+        'SELECT id FROM '.prefixTable('users').' WHERE read_only = %i',
1032 1032
         1
1033 1033
     );
1034 1034
     $readOnly = DB::count();
1035 1035
     // list the languages
1036 1036
     $usedLang = [];
1037 1037
     $tp_languages = DB::query(
1038
-        'SELECT name FROM ' . prefixTable('languages')
1038
+        'SELECT name FROM '.prefixTable('languages')
1039 1039
     );
1040 1040
     foreach ($tp_languages as $tp_language) {
1041 1041
         DB::query(
1042
-            'SELECT * FROM ' . prefixTable('users') . ' WHERE user_language = %s',
1042
+            'SELECT * FROM '.prefixTable('users').' WHERE user_language = %s',
1043 1043
             $tp_language['name']
1044 1044
         );
1045 1045
         $usedLang[$tp_language['name']] = round((DB::count() * 100 / $counter_users), 0);
@@ -1048,12 +1048,12 @@  discard block
 block discarded – undo
1048 1048
     // get list of ips
1049 1049
     $usedIp = [];
1050 1050
     $tp_ips = DB::query(
1051
-        'SELECT user_ip FROM ' . prefixTable('users')
1051
+        'SELECT user_ip FROM '.prefixTable('users')
1052 1052
     );
1053 1053
     foreach ($tp_ips as $ip) {
1054 1054
         if (array_key_exists($ip['user_ip'], $usedIp)) {
1055 1055
             $usedIp[$ip['user_ip']] += $usedIp[$ip['user_ip']];
1056
-        } elseif (! empty($ip['user_ip']) && $ip['user_ip'] !== 'none') {
1056
+        } elseif (!empty($ip['user_ip']) && $ip['user_ip'] !== 'none') {
1057 1057
             $usedIp[$ip['user_ip']] = 1;
1058 1058
         }
1059 1059
     }
@@ -1206,7 +1206,7 @@  discard block
 block discarded – undo
1206 1206
 {
1207 1207
     // Load PHPMailer
1208 1208
     $mail = new PHPMailer(true);
1209
-    $languageDir = $SETTINGS['cpassman_dir'] . '/vendor/phpmailer/phpmailer/language/';
1209
+    $languageDir = $SETTINGS['cpassman_dir'].'/vendor/phpmailer/phpmailer/language/';
1210 1210
 
1211 1211
     try {
1212 1212
         // Set language and SMTPDebug
@@ -1297,7 +1297,7 @@  discard block
 block discarded – undo
1297 1297
         <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;">
1298 1298
         <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;">
1299 1299
         <br><div style="float:right;">' .
1300
-        $textMail .
1300
+        $textMail.
1301 1301
         '<br><br></td></tr></table>
1302 1302
     </td></tr></table>
1303 1303
     <br></body></html>';
@@ -1310,7 +1310,7 @@  discard block
 block discarded – undo
1310 1310
  */
1311 1311
 function generateKey(): string
1312 1312
 {
1313
-    return substr(md5(rand() . rand()), 0, 15);
1313
+    return substr(md5(rand().rand()), 0, 15);
1314 1314
 }
1315 1315
 
1316 1316
 /**
@@ -1388,7 +1388,7 @@  discard block
 block discarded – undo
1388 1388
 {
1389 1389
     array_walk_recursive(
1390 1390
         $array,
1391
-        static function (&$item): void {
1391
+        static function(&$item): void {
1392 1392
             if (mb_detect_encoding((string) $item, 'utf-8', true) === false) {
1393 1393
                 $item = mb_convert_encoding($item, 'ISO-8859-1', 'UTF-8');
1394 1394
             }
@@ -1481,7 +1481,7 @@  discard block
 block discarded – undo
1481 1481
  */
1482 1482
 function prefixTable(string $table): string
1483 1483
 {
1484
-    $safeTable = htmlspecialchars(DB_PREFIX . $table);
1484
+    $safeTable = htmlspecialchars(DB_PREFIX.$table);
1485 1485
     if (empty($safeTable) === false) {
1486 1486
         // sanitize string
1487 1487
         return $safeTable;
@@ -1545,7 +1545,7 @@  discard block
 block discarded – undo
1545 1545
 function send_syslog($message, $host, $port, $component = 'teampass'): void
1546 1546
 {
1547 1547
     $sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
1548
-    $syslog_message = '<123>' . date('M d H:i:s ') . $component . ': ' . $message;
1548
+    $syslog_message = '<123>'.date('M d H:i:s ').$component.': '.$message;
1549 1549
     socket_sendto($sock, (string) $syslog_message, strlen($syslog_message), 0, (string) $host, (int) $port);
1550 1550
     socket_close($sock);
1551 1551
 }
@@ -1592,14 +1592,14 @@  discard block
 block discarded – undo
1592 1592
     if (isset($SETTINGS['syslog_enable']) === true && (int) $SETTINGS['syslog_enable'] === 1) {
1593 1593
         if ($type === 'user_mngt') {
1594 1594
             send_syslog(
1595
-                'action=' . str_replace('at_', '', $label) . ' attribute=user user=' . $who . ' userid="' . $login . '" change="' . $field_1 . '" ',
1595
+                'action='.str_replace('at_', '', $label).' attribute=user user='.$who.' userid="'.$login.'" change="'.$field_1.'" ',
1596 1596
                 $SETTINGS['syslog_host'],
1597 1597
                 $SETTINGS['syslog_port'],
1598 1598
                 'teampass'
1599 1599
             );
1600 1600
         } else {
1601 1601
             send_syslog(
1602
-                'action=' . $type . ' attribute=' . $label . ' user=' . $who . ' userid="' . $login . '" ',
1602
+                'action='.$type.' attribute='.$label.' user='.$who.' userid="'.$login.'" ',
1603 1603
                 $SETTINGS['syslog_host'],
1604 1604
                 $SETTINGS['syslog_port'],
1605 1605
                 'teampass'
@@ -1673,7 +1673,7 @@  discard block
 block discarded – undo
1673 1673
         if (empty($item_label) === true) {
1674 1674
             $dataItem = DB::queryfirstrow(
1675 1675
                 'SELECT id, id_tree, label
1676
-                FROM ' . prefixTable('items') . '
1676
+                FROM ' . prefixTable('items').'
1677 1677
                 WHERE id = %i',
1678 1678
                 $item_id
1679 1679
             );
@@ -1681,11 +1681,11 @@  discard block
 block discarded – undo
1681 1681
         }
1682 1682
 
1683 1683
         send_syslog(
1684
-            'action=' . str_replace('at_', '', $action) .
1685
-                ' attribute=' . str_replace('at_', '', $attribute[0]) .
1686
-                ' itemno=' . $item_id .
1687
-                ' user=' . is_null($login) === true ? '' : addslashes((string) $login) .
1688
-                ' itemname="' . addslashes($item_label) . '"',
1684
+            'action='.str_replace('at_', '', $action).
1685
+                ' attribute='.str_replace('at_', '', $attribute[0]).
1686
+                ' itemno='.$item_id.
1687
+                ' user='.is_null($login) === true ? '' : addslashes((string) $login).
1688
+                ' itemname="'.addslashes($item_label).'"',
1689 1689
             $SETTINGS['syslog_host'],
1690 1690
             $SETTINGS['syslog_port'],
1691 1691
             'teampass'
@@ -1717,8 +1717,8 @@  discard block
 block discarded – undo
1717 1717
     $notification = DB::queryOneColumn(
1718 1718
         'email',
1719 1719
         'SELECT *
1720
-        FROM ' . prefixTable('notification') . ' AS n
1721
-        INNER JOIN ' . prefixTable('users') . ' AS u ON (n.user_id = u.id)
1720
+        FROM ' . prefixTable('notification').' AS n
1721
+        INNER JOIN ' . prefixTable('users').' AS u ON (n.user_id = u.id)
1722 1722
         WHERE n.item_id = %i AND n.user_id != %i',
1723 1723
         $item_id,
1724 1724
         $globalsUserId
@@ -1729,7 +1729,7 @@  discard block
 block discarded – undo
1729 1729
         // Get list of changes
1730 1730
         $htmlChanges = '<ul>';
1731 1731
         foreach ($changes as $change) {
1732
-            $htmlChanges .= '<li>' . $change . '</li>';
1732
+            $htmlChanges .= '<li>'.$change.'</li>';
1733 1733
         }
1734 1734
         $htmlChanges .= '</ul>';
1735 1735
         // send email
@@ -1766,15 +1766,15 @@  discard block
 block discarded – undo
1766 1766
     $path = '';
1767 1767
     foreach ($arbo as $elem) {
1768 1768
         if (empty($path) === true) {
1769
-            $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES) . ' ';
1769
+            $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES).' ';
1770 1770
         } else {
1771
-            $path .= '&#8594; ' . htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
1771
+            $path .= '&#8594; '.htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
1772 1772
         }
1773 1773
     }
1774 1774
 
1775 1775
     // Build text to show user
1776 1776
     if (empty($label) === false) {
1777
-        return empty($path) === true ? addslashes($label) : addslashes($label) . ' (' . $path . ')';
1777
+        return empty($path) === true ? addslashes($label) : addslashes($label).' ('.$path.')';
1778 1778
     }
1779 1779
     return empty($path) === true ? '' : $path;
1780 1780
 }
@@ -1831,7 +1831,7 @@  discard block
 block discarded – undo
1831 1831
  */
1832 1832
 function handleConfigFile($action, $SETTINGS, $field = null, $value = null)
1833 1833
 {
1834
-    $tp_config_file = $SETTINGS['cpassman_dir'] . '/includes/config/tp.config.php';
1834
+    $tp_config_file = $SETTINGS['cpassman_dir'].'/includes/config/tp.config.php';
1835 1835
 
1836 1836
     // Load class DB
1837 1837
     loadClasses('DB');
@@ -1839,8 +1839,8 @@  discard block
 block discarded – undo
1839 1839
     if (file_exists($tp_config_file) === false || $action === 'rebuild') {
1840 1840
         // perform a copy
1841 1841
         if (file_exists($tp_config_file)) {
1842
-            if (! copy($tp_config_file, $tp_config_file . '.' . date('Y_m_d_His', time()))) {
1843
-                return "ERROR: Could not copy file '" . $tp_config_file . "'";
1842
+            if (!copy($tp_config_file, $tp_config_file.'.'.date('Y_m_d_His', time()))) {
1843
+                return "ERROR: Could not copy file '".$tp_config_file."'";
1844 1844
             }
1845 1845
         }
1846 1846
 
@@ -1850,11 +1850,11 @@  discard block
 block discarded – undo
1850 1850
         $data[1] = "global \$SETTINGS;\n";
1851 1851
         $data[2] = "\$SETTINGS = array (\n";
1852 1852
         $rows = DB::query(
1853
-            'SELECT * FROM ' . prefixTable('misc') . ' WHERE type=%s',
1853
+            'SELECT * FROM '.prefixTable('misc').' WHERE type=%s',
1854 1854
             'admin'
1855 1855
         );
1856 1856
         foreach ($rows as $record) {
1857
-            array_push($data, "    '" . $record['intitule'] . "' => '" . htmlspecialchars_decode($record['valeur'], ENT_COMPAT) . "',\n");
1857
+            array_push($data, "    '".$record['intitule']."' => '".htmlspecialchars_decode($record['valeur'], ENT_COMPAT)."',\n");
1858 1858
         }
1859 1859
         array_push($data, ");\n");
1860 1860
         $data = array_unique($data);
@@ -1868,15 +1868,15 @@  discard block
 block discarded – undo
1868 1868
                 break;
1869 1869
             }
1870 1870
 
1871
-            if (stristr($line, "'" . $field . "' => '")) {
1872
-                $data[$inc] = "    '" . $field . "' => '" . htmlspecialchars_decode($value ?? '', ENT_COMPAT) . "',\n";
1871
+            if (stristr($line, "'".$field."' => '")) {
1872
+                $data[$inc] = "    '".$field."' => '".htmlspecialchars_decode($value ?? '', ENT_COMPAT)."',\n";
1873 1873
                 $bFound = true;
1874 1874
                 break;
1875 1875
             }
1876 1876
             ++$inc;
1877 1877
         }
1878 1878
         if ($bFound === false) {
1879
-            $data[$inc] = "    '" . $field . "' => '" . htmlspecialchars_decode($value ?? '', ENT_COMPAT). "',\n);\n";
1879
+            $data[$inc] = "    '".$field."' => '".htmlspecialchars_decode($value ?? '', ENT_COMPAT)."',\n);\n";
1880 1880
         }
1881 1881
     }
1882 1882
 
@@ -1906,7 +1906,7 @@  discard block
 block discarded – undo
1906 1906
 {
1907 1907
     global $SETTINGS;
1908 1908
     /* LOAD CPASSMAN SETTINGS */
1909
-    if (! isset($SETTINGS['loaded']) || $SETTINGS['loaded'] !== 1) {
1909
+    if (!isset($SETTINGS['loaded']) || $SETTINGS['loaded'] !== 1) {
1910 1910
         $SETTINGS = [];
1911 1911
         $SETTINGS['duplicate_folder'] = 0;
1912 1912
         //by default, this is set to 0;
@@ -1916,7 +1916,7 @@  discard block
 block discarded – undo
1916 1916
         //by default, this value is set to 5;
1917 1917
         $settings = [];
1918 1918
         $rows = DB::query(
1919
-            'SELECT * FROM ' . prefixTable('misc') . ' WHERE type=%s_type OR type=%s_type2',
1919
+            'SELECT * FROM '.prefixTable('misc').' WHERE type=%s_type OR type=%s_type2',
1920 1920
             [
1921 1921
                 'type' => 'admin',
1922 1922
                 'type2' => 'settings',
@@ -1948,7 +1948,7 @@  discard block
 block discarded – undo
1948 1948
     $source_cf = [];
1949 1949
     $rows = DB::QUERY(
1950 1950
         'SELECT id_category
1951
-            FROM ' . prefixTable('categories_folders') . '
1951
+            FROM ' . prefixTable('categories_folders').'
1952 1952
             WHERE id_folder = %i',
1953 1953
         $source_id
1954 1954
     );
@@ -1959,7 +1959,7 @@  discard block
 block discarded – undo
1959 1959
     $target_cf = [];
1960 1960
     $rows = DB::QUERY(
1961 1961
         'SELECT id_category
1962
-            FROM ' . prefixTable('categories_folders') . '
1962
+            FROM ' . prefixTable('categories_folders').'
1963 1963
             WHERE id_folder = %i',
1964 1964
         $target_id
1965 1965
     );
@@ -2177,7 +2177,7 @@  discard block
 block discarded – undo
2177 2177
     int  $dirPerm = 0755
2178 2178
 ) {
2179 2179
     // Check if the path exists
2180
-    if (! file_exists($path)) {
2180
+    if (!file_exists($path)) {
2181 2181
         return false;
2182 2182
     }
2183 2183
 
@@ -2230,7 +2230,7 @@  discard block
 block discarded – undo
2230 2230
     // Load item data
2231 2231
     $data = DB::queryFirstRow(
2232 2232
         'SELECT id_tree
2233
-        FROM ' . prefixTable('items') . '
2233
+        FROM ' . prefixTable('items').'
2234 2234
         WHERE id = %i',
2235 2235
         $item_id
2236 2236
     );
@@ -2293,7 +2293,7 @@  discard block
 block discarded – undo
2293 2293
         }
2294 2294
         $host .= substr(explode(".", $email[1])[0], -1, 1);
2295 2295
     }
2296
-    $email = $name . "@" . $host . "." . explode(".", $email[1])[1];
2296
+    $email = $name."@".$host.".".explode(".", $email[1])[1];
2297 2297
     return $email;
2298 2298
 }
2299 2299
 
@@ -2316,7 +2316,7 @@  discard block
 block discarded – undo
2316 2316
     
2317 2317
     // Insert log in DB
2318 2318
     return DB::query(
2319
-        'SELECT ' . $fields . '
2319
+        'SELECT '.$fields.'
2320 2320
         FROM ' . prefixTable($table)
2321 2321
     );
2322 2322
 }
@@ -2331,11 +2331,11 @@  discard block
 block discarded – undo
2331 2331
 function formatSizeUnits(int $bytes): string
2332 2332
 {
2333 2333
     if ($bytes >= 1073741824) {
2334
-        $bytes = number_format($bytes / 1073741824, 2) . ' GB';
2334
+        $bytes = number_format($bytes / 1073741824, 2).' GB';
2335 2335
     } elseif ($bytes >= 1048576) {
2336
-        $bytes = number_format($bytes / 1048576, 2) . ' MB';
2336
+        $bytes = number_format($bytes / 1048576, 2).' MB';
2337 2337
     } elseif ($bytes >= 1024) {
2338
-        $bytes = number_format($bytes / 1024, 2) . ' KB';
2338
+        $bytes = number_format($bytes / 1024, 2).' KB';
2339 2339
     } elseif ($bytes > 1) {
2340 2340
         $bytes .= ' bytes';
2341 2341
     } elseif ($bytes === 1) {
@@ -2569,7 +2569,7 @@  discard block
 block discarded – undo
2569 2569
             return '';
2570 2570
         }
2571 2571
     } catch (Exception $e) {
2572
-        return 'Exception: ' . $e->getMessage();
2572
+        return 'Exception: '.$e->getMessage();
2573 2573
     }
2574 2574
 }
2575 2575
 
@@ -2599,14 +2599,14 @@  discard block
 block discarded – undo
2599 2599
 
2600 2600
         // Encrypt the file content
2601 2601
         $plaintext = file_get_contents(
2602
-            filter_var($fileInPath . '/' . $fileInName, FILTER_SANITIZE_URL)
2602
+            filter_var($fileInPath.'/'.$fileInName, FILTER_SANITIZE_URL)
2603 2603
         );
2604 2604
         $ciphertext = $cipher->encrypt($plaintext);
2605 2605
         // Save new file
2606 2606
         $hash = md5($plaintext);
2607
-        $fileOut = $fileInPath . '/' . TP_FILE_PREFIX . $hash;
2607
+        $fileOut = $fileInPath.'/'.TP_FILE_PREFIX.$hash;
2608 2608
         file_put_contents($fileOut, $ciphertext);
2609
-        unlink($fileInPath . '/' . $fileInName);
2609
+        unlink($fileInPath.'/'.$fileInName);
2610 2610
         return [
2611 2611
             'fileHash' => base64_encode($hash),
2612 2612
             'objectKey' => base64_encode($objectKey),
@@ -2627,7 +2627,7 @@  discard block
 block discarded – undo
2627 2627
  */
2628 2628
 function decryptFile(string $fileName, string $filePath, string $key): string
2629 2629
 {
2630
-    if (! defined('FILE_BUFFER_SIZE')) {
2630
+    if (!defined('FILE_BUFFER_SIZE')) {
2631 2631
         define('FILE_BUFFER_SIZE', 128 * 1024);
2632 2632
     }
2633 2633
     
@@ -2643,7 +2643,7 @@  discard block
 block discarded – undo
2643 2643
         $cipher->enableContinuousBuffer();
2644 2644
         $cipher->disablePadding();
2645 2645
         // Get file content
2646
-        $ciphertext = file_get_contents($filePath . '/' . TP_FILE_PREFIX . $fileName);
2646
+        $ciphertext = file_get_contents($filePath.'/'.TP_FILE_PREFIX.$fileName);
2647 2647
         // Decrypt file content and return
2648 2648
         return base64_encode($cipher->decrypt($ciphertext));
2649 2649
     /*} else {
@@ -2725,8 +2725,8 @@  discard block
 block discarded – undo
2725 2725
         // Only create the sharekey for a user
2726 2726
         $user = DB::queryFirstRow(
2727 2727
             'SELECT public_key
2728
-            FROM ' . prefixTable('users') . '
2729
-            WHERE id = ' . (int) $session->get('user-id') . '
2728
+            FROM ' . prefixTable('users').'
2729
+            WHERE id = ' . (int) $session->get('user-id').'
2730 2730
             AND public_key != ""'
2731 2731
         );
2732 2732
 
@@ -2762,10 +2762,9 @@  discard block
 block discarded – undo
2762 2762
         //DB::debugmode(true);
2763 2763
         $users = DB::query(
2764 2764
             'SELECT id, public_key
2765
-            FROM ' . prefixTable('users') . '
2765
+            FROM ' . prefixTable('users').'
2766 2766
             WHERE ' . ($onlyForUser === true ? 
2767
-                'id IN ("' . TP_USER_ID . '","' . $session->get('user-id') . '") ' : 
2768
-                'id NOT IN ("' . OTV_USER_ID . '","' . SSH_USER_ID . '","' . API_USER_ID . '") ') . '
2767
+                'id IN ("'.TP_USER_ID.'","'.$session->get('user-id').'") ' : 'id NOT IN ("'.OTV_USER_ID.'","'.SSH_USER_ID.'","'.API_USER_ID.'") ').'
2769 2768
             AND public_key != ""'
2770 2769
         );
2771 2770
         //DB::debugmode(false);
@@ -2812,7 +2811,7 @@  discard block
 block discarded – undo
2812 2811
 function isBase64(string $str): bool
2813 2812
 {
2814 2813
     $str = (string) trim($str);
2815
-    if (! isset($str[0])) {
2814
+    if (!isset($str[0])) {
2816 2815
         return false;
2817 2816
     }
2818 2817
 
@@ -2885,7 +2884,7 @@  discard block
 block discarded – undo
2885 2884
         $connection->connect();
2886 2885
     } catch (\LdapRecord\Auth\BindException $e) {
2887 2886
         $error = $e->getDetailedError();
2888
-        echo 'Error : '.$error->getErrorCode().' - '.$error->getErrorMessage(). '<br>'.$error->getDiagnosticMessage();
2887
+        echo 'Error : '.$error->getErrorCode().' - '.$error->getErrorMessage().'<br>'.$error->getDiagnosticMessage();
2889 2888
         return false;
2890 2889
     }
2891 2890
 
@@ -2898,7 +2897,7 @@  discard block
 block discarded – undo
2898 2897
         }
2899 2898
     } catch (\LdapRecord\Auth\BindException $e) {
2900 2899
         $error = $e->getDetailedError();
2901
-        echo 'Error : '.$error->getErrorCode().' - '.$error->getErrorMessage(). '<br>'.$error->getDiagnosticMessage();
2900
+        echo 'Error : '.$error->getErrorCode().' - '.$error->getErrorMessage().'<br>'.$error->getDiagnosticMessage();
2902 2901
         return false;
2903 2902
     }
2904 2903
 
@@ -2922,7 +2921,7 @@  discard block
 block discarded – undo
2922 2921
     // expect if personal item
2923 2922
     DB::delete(
2924 2923
         prefixTable('sharekeys_items'),
2925
-        'user_id = %i AND object_id NOT IN (SELECT i.id FROM ' . prefixTable('items') . ' AS i WHERE i.perso = 1)',
2924
+        'user_id = %i AND object_id NOT IN (SELECT i.id FROM '.prefixTable('items').' AS i WHERE i.perso = 1)',
2926 2925
         $userId
2927 2926
     );
2928 2927
     // Remove all item sharekeys files
@@ -2930,8 +2929,8 @@  discard block
 block discarded – undo
2930 2929
         prefixTable('sharekeys_files'),
2931 2930
         'user_id = %i AND object_id NOT IN (
2932 2931
             SELECT f.id 
2933
-            FROM ' . prefixTable('items') . ' AS i 
2934
-            INNER JOIN ' . prefixTable('files') . ' AS f ON f.id_item = i.id
2932
+            FROM ' . prefixTable('items').' AS i 
2933
+            INNER JOIN ' . prefixTable('files').' AS f ON f.id_item = i.id
2935 2934
             WHERE i.perso = 1
2936 2935
         )',
2937 2936
         $userId
@@ -2941,8 +2940,8 @@  discard block
 block discarded – undo
2941 2940
         prefixTable('sharekeys_fields'),
2942 2941
         'user_id = %i AND object_id NOT IN (
2943 2942
             SELECT c.id 
2944
-            FROM ' . prefixTable('items') . ' AS i 
2945
-            INNER JOIN ' . prefixTable('categories_items') . ' AS c ON c.item_id = i.id
2943
+            FROM ' . prefixTable('items').' AS i 
2944
+            INNER JOIN ' . prefixTable('categories_items').' AS c ON c.item_id = i.id
2946 2945
             WHERE i.perso = 1
2947 2946
         )',
2948 2947
         $userId
@@ -2950,13 +2949,13 @@  discard block
 block discarded – undo
2950 2949
     // Remove all item sharekeys logs
2951 2950
     DB::delete(
2952 2951
         prefixTable('sharekeys_logs'),
2953
-        'user_id = %i AND object_id NOT IN (SELECT i.id FROM ' . prefixTable('items') . ' AS i WHERE i.perso = 1)',
2952
+        'user_id = %i AND object_id NOT IN (SELECT i.id FROM '.prefixTable('items').' AS i WHERE i.perso = 1)',
2954 2953
         $userId
2955 2954
     );
2956 2955
     // Remove all item sharekeys suggestions
2957 2956
     DB::delete(
2958 2957
         prefixTable('sharekeys_suggestions'),
2959
-        'user_id = %i AND object_id NOT IN (SELECT i.id FROM ' . prefixTable('items') . ' AS i WHERE i.perso = 1)',
2958
+        'user_id = %i AND object_id NOT IN (SELECT i.id FROM '.prefixTable('items').' AS i WHERE i.perso = 1)',
2960 2959
         $userId
2961 2960
     );
2962 2961
     return false;
@@ -2977,7 +2976,7 @@  discard block
 block discarded – undo
2977 2976
         foreach (DateTimeZone::listIdentifiers() as $timezone) {
2978 2977
             $now->setTimezone(new DateTimeZone($timezone));
2979 2978
             $offsets[] = $offset = $now->getOffset();
2980
-            $timezones[$timezone] = '(' . format_GMT_offset($offset) . ') ' . format_timezone_name($timezone);
2979
+            $timezones[$timezone] = '('.format_GMT_offset($offset).') '.format_timezone_name($timezone);
2981 2980
         }
2982 2981
 
2983 2982
         array_multisort($offsets, $timezones);
@@ -2997,7 +2996,7 @@  discard block
 block discarded – undo
2997 2996
 {
2998 2997
     $hours = intval($offset / 3600);
2999 2998
     $minutes = abs(intval($offset % 3600 / 60));
3000
-    return 'GMT' . ($offset ? sprintf('%+03d:%02d', $hours, $minutes) : '');
2999
+    return 'GMT'.($offset ? sprintf('%+03d:%02d', $hours, $minutes) : '');
3001 3000
 }
3002 3001
 
3003 3002
 /**
@@ -3097,8 +3096,7 @@  discard block
 block discarded – undo
3097 3096
 {
3098 3097
     if (isset($array[$key]) === true
3099 3098
         && (is_int($value) === true ?
3100
-            (int) $array[$key] === $value :
3101
-            (string) $array[$key] === $value)
3099
+            (int) $array[$key] === $value : (string) $array[$key] === $value)
3102 3100
     ) {
3103 3101
         return true;
3104 3102
     }
@@ -3120,8 +3118,7 @@  discard block
 block discarded – undo
3120 3118
 {
3121 3119
     if (isset($var) === false
3122 3120
         || (is_int($value) === true ?
3123
-            (int) $var === $value :
3124
-            (string) $var === $value)
3121
+            (int) $var === $value : (string) $var === $value)
3125 3122
     ) {
3126 3123
         return true;
3127 3124
     }
@@ -3172,7 +3169,7 @@  discard block
 block discarded – undo
3172 3169
  */
3173 3170
 function isSetArrayOfValues(array $arrayOfValues): bool
3174 3171
 {
3175
-    foreach($arrayOfValues as $value) {
3172
+    foreach ($arrayOfValues as $value) {
3176 3173
         if (isset($value) === false) {
3177 3174
             return false;
3178 3175
         }
@@ -3194,7 +3191,7 @@  discard block
 block discarded – undo
3194 3191
     /*PHP8 - integer|string*/$value
3195 3192
 ) : bool
3196 3193
 {
3197
-    foreach($arrayOfVars as $variable) {
3194
+    foreach ($arrayOfVars as $variable) {
3198 3195
         if ($variable !== $value) {
3199 3196
             return false;
3200 3197
         }
@@ -3214,7 +3211,7 @@  discard block
 block discarded – undo
3214 3211
     /*PHP8 - integer|string*/$value
3215 3212
 ) : bool
3216 3213
 {
3217
-    foreach($arrayOfVars as $variable) {
3214
+    foreach ($arrayOfVars as $variable) {
3218 3215
         if ($variable === $value) {
3219 3216
             return true;
3220 3217
         }
@@ -3282,7 +3279,7 @@  discard block
 block discarded – undo
3282 3279
  * @param array     $filters
3283 3280
  * @return array|string
3284 3281
  */
3285
-function dataSanitizer(array $data, array $filters): array|string
3282
+function dataSanitizer(array $data, array $filters): array | string
3286 3283
 {
3287 3284
     // Load Sanitizer library
3288 3285
     $sanitizer = new Sanitizer($data, $filters);
@@ -3311,7 +3308,7 @@  discard block
 block discarded – undo
3311 3308
     // Exists ?
3312 3309
     $userCacheId = DB::queryfirstrow(
3313 3310
         'SELECT increment_id
3314
-        FROM ' . prefixTable('cache_tree') . '
3311
+        FROM ' . prefixTable('cache_tree').'
3315 3312
         WHERE user_id = %i',
3316 3313
         $user_id
3317 3314
     );
@@ -3362,7 +3359,7 @@  discard block
 block discarded – undo
3362 3359
  */
3363 3360
 function pourcentage(float $nombre, float $total, float $pourcentage): float
3364 3361
 { 
3365
-    $resultat = ($nombre/$total) * $pourcentage;
3362
+    $resultat = ($nombre / $total) * $pourcentage;
3366 3363
     return round($resultat);
3367 3364
 }
3368 3365
 
@@ -3392,7 +3389,7 @@  discard block
 block discarded – undo
3392 3389
 
3393 3390
     // Get last folder update
3394 3391
     $lastFolderChange = DB::queryfirstrow(
3395
-        'SELECT valeur FROM ' . prefixTable('misc') . '
3392
+        'SELECT valeur FROM '.prefixTable('misc').'
3396 3393
         WHERE type = %s AND intitule = %s',
3397 3394
         'timestamp',
3398 3395
         'last_folder_change'
@@ -3422,7 +3419,7 @@  discard block
 block discarded – undo
3422 3419
     // Does this user has a tree cache
3423 3420
     $userCacheTree = DB::queryfirstrow(
3424 3421
         'SELECT '.$fieldName.'
3425
-        FROM ' . prefixTable('cache_tree') . '
3422
+        FROM ' . prefixTable('cache_tree').'
3426 3423
         WHERE user_id = %i',
3427 3424
         $session->get('user-id')
3428 3425
     );
@@ -3464,7 +3461,7 @@  discard block
 block discarded – undo
3464 3461
     if (count($folderIds) === 0) {
3465 3462
         $folderIds = DB::queryFirstColumn(
3466 3463
             'SELECT id
3467
-            FROM ' . prefixTable('nested_tree') . '
3464
+            FROM ' . prefixTable('nested_tree').'
3468 3465
             WHERE personal_folder=%i',
3469 3466
             0
3470 3467
         );
@@ -3481,8 +3478,8 @@  discard block
 block discarded – undo
3481 3478
         $rows_tmp = DB::query(
3482 3479
             'SELECT c.id, c.title, c.level, c.type, c.masked, c.order, c.encrypted_data, c.role_visibility, c.is_mandatory,
3483 3480
             f.id_category AS category_id
3484
-            FROM ' . prefixTable('categories_folders') . ' AS f
3485
-            INNER JOIN ' . prefixTable('categories') . ' AS c ON (f.id_category = c.parent_id)
3481
+            FROM ' . prefixTable('categories_folders').' AS f
3482
+            INNER JOIN ' . prefixTable('categories').' AS c ON (f.id_category = c.parent_id)
3486 3483
             WHERE id_folder=%i',
3487 3484
             $folder
3488 3485
         );
@@ -3508,7 +3505,7 @@  discard block
 block discarded – undo
3508 3505
         $valTemp = '';
3509 3506
         $data = DB::queryFirstRow(
3510 3507
             'SELECT valeur
3511
-            FROM ' . prefixTable('misc') . '
3508
+            FROM ' . prefixTable('misc').'
3512 3509
             WHERE type = %s AND intitule=%i',
3513 3510
             'complex',
3514 3511
             $folder
@@ -3525,14 +3522,14 @@  discard block
 block discarded – undo
3525 3522
         $valTemp = '';
3526 3523
         $rows_tmp = DB::query(
3527 3524
             'SELECT t.title
3528
-            FROM ' . prefixTable('roles_values') . ' as v
3529
-            INNER JOIN ' . prefixTable('roles_title') . ' as t ON (v.role_id = t.id)
3525
+            FROM ' . prefixTable('roles_values').' as v
3526
+            INNER JOIN ' . prefixTable('roles_title').' as t ON (v.role_id = t.id)
3530 3527
             WHERE v.folder_id = %i
3531 3528
             GROUP BY title',
3532 3529
             $folder
3533 3530
         );
3534 3531
         foreach ($rows_tmp as $record) {
3535
-            $valTemp .= (empty($valTemp) === true ? '' : ' - ') . $record['title'];
3532
+            $valTemp .= (empty($valTemp) === true ? '' : ' - ').$record['title'];
3536 3533
         }
3537 3534
         $arr_data['visibilityRoles'] = $valTemp;
3538 3535
 
@@ -3565,7 +3562,7 @@  discard block
 block discarded – undo
3565 3562
         // loop on users and check if user has this role
3566 3563
         $rows = DB::query(
3567 3564
             'SELECT id, fonction_id
3568
-            FROM ' . prefixTable('users') . '
3565
+            FROM ' . prefixTable('users').'
3569 3566
             WHERE id != %i AND admin = 0 AND fonction_id IS NOT NULL AND fonction_id != ""',
3570 3567
             $session->get('user-id')
3571 3568
         );
@@ -3597,7 +3594,7 @@  discard block
 block discarded – undo
3597 3594
 
3598 3595
     $val = DB::queryfirstrow(
3599 3596
         'SELECT *
3600
-        FROM ' . prefixTable('users') . '
3597
+        FROM ' . prefixTable('users').'
3601 3598
         WHERE id = %i',
3602 3599
         $userId
3603 3600
     );
@@ -3613,12 +3610,12 @@  discard block
 block discarded – undo
3613 3610
 function upgradeRequired(): bool
3614 3611
 {
3615 3612
     // Get settings.php
3616
-    include_once __DIR__. '/../includes/config/settings.php';
3613
+    include_once __DIR__.'/../includes/config/settings.php';
3617 3614
 
3618 3615
     // Get timestamp in DB
3619 3616
     $val = DB::queryfirstrow(
3620 3617
         'SELECT valeur
3621
-        FROM ' . prefixTable('misc') . '
3618
+        FROM ' . prefixTable('misc').'
3622 3619
         WHERE type = %s AND intitule = %s',
3623 3620
         'admin',
3624 3621
         'upgrade_timestamp'
@@ -3673,7 +3670,7 @@  discard block
 block discarded – undo
3673 3670
     // prepapre background tasks for item keys generation        
3674 3671
     $userTP = DB::queryFirstRow(
3675 3672
         'SELECT pw, public_key, private_key
3676
-        FROM ' . prefixTable('users') . '
3673
+        FROM ' . prefixTable('users').'
3677 3674
         WHERE id = %i',
3678 3675
         TP_USER_ID
3679 3676
     );
@@ -3707,7 +3704,7 @@  discard block
 block discarded – undo
3707 3704
     }
3708 3705
 
3709 3706
     // Generate new keys
3710
-    if ($user_self_change === true && empty($recovery_public_key) === false && empty($recovery_private_key) === false){
3707
+    if ($user_self_change === true && empty($recovery_public_key) === false && empty($recovery_private_key) === false) {
3711 3708
         $userKeys = [
3712 3709
             'public_key' => $recovery_public_key,
3713 3710
             'private_key_clear' => $recovery_private_key,
@@ -3747,8 +3744,8 @@  discard block
 block discarded – undo
3747 3744
             'process_type' => 'create_user_keys',
3748 3745
             'arguments' => json_encode([
3749 3746
                 'new_user_id' => (int) $userId,
3750
-                'new_user_pwd' => cryption($passwordClear, '','encrypt')['string'],
3751
-                'new_user_code' => cryption(empty($encryptionKey) === true ? uniqidReal(20) : $encryptionKey, '','encrypt')['string'],
3747
+                'new_user_pwd' => cryption($passwordClear, '', 'encrypt')['string'],
3748
+                'new_user_code' => cryption(empty($encryptionKey) === true ? uniqidReal(20) : $encryptionKey, '', 'encrypt')['string'],
3752 3749
                 'owner_id' => (int) TP_USER_ID,
3753 3750
                 'creator_pwd' => $userTP['pw'],
3754 3751
                 'send_email' => $sendEmailToUser === true ? 1 : 0,
@@ -4056,7 +4053,7 @@  discard block
 block discarded – undo
4056 4053
  * @param integer $user_id
4057 4054
  * @return void
4058 4055
  */
4059
-function purgeUnnecessaryKeys(bool $allUsers = true, int $user_id=0)
4056
+function purgeUnnecessaryKeys(bool $allUsers = true, int $user_id = 0)
4060 4057
 {
4061 4058
     if ($allUsers === true) {
4062 4059
         // Load class DB
@@ -4066,7 +4063,7 @@  discard block
 block discarded – undo
4066 4063
 
4067 4064
         $users = DB::query(
4068 4065
             'SELECT id
4069
-            FROM ' . prefixTable('users') . '
4066
+            FROM ' . prefixTable('users').'
4070 4067
             WHERE id NOT IN ('.OTV_USER_ID.', '.TP_USER_ID.', '.SSH_USER_ID.', '.API_USER_ID.')
4071 4068
             ORDER BY login ASC'
4072 4069
         );
@@ -4084,7 +4081,7 @@  discard block
 block discarded – undo
4084 4081
  * @param integer $user_id
4085 4082
  * @return void
4086 4083
  */
4087
-function purgeUnnecessaryKeysForUser(int $user_id=0)
4084
+function purgeUnnecessaryKeysForUser(int $user_id = 0)
4088 4085
 {
4089 4086
     if ($user_id === 0) {
4090 4087
         return;
@@ -4095,8 +4092,8 @@  discard block
 block discarded – undo
4095 4092
 
4096 4093
     $personalItems = DB::queryFirstColumn(
4097 4094
         'SELECT id
4098
-        FROM ' . prefixTable('items') . ' AS i
4099
-        INNER JOIN ' . prefixTable('log_items') . ' AS li ON li.id_item = i.id
4095
+        FROM ' . prefixTable('items').' AS i
4096
+        INNER JOIN ' . prefixTable('log_items').' AS li ON li.id_item = i.id
4100 4097
         WHERE i.perso = 1 AND li.action = "at_creation" AND li.id_user IN (%i, '.TP_USER_ID.')',
4101 4098
         $user_id
4102 4099
     );
@@ -4145,7 +4142,7 @@  discard block
 block discarded – undo
4145 4142
     // Check if user exists
4146 4143
     $userInfo = DB::queryFirstRow(
4147 4144
         'SELECT pw, public_key, private_key, login, name
4148
-        FROM ' . prefixTable('users') . '
4145
+        FROM ' . prefixTable('users').'
4149 4146
         WHERE id = %i',
4150 4147
         $userId
4151 4148
     );
@@ -4155,7 +4152,7 @@  discard block
 block discarded – undo
4155 4152
 
4156 4153
         // Prepare file content
4157 4154
         $export_value = file_get_contents(__DIR__."/../includes/core/teampass_ascii.txt")."\n".
4158
-            "Generation date: ".date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], $now)."\n\n".
4155
+            "Generation date: ".date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], $now)."\n\n".
4159 4156
             "RECOVERY KEYS - Not to be shared - To be store safely\n\n".
4160 4157
             "Public Key:\n".$userInfo['public_key']."\n\n".
4161 4158
             "Private Key:\n".decryptPrivateKey($session->get('user-password'), $userInfo['private_key'])."\n\n";
@@ -4178,7 +4175,7 @@  discard block
 block discarded – undo
4178 4175
         return prepareExchangedData(
4179 4176
             array(
4180 4177
                 'error' => false,
4181
-                'datetime' => date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], $now),
4178
+                'datetime' => date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], $now),
4182 4179
                 'timestamp' => $now,
4183 4180
                 'content' => base64_encode($export_value),
4184 4181
                 'login' => $userInfo['login'],
@@ -4204,8 +4201,8 @@  discard block
 block discarded – undo
4204 4201
  */
4205 4202
 function loadClasses(string $className = ''): void
4206 4203
 {
4207
-    require_once __DIR__. '/../includes/config/include.php';
4208
-    require_once __DIR__. '/../includes/config/settings.php';
4204
+    require_once __DIR__.'/../includes/config/include.php';
4205
+    require_once __DIR__.'/../includes/config/settings.php';
4209 4206
     require_once __DIR__.'/../vendor/autoload.php';
4210 4207
 
4211 4208
     if (defined('DB_PASSWD_CLEAR') === false) {
Please login to merge, or discard this patch.
api/Controller/Api/FolderController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
                     $arrFolders = $folderModel->getFoldersInfo(explode(",", $userData['folders_list']));
51 51
                     $responseData = json_encode($arrFolders);
52 52
                 } catch (Error $e) {
53
-                    $strErrorDesc = $e->getMessage() . ' Something went wrong! Please contact support.';
53
+                    $strErrorDesc = $e->getMessage().' Something went wrong! Please contact support.';
54 54
                     $strErrorHeader = 'HTTP/1.1 500 Internal Server Error';
55 55
                 }
56 56
             }
Please login to merge, or discard this patch.
scripts/background_tasks___sending_emails.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 DB::debugmode(false);
64 64
 $rows = DB::query(
65 65
     'SELECT *
66
-    FROM ' . prefixTable('processes') . '
66
+    FROM ' . prefixTable('processes').'
67 67
     WHERE is_in_progress = %i AND process_type = %s
68 68
     ORDER BY increment_id ASC LIMIT 0,10',
69 69
     0,
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 {
119 119
     //if ((int) $SETTINGS['enable_backlog_mail'] === 1) {
120 120
         $row = DB::queryFirstRow(
121
-            'SELECT valeur FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s',
121
+            'SELECT valeur FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s',
122 122
             'cron',
123 123
             'sending_emails'
124 124
         );
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
         if ((int) (time() - $row['valeur']) >= 300 || (int) $row['valeur'] === 0) {
127 127
             $rows = DB::query(
128 128
                 'SELECT *
129
-                FROM ' . prefixTable('emails') .
129
+                FROM ' . prefixTable('emails').
130 130
                 ' WHERE status != %s',
131 131
                 'sent'
132 132
             );
Please login to merge, or discard this patch.
pages/tasks.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -128,8 +128,7 @@
 block discarded – undo
128 128
                                             </div>
129 129
         <?php
130 130
     }
131
-}
132
-catch (Exception $e) {
131
+} catch (Exception $e) {
133 132
     echo $e->getMessage();
134 133
 }?>
135 134
                                     </div>
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('tasks') === false) {
60 60
     // Not allowed page
61 61
     $session->set('system-error_code', ERR_NOT_ALLOWED);
62
-    include $SETTINGS['cpassman_dir'] . '/error.php';
62
+    include $SETTINGS['cpassman_dir'].'/error.php';
63 63
     exit;
64 64
 }
65 65
 
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
                                             $task = isset($SETTINGS['users_personal_folder_task']) === true ? explode(";", $SETTINGS['users_personal_folder_task']) : [];
220 220
                                             ?>
221 221
                                             <input type='text' disabled class='form-control form-control-sm' id='users_personal_folder_task_parameter' value='<?php echo isset($task[0]) === true && empty($task[0]) === false ? $lang->get($task[0])." ".(isset($task[2]) === true ? strtolower($lang->get('day')).' '.$task[2].' ' : '').$lang->get('at')." ".$task[1] : $lang->get('not_defined') ?>'>
222
-                                            <input type='hidden' disabled class='form-control form-control-sm' id='users_personal_folder_task_parameter_value' value='<?php echo isset($task[0]) === true ? $task[0].";".$task[1].(isset($task[2]) === true ? ';'.$task[2] : '') : '';?>'>
222
+                                            <input type='hidden' disabled class='form-control form-control-sm' id='users_personal_folder_task_parameter_value' value='<?php echo isset($task[0]) === true ? $task[0].";".$task[1].(isset($task[2]) === true ? ';'.$task[2] : '') : ''; ?>'>
223 223
                                         </div>
224 224
                                         <div class='col-2'>
225 225
                                             <button class="btn btn-primary task-define" data-task="users_personal_folder_task">
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
                                             $task = isset($SETTINGS['clean_orphan_objects_task']) === true ? explode(";", $SETTINGS['clean_orphan_objects_task']) : [];
248 248
                                             ?>
249 249
                                             <input type='text' disabled class='form-control form-control-sm' id='clean_orphan_objects_task_parameter' value='<?php echo isset($task[0]) === true && empty($task[0]) === false ? $lang->get($task[0])." ".(isset($task[2]) === true ? strtolower($lang->get('day')).' '.$task[2].' ' : '').$lang->get('at')." ".$task[1] : $lang->get('not_defined') ?>'>
250
-                                            <input type='hidden' disabled class='form-control form-control-sm' id='clean_orphan_objects_task_parameter_value' value='<?php echo isset($task[0]) === true ? $task[0].";".$task[1].(isset($task[2]) === true ? ';'.$task[2] : '') : '';?>'>
250
+                                            <input type='hidden' disabled class='form-control form-control-sm' id='clean_orphan_objects_task_parameter_value' value='<?php echo isset($task[0]) === true ? $task[0].";".$task[1].(isset($task[2]) === true ? ';'.$task[2] : '') : ''; ?>'>
251 251
                                         </div>
252 252
                                         <div class='col-2'>
253 253
                                             <button class="btn btn-primary task-define" data-task="clean_orphan_objects_task">
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
                                             $task = isset($SETTINGS['purge_temporary_files_task']) === true ? explode(";", $SETTINGS['purge_temporary_files_task']) : [];
270 270
                                             ?>
271 271
                                             <input type='text' disabled class='form-control form-control-sm' id='purge_temporary_files_task_parameter' value='<?php echo isset($task[0]) === true && empty($task[0]) === false ? $lang->get($task[0])." ".(isset($task[2]) === true ? strtolower($lang->get('day')).' '.$task[2].' ' : '').$lang->get('at')." ".$task[1] : $lang->get('not_defined') ?>'>
272
-                                            <input type='hidden' disabled class='form-control form-control-sm' id='purge_temporary_files_task_parameter_value' value='<?php echo isset($task[0]) === true ? $task[0].";".$task[1].(isset($task[2]) === true ? ';'.$task[2] : '') : '';?>'>
272
+                                            <input type='hidden' disabled class='form-control form-control-sm' id='purge_temporary_files_task_parameter_value' value='<?php echo isset($task[0]) === true ? $task[0].";".$task[1].(isset($task[2]) === true ? ';'.$task[2] : '') : ''; ?>'>
273 273
                                         </div>
274 274
                                         <div class='col-2'>
275 275
                                             <button class="btn btn-primary task-define" data-task="purge_temporary_files_task">
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
                                             $task = isset($SETTINGS['reload_cache_table_task']) === true ? explode(";", $SETTINGS['reload_cache_table_task']) : [];
314 314
                                             ?>
315 315
                                             <input type='text' disabled class='form-control form-control-sm' id='reload_cache_table_task_parameter' value='<?php echo isset($task[0]) === true && empty($task[0]) === false ? $lang->get($task[0])." ".(isset($task[2]) === true ? strtolower($lang->get('day')).' '.$task[2].' ' : '').$lang->get('at')." ".$task[1] : $lang->get('not_defined') ?>'>
316
-                                            <input type='hidden' disabled class='form-control form-control-sm' id='reload_cache_table_task_parameter_value' value='<?php echo isset($task[0]) === true ? $task[0].";".$task[1].(isset($task[2]) === true ? ';'.$task[2] : '') : '';?>'>
316
+                                            <input type='hidden' disabled class='form-control form-control-sm' id='reload_cache_table_task_parameter_value' value='<?php echo isset($task[0]) === true ? $task[0].";".$task[1].(isset($task[2]) === true ? ';'.$task[2] : '') : ''; ?>'>
317 317
                                         </div>
318 318
                                         <div class='col-2'>
319 319
                                             <button class="btn btn-primary task-define" data-task="reload_cache_table_task">
@@ -506,7 +506,7 @@  discard block
 block discarded – undo
506 506
                         <h5><?php echo $lang->get('day_of_month'); ?></h5>              
507 507
                         <select class='form-control form-control-sm no-save' id='task-define-modal-parameter-monthly-value' style="width:100%;">
508 508
                             <?php
509
-                            for ($i=1; $i<=31; $i++) {
509
+                            for ($i = 1; $i <= 31; $i++) {
510 510
                                 echo '<option value="'.$i.'">'.$lang->get('day').' '.$i.'</option>';
511 511
                             }
512 512
                             ?>
Please login to merge, or discard this patch.
pages/admin.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -207,8 +207,7 @@
 block discarded – undo
207 207
                             </div>
208 208
         <?php
209 209
     }
210
-}
211
-catch (Exception $e) {
210
+} catch (Exception $e) {
212 211
     echo $e->getMessage();
213 212
 }
214 213
 ?>
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('admin') === false) {
72 72
     // Not allowed page
73 73
     $session->set('system-error_code', ERR_NOT_ALLOWED);
74
-    include $SETTINGS['cpassman_dir'] . '/error.php';
74
+    include $SETTINGS['cpassman_dir'].'/error.php';
75 75
     exit;
76 76
 }
77 77
 
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
                             </div>
213 213
         <?php
214 214
     } else {
215
-        $job = (array) $results[0];//print_r($job);
215
+        $job = (array) $results[0]; //print_r($job);
216 216
         ?>
217 217
                             <div>
218 218
                                 <i class="fa-solid fa-circle-check text-success mr-2"></i><?php echo $lang->get('tasks_cron_running'); ?>
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
                     <div class="card-body">
248 248
                         <?php
249 249
                         // Display information about server
250
-                        $dbSize = DB::queryFirstRow("SELECT ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS 'size' FROM information_schema.TABLES WHERE table_schema = '" . DB_NAME . "'");
250
+                        $dbSize = DB::queryFirstRow("SELECT ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS 'size' FROM information_schema.TABLES WHERE table_schema = '".DB_NAME."'");
251 251
 
252 252
                         // Get OS
253 253
                         $uname = php_uname('s');
@@ -285,16 +285,16 @@  discard block
 block discarded – undo
285 285
                         }
286 286
 
287 287
                         echo 
288
-                        '<p>' . $os.
288
+                        '<p>'.$os.
289 289
                             '<br><span class="ml-4"></span>'.
290 290
                         '</p>'.
291
-                        '<p><i class="fa-brands fa-php mr-2"></i>PHP version: ' . phpversion().
291
+                        '<p><i class="fa-brands fa-php mr-2"></i>PHP version: '.phpversion().
292 292
                             '<br><span class="ml-4">Memory limit: '.(ini_get('memory_limit')).'</span>'.
293 293
                             '<br><span class="ml-4">Memory usage: '.formatSizeUnits(memory_get_usage()).'</span>'.
294 294
                             '<br><span class="ml-4">Maximum time execution: '.ini_get('max_execution_time').'</span>'.
295 295
                             '<br><span class="ml-4">Maximum file size upload: '.ini_get('upload_max_filesize').'</span>'.
296 296
                         '</p>'.
297
-                        '<p><i class="fa-solid fa-server mr-2"></i>Server version: ' . DB::serverVersion().
297
+                        '<p><i class="fa-solid fa-server mr-2"></i>Server version: '.DB::serverVersion().
298 298
                             '<br><span class="ml-4">Database size: '.($dbSize['size']).'MB</span>'.
299 299
                         '</p>';
300 300
 
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
                         $serverTime = localtime(time(), true);
303 303
                         echo '<div class="row">'.
304 304
                             '<div class="col-6"><i class="fa-solid fa-clock mr-2"></i>Server time:</div>'.
305
-                            '<div class="col-6"><span class="badge badge-info">' . $serverTime['tm_hour'].':'.$serverTime['tm_min'].':'.$serverTime['tm_sec'].'</span></div>'.
305
+                            '<div class="col-6"><span class="badge badge-info">'.$serverTime['tm_hour'].':'.$serverTime['tm_min'].':'.$serverTime['tm_sec'].'</span></div>'.
306 306
                         '</div>'.
307 307
                         '<div class="row">'.
308 308
                             '<div class="col-6"><span class="ml-4">Timezone:</span></div>'.
Please login to merge, or discard this patch.