Passed
Pull Request — master (#4682)
by Nils
06:11
created
includes/core/otv.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
         filter_input(INPUT_GET, 'code', FILTER_SANITIZE_FULL_SPECIAL_CHARS)
87 87
     );
88 88
     
89
-    if (DB::count() > 0  && (int) $data['timestamp'] === (int) filter_input(INPUT_GET, 'stamp', FILTER_VALIDATE_INT)) {
89
+    if (DB::count() > 0 && (int) $data['timestamp'] === (int) filter_input(INPUT_GET, 'stamp', FILTER_VALIDATE_INT)) {
90 90
         // otv is too old
91 91
         if ($data['time_limit'] < time() || ($data['views'] + 1) > $data['max_views']) {
92 92
             $html = '<div class="text-center text-danger">
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
                 <tr><th>URL:</th><td>'.$url.'</td></tr>
191 191
                 </table></div>
192 192
                 <p class="mt-3 text-info"><i class="fas fa-info mr-2"></i>Copy carefully the data you need.<br>This page is visible until <b>'.
193
-                date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $dataItem['time_limit']).'</b> OR <b>'.($dataItem['max_views'] - ($dataItem['views']+1)).' more time(s)</b>.</div>
193
+                date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $dataItem['time_limit']).'</b> OR <b>'.($dataItem['max_views'] - ($dataItem['views'] + 1)).' more time(s)</b>.</div>
194 194
                 </div>';
195 195
             // log
196 196
             logItems(
Please login to merge, or discard this patch.
pages/users.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('users') === false) {
67 67
     // Not allowed page
68 68
     $session->set('system-error_code', ERR_NOT_ALLOWED);
69
-    include $SETTINGS['cpassman_dir'] . '/error.php';
69
+    include $SETTINGS['cpassman_dir'].'/error.php';
70 70
     exit;
71 71
 }
72 72
 
@@ -89,24 +89,24 @@  discard block
 block discarded – undo
89 89
 // If administrator then all roles are shown
90 90
 // else only the Roles the users is associated to.
91 91
 if ((int) $session->get('user-admin') === 1) {
92
-    $optionsManagedBy .= '<option value="0">' . $lang->get('administrators_only') . '</option>';
92
+    $optionsManagedBy .= '<option value="0">'.$lang->get('administrators_only').'</option>';
93 93
 }
94 94
 
95 95
 $rows = DB::query(
96 96
     'SELECT id, title, creator_id
97
-    FROM ' . prefixTable('roles_title') . '
97
+    FROM ' . prefixTable('roles_title').'
98 98
     ORDER BY title ASC'
99 99
 );
100 100
 foreach ($rows as $record) {
101 101
     if ((int) $session->get('user-admin') === 1 || in_array($record['id'], $session->get('user-roles_array')) === true) {
102
-        $optionsManagedBy .= '<option value="' . $record['id'] . '">' . $lang->get('managers_of') . ' ' . addslashes($record['title']) . '</option>';
102
+        $optionsManagedBy .= '<option value="'.$record['id'].'">'.$lang->get('managers_of').' '.addslashes($record['title']).'</option>';
103 103
     }
104 104
     if (
105 105
         (int) $session->get('user-admin') === 1
106 106
         || (((int) $session->get('user-manager') === 1 || (int) $session->get('user-can_manage_all_users') === 1)
107 107
             && (in_array($record['id'], $userRoles) === true) || (int) $record['creator_id'] === (int) $session->get('user-id'))
108 108
     ) {
109
-        $optionsRoles .= '<option value="' . $record['id'] . '">' . addslashes($record['title']) . '</option>';
109
+        $optionsRoles .= '<option value="'.$record['id'].'">'.addslashes($record['title']).'</option>';
110 110
     }
111 111
 }
112 112
 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
         for ($y = 1; $y < $t->nlevel; ++$y) {
122 122
             $ident .= '&nbsp;&nbsp;';
123 123
         }
124
-        $foldersList .= '<option value="' . $t->id . '">' . $ident . htmlspecialchars($t->title, ENT_COMPAT, 'UTF-8') . '</option>';
124
+        $foldersList .= '<option value="'.$t->id.'">'.$ident.htmlspecialchars($t->title, ENT_COMPAT, 'UTF-8').'</option>';
125 125
     }
126 126
 }
127 127
 
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
                         </button><?php
159 159
                                     echo isset($SETTINGS['ldap_mode']) === true && (int) $SETTINGS['ldap_mode'] === 1 && (int) $session->get('user-admin') === 1 ?
160 160
                                         '<button type="button" class="btn btn-primary btn-sm tp-action mr-2" data-action="ldap-sync">
161
-                            <i class="fa-solid fa-address-card mr-2"></i>' . $lang->get('ldap_synchronization') . '
161
+                            <i class="fa-solid fa-address-card mr-2"></i>' . $lang->get('ldap_synchronization').'
162 162
                         </button>' : '';
163 163
                                     ?>
164 164
                     </h3>
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 
167 167
                 <!-- /.card-header -->
168 168
                 <div class="card-body form" id="users-list">
169
-                    <label><input type="checkbox" id="warnings_display" class="tp-action pointer" data-action="refresh"><span class="ml-2 pointer"><?php echo $lang->get('display_warning_icons');?></span></label>
169
+                    <label><input type="checkbox" id="warnings_display" class="tp-action pointer" data-action="refresh"><span class="ml-2 pointer"><?php echo $lang->get('display_warning_icons'); ?></span></label>
170 170
                     <table id="table-users" class="table table-striped nowrap table-responsive-sm">
171 171
                         <thead>
172 172
                             <tr>
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
                                             <?php
232 232
                                             foreach (TP_PW_COMPLEXITY as $entry) {
233 233
                                                 echo '
234
-                                            <option value="' . $entry[0] . '">' . addslashes($entry[1]) . '</option>';
234
+                                            <option value="' . $entry[0].'">'.addslashes($entry[1]).'</option>';
235 235
                                             }
236 236
                                             ?>
237 237
                                         </select>
Please login to merge, or discard this patch.
scripts/background_tasks___items_handler_subtask.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 
57 57
 $subtask = DB::queryfirstrow(
58 58
     'SELECT *
59
-    FROM ' . prefixTable('background_subtasks') . '
59
+    FROM ' . prefixTable('background_subtasks').'
60 60
     WHERE process_id = %i AND finished_at IS NULL
61 61
     ORDER BY increment_id ASC',
62 62
     (int) $request->request->get('subTask')
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 
65 65
 list($taskArguments) = DB::queryFirstField(
66 66
     'SELECT arguments
67
-    FROM ' . prefixTable('background_tasks') . '
67
+    FROM ' . prefixTable('background_tasks').'
68 68
     WHERE increment_id = %i',
69 69
     $subtask['process_id']
70 70
 );
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
     // Loop on all files for this item
76 76
     // and encrypt them for each user
77 77
     if (WIP === true) provideLog('[DEBUG] '.print_r($args['files_keys'], true), $SETTINGS);
78
-    foreach($args['files_keys'] as $file) {
78
+    foreach ($args['files_keys'] as $file) {
79 79
         storeUsersShareKey(
80 80
             prefixTable('sharekeys_items'),
81 81
             0,
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
     // Loop on all encrypted fields for this item
93 93
     // and encrypt them for each user
94 94
     if (WIP === true) provideLog('[DEBUG] '.print_r($args, true), $SETTINGS);
95
-    foreach($args['fields_keys'] as $field) {
95
+    foreach ($args['fields_keys'] as $field) {
96 96
         storeUsersShareKey(
97 97
             prefixTable('sharekeys_fields'),
98 98
             0,
Please login to merge, or discard this patch.
sources/tasks.queries.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 ) {
79 79
     // Not allowed page
80 80
     $session->set('system-error_code', ERR_NOT_ALLOWED);
81
-    include $SETTINGS['cpassman_dir'] . '/error.php';
81
+    include $SETTINGS['cpassman_dir'].'/error.php';
82 82
     exit;
83 83
 }
84 84
 
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
     // get exec from processes table
164 164
     $rows = DB::query(
165 165
         'SELECT max(finished_at), process_type
166
-        FROM ' . prefixTable('background_tasks') . '
166
+        FROM ' . prefixTable('background_tasks').'
167 167
         GROUP BY process_type'
168 168
     );
169 169
     foreach ($rows as $row) {
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
     // get exec from background_tasks_log table
180 180
     $rows = DB::query(
181 181
         'SELECT MAX(finished_at) AS max_finished_at, job AS process_type 
182
-        FROM ' . prefixTable('background_tasks_logs') . '
182
+        FROM ' . prefixTable('background_tasks_logs').'
183 183
         WHERE finished_at >= UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 7 DAY))
184 184
         GROUP BY process_type'
185 185
     );
Please login to merge, or discard this patch.
sources/utilities.queries.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 ) {
80 80
     // Not allowed page
81 81
     $session->set('system-error_code', ERR_NOT_ALLOWED);
82
-    include $SETTINGS['cpassman_dir'] . '/error.php';
82
+    include $SETTINGS['cpassman_dir'].'/error.php';
83 83
     exit;
84 84
 }
85 85
 
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
             $arrFolders = array();
131 131
             $rows = DB::query(
132 132
                 'SELECT valeur, intitule
133
-                FROM ' . prefixTable('misc') . '
133
+                FROM ' . prefixTable('misc').'
134 134
                 WHERE type  = %s',
135 135
                 'folder_deleted'
136 136
             );
@@ -152,10 +152,10 @@  discard block
 block discarded – undo
152 152
                 'SELECT u.login as login, u.name as name, u.lastname as lastname,
153 153
                 i.id as id, i.label as label,
154 154
                 i.id_tree as id_tree, l.date as date, n.title as folder_title
155
-                FROM ' . prefixTable('log_items') . ' as l
156
-                INNER JOIN ' . prefixTable('items') . ' as i ON (l.id_item=i.id)
157
-                LEFT JOIN ' . prefixTable('users') . ' as u ON (l.id_user=u.id)
158
-                LEFT JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree=n.id)
155
+                FROM ' . prefixTable('log_items').' as l
156
+                INNER JOIN ' . prefixTable('items').' as i ON (l.id_item=i.id)
157
+                LEFT JOIN ' . prefixTable('users').' as u ON (l.id_user=u.id)
158
+                LEFT JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree=n.id)
159 159
                 WHERE i.inactif = %i
160 160
                 AND l.action = %s',
161 161
                 1,
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
                             'label' => $record['label'],
178 178
                             'date' => date($SETTINGS['date_format'], (int) $record['date']),
179 179
                             'login' => $record['login'],
180
-                            'name' => $record['name'] . ' ' . $record['lastname'],
180
+                            'name' => $record['name'].' '.$record['lastname'],
181 181
                             'folder_label' => $record['folder_title'],
182 182
                             'folder_deleted' => $thisFolder,
183 183
                         )
@@ -235,10 +235,10 @@  discard block
 block discarded – undo
235 235
             foreach ($post_folders as $folderId) {
236 236
                 $data = DB::queryfirstrow(
237 237
                     'SELECT valeur
238
-                    FROM ' . prefixTable('misc') . "
238
+                    FROM ' . prefixTable('misc')."
239 239
                     WHERE type = 'folder_deleted'
240 240
                     AND intitule = %s",
241
-                    'f' . $folderId
241
+                    'f'.$folderId
242 242
                 );
243 243
                 if ((int) $data['valeur'] !== 0) {
244 244
                     $folderData = explode(', ', $data['valeur']);
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
                         prefixTable('misc'),
266 266
                         'type = %s AND intitule = %s',
267 267
                         'folder_deleted',
268
-                        'f' . $folderId
268
+                        'f'.$folderId
269 269
                     );
270 270
 
271 271
                     // Restore all items in this folder
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
                     // Get list of all items in thos folder
282 282
                     $items = DB::query(
283 283
                         'SELECT id
284
-                        FROM ' . prefixTable('items') . '
284
+                        FROM ' . prefixTable('items').'
285 285
                         WHERE id_tree = %i',
286 286
                         $folderId
287 287
                     );
@@ -370,10 +370,10 @@  discard block
 block discarded – undo
370 370
             foreach ($post_folders as $folderId) {
371 371
                 $data = DB::queryfirstrow(
372 372
                     'SELECT valeur
373
-                    FROM ' . prefixTable('misc') . "
373
+                    FROM ' . prefixTable('misc')."
374 374
                     WHERE type = 'folder_deleted'
375 375
                     AND intitule = %s",
376
-                    'f' . $folderId
376
+                    'f'.$folderId
377 377
                 );
378 378
                 if ((int) $data['valeur'] !== 0) {
379 379
                     $exploded = explode(',', $data['valeur']);
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
                         prefixTable('misc'),
385 385
                         'type = %s AND intitule = %s',
386 386
                         'folder_deleted',
387
-                        'f' . $folderData[0]
387
+                        'f'.$folderData[0]
388 388
                     );
389 389
 
390 390
                     // Delete all items in this folder
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
                     // Get list of all items in thos folder
399 399
                     $items = DB::query(
400 400
                         'SELECT id
401
-                        FROM ' . prefixTable('items') . '
401
+                        FROM ' . prefixTable('items').'
402 402
                         WHERE id_tree = %i',
403 403
                         $folderData[0]
404 404
                     );
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
                         // Delete all fields
416 416
                         $fields = DB::query(
417 417
                             'SELECT id
418
-                            FROM ' . prefixTable('categories_items') . '
418
+                            FROM ' . prefixTable('categories_items').'
419 419
                             WHERE item_id = %i',
420 420
                             $folderData[0]
421 421
                         );
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
                         // Delete all files
436 436
                         $files = DB::query(
437 437
                             'SELECT id
438
-                            FROM ' . prefixTable('files') . '
438
+                            FROM ' . prefixTable('files').'
439 439
                             WHERE id_item = %i',
440 440
                             $folderData[0]
441 441
                         );
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
                 // Delete sharekey fields
493 493
                 $itemFields = DB::query(
494 494
                     'SELECT id
495
-                    FROM ' . prefixTable('categories_items') . '
495
+                    FROM ' . prefixTable('categories_items').'
496 496
                     WHERE item_id = %i',
497 497
                     $itemId
498 498
                 );
@@ -507,7 +507,7 @@  discard block
 block discarded – undo
507 507
                 // Delete sharekey files
508 508
                 $itemFiles = DB::query(
509 509
                     'SELECT id
510
-                    FROM ' . prefixTable('files') . '
510
+                    FROM ' . prefixTable('files').'
511 511
                     WHERE id_item = %i',
512 512
                     $itemId
513 513
                 );
@@ -584,7 +584,7 @@  discard block
 block discarded – undo
584 584
             ) {
585 585
                 if ($post_log_type === 'items') {
586 586
                     DB::query(
587
-                        'SELECT * FROM ' . prefixTable('log_items') . '
587
+                        'SELECT * FROM '.prefixTable('log_items').'
588 588
                         WHERE (date BETWEEN %i AND %i)'
589 589
                         . ($post_filter_action === 'all' ? '' : ' AND action = "'.$post_filter_action.'"')
590 590
                         . ((int) $post_filter_user === -1 ? '' : ' AND id_user = '.(int) $post_filter_user),
@@ -604,7 +604,7 @@  discard block
 block discarded – undo
604 604
                 } elseif ($post_log_type === 'connections') {
605 605
                     //db::debugmode(true);
606 606
                     DB::query(
607
-                        'SELECT * FROM ' . prefixTable('log_system') . '
607
+                        'SELECT * FROM '.prefixTable('log_system').'
608 608
                         WHERE type=%s '
609 609
                         . 'AND (date BETWEEN %i AND %i)'
610 610
                         . ($post_filter_action === 'all' ? '' : ' AND action = '.$post_filter_action)
@@ -627,7 +627,7 @@  discard block
 block discarded – undo
627 627
                     );
628 628
                 } elseif ($post_log_type === 'errors') {
629 629
                     DB::query(
630
-                        'SELECT * FROM ' . prefixTable('log_system') . ' WHERE type=%s ' .
630
+                        'SELECT * FROM '.prefixTable('log_system').' WHERE type=%s '.
631 631
                             'AND (date BETWEEN %i AND %i)',
632 632
                         'error',
633 633
                         $post_date_from,
@@ -644,7 +644,7 @@  discard block
 block discarded – undo
644 644
                     );
645 645
                 } elseif ($post_log_type === 'copy') {
646 646
                     DB::query(
647
-                        'SELECT * FROM ' . prefixTable('log_items') . ' WHERE action=%s ' .
647
+                        'SELECT * FROM '.prefixTable('log_items').' WHERE action=%s '.
648 648
                             'AND (date BETWEEN %i AND %i)',
649 649
                         'at_copy',
650 650
                         $post_date_from,
@@ -661,7 +661,7 @@  discard block
 block discarded – undo
661 661
                     );
662 662
                 } elseif ($post_log_type === 'admin') {
663 663
                     DB::query(
664
-                        'SELECT * FROM ' . prefixTable('log_system') . ' WHERE type=%s ' .
664
+                        'SELECT * FROM '.prefixTable('log_system').' WHERE type=%s '.
665 665
                             'AND (date BETWEEN %i AND %i)',
666 666
                         'admin_action',
667 667
                         $post_date_from,
@@ -678,7 +678,7 @@  discard block
 block discarded – undo
678 678
                     );
679 679
                 } elseif ($post_log_type === 'failed') {
680 680
                     DB::query(
681
-                        'SELECT * FROM ' . prefixTable('log_system') . ' WHERE type=%s ' .
681
+                        'SELECT * FROM '.prefixTable('log_system').' WHERE type=%s '.
682 682
                             'AND (date BETWEEN %i AND %i)',
683 683
                         'failed_auth',
684 684
                         $post_date_from,
@@ -749,19 +749,19 @@  discard block
 block discarded – undo
749 749
             // Get info about task
750 750
             $taskInfo = DB::queryfirstrow(
751 751
                 'SELECT p.process_type as process_type
752
-                FROM ' . prefixTable('background_tasks') . ' as p
752
+                FROM ' . prefixTable('background_tasks').' as p
753 753
                 WHERE p.increment_id = %i',
754 754
                 $post_id
755 755
             );
756 756
             if ($taskInfo !== null) {
757 757
                 // delete task
758 758
                 DB::query(
759
-                    'DELETE FROM ' . prefixTable('background_subtasks') . '
759
+                    'DELETE FROM '.prefixTable('background_subtasks').'
760 760
                     WHERE task_id = %i',
761 761
                     $post_id
762 762
                 );
763 763
                 DB::query(
764
-                    'DELETE FROM ' . prefixTable('background_tasks') . '
764
+                    'DELETE FROM '.prefixTable('background_tasks').'
765 765
                     WHERE increment_id = %i',
766 766
                     $post_id
767 767
                 );
@@ -828,7 +828,7 @@  discard block
 block discarded – undo
828 828
                         ->setDayOfMonth('*')
829 829
                         ->setMonths('*')
830 830
                         ->setDayOfWeek('*')
831
-                        ->setTaskCommandLine($phpBinaryPath . ' ' . $SETTINGS['cpassman_dir'] . '/sources/scheduler.php')
831
+                        ->setTaskCommandLine($phpBinaryPath.' '.$SETTINGS['cpassman_dir'].'/sources/scheduler.php')
832 832
                         ->setComments('Teampass scheduler');
833 833
                     
834 834
                     $crontabRepository->addJob($crontabJob);
Please login to merge, or discard this patch.
api/Controller/Api/BaseController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
         $requestUri = $request->getRequestUri();
48 48
 
49 49
         $uri = parse_url($requestUri, PHP_URL_PATH);
50
-        $uri = explode( '/', $uri );
50
+        $uri = explode('/', $uri);
51 51
         return $this->sanitizeUrl(array_slice($uri, ((int) array_search('index.php', $uri) + 1)));
52 52
     }
53 53
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
     {
75 75
         $filters = [];
76 76
         $array_size = count($array);
77
-        for ($i=0; $i < $array_size; $i++) {
77
+        for ($i = 0; $i < $array_size; $i++) {
78 78
             array_push($filters, 'trim|escape');
79 79
         }
80 80
         
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
      * @param mixed  $data
93 93
      * @param string $httpHeader
94 94
      */
95
-    protected function sendOutput($data, $httpHeaders=array()): void
95
+    protected function sendOutput($data, $httpHeaders = array()): void
96 96
     {
97 97
         header_remove('Set-Cookie');
98 98
 
Please login to merge, or discard this patch.
api/Controller/Api/FolderController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
                     $arrFolders = $folderModel->getFoldersInfo(explode(",", $userData['folders_list']));
49 49
                     $responseData = json_encode($arrFolders);
50 50
                 } catch (Error $e) {
51
-                    $strErrorDesc = $e->getMessage() . ' Something went wrong! Please contact support.3';
51
+                    $strErrorDesc = $e->getMessage().' Something went wrong! Please contact support.3';
52 52
                     $strErrorHeader = 'HTTP/1.1 500 Internal Server Error';
53 53
                 }
54 54
             }
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
                         
122 122
                         $responseData = json_encode($arrFolder);
123 123
                     } catch (Error $e) {
124
-                        $strErrorDesc = $e->getMessage() . ' Something went wrong! Please contact support.1';
124
+                        $strErrorDesc = $e->getMessage().' Something went wrong! Please contact support.1';
125 125
                         $strErrorHeader = 'HTTP/1.1 500 Internal Server Error';
126 126
                     }
127 127
                 }
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
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
     // get count of Items in this folder
75 75
     $get = DB::queryfirstrow(
76 76
         'SELECT count(*) as num_results
77
-        FROM ' . prefixTable('items') . '
77
+        FROM ' . prefixTable('items').'
78 78
         WHERE inactif = %i AND id_tree = %i',
79 79
         0,
80 80
         $child->id
@@ -83,14 +83,14 @@  discard block
 block discarded – undo
83 83
     $ret[$child->id]['id'] = $child->id;
84 84
 
85 85
     // get number of subfolders
86
-    $nodeDescendants =$tree->getDescendants($child->id, false, false, true);
86
+    $nodeDescendants = $tree->getDescendants($child->id, false, false, true);
87 87
     $ret[$child->id]['subfoldersCount'] = count($nodeDescendants);
88 88
 
89 89
     // get items number in subfolders
90 90
     if (count($nodeDescendants) > 0) {
91 91
         $get = DB::queryfirstrow(
92 92
             'SELECT count(*) as num_results
93
-            FROM ' . prefixTable('items') . '
93
+            FROM ' . prefixTable('items').'
94 94
             WHERE inactif = %i AND id_tree IN (%l)',
95 95
             0,
96 96
             implode(',', $nodeDescendants)
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
     // Get item key
139 139
     $itemKey = DB::queryFirstRow(
140 140
         'SELECT share_key
141
-        FROM ' . prefixTable('sharekeys_items') . '
141
+        FROM ' . prefixTable('sharekeys_items').'
142 142
         WHERE user_id = %i AND object_id = %i',
143 143
         TP_USER_ID,
144 144
         $item['itemId']
Please login to merge, or discard this patch.
pages/api.php 1 patch
Spacing   +25 added lines, -25 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('api') === 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
 
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
                                     <?php
159 159
                                     $rowsKeys = DB::query(
160 160
                                         'SELECT *
161
-                                        FROM ' . prefixTable('api') . '
161
+                                        FROM ' . prefixTable('api').'
162 162
                                         WHERE type = %s
163 163
                                         ORDER BY timestamp ASC',
164 164
                                         'key'
@@ -181,15 +181,15 @@  discard block
 block discarded – undo
181 181
                                             <?php
182 182
                                             foreach ($rowsKeys as $key) {
183 183
                                                 echo '
184
-                                                    <tr data-id="' . $key['increment_id'] . '">
185
-                                                    <td width="50px"><i class="fas fa-trash infotip pointer delete-api-key" title="' . $lang->get('del_button') . '"></i></td>
186
-                                                    <td><span class="edit-api-key pointer">' . $key['label'] . '</span></td>
187
-                                                    <td>' . $key['value']. '</td>   
188
-                                                    <td><i class="fas '.((int) $key['enabled'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="enabled" data-increment-id="' . $key['increment_id'] . '"></i></td>
189
-                                                    <td><i class="fas '.((int) $key['allowed_to_create'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_create" data-increment-id="' . $key['increment_id'] . '"></i></td>
190
-                                                    <td><i class="fas '.((int) $key['allowed_to_read'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_read" data-increment-id="' . $key['increment_id'] . '"></i></td>
191
-                                                    <td><i class="fas '.((int) $key['allowed_to_update'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_update" data-increment-id="' . $key['increment_id'] . '"></i></td>
192
-                                                    <td><i class="fas '.((int) $key['allowed_to_delete'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_delete" data-increment-id="' . $key['increment_id'] . '"></i></td>                   
184
+                                                    <tr data-id="' . $key['increment_id'].'">
185
+                                                    <td width="50px"><i class="fas fa-trash infotip pointer delete-api-key" title="' . $lang->get('del_button').'"></i></td>
186
+                                                    <td><span class="edit-api-key pointer">' . $key['label'].'</span></td>
187
+                                                    <td>' . $key['value'].'</td>   
188
+                                                    <td><i class="fas '.((int) $key['enabled'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="enabled" data-increment-id="'.$key['increment_id'].'"></i></td>
189
+                                                    <td><i class="fas '.((int) $key['allowed_to_create'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_create" data-increment-id="'.$key['increment_id'].'"></i></td>
190
+                                                    <td><i class="fas '.((int) $key['allowed_to_read'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_read" data-increment-id="'.$key['increment_id'].'"></i></td>
191
+                                                    <td><i class="fas '.((int) $key['allowed_to_update'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_update" data-increment-id="'.$key['increment_id'].'"></i></td>
192
+                                                    <td><i class="fas '.((int) $key['allowed_to_delete'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_delete" data-increment-id="'.$key['increment_id'].'"></i></td>                   
193 193
                                                 </tr>';
194 194
                                             } ?>
195 195
                                         </tbody>
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
                                 <div class="col-12 mt-4" id="table-api-ip">
225 225
                                     <?php
226 226
                                     $rowsIps = DB::query(
227
-                                                'SELECT increment_id, label, timestamp value FROM ' . prefixTable('api') . '
227
+                                                'SELECT increment_id, label, timestamp value FROM '.prefixTable('api').'
228 228
                                                 WHERE type = %s
229 229
                                                 ORDER BY timestamp ASC',
230 230
                                                 'ip'
@@ -242,10 +242,10 @@  discard block
 block discarded – undo
242 242
                                             <?php
243 243
                                             foreach ($rowsIps as $ip) {
244 244
                                                 echo '
245
-                                                <tr data-id="' . $ip['increment_id'] . '">
246
-                                                    <td width="50px"><i class="fas fa-trash infotip pointer delete-api-ip" title="' . $lang->get('del_button') . '"></i></td>
247
-                                                    <td><span class="edit-api-ip pointer" data-field="label">' . $ip['label'] . '</span></td>
248
-                                                    <td><span class="edit-api-ip pointer" data-field="value">' . $ip['value'] . '</span></td>
245
+                                                <tr data-id="' . $ip['increment_id'].'">
246
+                                                    <td width="50px"><i class="fas fa-trash infotip pointer delete-api-ip" title="' . $lang->get('del_button').'"></i></td>
247
+                                                    <td><span class="edit-api-ip pointer" data-field="label">' . $ip['label'].'</span></td>
248
+                                                    <td><span class="edit-api-ip pointer" data-field="value">' . $ip['value'].'</span></td>
249 249
                                                 </tr>';
250 250
                                             } ?>
251 251
                                         </tbody>
@@ -281,8 +281,8 @@  discard block
 block discarded – undo
281 281
                                     <?php
282 282
                                     $rowsKeys = DB::query(
283 283
                                         'SELECT a.*, u.name, u.lastname, u.login
284
-                                        FROM ' . prefixTable('api') . ' AS a
285
-                                        INNER JOIN ' . prefixTable('users') . ' AS u ON a.user_id = u.id
284
+                                        FROM ' . prefixTable('api').' AS a
285
+                                        INNER JOIN ' . prefixTable('users').' AS u ON a.user_id = u.id
286 286
                                         WHERE a.type = %s
287 287
                                         ORDER BY u.login ASC',
288 288
                                         'user'
@@ -303,13 +303,13 @@  discard block
 block discarded – undo
303 303
                                             <?php
304 304
                                             foreach ($rowsKeys as $key) {
305 305
                                                 echo '
306
-                                                    <tr data-id="' . $key['increment_id'] . '">
307
-                                                    <td>' . $key['name'] . ' ' . $key['lastname'] . ' (<i>'.$key['login'].'</i>)</td>
308
-                                                    <td><i class="fas '.((int) $key['enabled'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="enabled" data-increment-id="' . $key['increment_id'] . '"></i></td>
309
-                                                    <td><i class="fas '.((int) $key['allowed_to_create'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_create" data-increment-id="' . $key['increment_id'] . '"></i></td>
310
-                                                    <td><i class="fas '.((int) $key['allowed_to_read'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_read" data-increment-id="' . $key['increment_id'] . '"></i></td>
311
-                                                    <td><i class="fas '.((int) $key['allowed_to_update'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_update" data-increment-id="' . $key['increment_id'] . '"></i></td>
312
-                                                    <td><i class="fas '.((int) $key['allowed_to_delete'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_delete" data-increment-id="' . $key['increment_id'] . '"></i></td>
306
+                                                    <tr data-id="' . $key['increment_id'].'">
307
+                                                    <td>' . $key['name'].' '.$key['lastname'].' (<i>'.$key['login'].'</i>)</td>
308
+                                                    <td><i class="fas '.((int) $key['enabled'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="enabled" data-increment-id="'.$key['increment_id'].'"></i></td>
309
+                                                    <td><i class="fas '.((int) $key['allowed_to_create'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_create" data-increment-id="'.$key['increment_id'].'"></i></td>
310
+                                                    <td><i class="fas '.((int) $key['allowed_to_read'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_read" data-increment-id="'.$key['increment_id'].'"></i></td>
311
+                                                    <td><i class="fas '.((int) $key['allowed_to_update'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_update" data-increment-id="'.$key['increment_id'].'"></i></td>
312
+                                                    <td><i class="fas '.((int) $key['allowed_to_delete'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_delete" data-increment-id="'.$key['increment_id'].'"></i></td>
313 313
                                                 </tr>';
314 314
                                             } ?>
315 315
                                         </tbody>
Please login to merge, or discard this patch.