Passed
Push — dev ( 8b84d5...475726 )
by Nils
05:50
created
api/Controller/Api/AuthController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
         $arrQueryStringParams = $this->getQueryStringParams();
40 40
 
41 41
         if (strtoupper($requestMethod) === 'POST') {
42
-            require API_ROOT_PATH . "/Model/AuthModel.php";
42
+            require API_ROOT_PATH."/Model/AuthModel.php";
43 43
             try {
44 44
                 $authModel = new AuthModel();
45 45
                 $arrUser = $authModel->getUserAuth(
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
                 if (array_key_exists("token", $arrUser)) {
51 51
                     $responseData = json_encode($arrUser);
52 52
                 } else {
53
-                    $strErrorDesc = $arrUser['error'] . " (" . $arrUser['info'] . ")";
53
+                    $strErrorDesc = $arrUser['error']." (".$arrUser['info'].")";
54 54
                     $strErrorHeader = 'HTTP/1.1 401 Unauthorized';
55 55
                 }
56 56
             } catch (Error $e) {
Please login to merge, or discard this patch.
scripts/background_tasks___functions.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -89,5 +89,5 @@
 block discarded – undo
89 89
  */
90 90
 function provideLog(string $message, array $SETTINGS)
91 91
 {
92
-    echo '\n' . (string) date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], time()) . ' - '.$message . '\n';
92
+    echo '\n'.(string) date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], time()).' - '.$message.'\n';
93 93
 }
94 94
\ No newline at end of file
Please login to merge, or discard this patch.
includes/core/load.js.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 
155 155
                             // Show passwords inputs and form
156 156
                             $('#dialog-user-change-password-info')
157
-                                .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo langHdl('user_has_to_change_password_info');?>')
157
+                                .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo langHdl('user_has_to_change_password_info'); ?>')
158 158
                                 .removeClass('hidden');
159 159
                             $('#dialog-user-change-password').removeClass('hidden');
160 160
 
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 
168 168
                             // Show passwords inputs and form
169 169
                             $('#dialog-ldap-user-change-password-info')
170
-                                .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo langHdl('ldap_user_has_changed_his_password');?>')
170
+                                .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo langHdl('ldap_user_has_changed_his_password'); ?>')
171 171
                                 .removeClass('hidden');
172 172
                             $('#dialog-ldap-user-change-password').removeClass('hidden');
173 173
                             
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
         /*console.log('User has to regenerate keys')
290 290
         // HIde
291 291
         $('.content-header, .content').addClass('hidden');
292
-        $('#dialog-user-temporary-code-info').html('<i class="icon fa-solid fa-info mr-2"></i><?php echo langHdl('renecyption_expected');?>');
292
+        $('#dialog-user-temporary-code-info').html('<i class="icon fa-solid fa-info mr-2"></i><?php echo langHdl('renecyption_expected'); ?>');
293 293
 
294 294
         // Show passwords inputs and form
295 295
         $('#dialog-user-temporary-code').removeClass('hidden');
@@ -371,13 +371,13 @@  discard block
 block discarded – undo
371 371
             {
372 372
                 if (step === 'psk') {
373 373
                     // Inform user
374
-                    $("#user-current-defuse-psk-progress").html('<b><?php echo langHdl('encryption_keys'); ?> </b> [' + start + ' - ' + (parseInt(start) + <?php echo NUMBER_ITEMS_IN_BATCH;?>) + '] ' +
374
+                    $("#user-current-defuse-psk-progress").html('<b><?php echo langHdl('encryption_keys'); ?> </b> [' + start + ' - ' + (parseInt(start) + <?php echo NUMBER_ITEMS_IN_BATCH; ?>) + '] ' +
375 375
                         '... <?php echo langHdl('please_wait'); ?><i class="fa-solid fa-spinner fa-pulse ml-3 text-primary"></i>');
376 376
 
377 377
                     var data = {
378 378
                         'userPsk' : $('#user-current-defuse-psk').val(),
379 379
                             'start': start,
380
-                            'length': <?php echo NUMBER_ITEMS_IN_BATCH;?>,
380
+                            'length': <?php echo NUMBER_ITEMS_IN_BATCH; ?>,
381 381
                             'user_id': userId,
382 382
                     };
383 383
                     // Do query
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
 
455 455
                 // Show passwords inputs and form
456 456
                 $('#dialog-ldap-user-change-password-info')
457
-                    .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo langHdl('ldap_user_has_changed_his_password');?>')
457
+                    .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo langHdl('ldap_user_has_changed_his_password'); ?>')
458 458
                     .removeClass('hidden');
459 459
                 $('#dialog-ldap-user-change-password').removeClass('hidden');
460 460
 
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
                                 '</div>' +
544 544
                             '</div>' +
545 545
                         '</div>' +
546
-                        '<div class="row mt-2<?php echo isset($SETTINGS['enable_pf_feature']) === true && (int) $SETTINGS['enable_pf_feature'] === 1  ? '' : ' hidden'; ?>">' +
546
+                        '<div class="row mt-2<?php echo isset($SETTINGS['enable_pf_feature']) === true && (int) $SETTINGS['enable_pf_feature'] === 1 ? '' : ' hidden'; ?>">' +
547 547
                             '<h6><?php echo langHdl('provide_recovery_keys'); ?></h6>' +
548 548
                             '<div class="input-group mb-2">' +
549 549
                                 '<div class="input-group-prepend">' +
@@ -558,7 +558,7 @@  discard block
 block discarded – undo
558 558
                                 '<textarea rows="2" id="recovery-private-key" class="form-control form-item-control"></textarea>' +
559 559
                             '</div>' +
560 560
                         '</div>' +
561
-                        '<div class="row mt-2<?php echo isset($SETTINGS['enable_pf_feature']) === true && (int) $SETTINGS['enable_pf_feature'] === 1  ? '' : ' hidden'; ?>">' +
561
+                        '<div class="row mt-2<?php echo isset($SETTINGS['enable_pf_feature']) === true && (int) $SETTINGS['enable_pf_feature'] === 1 ? '' : ' hidden'; ?>">' +
562 562
                             '<div class="alert" id="confirm-no-recovery-keys-div">' +
563 563
                                 '<div class="form-check">' +
564 564
                                     '<input type="checkbox" class="form-check-input" id="confirm-no-recovery-keys">' +
@@ -1062,15 +1062,15 @@  discard block
 block discarded – undo
1062 1062
             // Prepare data
1063 1063
             var data = {
1064 1064
                 'receipt': $('#temp-user-email').val(),
1065
-                'subject': '[Teampass] <?php echo langHdl('your_new_password');?>',
1066
-                'body': '<?php echo langHdl('email_body_temporary_login_password');?>',
1065
+                'subject': '[Teampass] <?php echo langHdl('your_new_password'); ?>',
1066
+                'body': '<?php echo langHdl('email_body_temporary_login_password'); ?>',
1067 1067
                 'pre_replace' : {
1068 1068
                     '#enc_code#' : $('#temp-user-pwd').val(),
1069 1069
                 }
1070 1070
             }
1071 1071
             if (debugJavascript === true) console.log(data);
1072 1072
             // Prepare form
1073
-            $('#dialog-admin-change-user-password-info').html('<?php echo langHdl('sending_email_message');?>');
1073
+            $('#dialog-admin-change-user-password-info').html('<?php echo langHdl('sending_email_message'); ?>');
1074 1074
             toastr.remove();
1075 1075
             toastr.info(
1076 1076
                 '<?php echo langHdl('in_progress'); ?><i class="fa-solid fa-circle-notch fa-spin fa-2x ml-3"></i>'
@@ -1583,7 +1583,7 @@  discard block
 block discarded – undo
1583 1583
                         '#warningModal',
1584 1584
                         '<i class="fa-solid fa-clock fa-lg warning mr-2"></i><?php echo langHdl('index_add_one_hour'); ?>',
1585 1585
                         '<div class="form-group">' +
1586
-                        '<label for="warningModal-input" class="col-form-label"><?php echo langHdl('extend_session_duration_by') . ' (' . langHdl('minutes') . ')'; ?>:</label>' +
1586
+                        '<label for="warningModal-input" class="col-form-label"><?php echo langHdl('extend_session_duration_by').' ('.langHdl('minutes').')'; ?>:</label>' +
1587 1587
                         '<input type="number" max="'+(60*60*24)+'" class="form-control" id="warningModal-input" value="60">' +
1588 1588
                         '</div>' +
1589 1589
                         '<div class="form-text text-muted"><i class=\"fa-solid fa-info-circle mr-2\"></i><?php echo langHdl('maximum_session_expiration_time'); ?>: '+data.max_session_duration+'</div>',
Please login to merge, or discard this patch.
scripts/background_tasks___items_handler.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 DB::debugmode(false);
68 68
 $process_to_perform = DB::queryfirstrow(
69 69
     'SELECT *
70
-    FROM ' . prefixTable('processes') . '
70
+    FROM ' . prefixTable('processes').'
71 71
     WHERE is_in_progress = %i AND process_type IN ("item_copy", "new_item", "update_item")
72 72
     ORDER BY increment_id ASC',
73 73
     1
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
     // search for next process to handle
85 85
     $process_to_perform = DB::queryfirstrow(
86 86
         'SELECT *
87
-        FROM ' . prefixTable('processes') . '
87
+        FROM ' . prefixTable('processes').'
88 88
         WHERE is_in_progress = %i AND finished_at = "" AND process_type IN ("item_copy", "new_item", "update_item")
89 89
         ORDER BY increment_id ASC',
90 90
         0
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
             $process_to_perform['increment_id']
102 102
         );
103 103
 
104
-        provideLog('[PROCESS][#'. $process_to_perform['increment_id'].'][START]', $SETTINGS);
104
+        provideLog('[PROCESS][#'.$process_to_perform['increment_id'].'][START]', $SETTINGS);
105 105
         handleTask(
106 106
             $process_to_perform['increment_id'],
107 107
             json_decode($process_to_perform['arguments'], true),
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 // launch a new iterative process
119 119
 $process_to_perform = DB::queryfirstrow(
120 120
     'SELECT *
121
-    FROM ' . prefixTable('processes') . '
121
+    FROM ' . prefixTable('processes').'
122 122
     WHERE is_in_progress = %i AND process_type IN ("item_copy", "new_item", "update_item")
123 123
     ORDER BY increment_id ASC',
124 124
     1
@@ -140,11 +140,11 @@  discard block
 block discarded – undo
140 140
  */
141 141
 function handleTask(int $processId, array $ProcessArguments, array $SETTINGS): bool
142 142
 {
143
-    provideLog('[PROCESS][#'. $processId.'][START]', $SETTINGS);
143
+    provideLog('[PROCESS][#'.$processId.'][START]', $SETTINGS);
144 144
     //DB::debugmode(false);
145 145
     $task_to_perform = DB::queryfirstrow(
146 146
         'SELECT *
147
-        FROM ' . prefixTable('processes_tasks') . '
147
+        FROM ' . prefixTable('processes_tasks').'
148 148
         WHERE process_id = %i AND finished_at IS NULL
149 149
         ORDER BY increment_id ASC',
150 150
         $processId
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
         // check if a linux process is not currently on going
165 165
         // if sub_task_in_progress === 1 then exit
166 166
         if ((int) $task_to_perform['sub_task_in_progress'] === 0) {
167
-            provideLog('[TASK][#'. $task_to_perform['increment_id'].'][START]', $SETTINGS);
167
+            provideLog('[TASK][#'.$task_to_perform['increment_id'].'][START]', $SETTINGS);
168 168
 
169 169
             // handle next task
170 170
             $args = json_decode($task_to_perform['task'], true);
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
             DB::update(
246 246
                 prefixTable('processes_tasks'),
247 247
                 array(
248
-                    'sub_task_in_progress' => 0,    // flag sub task is no more in prgoress
248
+                    'sub_task_in_progress' => 0, // flag sub task is no more in prgoress
249 249
                     'task' => json_encode(["status" => "Done"]),
250 250
                     'is_in_progress' => -1,
251 251
                     'finished_at' => time(),
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 
280 280
         } else {
281 281
             // Task is currently being in progress by another server process
282
-            provideLog('[TASK][#'. $task_to_perform['increment_id'].'][WARNING] Similar task already being processes', $SETTINGS);
282
+            provideLog('[TASK][#'.$task_to_perform['increment_id'].'][WARNING] Similar task already being processes', $SETTINGS);
283 283
             return false;
284 284
         }
285 285
     }
Please login to merge, or discard this patch.
scripts/background_tasks___user_keys_creation.php 1 patch
Spacing   +43 added lines, -44 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 DB::debugmode(false);
72 72
 $process_to_perform = DB::queryfirstrow(
73 73
     'SELECT *
74
-    FROM ' . prefixTable('processes') . '
74
+    FROM ' . prefixTable('processes').'
75 75
     WHERE is_in_progress = %i AND process_type = %s
76 76
     ORDER BY increment_id ASC',
77 77
     1,
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
     // search for next process to handle
92 92
     $process_to_perform = DB::queryfirstrow(
93 93
         'SELECT *
94
-        FROM ' . prefixTable('processes') . '
94
+        FROM ' . prefixTable('processes').'
95 95
         WHERE is_in_progress = %i AND finished_at = "" AND process_type = %s
96 96
         ORDER BY increment_id ASC',
97 97
         0,
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
             $process_to_perform['increment_id']
110 110
         );
111 111
 
112
-        provideLog('[PROCESS][#'. $process_to_perform['increment_id'].'][START]', $SETTINGS);
112
+        provideLog('[PROCESS][#'.$process_to_perform['increment_id'].'][START]', $SETTINGS);
113 113
         handleTask(
114 114
             $process_to_perform['increment_id'],
115 115
             json_decode($process_to_perform['arguments'], true),
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 // launch a new iterative process
125 125
 $process_to_perform = DB::queryfirstrow(
126 126
     'SELECT *
127
-    FROM ' . prefixTable('processes') . '
127
+    FROM ' . prefixTable('processes').'
128 128
     WHERE is_in_progress = %i AND process_type = %s
129 129
     ORDER BY increment_id ASC',
130 130
     1,
@@ -148,11 +148,11 @@  discard block
 block discarded – undo
148 148
  */
149 149
 function handleTask(int $processId, array $ProcessArguments, array $SETTINGS): bool
150 150
 {
151
-    provideLog('[PROCESS][#'. $processId.'][START]', $SETTINGS);
151
+    provideLog('[PROCESS][#'.$processId.'][START]', $SETTINGS);
152 152
     //DB::debugmode(false);
153 153
     $task_to_perform = DB::queryfirstrow(
154 154
         'SELECT *
155
-        FROM ' . prefixTable('processes_tasks') . '
155
+        FROM ' . prefixTable('processes_tasks').'
156 156
         WHERE process_id = %i AND finished_at IS NULL
157 157
         ORDER BY increment_id ASC',
158 158
         $processId
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
         // check if a linux process is not currently on going
168 168
         // if sub_task_in_progress === 1 then exit
169 169
         if ((int) $task_to_perform['sub_task_in_progress'] === 0) {
170
-            provideLog('[TASK][#'. $task_to_perform['increment_id'].'][START]', $SETTINGS);
170
+            provideLog('[TASK][#'.$task_to_perform['increment_id'].'][START]', $SETTINGS);
171 171
 
172 172
             // handle next task
173 173
             $args = json_decode($task_to_perform['task'], true);
@@ -220,10 +220,9 @@  discard block
 block discarded – undo
220 220
             DB::update(
221 221
                 prefixTable('processes_tasks'),
222 222
                 array(
223
-                    'sub_task_in_progress' => 0,    // flag sub task is no more in prgoress
223
+                    'sub_task_in_progress' => 0, // flag sub task is no more in prgoress
224 224
                     'task' => $taskStatus['new_action'] !== $args['step'] ? 
225
-                    json_encode(["status" => "Done"]) :
226
-                    json_encode([
225
+                    json_encode(["status" => "Done"]) : json_encode([
227 226
                         "step" => $taskStatus['new_action'],
228 227
                         "index" => $taskStatus['new_index'],
229 228
                         "nb" => isset($SETTINGS['maximum_number_of_items_to_treat']) === true ? $SETTINGS['maximum_number_of_items_to_treat'] : $args['nb'],
@@ -259,7 +258,7 @@  discard block
 block discarded – undo
259 258
 
260 259
         } else {
261 260
             // Task is currently being in progress by another server process
262
-            provideLog('[TASK][#'. $task_to_perform['increment_id'].'][WARNING] Similar task already being processes', $SETTINGS);
261
+            provideLog('[TASK][#'.$task_to_perform['increment_id'].'][WARNING] Similar task already being processes', $SETTINGS);
263 262
             return false;
264 263
         }
265 264
     }
@@ -292,7 +291,7 @@  discard block
 block discarded – undo
292 291
         // Check if user exists
293 292
         $userInfo = DB::queryFirstRow(
294 293
             'SELECT public_key, private_key
295
-            FROM ' . prefixTable('users') . '
294
+            FROM ' . prefixTable('users').'
296 295
             WHERE id = %i',
297 296
             $post_user_id
298 297
         );
@@ -423,13 +422,13 @@  discard block
 block discarded – undo
423 422
 {
424 423
     $userInfo = DB::queryFirstRow(
425 424
         'SELECT pw, public_key, private_key, login, name
426
-        FROM ' . prefixTable('users') . '
425
+        FROM ' . prefixTable('users').'
427 426
         WHERE id = %i',
428 427
         $owner_id
429 428
     );
430 429
     
431 430
     // decrypt owner password
432
-    $pwd = cryption($owner_pwd, '','decrypt', $SETTINGS)['string'];
431
+    $pwd = cryption($owner_pwd, '', 'decrypt', $SETTINGS)['string'];
433 432
     provideLog('[USER][INFO] ID:'.$owner_id, $SETTINGS);
434 433
     //provideLog('[DEBUG] '.$pwd." -- ", $SETTINGS);
435 434
     // decrypt private key and send back
@@ -470,17 +469,17 @@  discard block
 block discarded – undo
470 469
     // Loop on items
471 470
     $rows = DB::query(
472 471
         'SELECT id, pw, perso
473
-        FROM ' . prefixTable('items') . '
472
+        FROM ' . prefixTable('items').'
474 473
         '.(isset($extra_arguments['only_personal_items']) === true && $extra_arguments['only_personal_items'] === 1 ? 'WHERE perso = 1' : '').'
475 474
         ORDER BY id ASC
476
-        LIMIT ' . $post_start . ', ' . $post_length
475
+        LIMIT ' . $post_start.', '.$post_length
477 476
     );
478 477
     //    WHERE perso = 0
479 478
     foreach ($rows as $record) {
480 479
         // Get itemKey from current user
481 480
         $currentUserKey = DB::queryFirstRow(
482 481
             'SELECT share_key, increment_id
483
-            FROM ' . prefixTable('sharekeys_items') . '
482
+            FROM ' . prefixTable('sharekeys_items').'
484 483
             WHERE object_id = %i AND user_id = %i',
485 484
             $record['id'],
486 485
             //$extra_arguments['owner_id']
@@ -509,7 +508,7 @@  discard block
 block discarded – undo
509 508
         
510 509
         $currentUserKey = DB::queryFirstRow(
511 510
             'SELECT increment_id
512
-            FROM ' . prefixTable('sharekeys_items') . '
511
+            FROM ' . prefixTable('sharekeys_items').'
513 512
             WHERE object_id = %i AND user_id = %i',
514 513
             $record['id'],
515 514
             $post_user_id
@@ -580,15 +579,15 @@  discard block
 block discarded – undo
580 579
     // Loop on logs
581 580
     $rows = DB::query(
582 581
         'SELECT increment_id
583
-        FROM ' . prefixTable('log_items') . '
582
+        FROM ' . prefixTable('log_items').'
584 583
         WHERE raison LIKE "at_pw :%" AND encryption_type = "teampass_aes"
585
-        LIMIT ' . $post_start . ', ' . $post_length
584
+        LIMIT ' . $post_start.', '.$post_length
586 585
     );
587 586
     foreach ($rows as $record) {
588 587
         // Get itemKey from current user
589 588
         $currentUserKey = DB::queryFirstRow(
590 589
             'SELECT share_key
591
-            FROM ' . prefixTable('sharekeys_logs') . '
590
+            FROM ' . prefixTable('sharekeys_logs').'
592 591
             WHERE object_id = %i AND user_id = %i',
593 592
             $record['increment_id'],
594 593
             $extra_arguments['owner_id']
@@ -620,7 +619,7 @@  discard block
 block discarded – undo
620 619
             if ((int) $post_user_id !== (int) $extra_arguments['owner_id']) {
621 620
                 $currentUserKey = DB::queryFirstRow(
622 621
                     'SELECT increment_id
623
-                    FROM ' . prefixTable('sharekeys_items') . '
622
+                    FROM ' . prefixTable('sharekeys_items').'
624 623
                     WHERE object_id = %i AND user_id = %i',
625 624
                     $record['id'],
626 625
                     $post_user_id
@@ -642,7 +641,7 @@  discard block
 block discarded – undo
642 641
     // SHould we change step?
643 642
     DB::query(
644 643
         'SELECT increment_id
645
-        FROM ' . prefixTable('log_items') . '
644
+        FROM ' . prefixTable('log_items').'
646 645
         WHERE raison LIKE "at_pw :%" AND encryption_type = "teampass_aes"'
647 646
     );
648 647
 
@@ -683,15 +682,15 @@  discard block
 block discarded – undo
683 682
     // Loop on fields
684 683
     $rows = DB::query(
685 684
         'SELECT id
686
-        FROM ' . prefixTable('categories_items') . '
685
+        FROM ' . prefixTable('categories_items').'
687 686
         WHERE encryption_type = "teampass_aes"
688
-        LIMIT ' . $post_start . ', ' . $post_length
687
+        LIMIT ' . $post_start.', '.$post_length
689 688
     );
690 689
     foreach ($rows as $record) {
691 690
         // Get itemKey from current user
692 691
         $currentUserKey = DB::queryFirstRow(
693 692
             'SELECT share_key
694
-            FROM ' . prefixTable('sharekeys_fields') . '
693
+            FROM ' . prefixTable('sharekeys_fields').'
695 694
             WHERE object_id = %i AND user_id = %i',
696 695
             $record['id'],
697 696
             $extra_arguments['owner_id']
@@ -719,7 +718,7 @@  discard block
 block discarded – undo
719 718
                 if ((int) $post_user_id !== (int) $extra_arguments['owner_id']) {
720 719
                     $currentUserKey = DB::queryFirstRow(
721 720
                         'SELECT increment_id
722
-                        FROM ' . prefixTable('sharekeys_items') . '
721
+                        FROM ' . prefixTable('sharekeys_items').'
723 722
                         WHERE object_id = %i AND user_id = %i',
724 723
                         $record['id'],
725 724
                         $post_user_id
@@ -742,7 +741,7 @@  discard block
 block discarded – undo
742 741
     // SHould we change step?
743 742
     DB::query(
744 743
         'SELECT *
745
-        FROM ' . prefixTable('categories_items') . '
744
+        FROM ' . prefixTable('categories_items').'
746 745
         WHERE encryption_type = "teampass_aes"'
747 746
     );
748 747
 
@@ -782,14 +781,14 @@  discard block
 block discarded – undo
782 781
     // Loop on suggestions
783 782
     $rows = DB::query(
784 783
         'SELECT id
785
-        FROM ' . prefixTable('suggestion') . '
786
-        LIMIT ' . $post_start . ', ' . $post_length
784
+        FROM ' . prefixTable('suggestion').'
785
+        LIMIT ' . $post_start.', '.$post_length
787 786
     );
788 787
     foreach ($rows as $record) {
789 788
         // Get itemKey from current user
790 789
         $currentUserKey = DB::queryFirstRow(
791 790
             'SELECT share_key
792
-            FROM ' . prefixTable('sharekeys_suggestions') . '
791
+            FROM ' . prefixTable('sharekeys_suggestions').'
793 792
             WHERE object_id = %i AND user_id = %i',
794 793
             $record['id'],
795 794
             $extra_arguments['owner_id']
@@ -821,7 +820,7 @@  discard block
 block discarded – undo
821 820
             if ((int) $post_user_id !== (int) $extra_arguments['owner_id']) {
822 821
                 $currentUserKey = DB::queryFirstRow(
823 822
                     'SELECT increment_id
824
-                    FROM ' . prefixTable('sharekeys_items') . '
823
+                    FROM ' . prefixTable('sharekeys_items').'
825 824
                     WHERE object_id = %i AND user_id = %i',
826 825
                     $record['id'],
827 826
                     $post_user_id
@@ -883,16 +882,16 @@  discard block
 block discarded – undo
883 882
     // Loop on files
884 883
     $rows = DB::query(
885 884
         'SELECT f.id AS id, i.perso AS perso
886
-        FROM ' . prefixTable('files') . ' AS f
887
-        INNER JOIN ' . prefixTable('items') . ' AS i ON i.id = f.id_item
888
-        WHERE f.status = "' . TP_ENCRYPTION_NAME . '"
889
-        LIMIT ' . $post_start . ', ' . $post_length
885
+        FROM ' . prefixTable('files').' AS f
886
+        INNER JOIN ' . prefixTable('items').' AS i ON i.id = f.id_item
887
+        WHERE f.status = "' . TP_ENCRYPTION_NAME.'"
888
+        LIMIT ' . $post_start.', '.$post_length
890 889
     ); //aes_encryption
891 890
     foreach ($rows as $record) {
892 891
         // Get itemKey from current user
893 892
         $currentUserKey = DB::queryFirstRow(
894 893
             'SELECT share_key, increment_id
895
-            FROM ' . prefixTable('sharekeys_files') . '
894
+            FROM ' . prefixTable('sharekeys_files').'
896 895
             WHERE object_id = %i AND user_id = %i',
897 896
             $record['id'],
898 897
             (int) $record['perso'] === 0 ? $extra_arguments['owner_id'] : $extra_arguments['new_user_id']
@@ -920,7 +919,7 @@  discard block
 block discarded – undo
920 919
 
921 920
         $currentUserKey = DB::queryFirstRow(
922 921
             'SELECT increment_id
923
-            FROM ' . prefixTable('sharekeys_files') . '
922
+            FROM ' . prefixTable('sharekeys_files').'
924 923
             WHERE object_id = %i AND user_id = %i',
925 924
             $record['id'],
926 925
             $post_user_id
@@ -982,8 +981,8 @@  discard block
 block discarded – undo
982 981
     // SHould we change step? Finished ?
983 982
     DB::query(
984 983
         'SELECT *
985
-        FROM ' . prefixTable('files') . '
986
-        WHERE status = "' . TP_ENCRYPTION_NAME . '"'
984
+        FROM ' . prefixTable('files').'
985
+        WHERE status = "' . TP_ENCRYPTION_NAME.'"'
987 986
     );
988 987
     $counter = DB::count();
989 988
     $next_start = (int) $post_start + (int) $post_length;
@@ -1047,7 +1046,7 @@  discard block
 block discarded – undo
1047 1046
     // get user info
1048 1047
     $userInfo = DB::queryFirstRow(
1049 1048
         'SELECT email, login, auth_type, special, lastname, name
1050
-        FROM ' . prefixTable('users') . '
1049
+        FROM ' . prefixTable('users').'
1051 1050
         WHERE id = %i',
1052 1051
         $extra_arguments['new_user_id']
1053 1052
     );
@@ -1061,13 +1060,13 @@  discard block
 block discarded – undo
1061 1060
         sendMailToUser(
1062 1061
             filter_var($userInfo['email'], FILTER_SANITIZE_FULL_SPECIAL_CHARS),
1063 1062
             empty($extra_arguments['email_body']) === false ? $extra_arguments['email_body'] : langHdl('email_body_user_config_1'),
1064
-            'TEAMPASS - ' . langHdl('login_credentials'),
1063
+            'TEAMPASS - '.langHdl('login_credentials'),
1065 1064
             (array) filter_var_array(
1066 1065
                 [
1067
-                    '#code#' => cryption($extra_arguments['new_user_code'], '','decrypt', $SETTINGS)['string'],
1066
+                    '#code#' => cryption($extra_arguments['new_user_code'], '', 'decrypt', $SETTINGS)['string'],
1068 1067
                     '#lastname#' => isset($userInfo['name']) === true ? $userInfo['name'] : '',
1069 1068
                     '#login#' => isset($userInfo['login']) === true ? $userInfo['login'] : '',
1070
-                    '#password#' => cryption($extra_arguments['new_user_pwd'], '','decrypt', $SETTINGS)['string'],
1069
+                    '#password#' => cryption($extra_arguments['new_user_pwd'], '', 'decrypt', $SETTINGS)['string'],
1071 1070
                 ],
1072 1071
                 FILTER_SANITIZE_FULL_SPECIAL_CHARS
1073 1072
             ),
Please login to merge, or discard this patch.
pages/utilities.renewal.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
 if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('utilities.renewal') === false) {
63 63
     // Not allowed page
64 64
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
65
-    include $SETTINGS['cpassman_dir'] . '/error.php';
65
+    include $SETTINGS['cpassman_dir'].'/error.php';
66 66
     exit;
67 67
 }
68 68
 
Please login to merge, or discard this patch.
pages/uploads.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
 if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('uploads') === false) {
57 57
     // Not allowed page
58 58
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
59
-    include $SETTINGS['cpassman_dir'] . '/error.php';
59
+    include $SETTINGS['cpassman_dir'].'/error.php';
60 60
     exit;
61 61
 }
62 62
 
Please login to merge, or discard this patch.
pages/folders.php 1 patch
Spacing   +11 added lines, -11 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('folders') === false) {
65 65
     // Not allowed page
66 66
     $_SESSION['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
 
@@ -100,28 +100,28 @@  discard block
 block discarded – undo
100 100
 $complexityHtml = '<div id="hidden-select-complexity" class="hidden"><select id="select-complexity" class="form-control form-item-control save-me">';
101 101
 $complexitySelect = '';
102 102
 foreach (TP_PW_COMPLEXITY as $level) {
103
-    $complexitySelect .= '<option value="' . $level[0] . '">' . $level[1] . '</option>';
103
+    $complexitySelect .= '<option value="'.$level[0].'">'.$level[1].'</option>';
104 104
 }
105
-$complexityHtml .= $complexitySelect . '</select></div>';
105
+$complexityHtml .= $complexitySelect.'</select></div>';
106 106
 
107 107
 /* Get full tree structure */
108 108
 $tst = $tree->getDescendants();
109 109
 // prepare options list
110
-$droplist = '<option value="na">---' . langHdl('select') . '---</option>';
110
+$droplist = '<option value="na">---'.langHdl('select').'---</option>';
111 111
 if ((int) $_SESSION['is_admin'] === 1 || (int) $_SESSION['user_manager'] === 1 || (int) $_SESSION['can_create_root_folder'] === 1) {
112
-    $droplist .= '<option value="0">' . langHdl('root') . '</option>';
112
+    $droplist .= '<option value="0">'.langHdl('root').'</option>';
113 113
 }
114 114
 foreach ($tst as $t) {
115 115
     if (
116 116
         in_array($t->id, $_SESSION['groupes_visibles']) === true
117 117
         && in_array($t->id, $_SESSION['personal_visible_groups']) === false
118 118
     ) {
119
-        $droplist .= '<option value="' . $t->id . '">' . addslashes($t->title);
119
+        $droplist .= '<option value="'.$t->id.'">'.addslashes($t->title);
120 120
         $text = '';
121 121
         foreach ($tree->getPath($t->id, false) as $fld) {
122
-            $text .= empty($text) === true ? '     [' . $fld->title : ' > ' . $fld->title;
122
+            $text .= empty($text) === true ? '     ['.$fld->title : ' > '.$fld->title;
123 123
         }
124
-        $droplist .= (empty($text) === true ? '' : $text . '</i>]') . '</option>';
124
+        $droplist .= (empty($text) === true ? '' : $text.'</i>]').'</option>';
125 125
     }
126 126
 }
127 127
 
@@ -200,14 +200,14 @@  discard block
 block discarded – undo
200 200
                                     <label><?php echo langHdl('icon'); ?></label>
201 201
                                     <input type="text" class="form-control form-folder-control purify" id="new-folder-add-icon" data-field="icon">
202 202
                                     <small class='form-text text-muted'>
203
-                                        <?php echo langHdl('fontawesome_icon_tip'); ?><a href="<?php echo FONTAWESOME_URL;?>" target="_blank"><i class="fas fa-external-link-alt ml-1"></i></a>
203
+                                        <?php echo langHdl('fontawesome_icon_tip'); ?><a href="<?php echo FONTAWESOME_URL; ?>" target="_blank"><i class="fas fa-external-link-alt ml-1"></i></a>
204 204
                                     </small>
205 205
                                 </div>
206 206
                                 <div class="form-group">
207 207
                                     <label><?php echo langHdl('icon_on_selection'); ?></label>
208 208
                                     <input type="text" class="form-control form-folder-control purify" id="new-folder-add-icon-selected" data-field="iconSelected">
209 209
                                     <small class='form-text text-muted'>
210
-                                        <?php echo langHdl('fontawesome_icon_tip'); ?><a href="<?php echo FONTAWESOME_URL;?>" target="_blank"><i class="fas fa-external-link-alt ml-1"></i></a>
210
+                                        <?php echo langHdl('fontawesome_icon_tip'); ?><a href="<?php echo FONTAWESOME_URL; ?>" target="_blank"><i class="fas fa-external-link-alt ml-1"></i></a>
211 211
                                     </small>
212 212
                                 </div>
213 213
                                 <div class="form-group">
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
                                 <th scope="col" min-width="200px"><?php echo langHdl('group'); ?></th>
299 299
                                 <th scope="col" min-width="200px"><?php echo langHdl('group_parent'); ?></th>
300 300
                                 <th scope="col" width="50px"><i class="fas fa-gavel fa-lg infotip" title="<?php echo langHdl('password_strength'); ?>"></i></th>
301
-                                <th scope="col" width="50px"><i class="fas fa-recycle fa-lg infotip" title="<?php echo langHdl('group_pw_duration') . ' ' . langHdl('group_pw_duration_tip'); ?>"></i></th>
301
+                                <th scope="col" width="50px"><i class="fas fa-recycle fa-lg infotip" title="<?php echo langHdl('group_pw_duration').' '.langHdl('group_pw_duration_tip'); ?>"></i></th>
302 302
                                 <th scope="col" width="50px"><i class="fas fa-pen fa-lg infotip" title="<?php echo langHdl('auth_creation_without_complexity'); ?>"></i></th>
303 303
                                 <th scope="col" width="50px"><i class="fas fa-edit fa-lg infotip" title="<?php echo langHdl('auth_modification_without_complexity'); ?>"></i></th>
304 304
                                 <th scope="col" width="50px"><i class="fas fa-folder fa-lg infotip" title="<?php echo langHdl('icon'); ?>"></i></th>
Please login to merge, or discard this patch.
pages/utilities.renewal.js.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@
 block discarded – undo
71 71
 if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('utilities.logs') === false) {
72 72
     // Not allowed page
73 73
     $_SESSION['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
 
Please login to merge, or discard this patch.