Passed
Push — master ( 106709...350f1a )
by Nils
07:20
created
pages/tasks.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('tasks') === false) {
65 65
     // Not allowed page
66 66
     $session->set('system-error_code', ERR_NOT_ALLOWED);
67
-    include $SETTINGS['cpassman_dir'] . '/error.php';
67
+    include $SETTINGS['cpassman_dir'].'/error.php';
68 68
     exit;
69 69
 }
70 70
 
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
     // Get last cron execution timestamp
127 127
     $queryResults = DB::query(
128 128
         'SELECT valeur
129
-        FROM ' . prefixTable('misc') . '
129
+        FROM ' . prefixTable('misc').'
130 130
         WHERE type = %s AND intitule = %s and valeur >= %d',
131 131
         'admin',
132 132
         'last_cron_exec',
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
                                             $task = isset($SETTINGS['users_personal_folder_task']) === true ? explode(";", $SETTINGS['users_personal_folder_task']) : [];
235 235
                                             ?>
236 236
                                             <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')." ".(isset($task[1]) === true ? $task[1] : '') : $lang->get('not_defined') ?>'>
237
-                                            <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].";".(isset($task[1]) === true ? $task[1] : '').(isset($task[2]) === true ? $task[2] : '') : '';?>'>
237
+                                            <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].";".(isset($task[1]) === true ? $task[1] : '').(isset($task[2]) === true ? $task[2] : '') : ''; ?>'>
238 238
                                         </div>
239 239
                                         <div class='col-2'>
240 240
                                             <button class="btn btn-primary task-define" data-task="users_personal_folder_task">
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
                                             $task = isset($SETTINGS['clean_orphan_objects_task']) === true ? explode(";", $SETTINGS['clean_orphan_objects_task']) : [];
257 257
                                             ?>
258 258
                                             <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')." ".(isset($task[1]) === true ? $task[1] : '') : $lang->get('not_defined') ?>'>
259
-                                            <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].";".(isset($task[1]) === true ? $task[1] : '').(isset($task[2]) === true ? $task[2] : '') : '';?>'>
259
+                                            <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].";".(isset($task[1]) === true ? $task[1] : '').(isset($task[2]) === true ? $task[2] : '') : ''; ?>'>
260 260
                                         </div>
261 261
                                         <div class='col-2'>
262 262
                                             <button class="btn btn-primary task-define" data-task="clean_orphan_objects_task">
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
                                             $task = isset($SETTINGS['purge_temporary_files_task']) === true ? explode(";", $SETTINGS['purge_temporary_files_task']) : [];
279 279
                                             ?>
280 280
                                             <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')." ".(isset($task[1]) === true ? $task[1] : '') : $lang->get('not_defined') ?>'>
281
-                                            <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].";".(isset($task[1]) === true ? $task[1] : '').(isset($task[2]) === true ? $task[2] : '') : '';?>'>
281
+                                            <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].";".(isset($task[1]) === true ? $task[1] : '').(isset($task[2]) === true ? $task[2] : '') : ''; ?>'>
282 282
                                         </div>
283 283
                                         <div class='col-2'>
284 284
                                             <button class="btn btn-primary task-define" data-task="purge_temporary_files_task">
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
                                             $task = isset($SETTINGS['reload_cache_table_task']) === true ? explode(";", $SETTINGS['reload_cache_table_task']) : [];
301 301
                                             ?>
302 302
                                             <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')." ".(isset($task[1]) === true ? $task[1] : '') : $lang->get('not_defined') ?>'>
303
-                                            <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].";".(isset($task[1]) === true ? $task[1] : '').(isset($task[2]) === true ? $task[2] : '') : '';?>'>
303
+                                            <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].";".(isset($task[1]) === true ? $task[1] : '').(isset($task[2]) === true ? $task[2] : '') : ''; ?>'>
304 304
                                         </div>
305 305
                                         <div class='col-2'>
306 306
                                             <button class="btn btn-primary task-define" data-task="reload_cache_table_task">
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
                         <h5><?php echo $lang->get('day_of_month'); ?></h5>              
518 518
                         <select class='form-control form-control-sm no-save' id='task-define-modal-parameter-monthly-value' style="width:100%;">
519 519
                             <?php
520
-                            for ($i=1; $i<=31; $i++) {
520
+                            for ($i = 1; $i <= 31; $i++) {
521 521
                                 echo '<option value="'.$i.'">'.$lang->get('day').' '.$i.'</option>';
522 522
                             }
523 523
                             ?>
Please login to merge, or discard this patch.
scripts/task_maintenance_users_personal_folder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
     //get through all users with enabled personnal folder.
81 81
     $users = DB::query(
82 82
         'SELECT id, login, email
83
-        FROM ' . prefixTable('users') . '
83
+        FROM ' . prefixTable('users').'
84 84
         WHERE id NOT IN ('.OTV_USER_ID.', '.TP_USER_ID.', '.SSH_USER_ID.', '.API_USER_ID.')
85 85
         AND personal_folder = 1
86 86
         ORDER BY login ASC'
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
         //if folder doesn't exist then create it
90 90
         $data = DB::queryFirstRow(
91 91
             'SELECT id
92
-            FROM ' . prefixTable('nested_tree') . '
92
+            FROM ' . prefixTable('nested_tree').'
93 93
             WHERE title = %s AND parent_id = %i',
94 94
             $user['id'],
95 95
             0
Please login to merge, or discard this patch.
scripts/background_tasks___do_calculation.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     // get count of Items in this folder
73 73
     $get = DB::queryFirstRow(
74 74
         'SELECT count(*) as num_results
75
-        FROM ' . prefixTable('items') . '
75
+        FROM ' . prefixTable('items').'
76 76
         WHERE inactif = %i AND id_tree = %i',
77 77
         0,
78 78
         $child->id
@@ -81,14 +81,14 @@  discard block
 block discarded – undo
81 81
     $ret[$child->id]['id'] = $child->id;
82 82
 
83 83
     // get number of subfolders
84
-    $nodeDescendants =$tree->getDescendants($child->id, false, false, true);
84
+    $nodeDescendants = $tree->getDescendants($child->id, false, false, true);
85 85
     $ret[$child->id]['subfoldersCount'] = count($nodeDescendants);
86 86
 
87 87
     // get items number in subfolders
88 88
     if (count($nodeDescendants) > 0) {
89 89
         $get = DB::queryFirstRow(
90 90
             'SELECT count(*) as num_results
91
-            FROM ' . prefixTable('items') . '
91
+            FROM ' . prefixTable('items').'
92 92
             WHERE inactif = %i AND id_tree IN (%l)',
93 93
             0,
94 94
             implode(',', $nodeDescendants)
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
     // Get item key
140 140
     $itemKey = DB::queryFirstRow(
141 141
         'SELECT share_key
142
-        FROM ' . prefixTable('sharekeys_items') . '
142
+        FROM ' . prefixTable('sharekeys_items').'
143 143
         WHERE user_id = %i AND object_id = %i',
144 144
         TP_USER_ID,
145 145
         $item['itemId']
Please login to merge, or discard this patch.
sources/logs.datatables.php 1 patch
Spacing   +24 added lines, -26 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 ) {
77 77
     // Not allowed page
78 78
     $session->set('system-error_code', ERR_NOT_ALLOWED);
79
-    include $SETTINGS['cpassman_dir'] . '/error.php';
79
+    include $SETTINGS['cpassman_dir'].'/error.php';
80 80
     exit;
81 81
 }
82 82
 
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
     
169 169
     // Output
170 170
     $sOutput = '{';
171
-    $sOutput .= '"sEcho": '. $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT) . ', ';
171
+    $sOutput .= '"sEcho": '.$request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT).', ';
172 172
     $sOutput .= '"iTotalRecords": '.$iTotal.', ';
173 173
     $sOutput .= '"iTotalDisplayRecords": '.$iTotal.', ';
174 174
     $sOutput .= '"aaData": ';
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 
242 242
     // Output
243 243
     $sOutput = '{';
244
-    $sOutput .= '"sEcho": '. $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT) . ', ';
244
+    $sOutput .= '"sEcho": '.$request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT).', ';
245 245
     $sOutput .= '"iTotalRecords": '.$iTotal.', ';
246 246
     $sOutput .= '"iTotalDisplayRecords": '.$iTotal.', ';
247 247
     $sOutput .= '"aaData": ';
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
 
315 315
     // Output
316 316
     $sOutput = '{';
317
-    $sOutput .= '"sEcho": '. (int) $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT) . ', ';
317
+    $sOutput .= '"sEcho": '.(int) $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT).', ';
318 318
     $sOutput .= '"iTotalRecords": '.$iTotal.', ';
319 319
     $sOutput .= '"iTotalDisplayRecords": '.$iTotal.', ';
320 320
     $sOutput .= '"aaData": ';
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
 
388 388
     // Output
389 389
     $sOutput = '{';
390
-    $sOutput .= '"sEcho": '. (int) $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT) . ', ';
390
+    $sOutput .= '"sEcho": '.(int) $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT).', ';
391 391
     $sOutput .= '"iTotalRecords": '.$iTotal.', ';
392 392
     $sOutput .= '"iTotalDisplayRecords": '.$iTotal.', ';
393 393
     $sOutput .= '"aaData": [ ';
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
 
491 491
     // Output
492 492
     $sOutput = '{';
493
-    $sOutput .= '"sEcho": '. (int) $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT) . ', ';
493
+    $sOutput .= '"sEcho": '.(int) $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT).', ';
494 494
     $sOutput .= '"iTotalRecords": '.$iTotal.', ';
495 495
     $sOutput .= '"iTotalDisplayRecords": '.$iTotal.', ';
496 496
     $sOutput .= '"aaData": [ ';
@@ -572,7 +572,7 @@  discard block
 block discarded – undo
572 572
         $iTotal = 0;
573 573
     }
574 574
     $sOutput = '{';
575
-    $sOutput .= '"sEcho": '. (int) $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT) . ', ';
575
+    $sOutput .= '"sEcho": '.(int) $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT).', ';
576 576
     $sOutput .= '"iTotalRecords": '.$iTotal.', ';
577 577
     $sOutput .= '"iTotalDisplayRecords": '.$iTotal.', ';
578 578
     $sOutput .= '"aaData": ';
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
 
649 649
     // Output
650 650
     $sOutput = '{';
651
-    $sOutput .= '"sEcho": '. (int) $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT) . ', ';
651
+    $sOutput .= '"sEcho": '.(int) $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT).', ';
652 652
     $sOutput .= '"iTotalRecords": '.$iTotal.', ';
653 653
     $sOutput .= '"iTotalDisplayRecords": '.$iTotal.', ';
654 654
     $sOutput .= '"aaData": ';
@@ -717,7 +717,7 @@  discard block
 block discarded – undo
717 717
 
718 718
     // Output
719 719
     $sOutput = '{';
720
-    $sOutput .= '"sEcho": '. (int) $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT) . ', ';
720
+    $sOutput .= '"sEcho": '.(int) $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT).', ';
721 721
     $sOutput .= '"iTotalRecords": '.$iTotal.', ';
722 722
     $sOutput .= '"iTotalDisplayRecords": '.$iTotal.', ';
723 723
     $sOutput .= '"aaData": ';
@@ -790,7 +790,7 @@  discard block
 block discarded – undo
790 790
 
791 791
     // Output
792 792
     $sOutput = '{';
793
-    $sOutput .= '"sEcho": '. (int) $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT) . ', ';
793
+    $sOutput .= '"sEcho": '.(int) $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT).', ';
794 794
     $sOutput .= '"iTotalRecords": '.$iTotal.', ';
795 795
     $sOutput .= '"iTotalDisplayRecords": '.$iTotal.', ';
796 796
     $sOutput .= '"aaData": ';
@@ -867,7 +867,7 @@  discard block
 block discarded – undo
867 867
             FROM '.prefixTable('background_tasks').' AS p 
868 868
             LEFT JOIN '.prefixTable('users').' AS u ON %l
869 869
             WHERE %l ORDER BY %l %l LIMIT %i, %i';
870
-    $params = ['u.id = json_extract(p.arguments, "$[0]")',$sWhere, $orderColumn, $orderDirection, $sLimitStart, $sLimitLength];
870
+    $params = ['u.id = json_extract(p.arguments, "$[0]")', $sWhere, $orderColumn, $orderDirection, $sLimitStart, $sLimitLength];
871 871
 
872 872
     // Get the records
873 873
     $rows = DB::query($sql, ...$params);
@@ -875,7 +875,7 @@  discard block
 block discarded – undo
875 875
 
876 876
     // Output
877 877
     $sOutput = '{';
878
-    $sOutput .= '"sEcho": '. (int) $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT) . ', ';
878
+    $sOutput .= '"sEcho": '.(int) $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT).', ';
879 879
     $sOutput .= '"iTotalRecords": '.$iTotal.', ';
880 880
     $sOutput .= '"iTotalDisplayRecords": '.$iTotal.', ';
881 881
     $sOutput .= '"aaData": ';
@@ -890,7 +890,7 @@  discard block
 block discarded – undo
890 890
         //col1
891 891
         $sOutput .= '"<span data-done=\"'.$record['is_in_progress'].'\" data-type=\"'.$record['process_type'].'\" data-process-id=\"'.$record['increment_id'].'\"></span>", ';
892 892
         //col2
893
-        $sOutput .= '"'.date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['created_at']).'", ';
893
+        $sOutput .= '"'.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['created_at']).'", ';
894 894
         //col3
895 895
         //$sOutput .= '"'.($record['updated_at'] === '' ? '-' : date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['updated_at'])).'", ';
896 896
         $sOutput .= '"<div class=\"progress mt-2\"><div class=\"progress-bar\" style=\"width: '.$subtaskProgress.'\">'.$subtaskProgress.'</div></div>", ';
@@ -900,7 +900,7 @@  discard block
 block discarded – undo
900 900
         // col5
901 901
         if (in_array($record['process_type'], array('create_user_keys', 'item_copy')) === true) {
902 902
             $data_user = DB::queryFirstRow(
903
-                'SELECT name, lastname FROM ' . prefixTable('users') . '
903
+                'SELECT name, lastname FROM '.prefixTable('users').'
904 904
                 WHERE id = %i',
905 905
                 json_decode($record['arguments'], true)['new_user_id']
906 906
             );
@@ -956,7 +956,7 @@  discard block
 block discarded – undo
956 956
     FROM '.prefixTable('background_tasks').' AS p 
957 957
     LEFT JOIN '.prefixTable('users').' AS u ON %l
958 958
     WHERE %l ORDER BY %l %l LIMIT %i, %i';
959
-    $params = ['u.id = json_extract(p.arguments, "$[0]")',$sWhere, $orderColumn, $orderDirection, $sLimitStart, $sLimitLength];
959
+    $params = ['u.id = json_extract(p.arguments, "$[0]")', $sWhere, $orderColumn, $orderDirection, $sLimitStart, $sLimitLength];
960 960
 
961 961
     // Get the records
962 962
     $rows = DB::query($sql, ...$params);
@@ -964,7 +964,7 @@  discard block
 block discarded – undo
964 964
 
965 965
     // Output
966 966
     $sOutput = '{';
967
-    $sOutput .= '"sEcho": '. (int) $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT) . ', ';
967
+    $sOutput .= '"sEcho": '.(int) $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT).', ';
968 968
     $sOutput .= '"iTotalRecords": '.$iTotal.', ';
969 969
     $sOutput .= '"iTotalDisplayRecords": '.$iTotal.', ';
970 970
     $sOutput .= '"aaData": ';
@@ -980,13 +980,12 @@  discard block
 block discarded – undo
980 980
         //col1
981 981
         $sOutput .= '"'.(is_null($record['error_message']) ? '' : addslashes($record['error_message'])).'", ';
982 982
         //col2
983
-        $sOutput .= '"'.date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['created_at']).'", ';
983
+        $sOutput .= '"'.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['created_at']).'", ';
984 984
         //col3
985 985
         $sOutput .= is_null($record['started_at']) === false ?
986
-            ('"'.date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['started_at']).'", ') :
987
-                ('"'.date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['created_at']).'", ');
986
+            ('"'.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['started_at']).'", ') : ('"'.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['created_at']).'", ');
988 987
         //col4
989
-        $sOutput .= '"'.date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['finished_at']).'", '; 
988
+        $sOutput .= '"'.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['finished_at']).'", '; 
990 989
         // col7
991 990
         $sOutput .= '"'.gmdate('H:i:s', (int) $record['finished_at'] - (is_null($record['started_at']) === false ? (int) $record['started_at'] : (int) $record['created_at'])).'",';
992 991
         //col5
@@ -1009,11 +1008,10 @@  discard block
 block discarded – undo
1009 1008
         // col6
1010 1009
         $arguments = json_decode($record['arguments'], true);
1011 1010
         $newUserId = array_key_exists('new_user_id', $arguments) ? 
1012
-            $arguments['new_user_id'] : 
1013
-            (array_key_exists('user_id', $arguments) ? $arguments['user_id'] : null);
1011
+            $arguments['new_user_id'] : (array_key_exists('user_id', $arguments) ? $arguments['user_id'] : null);
1014 1012
         if ($record['process_type'] === 'create_user_keys' && is_null($newUserId) === false && empty($newUserId) === false) {
1015 1013
             $data_user = DB::queryFirstRow(
1016
-                'SELECT name, lastname, login FROM ' . prefixTable('users') . '
1014
+                'SELECT name, lastname, login FROM '.prefixTable('users').'
1017 1015
                 WHERE id = %i',
1018 1016
                 $newUserId
1019 1017
             );
@@ -1029,7 +1027,7 @@  discard block
 block discarded – undo
1029 1027
         } elseif ($record['process_type'] === 'user_build_cache_tree') {
1030 1028
             $user = json_decode($record['arguments'], true)['user_id'];
1031 1029
             $data_user = DB::queryFirstRow(
1032
-                'SELECT name, lastname, login FROM ' . prefixTable('users') . '
1030
+                'SELECT name, lastname, login FROM '.prefixTable('users').'
1033 1031
                 WHERE id = %i',
1034 1032
                 $user
1035 1033
             );
@@ -1063,7 +1061,7 @@  discard block
 block discarded – undo
1063 1061
 {
1064 1062
     $subtasks = DB::query(
1065 1063
         'SELECT *
1066
-        FROM ' . prefixTable('background_subtasks') . '
1064
+        FROM ' . prefixTable('background_subtasks').'
1067 1065
         WHERE task_id = %i',
1068 1066
         $id
1069 1067
     );
@@ -1079,5 +1077,5 @@  discard block
 block discarded – undo
1079 1077
         $i++;
1080 1078
     }
1081 1079
 
1082
-    return ($finished_nb !== 0 ? pourcentage($finished_nb, $nb, 100) : 0) .'%';
1080
+    return ($finished_nb !== 0 ? pourcentage($finished_nb, $nb, 100) : 0).'%';
1083 1081
 }
1084 1082
\ No newline at end of file
Please login to merge, or discard this patch.
scripts/taskLogger.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -47,8 +47,8 @@
 block discarded – undo
47 47
      */
48 48
     public function log(string $message, string $level = 'INFO') {
49 49
         if (!empty($this->settings['enable_tasks_log'])) {
50
-            $formattedMessage = date($this->settings['date_format'] . ' ' . $this->settings['time_format']) . 
51
-                                " - [$level] $message" . PHP_EOL;
50
+            $formattedMessage = date($this->settings['date_format'].' '.$this->settings['time_format']). 
51
+                                " - [$level] $message".PHP_EOL;
52 52
 
53 53
             if (!empty($this->logFile)) {
54 54
                 // WWrite to the specified log file
Please login to merge, or discard this patch.
pages/favourites.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     || (isset($session_user_admin) && (int) $session_user_admin === 1)) {
73 73
     // Not allowed page
74 74
     $session->set('system-error_code', ERR_NOT_ALLOWED);
75
-    include $SETTINGS['cpassman_dir'] . '/error.php';
75
+    include $SETTINGS['cpassman_dir'].'/error.php';
76 76
     exit;
77 77
 }
78 78
 
@@ -125,12 +125,12 @@  discard block
 block discarded – undo
125 125
                             if (empty($fav) === false) {
126 126
                                 $data = DB::queryFirstRow(
127 127
                                     'SELECT i.label, i.description, i.id, i.id_tree, t.title
128
-                                    FROM ' . prefixTable('items') . ' as i
129
-                                    INNER JOIN ' . prefixTable('nested_tree') . ' as t ON (t.id = i.id_tree)
128
+                                    FROM ' . prefixTable('items').' as i
129
+                                    INNER JOIN ' . prefixTable('nested_tree').' as t ON (t.id = i.id_tree)
130 130
                                     WHERE i.id = %i',
131 131
                                     $fav
132 132
                                 );
133
-                                if (! empty($data['label'])) {
133
+                                if (!empty($data['label'])) {
134 134
                                     ?>
135 135
                                     <tr>
136 136
                                         <td>
Please login to merge, or discard this patch.
includes/core/login.oauth2.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
 use TeampassClasses\SessionManager\SessionManager;
34 34
 use TeampassClasses\ConfigManager\ConfigManager;
35 35
 
36
-require_once __DIR__. '/../../includes/config/include.php';
36
+require_once __DIR__.'/../../includes/config/include.php';
37 37
 require_once __DIR__.'/../../sources/main.functions.php';
38 38
 
39 39
 // init
Please login to merge, or discard this patch.
sources/roles.queries.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 ) {
77 77
     // Not allowed page
78 78
     $session->set('system-error_code', ERR_NOT_ALLOWED);
79
-    include $SETTINGS['cpassman_dir'] . '/error.php';
79
+    include $SETTINGS['cpassman_dir'].'/error.php';
80 80
     exit;
81 81
 }
82 82
 
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
                         );
462 462
 
463 463
                         // add new role to user
464
-                        $tmp = $data_tmp['fonction_id'] . (substr($data_tmp['fonction_id'], -1) == ';' ? $role_id : ';' . $role_id);
464
+                        $tmp = $data_tmp['fonction_id'].(substr($data_tmp['fonction_id'], -1) == ';' ? $role_id : ';'.$role_id);
465 465
                         $session->set('user-roles', str_replace(';;', ';', $tmp));
466 466
 
467 467
                         // store in DB
@@ -649,7 +649,7 @@  discard block
 block discarded – undo
649 649
                         $groupsData = $openLdapExtra->getADGroups($ldapConnection, $SETTINGS);
650 650
                         break;
651 651
                     default:
652
-                        throw new Exception("Unsupported LDAP type: " . $SETTINGS['ldap_type']);
652
+                        throw new Exception("Unsupported LDAP type: ".$SETTINGS['ldap_type']);
653 653
                 }
654 654
             } catch (Exception $e) {
655 655
                 if (defined('LOG_TO_SERVER') && LOG_TO_SERVER === true) {
@@ -669,7 +669,7 @@  discard block
 block discarded – undo
669 669
             } else {
670 670
                 // Handle successful retrieval of groups
671 671
                 // exists in Teampass
672
-                foreach($groupsData['userGroups'] as $key => $group) {
672
+                foreach ($groupsData['userGroups'] as $key => $group) {
673 673
                     $role_detail = DB::queryFirstRow(
674 674
                         'SELECT a.increment_id as increment_id, a.role_id as role_id, r.title as title
675 675
                         FROM '.prefixTable('ldap_groups_roles').' AS a
@@ -694,7 +694,7 @@  discard block
 block discarded – undo
694 694
             
695 695
             // Get all groups in Teampass
696 696
             $teampassRoles = array();
697
-            $rows = DB::query('SELECT id,title FROM ' . prefixTable('roles_title'));
697
+            $rows = DB::query('SELECT id,title FROM '.prefixTable('roles_title'));
698 698
             foreach ($rows as $record) {
699 699
                 array_push(
700 700
                     $teampassRoles,
Please login to merge, or discard this patch.
sources/tree.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 ) {
65 65
     // Not allowed page
66 66
     $session->set('system-error_code', ERR_NOT_ALLOWED);
67
-    include $SETTINGS['cpassman_dir'] . '/error.php';
67
+    include $SETTINGS['cpassman_dir'].'/error.php';
68 68
     exit;
69 69
 }
70 70
 
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 );
126 126
 
127 127
 $lastFolderChange = DB::queryFirstRow(
128
-    'SELECT valeur FROM ' . prefixTable('misc') . '
128
+    'SELECT valeur FROM '.prefixTable('misc').'
129 129
     WHERE type = %s AND intitule = %s',
130 130
     'timestamp',
131 131
     'last_folder_change'
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
         $nbItemsInSubfolders = (int) $node->nb_items_in_subfolders;
347 347
         $nbItemsInFolder = (int) $node->nb_items_in_folder;
348 348
         $nbSubfolders = (int) $node->nb_subfolders;
349
-        break;  // Get out as soon as we find a valid node.
349
+        break; // Get out as soon as we find a valid node.
350 350
     }
351 351
     
352 352
     if ($displayThisNode === true) {
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
         foreach ($currentNode->children as $child) {
459 459
             recursiveTree(
460 460
                 (int) $child,
461
-                $tree->getNode($child),// get node info for this child
461
+                $tree->getNode($child), // get node info for this child
462 462
                 /** @scrutinizer ignore-type */ $tree,
463 463
                 $listFoldersLimitedKeys,
464 464
                 $listRestrictedFoldersForItemsKeys,
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
     $lang = new Language($session->get('user-language') ?? 'english');
506 506
 
507 507
     // prepare json return for current node
508
-    $parent = $currentNode->parent_id === '0' ? '#' : 'li_' . $currentNode->parent_id;
508
+    $parent = $currentNode->parent_id === '0' ? '#' : 'li_'.$currentNode->parent_id;
509 509
 
510 510
     // handle displaying
511 511
     if (isKeyExistingAndEqual('show_only_accessible_folders', 1, $SETTINGS) === true) {
@@ -522,17 +522,17 @@  discard block
 block discarded – undo
522 522
         array_push(
523 523
             $ret_json,
524 524
             array(
525
-                'id' => 'li_' . $nodeId,
525
+                'id' => 'li_'.$nodeId,
526 526
                 'parent' => $last_visible_parent === -1 ? $parent : $last_visible_parent,
527 527
                 'text' => '<i class="'.$currentNode->fa_icon.' tree-folder mr-2" data-folder="'.$currentNode->fa_icon.'"  data-folder-selected="'.$currentNode->fa_icon_selected.'"></i>'.$text.htmlspecialchars($currentNode->title).$nodeData['html'],
528 528
                 'li_attr' => array(
529 529
                     'class' => 'jstreeopen',
530
-                    'title' => 'ID [' . $nodeId . '] ' . $nodeData['title'],
530
+                    'title' => 'ID ['.$nodeId.'] '.$nodeData['title'],
531 531
                 ),
532 532
                 'a_attr' => array(
533
-                    'id' => 'fld_' . $nodeId,
533
+                    'id' => 'fld_'.$nodeId,
534 534
                     'class' => $nodeData['folderClass'],
535
-                    'onclick' => 'ListerItems(' . $nodeId . ', ' . $nodeData['restricted'] . ', 0, 1)',
535
+                    'onclick' => 'ListerItems('.$nodeId.', '.$nodeData['restricted'].', 0, 1)',
536 536
                     'data-title' => htmlspecialchars($currentNode->title),
537 537
                 ),
538 538
                 'is_pf' => in_array($nodeId, $inputData['personalFolders']) === true ? 1 : 0,
@@ -548,12 +548,12 @@  discard block
 block discarded – undo
548 548
         array_push(
549 549
             $ret_json,
550 550
             array(
551
-                'id' => 'li_' . $nodeId,
551
+                'id' => 'li_'.$nodeId,
552 552
                 'parent' => $last_visible_parent === -1 ? $parent : $last_visible_parent,
553 553
                 'text' => '<i class="'.$currentNode->fa_icon.' tree-folder mr-2" data-folder="'.$currentNode->fa_icon.'"  data-folder-selected="'.$currentNode->fa_icon_selected.'"></i>'.'<i class="fas fa-times fa-xs text-danger mr-1 ml-1"></i>'.$text.htmlspecialchars($currentNode->title).$nodeData['html'],
554 554
                 'li_attr' => array(
555 555
                     'class' => '',
556
-                    'title' => 'ID [' . $nodeId . '] ' . $lang->get('no_access'),
556
+                    'title' => 'ID ['.$nodeId.'] '.$lang->get('no_access'),
557 557
                 ),
558 558
             )
559 559
         );
@@ -613,7 +613,7 @@  discard block
 block discarded – undo
613 613
         if (in_array($nodeId, $session_read_only_folders) === true) {
614 614
             return [
615 615
                 'html' => '<i class="far fa-eye fa-xs mr-1 ml-1"></i>'.
616
-                    ($tree_counters === 1 ? '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_' . $nodeId . '">' . $nbItemsInFolder .'/'.$nbItemsInSubfolders .'/'.$nbSubfolders. '</span>'  : ''),
616
+                    ($tree_counters === 1 ? '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_'.$nodeId.'">'.$nbItemsInFolder.'/'.$nbItemsInSubfolders.'/'.$nbSubfolders.'</span>' : ''),
617 617
                 'title' => $lang->get('read_only_account'),
618 618
                 'restricted' => 1,
619 619
                 'folderClass' => 'folder_not_droppable',
@@ -628,7 +628,7 @@  discard block
 block discarded – undo
628 628
         ) {
629 629
             return [
630 630
                 'html' => '<i class="far fa-eye fa-xs mr-1"></i>'.
631
-                    ($tree_counters === 1 ? '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_' . $nodeId . '">' . $nbItemsInFolder .'/'.$nbItemsInSubfolders .'/'.$nbSubfolders. '</span>'  : ''),
631
+                    ($tree_counters === 1 ? '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_'.$nodeId.'">'.$nbItemsInFolder.'/'.$nbItemsInSubfolders.'/'.$nbSubfolders.'</span>' : ''),
632 632
                 'title' => $lang->get('read_only_account'),
633 633
                 'restricted' => 0,
634 634
                 'folderClass' => 'folder',
@@ -639,7 +639,7 @@  discard block
 block discarded – undo
639 639
         }
640 640
         
641 641
         return [
642
-            'html' => ($tree_counters === 1 ? '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_' . $nodeId . '">' . $nbItemsInFolder .'/'.$nbItemsInSubfolders .'/'.$nbSubfolders. '</span>'  : ''),
642
+            'html' => ($tree_counters === 1 ? '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_'.$nodeId.'">'.$nbItemsInFolder.'/'.$nbItemsInSubfolders.'/'.$nbSubfolders.'</span>' : ''),
643 643
             'title' => '',
644 644
             'restricted' => 0,
645 645
             'folderClass' => 'folder',
@@ -650,8 +650,8 @@  discard block
 block discarded – undo
650 650
 
651 651
     } elseif (in_array($nodeId, $listFoldersLimitedKeys) === true) {
652 652
         return [
653
-            'html' => ($session_user_read_only === true ? '<i class="far fa-eye fa-xs mr-1"></i>' : '') .
654
-                ($tree_counters === 1 ? '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_' . $nodeId . '">' . count($session_list_folders_limited[$nodeId]) . '</span>' : ''),
653
+            'html' => ($session_user_read_only === true ? '<i class="far fa-eye fa-xs mr-1"></i>' : '').
654
+                ($tree_counters === 1 ? '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_'.$nodeId.'">'.count($session_list_folders_limited[$nodeId]).'</span>' : ''),
655 655
             'title' => '',
656 656
             'restricted' => 1,
657 657
             'folderClass' => 'folder',
@@ -662,8 +662,8 @@  discard block
 block discarded – undo
662 662
 
663 663
     } elseif (in_array($nodeId, $listRestrictedFoldersForItemsKeys) === true) {
664 664
         return [
665
-            'html' => $session_user_read_only === true ? '<i class="far fa-eye fa-xs mr-1"></i>' : '' .
666
-                '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_' . $nodeId . '">' . count($session_list_restricted_folders_for_items[$nodeId]) . '</span>',
665
+            'html' => $session_user_read_only === true ? '<i class="far fa-eye fa-xs mr-1"></i>' : ''.
666
+                '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_'.$nodeId.'">'.count($session_list_restricted_folders_for_items[$nodeId]).'</span>',
667 667
             'title' => '',
668 668
             'restricted' => 1,
669 669
             'folderClass' => 'folder',
@@ -773,7 +773,7 @@  discard block
 block discarded – undo
773 773
     // Does this user has a tree cache
774 774
     $userCacheTree = DB::queryFirstRow(
775 775
         'SELECT data
776
-        FROM ' . prefixTable('cache_tree') . '
776
+        FROM ' . prefixTable('cache_tree').'
777 777
         WHERE user_id = %i',
778 778
         $userId
779 779
     );
Please login to merge, or discard this patch.