Passed
Pull Request — master (#4704)
by Nils
07:37
created
pages/profile.js.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('profile') === false) {
74 74
     // Not allowed page
75 75
     $session->set('system-error_code', ERR_NOT_ALLOWED);
76
-    include $SETTINGS['cpassman_dir'] . '/error.php';
76
+    include $SETTINGS['cpassman_dir'].'/error.php';
77 77
     exit;
78 78
 }
79 79
 ?>
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
     })
98 98
 
99 99
     // Select user properties
100
-    $('#profile-user-language option[value=<?php echo $session->get('user-language');?>').attr('selected','selected');
100
+    $('#profile-user-language option[value=<?php echo $session->get('user-language'); ?>').attr('selected','selected');
101 101
 
102 102
 
103 103
     // AVATAR IMPORT
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
 
296 296
                     // reload page in case of language change
297 297
                     if ($('#profile-user-language').val()
298
-                        && $('#profile-user-language').val().toLowerCase() !== '<?php echo $session->get('user-language');?>') {
298
+                        && $('#profile-user-language').val().toLowerCase() !== '<?php echo $session->get('user-language'); ?>') {
299 299
                         // prepare reload
300 300
                         $(this).delay(3000).queue(function() {
301 301
                             document.location.href = "index.php?page=profile";
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
                         // Inform user
307 307
                         toastr.remove();
308 308
                         toastr.info(
309
-                            '<?php echo $lang->get('alert_page_will_reload') . ' ... ' . $lang->get('please_wait'); ?>',
309
+                            '<?php echo $lang->get('alert_page_will_reload').' ... '.$lang->get('please_wait'); ?>',
310 310
                             '', {
311 311
                                 timeOut: 3000,
312 312
                                 progressBar: true
@@ -410,27 +410,27 @@  discard block
 block discarded – undo
410 410
         "defaultText": "<?php echo $lang->get('index_pw_level_txt'); ?>",
411 411
         "ratings": [
412 412
             {
413
-                "minScore": <?php echo TP_PW_STRENGTH_1;?>,
413
+                "minScore": <?php echo TP_PW_STRENGTH_1; ?>,
414 414
                 "className": "meterWarn",
415 415
                 "text": "<?php echo $lang->get('complex_level1'); ?>"
416 416
             },
417 417
             {
418
-                "minScore": <?php echo TP_PW_STRENGTH_2;?>,
418
+                "minScore": <?php echo TP_PW_STRENGTH_2; ?>,
419 419
                 "className": "meterWarn",
420 420
                 "text": "<?php echo $lang->get('complex_level2'); ?>"
421 421
             },
422 422
             {
423
-                "minScore": <?php echo TP_PW_STRENGTH_3;?>,
423
+                "minScore": <?php echo TP_PW_STRENGTH_3; ?>,
424 424
                 "className": "meterGood",
425 425
                 "text": "<?php echo $lang->get('complex_level3'); ?>"
426 426
             },
427 427
             {
428
-                "minScore": <?php echo TP_PW_STRENGTH_4;?>,
428
+                "minScore": <?php echo TP_PW_STRENGTH_4; ?>,
429 429
                 "className": "meterGood",
430 430
                 "text": "<?php echo $lang->get('complex_level4'); ?>"
431 431
             },
432 432
             {
433
-                "minScore": <?php echo TP_PW_STRENGTH_5;?>,
433
+                "minScore": <?php echo TP_PW_STRENGTH_5; ?>,
434 434
                 "className": "meterExcel",
435 435
                 "text": "<?php echo $lang->get('complex_level5'); ?>"
436 436
             }
@@ -523,27 +523,27 @@  discard block
 block discarded – undo
523 523
         "defaultText": "<?php echo $lang->get('index_pw_level_txt'); ?>",
524 524
         "ratings": [
525 525
             {
526
-                "minScore": <?php echo TP_PW_STRENGTH_1;?>,
526
+                "minScore": <?php echo TP_PW_STRENGTH_1; ?>,
527 527
                 "className": "meterWarn",
528 528
                 "text": "<?php echo $lang->get('complex_level1'); ?>"
529 529
             },
530 530
             {
531
-                "minScore": <?php echo TP_PW_STRENGTH_2;?>,
531
+                "minScore": <?php echo TP_PW_STRENGTH_2; ?>,
532 532
                 "className": "meterWarn",
533 533
                 "text": "<?php echo $lang->get('complex_level2'); ?>"
534 534
             },
535 535
             {
536
-                "minScore": <?php echo TP_PW_STRENGTH_3;?>,
536
+                "minScore": <?php echo TP_PW_STRENGTH_3; ?>,
537 537
                 "className": "meterGood",
538 538
                 "text": "<?php echo $lang->get('complex_level3'); ?>"
539 539
             },
540 540
             {
541
-                "minScore": <?php echo TP_PW_STRENGTH_4;?>,
541
+                "minScore": <?php echo TP_PW_STRENGTH_4; ?>,
542 542
                 "className": "meterGood",
543 543
                 "text": "<?php echo $lang->get('complex_level4'); ?>"
544 544
             },
545 545
             {
546
-                "minScore": <?php echo TP_PW_STRENGTH_5;?>,
546
+                "minScore": <?php echo TP_PW_STRENGTH_5; ?>,
547 547
                 "className": "meterExcel",
548 548
                 "text": "<?php echo $lang->get('complex_level5'); ?>"
549 549
             }
@@ -559,7 +559,7 @@  discard block
 block discarded – undo
559 559
         }
560 560
     });
561 561
 
562
-    $('#profile-keys_download-date').text('<?php echo null === $session->get('user-keys_recovery_time') ? $lang->get('none') : date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $session->get('user-keys_recovery_time')); ?>');
562
+    $('#profile-keys_download-date').text('<?php echo null === $session->get('user-keys_recovery_time') ? $lang->get('none') : date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $session->get('user-keys_recovery_time')); ?>');
563 563
 
564 564
     $("#open-dialog-keys-download").on('click', function(event) {
565 565
         event.preventDefault();
Please login to merge, or discard this patch.
pages/items.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('items') === false) {
70 70
     // Not allowed page
71 71
     $session->set('system-error_code', ERR_NOT_ALLOWED);
72
-    include $SETTINGS['cpassman_dir'] . '/error.php';
72
+    include $SETTINGS['cpassman_dir'].'/error.php';
73 73
     exit;
74 74
 }
75 75
 // Define Timezone
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 
91 91
 // Get list of users
92 92
 $usersList = [];
93
-$rows = DB::query('SELECT id,login,email FROM ' . prefixTable('users') . ' ORDER BY login ASC');
93
+$rows = DB::query('SELECT id,login,email FROM '.prefixTable('users').' ORDER BY login ASC');
94 94
 foreach ($rows as $record) {
95 95
     $usersList[$record['login']] = [
96 96
         'id' => $record['id'],
@@ -101,16 +101,16 @@  discard block
 block discarded – undo
101 101
 // Get list of roles
102 102
 $arrRoles = [];
103 103
 $listRoles = '';
104
-$rows = DB::query('SELECT id,title FROM ' . prefixTable('roles_title') . ' ORDER BY title ASC');
104
+$rows = DB::query('SELECT id,title FROM '.prefixTable('roles_title').' ORDER BY title ASC');
105 105
 foreach ($rows as $reccord) {
106 106
     $arrRoles[$reccord['title']] = [
107 107
         'id' => $reccord['id'],
108 108
         'title' => $reccord['title'],
109 109
     ];
110 110
     if (empty($listRoles)) {
111
-        $listRoles = $reccord['id'] . '#' . $reccord['title'];
111
+        $listRoles = $reccord['id'].'#'.$reccord['title'];
112 112
     } else {
113
-        $listRoles .= ';' . $reccord['id'] . '#' . $reccord['title'];
113
+        $listRoles .= ';'.$reccord['id'].'#'.$reccord['title'];
114 114
     }
115 115
 }
116 116
 
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
                         <li class="nav-item"><a class="nav-link" href="#tab_3" data-toggle="tab"><i class="fa-solid fa-archive mr-2"></i><?php echo $lang->get('attachments'); ?></a></li>
186 186
                         <?php
187 187
                         echo isset($SETTINGS['item_extra_fields']) === true && (int) $SETTINGS['item_extra_fields'] === 1 ? '
188
-                            <li class="nav-item"><a class="nav-link" href="#tab_4" data-toggle="tab"><i class="fa-solid fa-cubes mr-2"></i>' . $lang->get('fields') . '</a></li>' : '';
188
+                            <li class="nav-item"><a class="nav-link" href="#tab_4" data-toggle="tab"><i class="fa-solid fa-cubes mr-2"></i>' . $lang->get('fields').'</a></li>' : '';
189 189
                         ?>
190 190
                     </ul>
191 191
                 </div><!-- /.card-header -->
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
                                                 <?php
255 255
                                                 for ($i = 4; $i <= $SETTINGS['pwd_maximum_length']; ++$i) {
256 256
                                                     echo '
257
-                                                <option>' . $i . '</option>';
257
+                                                <option>' . $i.'</option>';
258 258
                                                 }
259 259
                                                 ?>
260 260
                                             </select>
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
                                     <span class="ml-2 col-md-1 clear-me-html" id="form-item-icon-show"></span>
285 285
                                 </div>
286 286
                                 <small class='form-text text-muted'>
287
-                                    <?php echo $lang->get('fontawesome_icon_tip'); ?><a href="<?php echo FONTAWESOME_URL;?>" target="_blank"><i class="fa-solid fa-external-link-alt ml-1"></i></a>
287
+                                    <?php echo $lang->get('fontawesome_icon_tip'); ?><a href="<?php echo FONTAWESOME_URL; ?>" target="_blank"><i class="fa-solid fa-external-link-alt ml-1"></i></a>
288 288
                                 </small>
289 289
                             </div>
290 290
 
@@ -472,39 +472,39 @@  discard block
 block discarded – undo
472 472
                             <div class="tab-pane" id="tab_4">
473 473
                                 <div id="form-item-field" class="hidden">
474 474
                                     <?php
475
-                                        $session_item_fields = $session->get('system-item_fields');//print_r($session_item_fields);
475
+                                        $session_item_fields = $session->get('system-item_fields'); //print_r($session_item_fields);
476 476
                                         if (isset($session_item_fields) === true) {
477 477
                                             foreach ($session_item_fields as $category) {
478 478
                                                 //print_r($category);
479 479
                                                 echo '
480
-                                            <div class="callout callout-info form-item-category hidden" id="form-item-category-' . $category['id'] . '">
481
-                                                <h5>' . $category['title'] . '</h5>
480
+                                            <div class="callout callout-info form-item-category hidden" id="form-item-category-' . $category['id'].'">
481
+                                                <h5>' . $category['title'].'</h5>
482 482
                                                 <p>';
483 483
                                                 foreach ($category['fields'] as $field) {
484 484
                                                     if ($field['type'] === 'textarea') {
485 485
                                                         echo '
486
-                                                    <div class="form-group mb-3 form-item-field" id="form-item-field-' . $field['id'] . '" data-field-id="' . $field['id'] . '">
486
+                                                    <div class="form-group mb-3 form-item-field" id="form-item-field-' . $field['id'].'" data-field-id="'.$field['id'].'">
487 487
                                                         <label>' . $field['title'],
488 488
                                                             $field['is_mandatory'] === '1' ?
489
-                                                                '<span class="fa-solid fa-fire text-danger ml-1 infotip" title="' . $lang->get('is_mandatory') . '"></span>' : '',
489
+                                                                '<span class="fa-solid fa-fire text-danger ml-1 infotip" title="'.$lang->get('is_mandatory').'"></span>' : '',
490 490
                                                             '</label>
491
-                                                        <textarea class="form-control form-item-control form-item-field-custom" rows="2" data-field-name="' . $field['id'] . '" data-field-mandatory="' . $field['is_mandatory'] . '" data-field-regex="' . $field['regex'] . '" data-change-ongoing="0"></textarea>
491
+                                                        <textarea class="form-control form-item-control form-item-field-custom" rows="2" data-field-name="' . $field['id'].'" data-field-mandatory="'.$field['is_mandatory'].'" data-field-regex="'.$field['regex'].'" data-change-ongoing="0"></textarea>
492 492
                                                     </div>';
493 493
                                                     } else {
494 494
                                                         echo '
495
-                                                    <div class="input-group mb-3 form-item-field" id="form-item-field-' . $field['id'] . '" data-field-id="' . $field['id'] . '">
495
+                                                    <div class="input-group mb-3 form-item-field" id="form-item-field-' . $field['id'].'" data-field-id="'.$field['id'].'">
496 496
                                                         <div class="input-group-prepend">
497 497
                                                             <span class="input-group-text">' . $field['title'],
498 498
                                                             $field['is_mandatory'] === '1' ?
499
-                                                                '<span class="fa-solid fa-fire text-danger ml-1 infotip" title="' . $lang->get('is_mandatory') . '"></span>' : '',
499
+                                                                '<span class="fa-solid fa-fire text-danger ml-1 infotip" title="'.$lang->get('is_mandatory').'"></span>' : '',
500 500
                                                             '</span>
501 501
                                                         </div>
502
-                                                        <input type="' . $field['type'] . '" class="form-control form-item-control form-item-field-custom" data-field-name="' . $field['id'] . '" data-field-mandatory="' . $field['is_mandatory'] . '" data-field-regex="' . $field['regex'] . '" data-change-ongoing="0">
502
+                                                        <input type="' . $field['type'].'" class="form-control form-item-control form-item-field-custom" data-field-name="'.$field['id'].'" data-field-mandatory="'.$field['is_mandatory'].'" data-field-regex="'.$field['regex'].'" data-change-ongoing="0">
503 503
                                                     </div>';
504 504
                                                     }
505 505
                                                     if (!empty($field['regex'])) {
506 506
                                                         echo '
507
-                                                    <div>Regex: '. $field['regex'] .'</div>
507
+                                                    <div>Regex: '. $field['regex'].'</div>
508 508
                                                         ';
509 509
                                                     }
510 510
                                                 }
@@ -515,8 +515,8 @@  discard block
 block discarded – undo
515 515
                                                 ) {
516 516
                                                     echo '
517 517
                                                     <div class="form-check icheck-blue">
518
-                                                        <input type="checkbox" class="form-check-input form-check-input-template form-item-control flat-blue" data-category-id="' . $category['id'] . '" data-change-ongoing="0" data-field-name="template" id="template_' . $category['id'] . '">
519
-                                                        <label class="form-check-label ml-3" for="template_' . $category['id'] . '">' . $lang->get('main_template') . '</label>
518
+                                                        <input type="checkbox" class="form-check-input form-check-input-template form-item-control flat-blue" data-category-id="' . $category['id'].'" data-change-ongoing="0" data-field-name="template" id="template_'.$category['id'].'">
519
+                                                        <label class="form-check-label ml-3" for="template_' . $category['id'].'">'.$lang->get('main_template').'</label>
520 520
                                                     </div>';
521 521
                                                 }
522 522
                                                 echo '
@@ -526,8 +526,8 @@  discard block
 block discarded – undo
526 526
                                         } else {
527 527
                                             echo
528 528
                                             '<div class="alert alert-info">
529
-                                                <h5><i class="icon fa fa-info mr-3"></i>' . $lang->get('information') . '</h5>
530
-                                                ' . $lang->get('no_fields') . '
529
+                                                <h5><i class="icon fa fa-info mr-3"></i>' . $lang->get('information').'</h5>
530
+                                                ' . $lang->get('no_fields').'
531 531
                                             </div>';
532 532
                                         } ?>
533 533
                                 </div>
@@ -668,7 +668,7 @@  discard block
 block discarded – undo
668 668
                         <p><?php
669 669
                             echo str_replace(
670 670
         ['##otv_expiration_period##', '. '],
671
-        ['<span class="text-bold text-primary">' . $SETTINGS['otv_expiration_period'] . '</span>', '<br>'],
671
+        ['<span class="text-bold text-primary">'.$SETTINGS['otv_expiration_period'].'</span>', '<br>'],
672 672
         $lang->get('otv_message')
673 673
     );
674 674
                             ?></p>
@@ -686,9 +686,9 @@  discard block
 block discarded – undo
686 686
 
687 687
                     <div class="row">
688 688
                         <div class="form-group col-4">
689
-                            <label for="form-item-otv-days"><i class="fa-regular fa-calendar-days mr-2"></i><?php echo $lang->get('number_of_days'); ?> (<?php echo $lang->get('maximum').': '.$SETTINGS['otv_expiration_period'];?>)</label>
689
+                            <label for="form-item-otv-days"><i class="fa-regular fa-calendar-days mr-2"></i><?php echo $lang->get('number_of_days'); ?> (<?php echo $lang->get('maximum').': '.$SETTINGS['otv_expiration_period']; ?>)</label>
690 690
                             <div class="input-group mb-3">
691
-                                <input type="number" class="form-control clear-me-val" id="form-item-otv-days" min="0" max="<?php echo $SETTINGS['otv_expiration_period'];?>" value="<?php echo $SETTINGS['otv_expiration_period'];?>">
691
+                                <input type="number" class="form-control clear-me-val" id="form-item-otv-days" min="0" max="<?php echo $SETTINGS['otv_expiration_period']; ?>" value="<?php echo $SETTINGS['otv_expiration_period']; ?>">
692 692
                             </div>
693 693
                         </div>
694 694
 
@@ -776,7 +776,7 @@  discard block
 block discarded – undo
776 776
                             <select class="form-control form-folder-control select2" style="width:100%;" id="form-folder-add-complexicity" required>
777 777
                                 <?php
778 778
                                 foreach (TP_PW_COMPLEXITY as $key => $value) {
779
-                                    echo '<option value="' . $key . '">' . $value[1] . '</option>';
779
+                                    echo '<option value="'.$key.'">'.$value[1].'</option>';
780 780
                                 }
781 781
                                 ?>
782 782
                             </select>
@@ -794,14 +794,14 @@  discard block
 block discarded – undo
794 794
                             <label><?php echo $lang->get('icon'); ?></label>
795 795
                             <input type="text" class="form-control form-folder-control" id="form-folder-add-icon">
796 796
                             <small class='form-text text-muted'>
797
-                                <?php echo $lang->get('fontawesome_icon_tip'); ?><a href="<?php echo FONTAWESOME_URL;?>" target="_blank"><i class="fa-solid fa-external-link-alt ml-1"></i></a>
797
+                                <?php echo $lang->get('fontawesome_icon_tip'); ?><a href="<?php echo FONTAWESOME_URL; ?>" target="_blank"><i class="fa-solid fa-external-link-alt ml-1"></i></a>
798 798
                             </small>
799 799
                         </div>
800 800
                         <div class="form-group">
801 801
                             <label><?php echo $lang->get('icon_on_selection'); ?></label>
802 802
                             <input type="text" class="form-control form-folder-control" id="form-folder-add-icon-selected">
803 803
                             <small class='form-text text-muted'>
804
-                                <?php echo $lang->get('fontawesome_icon_tip'); ?><a href="<?php echo FONTAWESOME_URL;?>" target="_blank"><i class="fa-solid fa-external-link-alt ml-1"></i></a>
804
+                                <?php echo $lang->get('fontawesome_icon_tip'); ?><a href="<?php echo FONTAWESOME_URL; ?>" target="_blank"><i class="fa-solid fa-external-link-alt ml-1"></i></a>
805 805
                             </small>
806 806
                         </div>
807 807
                     </div>
@@ -1212,18 +1212,18 @@  discard block
 block discarded – undo
1212 1212
                                 <?php
1213 1213
                                     foreach ($session_item_fields as $elem) {
1214 1214
                                         echo '
1215
-                                <div class="callout callout-info card-item-category hidden" id="card-item-category-' . $elem['id'] . '">
1216
-                                    <h5>' . $elem['title'] . '</h5>
1215
+                                <div class="callout callout-info card-item-category hidden" id="card-item-category-' . $elem['id'].'">
1216
+                                    <h5>' . $elem['title'].'</h5>
1217 1217
                                     <p>
1218 1218
                                         <ul class="list-group list-group-unbordered mb-3">';
1219 1219
                                         foreach ($elem['fields'] as $field) {
1220 1220
                                             echo '
1221
-                                            <li class="list-group-item card-item-field hidden" id="card-item-field-' . $field['id'] . '">
1222
-                                                <span id="card-item-field-title-' . $field['id'] . '"><b>' . $field['title'] . '</b></span>
1223
-                                                <button type="button" class="float-right btn btn-secondary btn-sm ml-1 btn-copy-clipboard-clear"  data-clipboard-target="card-item-field-value-' . $field['id'] . '">
1221
+                                            <li class="list-group-item card-item-field hidden" id="card-item-field-' . $field['id'].'">
1222
+                                                <span id="card-item-field-title-' . $field['id'].'"><b>'.$field['title'].'</b></span>
1223
+                                                <button type="button" class="float-right btn btn-secondary btn-sm ml-1 btn-copy-clipboard-clear"  data-clipboard-target="card-item-field-value-' . $field['id'].'">
1224 1224
                                                     <i class="fa-solid fa-copy"></i>
1225 1225
                                                 </button>
1226
-                                                <span class="card-item-field-value float-right ml-1" id="card-item-field-value-' . $field['id'] . '"></span>
1226
+                                                <span class="card-item-field-value float-right ml-1" id="card-item-field-value-' . $field['id'].'"></span>
1227 1227
                                             </li>';
1228 1228
                                         }
1229 1229
                                         echo '
Please login to merge, or discard this patch.
sources/tools.queries.php 2 patches
Switch Indentation   +171 added lines, -171 removed lines patch added patch discarded remove patch
@@ -91,215 +91,215 @@
 block discarded – undo
91 91
 switch ($post_type) {
92 92
 //##########################################################
93 93
 //CASE for creating a DB backup
94
-case 'perform_fix_pf_items-step1':
95
-    // Check KEY
96
-    if (!hash_equals((string) $session->get('key'), (string) $post_key)) {
97
-        echo prepareExchangedData(
98
-            array(
99
-                'error' => true,
100
-                'message' => $lang->get('key_is_not_correct'),
101
-            ),
102
-            'encode'
103
-        );
104
-        break;
105
-    }
106
-    // Is admin?
107
-    if ((int) $session->get('user-admin') !== 1) {
108
-        echo prepareExchangedData(
109
-            array(
110
-                'error' => true,
111
-                'message' => $lang->get('error_not_allowed_to'),
112
-            ),
113
-            'encode'
114
-        );
115
-        break;
116
-    }
94
+    case 'perform_fix_pf_items-step1':
95
+        // Check KEY
96
+        if (!hash_equals((string) $session->get('key'), (string) $post_key)) {
97
+            echo prepareExchangedData(
98
+                array(
99
+                    'error' => true,
100
+                    'message' => $lang->get('key_is_not_correct'),
101
+                ),
102
+                'encode'
103
+            );
104
+            break;
105
+        }
106
+        // Is admin?
107
+        if ((int) $session->get('user-admin') !== 1) {
108
+            echo prepareExchangedData(
109
+                array(
110
+                    'error' => true,
111
+                    'message' => $lang->get('error_not_allowed_to'),
112
+                ),
113
+                'encode'
114
+            );
115
+            break;
116
+        }
117 117
 
118
-    // decrypt and retrieve data in JSON format
119
-    $dataReceived = prepareExchangedData(
120
-        $post_data,
121
-        'decode'
122
-    );
118
+        // decrypt and retrieve data in JSON format
119
+        $dataReceived = prepareExchangedData(
120
+            $post_data,
121
+            'decode'
122
+        );
123 123
 
124
-    $userId = filter_var($dataReceived['userId'], FILTER_SANITIZE_NUMBER_INT);
124
+        $userId = filter_var($dataReceived['userId'], FILTER_SANITIZE_NUMBER_INT);
125 125
 
126
-    // Get user info
127
-    $userInfo = DB::queryFirstRow(
128
-        'SELECT private_key, public_key, psk, encrypted_psk
126
+        // Get user info
127
+        $userInfo = DB::queryFirstRow(
128
+            'SELECT private_key, public_key, psk, encrypted_psk
129 129
         FROM teampass_users
130 130
         WHERE id = %i',
131
-        $userId
132
-    );
131
+            $userId
132
+        );
133 133
 
134
-    // Get user's private folders
135
-    $userPFRoot = DB::queryFirstRow(
136
-        'SELECT id
134
+        // Get user's private folders
135
+        $userPFRoot = DB::queryFirstRow(
136
+            'SELECT id
137 137
         FROM teampass_nested_tree
138 138
         WHERE title = %i',
139
-        $userId
140
-    );
141
-    if (DB::count() === 0) {
142
-        echo prepareExchangedData(
143
-            array(
144
-                'error' => true,
145
-                'message' => 'User has no personal folders',
146
-            ),
147
-            'encode'
148
-        );
149
-        break;
150
-    }
151
-    $personalFolders = [];
152
-    $tree = new NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title');
153
-    $tree->rebuild();
154
-    $folders = $tree->getDescendants($userPFRoot['id'], true);
155
-    foreach ($folders as $folder) {
156
-        array_push($personalFolders, $folder->id);
157
-    }
158
-
159
-    //Show done
160
-    echo prepareExchangedData(
161
-        array(
162
-            'error' => false,
163
-            'message' => 'Personal Folders found: ',
164
-            'personalFolders' => json_encode($personalFolders),
165
-        ),
166
-        'encode'
167
-    );
168
-    break;
169
-
170
-case 'perform_fix_pf_items-step2':
171
-    // Check KEY
172
-    if (!hash_equals((string) $session->get('key'), (string) $post_key)) {
173
-        echo prepareExchangedData(
174
-            array(
175
-                'error' => true,
176
-                'message' => $lang->get('key_is_not_correct'),
177
-            ),
178
-            'encode'
139
+            $userId
179 140
         );
180
-        break;
181
-    }
182
-    // Is admin?
183
-    if ((int) $session->get('user-admin') !== 1) {
141
+        if (DB::count() === 0) {
142
+            echo prepareExchangedData(
143
+                array(
144
+                    'error' => true,
145
+                    'message' => 'User has no personal folders',
146
+                ),
147
+                'encode'
148
+            );
149
+            break;
150
+        }
151
+        $personalFolders = [];
152
+        $tree = new NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title');
153
+        $tree->rebuild();
154
+        $folders = $tree->getDescendants($userPFRoot['id'], true);
155
+        foreach ($folders as $folder) {
156
+            array_push($personalFolders, $folder->id);
157
+        }
158
+
159
+        //Show done
184 160
         echo prepareExchangedData(
185 161
             array(
186
-                'error' => true,
187
-                'message' => $lang->get('error_not_allowed_to'),
162
+                'error' => false,
163
+                'message' => 'Personal Folders found: ',
164
+                'personalFolders' => json_encode($personalFolders),
188 165
             ),
189 166
             'encode'
190 167
         );
191 168
         break;
192
-    }
193 169
 
194
-    // decrypt and retrieve data in JSON format
195
-    $dataReceived = prepareExchangedData(
196
-        $post_data,
197
-        'decode'
198
-    );
170
+    case 'perform_fix_pf_items-step2':
171
+        // Check KEY
172
+        if (!hash_equals((string) $session->get('key'), (string) $post_key)) {
173
+            echo prepareExchangedData(
174
+                array(
175
+                    'error' => true,
176
+                    'message' => $lang->get('key_is_not_correct'),
177
+                ),
178
+                'encode'
179
+            );
180
+            break;
181
+        }
182
+        // Is admin?
183
+        if ((int) $session->get('user-admin') !== 1) {
184
+            echo prepareExchangedData(
185
+                array(
186
+                    'error' => true,
187
+                    'message' => $lang->get('error_not_allowed_to'),
188
+                ),
189
+                'encode'
190
+            );
191
+            break;
192
+        }
199 193
 
200
-    $userId = filter_var($dataReceived['userId'], FILTER_SANITIZE_NUMBER_INT);
201
-    $personalFolders = filter_var($dataReceived['personalFolders'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
194
+        // decrypt and retrieve data in JSON format
195
+        $dataReceived = prepareExchangedData(
196
+            $post_data,
197
+            'decode'
198
+        );
199
+
200
+        $userId = filter_var($dataReceived['userId'], FILTER_SANITIZE_NUMBER_INT);
201
+        $personalFolders = filter_var($dataReceived['personalFolders'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
202 202
 
203
-    // Delete all private items with sharekeys
204
-    $pfiSharekeys = DB::queryFirstColumn(
205
-        'select s.increment_id
203
+        // Delete all private items with sharekeys
204
+        $pfiSharekeys = DB::queryFirstColumn(
205
+            'select s.increment_id
206 206
         from teampass_sharekeys_items as s
207 207
         INNER JOIN teampass_items AS i ON (i.id = s.object_id)
208 208
         WHERE s.user_id = %i AND i.perso = 1 AND i.id_tree IN %ls',
209
-        $userId,
210
-        $personalFolders
211
-    );
212
-    $pfiSharekeysCount = DB::count();
213
-    if ($pfiSharekeysCount > 0) {
214
-        DB::delete(
215
-            "teampass_sharekeys_items",
216
-            "increment_id IN %ls",
217
-            $pfiSharekeys
209
+            $userId,
210
+            $personalFolders
218 211
         );
219
-    }
212
+        $pfiSharekeysCount = DB::count();
213
+        if ($pfiSharekeysCount > 0) {
214
+            DB::delete(
215
+                "teampass_sharekeys_items",
216
+                "increment_id IN %ls",
217
+                $pfiSharekeys
218
+            );
219
+        }
220 220
 
221 221
     
222
-    //Show done
223
-    echo prepareExchangedData(
224
-        array(
225
-            'error' => false,
226
-            'message' => '<br>Number of Sharekeys for private items DELETED: ',
227
-            'nbDeleted' => $pfiSharekeysCount,
228
-            'personalFolders' => json_encode($personalFolders),
229
-        ),
230
-        'encode'
231
-    );
232
-    break;
233
-
234
-case 'perform_fix_pf_items-step3':
235
-    // Check KEY
236
-    if (!hash_equals((string) $session->get('key'), (string) $post_key)) {
237
-        echo prepareExchangedData(
238
-            array(
239
-                'error' => true,
240
-                'message' => $lang->get('key_is_not_correct'),
241
-            ),
242
-            'encode'
243
-        );
244
-        break;
245
-    }
246
-    // Is admin?
247
-    if ((int) $session->get('user-admin') !== 1) {
222
+        //Show done
248 223
         echo prepareExchangedData(
249 224
             array(
250
-                'error' => true,
251
-                'message' => $lang->get('error_not_allowed_to'),
225
+                'error' => false,
226
+                'message' => '<br>Number of Sharekeys for private items DELETED: ',
227
+                'nbDeleted' => $pfiSharekeysCount,
228
+                'personalFolders' => json_encode($personalFolders),
252 229
             ),
253 230
             'encode'
254 231
         );
255 232
         break;
256
-    }
257 233
 
258
-    // decrypt and retrieve data in JSON format
259
-    $dataReceived = prepareExchangedData(
260
-        $post_data,
261
-        'decode'
262
-    );
234
+    case 'perform_fix_pf_items-step3':
235
+        // Check KEY
236
+        if (!hash_equals((string) $session->get('key'), (string) $post_key)) {
237
+            echo prepareExchangedData(
238
+                array(
239
+                    'error' => true,
240
+                    'message' => $lang->get('key_is_not_correct'),
241
+                ),
242
+                'encode'
243
+            );
244
+            break;
245
+        }
246
+        // Is admin?
247
+        if ((int) $session->get('user-admin') !== 1) {
248
+            echo prepareExchangedData(
249
+                array(
250
+                    'error' => true,
251
+                    'message' => $lang->get('error_not_allowed_to'),
252
+                ),
253
+                'encode'
254
+            );
255
+            break;
256
+        }
257
+
258
+        // decrypt and retrieve data in JSON format
259
+        $dataReceived = prepareExchangedData(
260
+            $post_data,
261
+            'decode'
262
+        );
263 263
 
264
-    $userId = filter_var($dataReceived['userId'], FILTER_SANITIZE_NUMBER_INT);
265
-    $personalFolders = filter_var($dataReceived['personalFolders'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
264
+        $userId = filter_var($dataReceived['userId'], FILTER_SANITIZE_NUMBER_INT);
265
+        $personalFolders = filter_var($dataReceived['personalFolders'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
266 266
 
267
-    // Update from items_old to items all the private itemsitems that have been converted to teampass_aes
268
-    // Get all key back
269
-    $items = DB::query(
270
-        "SELECT id
267
+        // Update from items_old to items all the private itemsitems that have been converted to teampass_aes
268
+        // Get all key back
269
+        $items = DB::query(
270
+            "SELECT id
271 271
         FROM teampass_items
272 272
         WHERE id_tree IN %ls AND encryption_type = %s",
273
-        $personalFolders,
274
-        "teampass_aes"
275
-    );
276
-    //DB::debugMode(false);
277
-    $nbItems = DB::count();
278
-    foreach ($items as $item) {
279
-        $defusePwd = DB::queryFirstField("SELECT pw FROM teampass_items_old WHERE id = %i", $item['id']);
280
-        DB::update(
281
-            "teampass_items",
282
-            ['pw' => $defusePwd, "encryption_type" => "defuse"],
283
-            "id = %i",
284
-            $item['id']
273
+            $personalFolders,
274
+            "teampass_aes"
285 275
         );
286
-    }
276
+        //DB::debugMode(false);
277
+        $nbItems = DB::count();
278
+        foreach ($items as $item) {
279
+            $defusePwd = DB::queryFirstField("SELECT pw FROM teampass_items_old WHERE id = %i", $item['id']);
280
+            DB::update(
281
+                "teampass_items",
282
+                ['pw' => $defusePwd, "encryption_type" => "defuse"],
283
+                "id = %i",
284
+                $item['id']
285
+            );
286
+        }
287 287
 
288 288
     
289
-    //Show done
290
-    echo prepareExchangedData(
291
-        array(
292
-            'error' => false,
293
-            'message' => '<br>Number of items reseted to Defuse: ',
294
-            'nbItems' => $nbItems,
295
-            'personalFolders' => json_encode($personalFolders),
296
-        ),
297
-        'encode'
298
-    );
299
-    break;
300
-
301
-    /* TOOL #2 - Fixing items master keys */
302
-    /*
289
+        //Show done
290
+        echo prepareExchangedData(
291
+            array(
292
+                'error' => false,
293
+                'message' => '<br>Number of items reseted to Defuse: ',
294
+                'nbItems' => $nbItems,
295
+                'personalFolders' => json_encode($personalFolders),
296
+            ),
297
+            'encode'
298
+        );
299
+        break;
300
+
301
+        /* TOOL #2 - Fixing items master keys */
302
+        /*
303 303
     * STEP 1 - Check if we have the correct pwd for TP_USER
304 304
     */
305 305
     case 'perform_fix_items_master_keys-step1':
Please login to merge, or discard this patch.
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('tools') === false) {
71 71
     // Not allowed page
72 72
     $session->set('system-error_code', ERR_NOT_ALLOWED);
73
-    include $SETTINGS['cpassman_dir'] . '/error.php';
73
+    include $SETTINGS['cpassman_dir'].'/error.php';
74 74
     exit;
75 75
 }
76 76
 
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
         // Get PT_USER info
336 336
         $userInfo = DB::queryFirstRow(
337 337
             'SELECT pw, public_key, private_key, login, name
338
-            FROM ' . prefixTable('users') . '
338
+            FROM ' . prefixTable('users').'
339 339
             WHERE id = %i',
340 340
             TP_USER_ID
341 341
         );
@@ -372,8 +372,8 @@  discard block
 block discarded – undo
372 372
         // Get one itemKey from current user
373 373
         $currentUserKey = DB::queryFirstRow(
374 374
             'SELECT ski.share_key, ski.increment_id AS increment_id, l.id_user
375
-            FROM ' . prefixTable('sharekeys_items') . ' AS ski
376
-            INNER JOIN ' . prefixTable('log_items') . ' AS l ON ski.object_id = l.id_item
375
+            FROM ' . prefixTable('sharekeys_items').' AS ski
376
+            INNER JOIN ' . prefixTable('log_items').' AS l ON ski.object_id = l.id_item
377 377
             WHERE ski.user_id = %i
378 378
             ORDER BY RAND()
379 379
             LIMIT 1',
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
                 echo  prepareExchangedData(
393 393
                     array(
394 394
                         'error' => true,
395
-                        'message' => 'No issue found, normal process should work. This process is now finished. (item id : ' . $currentUserKey['increment_id'] . ')',
395
+                        'message' => 'No issue found, normal process should work. This process is now finished. (item id : '.$currentUserKey['increment_id'].')',
396 396
                     ),
397 397
                     'encode'
398 398
                 );
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
         // Get user info
453 453
         $userInfo = DB::queryFirstRow(
454 454
             'SELECT public_key, private_key
455
-            FROM ' . prefixTable('users') . '
455
+            FROM ' . prefixTable('users').'
456 456
             WHERE id = %i',
457 457
             $userId
458 458
         );
@@ -475,8 +475,8 @@  discard block
 block discarded – undo
475 475
         // Get one itemKey from current user
476 476
         $currentUserKey = DB::queryFirstRow(
477 477
             'SELECT ski.share_key, ski.increment_id AS increment_id, l.id_user
478
-            FROM ' . prefixTable('sharekeys_items') . ' AS ski
479
-            INNER JOIN ' . prefixTable('log_items') . ' AS l ON ski.object_id = l.id_item
478
+            FROM ' . prefixTable('sharekeys_items').' AS ski
479
+            INNER JOIN ' . prefixTable('log_items').' AS l ON ski.object_id = l.id_item
480 480
             WHERE ski.user_id = %i
481 481
             ORDER BY RAND()
482 482
             LIMIT 1',
@@ -514,8 +514,8 @@  discard block
 block discarded – undo
514 514
                 // Get number of users to treat
515 515
                 DB::query(
516 516
                     'SELECT i.id 
517
-                    FROM ' . prefixTable('items') . ' AS i
518
-                    INNER JOIN ' . prefixTable('sharekeys_items') . ' AS si ON i.id = si.object_id
517
+                    FROM ' . prefixTable('items').' AS i
518
+                    INNER JOIN ' . prefixTable('sharekeys_items').' AS si ON i.id = si.object_id
519 519
                     WHERE i.perso = %i AND si.user_id = %i;',
520 520
                     0,
521 521
                     $userId
@@ -597,11 +597,11 @@  discard block
 block discarded – undo
597 597
             // Loop on items
598 598
             $rows = DB::query(
599 599
                 'SELECT si.object_id AS object_id, si.share_key AS share_key, i.pw AS pw, si.increment_id as increment_id
600
-                FROM ' . prefixTable('sharekeys_items') . ' AS si
601
-                INNER JOIN ' . prefixTable('items') . ' AS i ON (i.id = si.object_id)
600
+                FROM ' . prefixTable('sharekeys_items').' AS si
601
+                INNER JOIN ' . prefixTable('items').' AS i ON (i.id = si.object_id)
602 602
                 WHERE si.user_id = %i
603 603
                 ORDER BY si.increment_id ASC
604
-                LIMIT ' . $startIndex . ', ' . $limit,
604
+                LIMIT ' . $startIndex.', '.$limit,
605 605
                 $userId
606 606
             );        
607 607
             
@@ -625,7 +625,7 @@  discard block
 block discarded – undo
625 625
                     // It will be updated if already exists
626 626
                     $currentTPUserKey = DB::queryFirstRow(
627 627
                         'SELECT increment_id, user_id, share_key
628
-                        FROM ' . prefixTable('sharekeys_items') . '
628
+                        FROM ' . prefixTable('sharekeys_items').'
629 629
                         WHERE object_id = %i AND user_id = %i',
630 630
                         $record['object_id'],
631 631
                         TP_USER_ID
@@ -661,7 +661,7 @@  discard block
 block discarded – undo
661 661
             DB::commit();
662 662
         } catch (Exception $e) {
663 663
             DB::rollback();
664
-            error_log("Teampass - Error: Keys treatment: " . $e->getMessage());
664
+            error_log("Teampass - Error: Keys treatment: ".$e->getMessage());
665 665
         }
666 666
 
667 667
         $nextIndex = (int) $startIndex + (int) $limit;
@@ -717,7 +717,7 @@  discard block
 block discarded – undo
717 717
             // Get PT_USER info
718 718
             DB::queryFirstRow(
719 719
                 'SELECT operation_code
720
-                FROM ' . prefixTable('sharekeys_backup') . '
720
+                FROM ' . prefixTable('sharekeys_backup').'
721 721
                 WHERE operation_code = %s',
722 722
                 $operationCode
723 723
             );
@@ -727,7 +727,7 @@  discard block
 block discarded – undo
727 727
                 // using increment_id_value in order to update the correct record
728 728
                 $rows = DB::query(
729 729
                     'SELECT *
730
-                    FROM ' . prefixTable('sharekeys_backup') . '
730
+                    FROM ' . prefixTable('sharekeys_backup').'
731 731
                     WHERE operation_code = %s',
732 732
                     $operationCode
733 733
                 );
@@ -746,7 +746,7 @@  discard block
 block discarded – undo
746 746
 
747 747
                 // Delete all sharekeys for this operation
748 748
                 DB::query(
749
-                    'DELETE FROM ' . prefixTable('sharekeys_backup') . '
749
+                    'DELETE FROM '.prefixTable('sharekeys_backup').'
750 750
                     WHERE operation_code = %i',
751 751
                     $operationCode
752 752
                 );
@@ -809,7 +809,7 @@  discard block
 block discarded – undo
809 809
             // Get operation info
810 810
             DB::query(
811 811
                 'SELECT operation_code
812
-                FROM ' . prefixTable('sharekeys_backup') . '
812
+                FROM ' . prefixTable('sharekeys_backup').'
813 813
                 WHERE operation_code = %s',
814 814
                 $operationCode
815 815
             );
@@ -818,7 +818,7 @@  discard block
 block discarded – undo
818 818
             if ($nbKeys > 0) {
819 819
                 // Delete all sharekeys for this operation
820 820
                 DB::query(
821
-                    'DELETE FROM ' . prefixTable('sharekeys_backup') . '
821
+                    'DELETE FROM '.prefixTable('sharekeys_backup').'
822 822
                     WHERE operation_code = %s',
823 823
                     $operationCode
824 824
                 );
Please login to merge, or discard this patch.
sources/users.logs.datatable.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 ) {
76 76
     // Not allowed page
77 77
     $session->set('system-error_code', ERR_NOT_ALLOWED);
78
-    include $SETTINGS['cpassman_dir'] . '/error.php';
78
+    include $SETTINGS['cpassman_dir'].'/error.php';
79 79
     exit;
80 80
 }
81 81
 
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
     if (isset($order['column']) && preg_match('#^(asc|desc)$#i', $order['dir'])) {
146 146
         $columnIndex = $order['column'];
147 147
         $dir = $inputData['dir'];
148
-        $sOrder .= $aColumns[$columnIndex] . ' ' . $dir . ', ';
148
+        $sOrder .= $aColumns[$columnIndex].' '.$dir.', ';
149 149
     }
150 150
 
151 151
     $sOrder = substr_replace($sOrder, '', -2);
Please login to merge, or discard this patch.
sources/folders.class.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@
 block discarded – undo
113 113
     private function isParentFolderAllowed($parent_id, $user_accessible_folders, $user_is_admin, $user_can_create_root_folder)
114 114
     {
115 115
         if ($parent_id == 0 && $user_can_create_root_folder == true)
116
-	    return true;
116
+        return true;
117 117
 
118 118
         if (in_array($parent_id, $user_accessible_folders) === false
119 119
             && (int) $user_is_admin !== 1
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -112,8 +112,9 @@  discard block
 block discarded – undo
112 112
      */
113 113
     private function isParentFolderAllowed($parent_id, $user_accessible_folders, $user_is_admin, $user_can_create_root_folder)
114 114
     {
115
-        if ($parent_id == 0 && $user_can_create_root_folder == true)
116
-	    return true;
115
+        if ($parent_id == 0 && $user_can_create_root_folder == true) {
116
+        	    return true;
117
+        }
117 118
 
118 119
         if (in_array($parent_id, $user_accessible_folders) === false
119 120
             && (int) $user_is_admin !== 1
@@ -438,8 +439,9 @@  discard block
 block discarded – undo
438 439
             )['count'];
439 440
 
440 441
             // Don't insert duplicates
441
-            if ($count > 0)
442
-                continue;
442
+            if ($count > 0) {
443
+                            continue;
444
+            }
443 445
 
444 446
             // Insert new background task
445 447
             DB::insert(
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 
92 92
         $parentComplexity = $this->checkComplexityLevel($parentFolderData, $complexity, $parent_id);
93 93
         if (isset($parentComplexity['error']) && $parentComplexity['error'] === true) {
94
-            return $this->errorResponse($this->lang->get('error_folder_complexity_lower_than_top_folder') . " [<b>{$this->settings['TP_PW_COMPLEXITY'][$parentComplexity['valeur']][1]}</b>]");
94
+            return $this->errorResponse($this->lang->get('error_folder_complexity_lower_than_top_folder')." [<b>{$this->settings['TP_PW_COMPLEXITY'][$parentComplexity['valeur']][1]}</b>]");
95 95
         }
96 96
 
97 97
         return $this->createFolder($params, array_merge($parentFolderData, $parentComplexity), $options);
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
         ) {
145 145
             DB::query(
146 146
                 'SELECT *
147
-                FROM ' . prefixTable('nested_tree') . '
147
+                FROM ' . prefixTable('nested_tree').'
148 148
                 WHERE title = %s AND personal_folder = 0',
149 149
                 $title
150 150
             );
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
         //check if parent folder is personal
169 169
         $data = DB::queryFirstRow(
170 170
             'SELECT personal_folder, bloquer_creation, bloquer_modification
171
-            FROM ' . prefixTable('nested_tree') . '
171
+            FROM ' . prefixTable('nested_tree').'
172 172
             WHERE id = %i',
173 173
             $parent_id
174 174
         );
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
             // get complexity level for this folder
208 208
             $data = DB::queryFirstRow(
209 209
                 'SELECT valeur
210
-                FROM ' . prefixTable('misc') . '
210
+                FROM ' . prefixTable('misc').'
211 211
                 WHERE intitule = %i AND type = %s',
212 212
                 $parent_id,
213 213
                 'complex'
@@ -278,11 +278,11 @@  discard block
 block discarded – undo
278 278
      */
279 279
     private function canCreateFolder($isPersonal, $user_is_admin, $user_is_manager, $user_can_manage_all_users, $user_can_create_root_folder)
280 280
     {
281
-        return (int)$isPersonal === 1 ||
282
-            (int)$user_is_admin === 1 ||
283
-            ((int)$user_is_manager === 1 || (int)$user_can_manage_all_users === 1) ||
281
+        return (int) $isPersonal === 1 ||
282
+            (int) $user_is_admin === 1 ||
283
+            ((int) $user_is_manager === 1 || (int) $user_can_manage_all_users === 1) ||
284 284
             ($this->settings['enable_user_can_create_folders'] ?? false) ||
285
-            ((int)$user_can_create_root_folder === 1);
285
+            ((int) $user_can_create_root_folder === 1);
286 286
     }
287 287
 
288 288
     /**
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
         $path = '';
363 363
         $tree_path = $tree->getPath(0, false);
364 364
         foreach ($tree_path as $fld) {
365
-            $path .= empty($path) ? $fld->title : '/' . $fld->title;
365
+            $path .= empty($path) ? $fld->title : '/'.$fld->title;
366 366
         }
367 367
 
368 368
         $new_json = [
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
             "is_visible_active" => 0,
377 377
         ];
378 378
 
379
-        $cache_tree = DB::queryFirstRow('SELECT increment_id, folders, visible_folders FROM ' . prefixTable('cache_tree') . ' WHERE user_id = %i', (int)$user_id);
379
+        $cache_tree = DB::queryFirstRow('SELECT increment_id, folders, visible_folders FROM '.prefixTable('cache_tree').' WHERE user_id = %i', (int) $user_id);
380 380
 
381 381
         if (empty($cache_tree)) {
382 382
             DB::insert(prefixTable('cache_tree'), [
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
                 'folders' => json_encode($folders),
397 397
                 'visible_folders' => json_encode($visible_folders),
398 398
                 'timestamp' => time(),
399
-            ], 'increment_id = %i', (int)$cache_tree['increment_id']);
399
+            ], 'increment_id = %i', (int) $cache_tree['increment_id']);
400 400
         }
401 401
     }
402 402
 
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
     private function manageFolderPermissions($parent_id, $newId, $user_roles, $access_rights, $user_is_admin)
407 407
     {
408 408
         if ($parent_id !== 0 && $this->settings['subfolder_rights_as_parent'] ?? false) {
409
-            $rows = DB::query('SELECT role_id, type FROM ' . prefixTable('roles_values') . ' WHERE folder_id = %i', $parent_id);
409
+            $rows = DB::query('SELECT role_id, type FROM '.prefixTable('roles_values').' WHERE folder_id = %i', $parent_id);
410 410
             foreach ($rows as $record) {
411 411
                 DB::insert(prefixTable('roles_values'), [
412 412
                     'role_id' => $record['role_id'],
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
                     'type' => $record['type'],
415 415
                 ]);
416 416
             }
417
-        } elseif ((int)$user_is_admin !== 1) {
417
+        } elseif ((int) $user_is_admin !== 1) {
418 418
             foreach (array_unique(explode(';', $user_roles)) as $role) {
419 419
                 if (!empty($role)) {
420 420
                     DB::insert(prefixTable('roles_values'), [
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
      */
433 433
     private function copyCustomFieldsCategories($parent_id, $newId)
434 434
     {
435
-        $rows = DB::query('SELECT id_category FROM ' . prefixTable('categories_folders') . ' WHERE id_folder = %i', $parent_id);
435
+        $rows = DB::query('SELECT id_category FROM '.prefixTable('categories_folders').' WHERE id_folder = %i', $parent_id);
436 436
         foreach ($rows as $record) {
437 437
             DB::insert(prefixTable('categories_folders'), [
438 438
                 'id_category' => $record['id_category'],
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
             // Search for existing job
458 458
             $count = DB::queryFirstRow(
459 459
                 'SELECT COUNT(*) AS count
460
-                FROM ' . prefixTable('background_tasks') . '
460
+                FROM ' . prefixTable('background_tasks').'
461 461
                 WHERE is_in_progress = %i AND process_type = %s AND arguments = %s',
462 462
                 0,
463 463
                 'user_build_cache_tree',
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
         return [
492 492
             'error' => true,
493 493
             'message' => $message,
494
-            'newId' => '' . $newIdSuffix,
494
+            'newId' => ''.$newIdSuffix,
495 495
         ];
496 496
     }
497 497
 }
Please login to merge, or discard this patch.
pages/import.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
     || isset($SETTINGS['allow_import']) === false || (int) $SETTINGS['allow_import'] !== 1) {
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
 
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
                                         <?php
184 184
 $complexitySelect = '';
185 185
 foreach (TP_PW_COMPLEXITY as $level) {
186
-    $complexitySelect .= '<option value="' . $level[0] . '">' . $level[1] . '</option>';
186
+    $complexitySelect .= '<option value="'.$level[0].'">'.$level[1].'</option>';
187 187
 }
188 188
 echo $complexitySelect;
189 189
                                         ?>
Please login to merge, or discard this patch.
pages/import.js.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('import') === false) {
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
 ?>
@@ -1043,7 +1043,7 @@  discard block
 block discarded – undo
1043 1043
                                     // Isolate first item
1044 1044
                                     if (itemsList.length > 0) {
1045 1045
                                         $('#import-feedback-progress-text')
1046
-                                            .html('<i class="fa-solid fa-cog fa-spin ml-4 mr-2"></i><?php echo $lang->get('operation_progress');?> ('+((counter*100)/itemsNumber).toFixed(2)+'%) - <i id="item-title"></i>');
1046
+                                            .html('<i class="fa-solid fa-cog fa-spin ml-4 mr-2"></i><?php echo $lang->get('operation_progress'); ?> ('+((counter*100)/itemsNumber).toFixed(2)+'%) - <i id="item-title"></i>');
1047 1047
 
1048 1048
                                         // XSS Filtering :
1049 1049
                                         $('#import-feedback-progress-text').text(itemsList[0].Title);
Please login to merge, or discard this patch.
sources/import.queries.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1364,4 +1364,4 @@
 block discarded – undo
1364 1364
     $string = str_replace("{%}", "?", $string);
1365 1365
     // Trim and return.
1366 1366
     return trim($string);
1367
-  }
1367
+    }
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 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
 
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
         );
168 168
 
169 169
         // Initialisation
170
-        $file = $SETTINGS['path_to_files_folder'] . '/' . $data['valeur'];
170
+        $file = $SETTINGS['path_to_files_folder'].'/'.$data['valeur'];
171 171
         $importation_possible = true;
172 172
         $valuesToImport = [];
173 173
         $items_number = 0;
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 
211 211
         // Observer pour récupérer les données et respecter l'ordre des colonnes
212 212
         $interpreter = new Interpreter();
213
-        $interpreter->addObserver(function (array $row) use (&$valuesToImport, $header) {
213
+        $interpreter->addObserver(function(array $row) use (&$valuesToImport, $header) {
214 214
             $rowData = array_combine($header, $row);
215 215
 
216 216
             if ($rowData !== false) {
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
             // Handle multiple lignes description
262 262
             if (strpos($comments, '<br>') !== false || strpos($label, '<br>') !== false) {
263 263
                 $continue_on_next_line = true;
264
-                $comment .= " " . $label;
264
+                $comment .= " ".$label;
265 265
             } else {
266 266
                 // Insert previous line if changing line
267 267
                 if (!empty($label)) {
@@ -325,10 +325,10 @@  discard block
 block discarded – undo
325 325
             $values = [];
326 326
         
327 327
             foreach ($batchInsert as $data) {
328
-                $values[] = "('" . implode("','", array_map('addslashes', $data)) . "')";
328
+                $values[] = "('".implode("','", array_map('addslashes', $data))."')";
329 329
             }
330 330
         
331
-            $sql = "INSERT INTO `$tableName` (`label`, `description`, `pwd`, `url`, `folder`, `login`, `operation_id`) VALUES " . implode(',', $values);
331
+            $sql = "INSERT INTO `$tableName` (`label`, `description`, `pwd`, `url`, `folder`, `login`, `operation_id`) VALUES ".implode(',', $values);
332 332
             
333 333
             DB::query($sql);
334 334
         }
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
             $parentId = $dataReceived['folderId']; // Strating with provided folder
412 412
 
413 413
             foreach ($parts as $part) {
414
-                $currentPath = trim($currentPath . "/" . $part, "/");
414
+                $currentPath = trim($currentPath."/".$part, "/");
415 415
                 $currentFolder = $part;
416 416
 
417 417
                 // Check if this folder has already been created
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
                         // Get ID of existing folder
473 473
                         $ret = DB::queryFirstRow(
474 474
                             'SELECT *
475
-                            FROM ' . prefixTable('nested_tree') . '
475
+                            FROM ' . prefixTable('nested_tree').'
476 476
                             WHERE title = %s',
477 477
                             $currentFolder
478 478
                         );
@@ -994,7 +994,7 @@  discard block
 block discarded – undo
994 994
         ];
995 995
         $startPathLevel = 1;
996 996
 
997
-        foreach($post_folders as $folder) {
997
+        foreach ($post_folders as $folder) {
998 998
             // get parent id
999 999
             $parentId = $arrFolders[$folder['parentFolderId']];
1000 1000
 
@@ -1065,7 +1065,7 @@  discard block
 block discarded – undo
1065 1065
         DB::startTransaction();
1066 1066
 
1067 1067
         // Import all items
1068
-        foreach($post_items as $item) {
1068
+        foreach ($post_items as $item) {
1069 1069
             // get info about this folder
1070 1070
             $destinationFolderMore = DB::queryFirstRow(
1071 1071
                 'SELECT title FROM '.prefixTable('nested_tree').' WHERE id = %i',
@@ -1290,7 +1290,7 @@  discard block
 block discarded – undo
1290 1290
     ];
1291 1291
 }
1292 1292
 
1293
-spl_autoload_register(function ($class) {
1293
+spl_autoload_register(function($class) {
1294 1294
     $prefix = 'League\\Csv\\';
1295 1295
     $base_dir = __DIR__.'/src/';
1296 1296
     $len = strlen($prefix);
Please login to merge, or discard this patch.
scripts/traits/UserHandlerTrait.php 2 patches
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -54,13 +54,17 @@  discard block
 block discarded – undo
54 54
         );
55 55
     
56 56
         if (empty($subtasks)) {
57
-            if (LOG_TASKS=== true) $this->logger->log("No subtask was found for task {$this->taskId}");
57
+            if (LOG_TASKS=== true) {
58
+                $this->logger->log("No subtask was found for task {$this->taskId}");
59
+            }
58 60
             return;
59 61
         }
60 62
     
61 63
         // Process each subtask
62 64
         foreach ($subtasks as $subtask) {
63
-            if (LOG_TASKS=== true) $this->logger->log("Processing subtask {$subtask['increment_id']} for task {$this->taskId}");
65
+            if (LOG_TASKS=== true) {
66
+                $this->logger->log("Processing subtask {$subtask['increment_id']} for task {$this->taskId}");
67
+            }
64 68
             $this->processGenerateUserKeysSubtask($subtask, $arguments);
65 69
         }
66 70
     
@@ -97,7 +101,9 @@  discard block
 block discarded – undo
97 101
                 $subtask['increment_id']
98 102
             );
99 103
             
100
-            if (LOG_TASKS=== true) $this->logger->log("Subtask is in progress: ".$taskData['step'], 'INFO');
104
+            if (LOG_TASKS=== true) {
105
+                $this->logger->log("Subtask is in progress: ".$taskData['step'], 'INFO');
106
+            }
101 107
             switch ($taskData['step'] ?? '') {
102 108
                 case 'step0':
103 109
                     $this->generateNewUserStep0($arguments);
Please login to merge, or discard this patch.
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -50,24 +50,24 @@  discard block
 block discarded – undo
50 50
     private function generateUserKeys($arguments) {
51 51
         // Get all subtasks related to this task
52 52
         $subtasks = DB::query(
53
-            'SELECT * FROM ' . prefixTable('background_subtasks') . ' WHERE task_id = %i AND is_in_progress = 0 ORDER BY `task` ASC',
53
+            'SELECT * FROM '.prefixTable('background_subtasks').' WHERE task_id = %i AND is_in_progress = 0 ORDER BY `task` ASC',
54 54
             $this->taskId
55 55
         );
56 56
     
57 57
         if (empty($subtasks)) {
58
-            if (LOG_TASKS=== true) $this->logger->log("No subtask was found for task {$this->taskId}");
58
+            if (LOG_TASKS === true) $this->logger->log("No subtask was found for task {$this->taskId}");
59 59
             return;
60 60
         }
61 61
     
62 62
         // Process each subtask
63 63
         foreach ($subtasks as $subtask) {
64
-            if (LOG_TASKS=== true) $this->logger->log("Processing subtask {$subtask['increment_id']} for task {$this->taskId}");
64
+            if (LOG_TASKS === true) $this->logger->log("Processing subtask {$subtask['increment_id']} for task {$this->taskId}");
65 65
             $this->processGenerateUserKeysSubtask($subtask, $arguments);
66 66
         }
67 67
     
68 68
         // Are all subtasks completed?
69 69
         $remainingSubtasks = DB::queryFirstField(
70
-            'SELECT COUNT(*) FROM ' . prefixTable('background_subtasks') . ' WHERE task_id = %i AND is_in_progress = 0',
70
+            'SELECT COUNT(*) FROM '.prefixTable('background_subtasks').' WHERE task_id = %i AND is_in_progress = 0',
71 71
             $this->taskId
72 72
         );    
73 73
         if ($remainingSubtasks == 0) {
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
                 $subtask['increment_id']
99 99
             );
100 100
             
101
-            if (LOG_TASKS=== true) $this->logger->log("Subtask is in progress: ".$taskData['step'], 'INFO');
101
+            if (LOG_TASKS === true) $this->logger->log("Subtask is in progress: ".$taskData['step'], 'INFO');
102 102
             switch ($taskData['step'] ?? '') {
103 103
                 case 'step0':
104 104
                     $this->generateNewUserStep0($arguments);
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
                 $subtask['increment_id']
153 153
             );
154 154
             
155
-            $this->logger->log("Subtask {$subtask['increment_id']} failure: " . $e->getMessage(), 'ERROR');
155
+            $this->logger->log("Subtask {$subtask['increment_id']} failure: ".$e->getMessage(), 'ERROR');
156 156
         }
157 157
     }
158 158
     
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
         // Loop on items
187 187
         $rows = DB::query(
188 188
             'SELECT id, pw, perso
189
-            FROM ' . prefixTable('items') . '
189
+            FROM ' . prefixTable('items').'
190 190
             WHERE perso =  %i
191 191
             ORDER BY id ASC
192 192
             LIMIT %i, %i',
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
             // Get itemKey from current user
200 200
             $currentUserKey = DB::queryFirstRow(
201 201
                 'SELECT share_key, increment_id
202
-                FROM ' . prefixTable('sharekeys_items') . '
202
+                FROM ' . prefixTable('sharekeys_items').'
203 203
                 WHERE object_id = %i AND user_id = %i',
204 204
                 $record['id'],
205 205
                 (int) $record['perso'] === 0 ? $arguments['owner_id'] : $arguments['new_user_id']
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
             
227 227
             $currentUserKey = DB::queryFirstRow(
228 228
                 'SELECT increment_id
229
-                FROM ' . prefixTable('sharekeys_items') . '
229
+                FROM ' . prefixTable('sharekeys_items').'
230 230
                 WHERE object_id = %i AND user_id = %i',
231 231
                 $record['id'],
232 232
                 $arguments['new_user_id']
@@ -276,16 +276,16 @@  discard block
 block discarded – undo
276 276
         // Loop on logs
277 277
         $rows = DB::query(
278 278
             'SELECT increment_id
279
-            FROM ' . prefixTable('log_items') . '
279
+            FROM ' . prefixTable('log_items').'
280 280
             WHERE raison LIKE "at_pw :%" AND encryption_type = "teampass_aes"
281 281
             ORDER BY increment_id ASC
282
-            LIMIT ' . $taskData['index'] . ', ' . $taskData['nb']
282
+            LIMIT ' . $taskData['index'].', '.$taskData['nb']
283 283
         );
284 284
         foreach ($rows as $record) {
285 285
             // Get itemKey from current user
286 286
             $currentUserKey = DB::queryFirstRow(
287 287
                 'SELECT share_key
288
-                FROM ' . prefixTable('sharekeys_logs') . '
288
+                FROM ' . prefixTable('sharekeys_logs').'
289 289
                 WHERE object_id = %i AND user_id = %i',
290 290
                 $record['increment_id'],
291 291
                 $arguments['owner_id']
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
                 if ((int) $arguments['new_user_id'] !== (int) $arguments['owner_id']) {
318 318
                     $currentUserKey = DB::queryFirstRow(
319 319
                         'SELECT increment_id
320
-                        FROM ' . prefixTable('sharekeys_items') . '
320
+                        FROM ' . prefixTable('sharekeys_items').'
321 321
                         WHERE object_id = %i AND user_id = %i',
322 322
                         $record['id'],
323 323
                         $arguments['new_user_id']
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
         // Loop on fields
359 359
         $rows = DB::query(
360 360
             'SELECT id
361
-            FROM ' . prefixTable('categories_items') . '
361
+            FROM ' . prefixTable('categories_items').'
362 362
             WHERE encryption_type = "teampass_aes"
363 363
             ORDER BY id ASC
364 364
             LIMIT %i, %i',
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
             // Get itemKey from current user
370 370
             $currentUserKey = DB::queryFirstRow(
371 371
                 'SELECT share_key
372
-                FROM ' . prefixTable('sharekeys_fields') . '
372
+                FROM ' . prefixTable('sharekeys_fields').'
373 373
                 WHERE object_id = %i AND user_id = %i',
374 374
                 $record['id'],
375 375
                 $arguments['owner_id']
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
                     if ((int) $arguments['new_user_id'] !== (int) $arguments['owner_id']) {
398 398
                         $currentUserKey = DB::queryFirstRow(
399 399
                             'SELECT increment_id
400
-                            FROM ' . prefixTable('sharekeys_items') . '
400
+                            FROM ' . prefixTable('sharekeys_items').'
401 401
                             WHERE object_id = %i AND user_id = %i',
402 402
                             $record['id'],
403 403
                             $arguments['new_user_id']
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
         // Loop on suggestions
440 440
         $rows = DB::query(
441 441
             'SELECT id
442
-            FROM ' . prefixTable('suggestion') . '
442
+            FROM ' . prefixTable('suggestion').'
443 443
             ORDER BY id ASC
444 444
             LIMIT %i, %i',
445 445
             $taskData['index'],
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
             // Get itemKey from current user
450 450
             $currentUserKey = DB::queryFirstRow(
451 451
                 'SELECT share_key
452
-                FROM ' . prefixTable('sharekeys_suggestions') . '
452
+                FROM ' . prefixTable('sharekeys_suggestions').'
453 453
                 WHERE object_id = %i AND user_id = %i',
454 454
                 $record['id'],
455 455
                 $arguments['owner_id']
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
                 if ((int) $arguments['new_user_id'] !== (int) $arguments['owner_id']) {
482 482
                     $currentUserKey = DB::queryFirstRow(
483 483
                         'SELECT increment_id
484
-                        FROM ' . prefixTable('sharekeys_items') . '
484
+                        FROM ' . prefixTable('sharekeys_items').'
485 485
                         WHERE object_id = %i AND user_id = %i',
486 486
                         $record['id'],
487 487
                         $arguments['new_user_id']
@@ -522,9 +522,9 @@  discard block
 block discarded – undo
522 522
         // Loop on files
523 523
         $rows = DB::query(
524 524
             'SELECT f.id AS id, i.perso AS perso
525
-            FROM ' . prefixTable('files') . ' AS f
526
-            INNER JOIN ' . prefixTable('items') . ' AS i ON i.id = f.id_item
527
-            WHERE f.status = "' . TP_ENCRYPTION_NAME . '"
525
+            FROM ' . prefixTable('files').' AS f
526
+            INNER JOIN ' . prefixTable('items').' AS i ON i.id = f.id_item
527
+            WHERE f.status = "' . TP_ENCRYPTION_NAME.'"
528 528
             LIMIT %i, %i',
529 529
             $taskData['index'],
530 530
             $taskData['nb']
@@ -533,7 +533,7 @@  discard block
 block discarded – undo
533 533
             // Get itemKey from current user
534 534
             $currentUserKey = DB::queryFirstRow(
535 535
                 'SELECT share_key, increment_id
536
-                FROM ' . prefixTable('sharekeys_files') . '
536
+                FROM ' . prefixTable('sharekeys_files').'
537 537
                 WHERE object_id = %i AND user_id = %i',
538 538
                 $record['id'],
539 539
                 (int) $record['perso'] === 0 ? $arguments['owner_id'] : $arguments['new_user_id']
@@ -561,7 +561,7 @@  discard block
 block discarded – undo
561 561
 
562 562
             $currentUserKey = DB::queryFirstRow(
563 563
                 'SELECT increment_id
564
-                FROM ' . prefixTable('sharekeys_files') . '
564
+                FROM ' . prefixTable('sharekeys_files').'
565 565
                 WHERE object_id = %i AND user_id = %i',
566 566
                 $record['id'],
567 567
                 $arguments['new_user_id']
@@ -623,7 +623,7 @@  discard block
 block discarded – undo
623 623
         // get user info
624 624
         $userInfo = DB::queryFirstRow(
625 625
             'SELECT email, login, auth_type, special, lastname, name
626
-            FROM ' . prefixTable('users') . '
626
+            FROM ' . prefixTable('users').'
627 627
             WHERE id = %i',
628 628
             $arguments['new_user_id']
629 629
         );
@@ -638,10 +638,10 @@  discard block
 block discarded – undo
638 638
                 filter_var($userInfo['email'], FILTER_SANITIZE_EMAIL),
639 639
                 // @scrutinizer ignore-type
640 640
                 empty($arguments['email_body']) === false ? $arguments['email_body'] : $lang->get('email_body_user_config_1'),
641
-                'TEAMPASS - ' . $lang->get('login_credentials'),
641
+                'TEAMPASS - '.$lang->get('login_credentials'),
642 642
                 (array) filter_var_array(
643 643
                     [
644
-                        '#code#' => cryption($arguments['new_user_code'], '','decrypt', $this->settings)['string'],
644
+                        '#code#' => cryption($arguments['new_user_code'], '', 'decrypt', $this->settings)['string'],
645 645
                         '#lastname#' => isset($userInfo['name']) === true ? $userInfo['name'] : '',
646 646
                         '#login#' => isset($userInfo['login']) === true ? $userInfo['login'] : '',
647 647
                     ],
@@ -677,13 +677,13 @@  discard block
 block discarded – undo
677 677
     private function getOwnerInfos(int $owner_id, string $owner_pwd) {
678 678
         $userInfo = DB::queryFirstRow(
679 679
             'SELECT pw, public_key, private_key, login, name
680
-            FROM ' . prefixTable('users') . '
680
+            FROM ' . prefixTable('users').'
681 681
             WHERE id = %i',
682 682
             $owner_id
683 683
         );
684 684
 
685 685
         // decrypt owner password
686
-        $pwd = cryption($owner_pwd, '','decrypt', $this->settings)['string'];
686
+        $pwd = cryption($owner_pwd, '', 'decrypt', $this->settings)['string'];
687 687
         // decrypt private key and send back
688 688
         return [
689 689
             'private_key' => decryptPrivateKey($pwd, $userInfo['private_key']),
Please login to merge, or discard this patch.