Passed
Push — teampass_3.0 ( 2e6bd1...4c0075 )
by Nils
13:44 queued 05:04
created
pages/items.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -43,18 +43,18 @@  discard block
 block discarded – undo
43 43
 }
44 44
 
45 45
 /* do checks */
46
-require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php';
46
+require_once $SETTINGS['cpassman_dir'].'/sources/checks.php';
47 47
 if (checkUser($_SESSION['user_id'], $_SESSION['key'], curPage($SETTINGS), $SETTINGS) === false) {
48 48
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
49 49
     //not allowed page
50
-    include $SETTINGS['cpassman_dir'] . '/error.php';
50
+    include $SETTINGS['cpassman_dir'].'/error.php';
51 51
     exit;
52 52
 }
53 53
 
54 54
 // Load
55
-require_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
56
-require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
57
-require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
55
+require_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
56
+require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
57
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
58 58
 $superGlobal = new protect\SuperGlobal\SuperGlobal();
59 59
 
60 60
 // Prepare SESSION variables
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 
70 70
 // Get list of users
71 71
 $usersList = [];
72
-$rows = DB::query('SELECT id,login,email FROM ' . prefixTable('users') . ' ORDER BY login ASC');
72
+$rows = DB::query('SELECT id,login,email FROM '.prefixTable('users').' ORDER BY login ASC');
73 73
 foreach ($rows as $record) {
74 74
     $usersList[$record['login']] = [
75 75
         'id' => $record['id'],
@@ -80,16 +80,16 @@  discard block
 block discarded – undo
80 80
 // Get list of roles
81 81
 $arrRoles = [];
82 82
 $listRoles = '';
83
-$rows = DB::query('SELECT id,title FROM ' . prefixTable('roles_title') . ' ORDER BY title ASC');
83
+$rows = DB::query('SELECT id,title FROM '.prefixTable('roles_title').' ORDER BY title ASC');
84 84
 foreach ($rows as $reccord) {
85 85
     $arrRoles[$reccord['title']] = [
86 86
         'id' => $reccord['id'],
87 87
         'title' => $reccord['title'],
88 88
     ];
89 89
     if (empty($listRoles)) {
90
-        $listRoles = $reccord['id'] . '#' . $reccord['title'];
90
+        $listRoles = $reccord['id'].'#'.$reccord['title'];
91 91
     } else {
92
-        $listRoles .= ';' . $reccord['id'] . '#' . $reccord['title'];
92
+        $listRoles .= ';'.$reccord['id'].'#'.$reccord['title'];
93 93
     }
94 94
 }
95 95
 ?>
@@ -163,9 +163,9 @@  discard block
 block discarded – undo
163 163
                         <li class="nav-item"><a class="nav-link" href="#tab_3" data-toggle="tab"><i class="fas fa-archive mr-2"></i><?php echo langHdl('attachments'); ?></a></li>
164 164
                         <?php
165 165
                         echo isset($SETTINGS['item_extra_fields']) === true && (int) $SETTINGS['item_extra_fields'] === 1 ? '
166
-                            <li class="nav-item"><a class="nav-link" href="#tab_4" data-toggle="tab"><i class="fas fa-cubes mr-2"></i>' . langHdl('fields') . '</a></li>' : '';
166
+                            <li class="nav-item"><a class="nav-link" href="#tab_4" data-toggle="tab"><i class="fas fa-cubes mr-2"></i>' . langHdl('fields').'</a></li>' : '';
167 167
 echo isset($SETTINGS['insert_manual_entry_item_history']) === true && (int) $SETTINGS['insert_manual_entry_item_history'] === 1 ? '
168
-                            <li class="nav-item"><a class="nav-link" href="#tab_5" data-toggle="tab"><i class="fas fa-history mr-2"></i>' . langHdl('history') . '</a></li>' : '';
168
+                            <li class="nav-item"><a class="nav-link" href="#tab_5" data-toggle="tab"><i class="fas fa-history mr-2"></i>' . langHdl('history').'</a></li>' : '';
169 169
                         ?>
170 170
                     </ul>
171 171
                 </div><!-- /.card-header -->
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
                                                 <?php
235 235
                                                 for ($i = 4; $i <= $SETTINGS['pwd_maximum_length']; ++$i) {
236 236
                                                     echo '
237
-                                                <option>' . $i . '</option>';
237
+                                                <option>' . $i.'</option>';
238 238
                                                 }
239 239
                                                 ?>
240 240
                                             </select>
@@ -403,29 +403,29 @@  discard block
 block discarded – undo
403 403
                                         if (isset($_SESSION['item_fields']) === true) {
404 404
                                             foreach ($_SESSION['item_fields'] as $category) {
405 405
                                                 echo '
406
-                                            <div class="callout callout-info form-item-category hidden" id="form-item-category-' . $category['id'] . '">
407
-                                                <h5>' . $category['title'] . '</h5>
406
+                                            <div class="callout callout-info form-item-category hidden" id="form-item-category-' . $category['id'].'">
407
+                                                <h5>' . $category['title'].'</h5>
408 408
                                                 <p>';
409 409
                                                 foreach ($category['fields'] as $field) {
410 410
                                                     if ($field['type'] === 'textarea') {
411 411
                                                         echo '
412
-                                                    <div class="form-group mb-3 form-item-field" id="form-item-field-' . $field['id'] . '" data-field-id="' . $field['id'] . '">
412
+                                                    <div class="form-group mb-3 form-item-field" id="form-item-field-' . $field['id'].'" data-field-id="'.$field['id'].'">
413 413
                                                         <label>' . $field['title'],
414 414
                                                             $field['is_mandatory'] === '1' ?
415
-                                                                '<span class="fas fa-fire text-danger ml-1 infotip" title="' . langHdl('is_mandatory') . '"></span>' : '',
415
+                                                                '<span class="fas fa-fire text-danger ml-1 infotip" title="'.langHdl('is_mandatory').'"></span>' : '',
416 416
                                                             '</label>
417
-                                                        <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-change-ongoing="0"></textarea>
417
+                                                        <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-change-ongoing="0"></textarea>
418 418
                                                     </div>';
419 419
                                                     } else {
420 420
                                                         echo '
421
-                                                    <div class="input-group mb-3 form-item-field" id="form-item-field-' . $field['id'] . '" data-field-id="' . $field['id'] . '">
421
+                                                    <div class="input-group mb-3 form-item-field" id="form-item-field-' . $field['id'].'" data-field-id="'.$field['id'].'">
422 422
                                                         <div class="input-group-prepend">
423 423
                                                             <span class="input-group-text">' . $field['title'],
424 424
                                                             $field['is_mandatory'] === '1' ?
425
-                                                                '<span class="fas fa-fire text-danger ml-1 infotip" title="' . langHdl('is_mandatory') . '"></span>' : '',
425
+                                                                '<span class="fas fa-fire text-danger ml-1 infotip" title="'.langHdl('is_mandatory').'"></span>' : '',
426 426
                                                             '</span>
427 427
                                                         </div>
428
-                                                        <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-change-ongoing="0">
428
+                                                        <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-change-ongoing="0">
429 429
                                                     </div>';
430 430
                                                     }
431 431
                                                 }
@@ -436,8 +436,8 @@  discard block
 block discarded – undo
436 436
                                                 ) {
437 437
                                                     echo '
438 438
                                                     <div class="form-check icheck-blue">
439
-                                                        <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'] . '">
440
-                                                        <label class="form-check-label ml-3" for="template_' . $category['id'] . '">' . langHdl('main_template') . '</label>
439
+                                                        <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'].'">
440
+                                                        <label class="form-check-label ml-3" for="template_' . $category['id'].'">'.langHdl('main_template').'</label>
441 441
                                                     </div>';
442 442
                                                 }
443 443
                                                 echo '
@@ -667,18 +667,18 @@  discard block
 block discarded – undo
667 667
                         <?php
668 668
                             foreach ($_SESSION['item_fields'] as $elem) {
669 669
                                 echo '
670
-                        <div class="callout callout-info card-item-category hidden" id="card-item-category-' . $elem['id'] . '">
671
-                            <h5>' . $elem['title'] . '</h5>
670
+                        <div class="callout callout-info card-item-category hidden" id="card-item-category-' . $elem['id'].'">
671
+                            <h5>' . $elem['title'].'</h5>
672 672
                             <p>
673 673
                                 <ul class="list-group list-group-unbordered mb-3">';
674 674
                                 foreach ($elem['fields'] as $field) {
675 675
                                     echo '
676
-                                    <li class="list-group-item card-item-field hidden" id="card-item-field-' . $field['id'] . '">
677
-                                        <b>' . $field['title'] . '</b>
678
-                                        <button type="button" class="float-right btn btn-outline-info btn-sm ml-1 btn-copy-clipboard-clear"  data-clipboard-target="#card-item-field-value-' . $field['id'] . '">
676
+                                    <li class="list-group-item card-item-field hidden" id="card-item-field-' . $field['id'].'">
677
+                                        <b>' . $field['title'].'</b>
678
+                                        <button type="button" class="float-right btn btn-outline-info btn-sm ml-1 btn-copy-clipboard-clear"  data-clipboard-target="#card-item-field-value-' . $field['id'].'">
679 679
                                             <i class="fas fa-copy"></i>
680 680
                                         </button>
681
-                                        <span class="card-item-field-value float-right ml-1" id="card-item-field-value-' . $field['id'] . '"></span>
681
+                                        <span class="card-item-field-value float-right ml-1" id="card-item-field-value-' . $field['id'].'"></span>
682 682
                                     </li>';
683 683
                                 }
684 684
                                 echo '
@@ -1050,7 +1050,7 @@  discard block
 block discarded – undo
1050 1050
                         <p><?php
1051 1051
                             echo str_replace(
1052 1052
         ['##otv_expiration_period##', '. '],
1053
-        ['<span class="text-bold text-primary">' . $SETTINGS['otv_expiration_period'] . '</span>', '<br>'],
1053
+        ['<span class="text-bold text-primary">'.$SETTINGS['otv_expiration_period'].'</span>', '<br>'],
1054 1054
         langHdl('otv_message')
1055 1055
     );
1056 1056
                             ?></p>
@@ -1124,7 +1124,7 @@  discard block
 block discarded – undo
1124 1124
                             <select class="form-control form-folder-control select2" style="width:100%;" id="form-folder-add-complexicity" required>
1125 1125
                                 <?php
1126 1126
                                 foreach (TP_PW_COMPLEXITY as $key => $value) {
1127
-                                    echo '<option value="' . $key . '">' . $value[1] . '</option>';
1127
+                                    echo '<option value="'.$key.'">'.$value[1].'</option>';
1128 1128
                                 }
1129 1129
                                 ?>
1130 1130
                             </select>
Please login to merge, or discard this patch.
sources/main.queries.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1834,7 +1834,9 @@
 block discarded – undo
1834 1834
             $record['id'],
1835 1835
             $_SESSION['user_id']
1836 1836
         );
1837
-        if ($currentUserKey === null || count($currentUserKey) === 0) continue;
1837
+        if ($currentUserKey === null || count($currentUserKey) === 0) {
1838
+            continue;
1839
+        }
1838 1840
 
1839 1841
         // Decrypt itemkey with admin key
1840 1842
         $itemKey = decryptUserObjectKey($currentUserKey['share_key'], $_SESSION['user']['private_key']);
Please login to merge, or discard this patch.
Spacing   +109 added lines, -109 removed lines patch added patch discarded remove patch
@@ -45,8 +45,8 @@  discard block
 block discarded – undo
45 45
 date_default_timezone_set(isset($SETTINGS['timezone']) === true ? $SETTINGS['timezone'] : 'UTC');
46 46
 
47 47
 // DO CHECKS
48
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
49
-require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php';
48
+require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php';
49
+require_once $SETTINGS['cpassman_dir'].'/sources/checks.php';
50 50
 $post_type = filter_input(INPUT_POST, 'type', FILTER_SANITIZE_STRING);
51 51
 if (
52 52
     isset($post_type) === true
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
     && checkUser($_SESSION['user_id'], $_SESSION['key'], 'home', $SETTINGS) === false
63 63
 ) {
64 64
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED; //not allowed page
65
-    include $SETTINGS['cpassman_dir'] . '/error.php';
65
+    include $SETTINGS['cpassman_dir'].'/error.php';
66 66
     exit();
67 67
 } elseif ((isset($_SESSION['user_id']) === true
68 68
         && isset($_SESSION['key'])) === true
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
     mainQuery($SETTINGS);
75 75
 } else {
76 76
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED; //not allowed page
77
-    include $SETTINGS['cpassman_dir'] . '/error.php';
77
+    include $SETTINGS['cpassman_dir'].'/error.php';
78 78
     exit();
79 79
 }
80 80
 
@@ -89,13 +89,13 @@  discard block
 block discarded – undo
89 89
 
90 90
 
91 91
     // Includes
92
-    include_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php';
93
-    include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
94
-    include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
95
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
92
+    include_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php';
93
+    include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
94
+    include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
95
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
96 96
 
97 97
     // Connect to mysql server
98
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
98
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
99 99
 
100 100
     DB::$host = DB_HOST;
101 101
     DB::$user = DB_USER;
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
     DB::$encoding = DB_ENCODING;
106 106
 
107 107
     // User's language loading
108
-    include_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php';
108
+    include_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php';
109 109
 
110 110
     // Prepare post variables
111 111
     $post_key = filter_input(INPUT_POST, 'key', FILTER_SANITIZE_STRING);
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
             $pwdlib = new PasswordLib\PasswordLib();
234 234
             // generate key
235 235
             $key = $pwdlib->getRandomToken(filter_input(INPUT_POST, 'size', FILTER_SANITIZE_NUMBER_INT));
236
-            echo '[{"key" : "' . htmlentities($key, ENT_QUOTES) . '"}]';
236
+            echo '[{"key" : "'.htmlentities($key, ENT_QUOTES).'"}]';
237 237
             break;
238 238
 
239 239
         /*
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
                 )
263 263
             );
264 264
 
265
-            echo '[{"token" : "' . $token . '"}]';
265
+            echo '[{"token" : "'.$token.'"}]';
266 266
             break;
267 267
 
268 268
 
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
     // get number of items
536 536
     DB::queryFirstRow(
537 537
         'SELECT increment_id
538
-        FROM ' . prefixTable('sharekeys_items') .
538
+        FROM ' . prefixTable('sharekeys_items').
539 539
         ' WHERE user_id = %i',
540 540
         $userId
541 541
     );
@@ -589,7 +589,7 @@  discard block
 block discarded – undo
589 589
         // check if expected security level is reached
590 590
         $dataUser = DB::queryfirstrow(
591 591
             'SELECT *
592
-            FROM ' . prefixTable('users') . ' WHERE id = %i',
592
+            FROM ' . prefixTable('users').' WHERE id = %i',
593 593
             $post_user_id
594 594
         );
595 595
 
@@ -610,8 +610,8 @@  discard block
 block discarded – undo
610 610
         if (empty($dataUser['fonction_id']) === false) {
611 611
             $data = DB::queryFirstRow(
612 612
                 'SELECT complexity
613
-                FROM ' . prefixTable('roles_title') . '
614
-                WHERE id IN (' . $dataUser['fonction_id'] . ')
613
+                FROM ' . prefixTable('roles_title').'
614
+                WHERE id IN (' . $dataUser['fonction_id'].')
615 615
                 ORDER BY complexity DESC'
616 616
             );
617 617
         } else {
@@ -624,8 +624,8 @@  discard block
 block discarded – undo
624 624
             return prepareExchangedData(
625 625
                 array(
626 626
                     'error' => true,
627
-                    'message' => '<div style="margin:10px 0 10px 15px;">' . langHdl('complexity_level_not_reached') . '.<br>' .
628
-                        langHdl('expected_complexity_level') . ': <b>' . TP_PW_COMPLEXITY[$data['complexity']][1] . '</b></div>',
627
+                    'message' => '<div style="margin:10px 0 10px 15px;">'.langHdl('complexity_level_not_reached').'.<br>'.
628
+                        langHdl('expected_complexity_level').': <b>'.TP_PW_COMPLEXITY[$data['complexity']][1].'</b></div>',
629 629
                 ),
630 630
                 'encode'
631 631
             );
@@ -726,14 +726,14 @@  discard block
 block discarded – undo
726 726
         // Get data about user
727 727
         $data = DB::queryfirstrow(
728 728
             'SELECT id, email, pw
729
-            FROM ' . prefixTable('users') . '
729
+            FROM ' . prefixTable('users').'
730 730
             WHERE login = %s',
731 731
             $post_login
732 732
         );
733 733
     } else {
734 734
         $data = DB::queryfirstrow(
735 735
             'SELECT id, login, email, pw
736
-            FROM ' . prefixTable('users') . '
736
+            FROM ' . prefixTable('users').'
737 737
             WHERE id = %i',
738 738
             $post_id
739 739
         );
@@ -743,7 +743,7 @@  discard block
 block discarded – undo
743 743
     $counter = DB::count();
744 744
 
745 745
     // load passwordLib library
746
-    $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'] . '/includes/libraries');
746
+    $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'].'/includes/libraries');
747 747
     $pwdlib->register();
748 748
     $pwdlib = new PasswordLib\PasswordLib();
749 749
 
@@ -790,7 +790,7 @@  discard block
 block discarded – undo
790 790
     }
791 791
     
792 792
     // generate new GA user code
793
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/TwoFactorAuth/TwoFactorAuth.php';
793
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/TwoFactorAuth/TwoFactorAuth.php';
794 794
     $tfa = new Authentication\TwoFactorAuth\TwoFactorAuth($SETTINGS['ga_website_name']);
795 795
     $gaSecretKey = $tfa->createSecret();
796 796
     $gaTemporaryCode = GenerateCryptKey(12, false, true, true, false, true, $SETTINGS);
@@ -829,7 +829,7 @@  discard block
 block discarded – undo
829 829
                 'email' => $data['email'],
830 830
                 'email_result' => str_replace(
831 831
                     '#email#',
832
-                    '<b>' . obfuscateEmail($data['email']) . '</b>',
832
+                    '<b>'.obfuscateEmail($data['email']).'</b>',
833 833
                     addslashes(langHdl('admin_email_result_ok'))
834 834
                 ),
835 835
             ),
@@ -845,7 +845,7 @@  discard block
 block discarded – undo
845 845
             'email' => $data['email'],
846 846
             'email_result' => str_replace(
847 847
                 '#email#',
848
-                '<b>' . obfuscateEmail($data['email']) . '</b>',
848
+                '<b>'.obfuscateEmail($data['email']).'</b>',
849 849
                 addslashes(langHdl('admin_email_result_ok'))
850 850
             ),
851 851
         ),
@@ -861,7 +861,7 @@  discard block
 block discarded – undo
861 861
         && (int) $SETTINGS['enable_send_email_on_user_login'] === 1
862 862
     ) {
863 863
         $row = DB::queryFirstRow(
864
-            'SELECT valeur FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s',
864
+            'SELECT valeur FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s',
865 865
             'cron',
866 866
             'sending_emails'
867 867
         );
@@ -869,7 +869,7 @@  discard block
 block discarded – undo
869 869
         if ((int) (time() - $row['valeur']) >= 300 || (int) $row['valeur'] === 0) {
870 870
             $rows = DB::query(
871 871
                 'SELECT *
872
-                FROM ' . prefixTable('emails') .
872
+                FROM ' . prefixTable('emails').
873 873
                 ' WHERE status != %s',
874 874
                 'sent'
875 875
             );
@@ -973,8 +973,8 @@  discard block
 block discarded – undo
973 973
     $arr_html = array();
974 974
     $rows = DB::query(
975 975
         'SELECT i.id AS id, i.label AS label, i.id_tree AS id_tree, l.date, i.perso AS perso, i.restricted_to AS restricted
976
-        FROM ' . prefixTable('log_items') . ' AS l
977
-        RIGHT JOIN ' . prefixTable('items') . ' AS i ON (l.id_item = i.id)
976
+        FROM ' . prefixTable('log_items').' AS l
977
+        RIGHT JOIN ' . prefixTable('items').' AS i ON (l.id_item = i.id)
978 978
         WHERE l.action = %s AND l.id_user = %i
979 979
         ORDER BY l.date DESC
980 980
         LIMIT 0, 100',
@@ -1007,7 +1007,7 @@  discard block
 block discarded – undo
1007 1007
         isset($SETTINGS['enable_suggestion']) === true && (int) $SETTINGS['enable_suggestion'] === 1
1008 1008
         && ((int) $_SESSION['user_admin'] === 1 || (int) $_SESSION['user_manager'] === 1)
1009 1009
     ) {
1010
-        DB::query('SELECT * FROM ' . prefixTable('suggestion'));
1010
+        DB::query('SELECT * FROM '.prefixTable('suggestion'));
1011 1011
         $nb_suggestions_waiting = DB::count();
1012 1012
     }
1013 1013
 
@@ -1043,13 +1043,13 @@  discard block
 block discarded – undo
1043 1043
             if ($data === 'stat_languages') {
1044 1044
                 $tmp = '';
1045 1045
                 foreach ($stats_data[$data] as $key => $value) {
1046
-                    $tmp .= $tmp === '' ? $key . '-' . $value : ',' . $key . '-' . $value;
1046
+                    $tmp .= $tmp === '' ? $key.'-'.$value : ','.$key.'-'.$value;
1047 1047
                 }
1048 1048
                 $statsToSend[$data] = $tmp;
1049 1049
             } elseif ($data === 'stat_country') {
1050 1050
                 $tmp = '';
1051 1051
                 foreach ($stats_data[$data] as $key => $value) {
1052
-                    $tmp .= $tmp === '' ? $key . '-' . $value : ',' . $key . '-' . $value;
1052
+                    $tmp .= $tmp === '' ? $key.'-'.$value : ','.$key.'-'.$value;
1053 1053
                 }
1054 1054
                 $statsToSend[$data] = $tmp;
1055 1055
             } else {
@@ -1123,8 +1123,8 @@  discard block
 block discarded – undo
1123 1123
             if (strpos($line, 'cpassman_url') > 0 && empty($url_found) === true) {
1124 1124
                 $url_found = substr($line, 19, strlen($line) - 22);
1125 1125
                 $tmp = parse_url($url_found);
1126
-                $anonym_url = $tmp['scheme'] . '://<anonym_url>' . $tmp['path'];
1127
-                $line = "'cpassman_url' => '" . $anonym_url . "\n";
1126
+                $anonym_url = $tmp['scheme'].'://<anonym_url>'.$tmp['path'];
1127
+                $line = "'cpassman_url' => '".$anonym_url."\n";
1128 1128
             }
1129 1129
 
1130 1130
             // Anonymize all urls
@@ -1151,7 +1151,7 @@  discard block
 block discarded – undo
1151 1151
     $teampass_errors = '';
1152 1152
     $rows = DB::query(
1153 1153
         'SELECT label, date AS error_date
1154
-        FROM ' . prefixTable('log_system') . "
1154
+        FROM ' . prefixTable('log_system')."
1155 1155
         WHERE `type` LIKE 'error'
1156 1156
         ORDER BY `date` DESC
1157 1157
         LIMIT 0, 10"
@@ -1159,9 +1159,9 @@  discard block
 block discarded – undo
1159 1159
     if (DB::count() > 0) {
1160 1160
         foreach ($rows as $record) {
1161 1161
             if (empty($teampass_errors) === true) {
1162
-                $teampass_errors = ' * ' . date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['error_date']) . ' - ' . $record['label'];
1162
+                $teampass_errors = ' * '.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['error_date']).' - '.$record['label'];
1163 1163
             } else {
1164
-                $teampass_errors .= ' * ' . date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['error_date']) . ' - ' . $record['label'];
1164
+                $teampass_errors .= ' * '.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['error_date']).' - '.$record['label'];
1165 1165
             }
1166 1166
         }
1167 1167
     }
@@ -1170,7 +1170,7 @@  discard block
 block discarded – undo
1170 1170
 
1171 1171
     // Now prepare text
1172 1172
     $txt = '### Page on which it happened
1173
-' . $post_data['current_page'] . '
1173
+' . $post_data['current_page'].'
1174 1174
 
1175 1175
 ### Steps to reproduce
1176 1176
 1.
@@ -1185,39 +1185,39 @@  discard block
 block discarded – undo
1185 1185
 Tell us what happens instead
1186 1186
 
1187 1187
 ### Server configuration
1188
-**Operating system**: ' . php_uname() . '
1188
+**Operating system**: ' . php_uname().'
1189 1189
 
1190
-**Web server:** ' . $_SERVER['SERVER_SOFTWARE'] . '
1190
+**Web server:** ' . $_SERVER['SERVER_SOFTWARE'].'
1191 1191
 
1192
-**Database:** ' . ($link === false ? langHdl('undefined') : mysqli_get_server_info($link)) . '
1192
+**Database:** ' . ($link === false ? langHdl('undefined') : mysqli_get_server_info($link)).'
1193 1193
 
1194
-**PHP version:** ' . PHP_VERSION . '
1194
+**PHP version:** ' . PHP_VERSION.'
1195 1195
 
1196
-**Teampass version:** ' . TP_VERSION_FULL . '
1196
+**Teampass version:** ' . TP_VERSION_FULL.'
1197 1197
 
1198 1198
 **Teampass configuration file:**
1199 1199
 ```
1200
-' . $list_of_options . '
1200
+' . $list_of_options.'
1201 1201
 ```
1202 1202
 
1203 1203
 **Updated from an older Teampass or fresh install:**
1204 1204
 
1205 1205
 ### Client configuration
1206 1206
 
1207
-**Browser:** ' . $post_data['browser_name'] . ' - ' . $post_data['browser_version'] . '
1207
+**Browser:** ' . $post_data['browser_name'].' - '.$post_data['browser_version'].'
1208 1208
 
1209
-**Operating system:** ' . $post_data['os'] . ' - ' . $post_data['os_archi'] . 'bits
1209
+**Operating system:** ' . $post_data['os'].' - '.$post_data['os_archi'].'bits
1210 1210
 
1211 1211
 ### Logs
1212 1212
 
1213 1213
 #### Web server error log
1214 1214
 ```
1215
-' . $err['message'] . ' - ' . $err['file'] . ' (' . $err['line'] . ')
1215
+' . $err['message'].' - '.$err['file'].' ('.$err['line'].')
1216 1216
 ```
1217 1217
 
1218 1218
 #### Teampass 10 last system errors
1219 1219
 ```
1220
-' . $teampass_errors . '
1220
+' . $teampass_errors.'
1221 1221
 ```
1222 1222
 
1223 1223
 #### Log from the web-browser developer console (CTRL + SHIFT + i)
@@ -1245,7 +1245,7 @@  discard block
 block discarded – undo
1245 1245
         // Check if user exists
1246 1246
         $userInfo = DB::queryFirstRow(
1247 1247
             'SELECT public_key, private_key, pw, auth_type
1248
-            FROM ' . prefixTable('users') . '
1248
+            FROM ' . prefixTable('users').'
1249 1249
             WHERE id = %i',
1250 1250
             $post_user_id
1251 1251
         );
@@ -1253,7 +1253,7 @@  discard block
 block discarded – undo
1253 1253
             // Get one item
1254 1254
             $record = DB::queryFirstRow(
1255 1255
                 'SELECT object_id
1256
-                FROM ' . prefixTable('sharekeys_items') . '
1256
+                FROM ' . prefixTable('sharekeys_items').'
1257 1257
                 WHERE user_id = %i',
1258 1258
                 $post_user_id
1259 1259
             );
@@ -1261,7 +1261,7 @@  discard block
 block discarded – undo
1261 1261
             // Get itemKey from current user
1262 1262
             $currentUserKey = DB::queryFirstRow(
1263 1263
                 'SELECT share_key, increment_id
1264
-                FROM ' . prefixTable('sharekeys_items') . '
1264
+                FROM ' . prefixTable('sharekeys_items').'
1265 1265
                 WHERE object_id = %i AND user_id = %i',
1266 1266
                 $record['object_id'],
1267 1267
                 $post_user_id
@@ -1288,7 +1288,7 @@  discard block
 block discarded – undo
1288 1288
             
1289 1289
             // Use the password check
1290 1290
             // load passwordLib library
1291
-            $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'] . '/includes/libraries');
1291
+            $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'].'/includes/libraries');
1292 1292
             $pwdlib->register();
1293 1293
             $pwdlib = new PasswordLib\PasswordLib();
1294 1294
             
@@ -1344,7 +1344,7 @@  discard block
 block discarded – undo
1344 1344
         // Get user info
1345 1345
         $userData = DB::queryFirstRow(
1346 1346
             'SELECT private_key
1347
-            FROM ' . prefixTable('users') . '
1347
+            FROM ' . prefixTable('users').'
1348 1348
             WHERE id = %i',
1349 1349
             $post_user_id
1350 1350
         );
@@ -1371,7 +1371,7 @@  discard block
 block discarded – undo
1371 1371
             );
1372 1372
 
1373 1373
             // Load superGlobals
1374
-            include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1374
+            include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1375 1375
             $superGlobal = new protect\SuperGlobal\SuperGlobal();
1376 1376
 
1377 1377
             $superGlobal->put('private_key', $privateKey, 'SESSION', 'user');
@@ -1409,7 +1409,7 @@  discard block
 block discarded – undo
1409 1409
         // Get user info
1410 1410
         $userData = DB::queryFirstRow(
1411 1411
             'SELECT email, auth_type, login
1412
-            FROM ' . prefixTable('users') . '
1412
+            FROM ' . prefixTable('users').'
1413 1413
             WHERE id = %i',
1414 1414
             $post_user_id
1415 1415
         );
@@ -1544,7 +1544,7 @@  discard block
 block discarded – undo
1544 1544
         // Get user info
1545 1545
         $userData = DB::queryFirstRow(
1546 1546
             'SELECT email, auth_type, login
1547
-            FROM ' . prefixTable('users') . '
1547
+            FROM ' . prefixTable('users').'
1548 1548
             WHERE id = %i',
1549 1549
             $post_user_id
1550 1550
         );
@@ -1607,13 +1607,13 @@  discard block
 block discarded – undo
1607 1607
         // Check if user exists
1608 1608
         DB::queryFirstRow(
1609 1609
             'SELECT *
1610
-            FROM ' . prefixTable('users') . '
1610
+            FROM ' . prefixTable('users').'
1611 1611
             WHERE id = %i',
1612 1612
             $post_user_id
1613 1613
         );
1614 1614
         if (DB::count() > 0) {
1615 1615
             // Include libraries
1616
-            include_once $SETTINGS['cpassman_dir'] . '/sources/aes.functions.php';
1616
+            include_once $SETTINGS['cpassman_dir'].'/sources/aes.functions.php';
1617 1617
 
1618 1618
             // CLear old sharekeys
1619 1619
             if ($post_self_change === false) {
@@ -1665,13 +1665,13 @@  discard block
 block discarded – undo
1665 1665
         // Check if user exists
1666 1666
         $userInfo = DB::queryFirstRow(
1667 1667
             'SELECT public_key
1668
-            FROM ' . prefixTable('users') . '
1668
+            FROM ' . prefixTable('users').'
1669 1669
             WHERE id = %i',
1670 1670
             $post_user_id
1671 1671
         );
1672 1672
         if (isset($userInfo['public_key']) === true) {
1673 1673
             // Include libraries
1674
-            include_once $SETTINGS['cpassman_dir'] . '/sources/aes.functions.php';
1674
+            include_once $SETTINGS['cpassman_dir'].'/sources/aes.functions.php';
1675 1675
 
1676 1676
             // WHAT STEP TO PERFORM?
1677 1677
             if ($post_action === 'step0') {
@@ -1831,15 +1831,15 @@  discard block
 block discarded – undo
1831 1831
     // Loop on items
1832 1832
     $rows = DB::query(
1833 1833
         'SELECT id, pw
1834
-        FROM ' . prefixTable('items') . '
1834
+        FROM ' . prefixTable('items').'
1835 1835
         WHERE perso = 0
1836
-        LIMIT ' . $post_start . ', ' . $post_length
1836
+        LIMIT ' . $post_start.', '.$post_length
1837 1837
     );
1838 1838
     foreach ($rows as $record) {
1839 1839
         // Get itemKey from current user
1840 1840
         $currentUserKey = DB::queryFirstRow(
1841 1841
             'SELECT share_key, increment_id
1842
-            FROM ' . prefixTable('sharekeys_items') . '
1842
+            FROM ' . prefixTable('sharekeys_items').'
1843 1843
             WHERE object_id = %i AND user_id = %i',
1844 1844
             $record['id'],
1845 1845
             $_SESSION['user_id']
@@ -1867,7 +1867,7 @@  discard block
 block discarded – undo
1867 1867
             if ((int) $post_user_id !== (int) $_SESSION['user_id']) {
1868 1868
                 $currentUserKey = DB::queryFirstRow(
1869 1869
                     'SELECT increment_id
1870
-                    FROM ' . prefixTable('sharekeys_items') . '
1870
+                    FROM ' . prefixTable('sharekeys_items').'
1871 1871
                     WHERE object_id = %i AND user_id = %i',
1872 1872
                     $record['id'],
1873 1873
                     $post_user_id
@@ -1900,7 +1900,7 @@  discard block
 block discarded – undo
1900 1900
     // SHould we change step?
1901 1901
     DB::query(
1902 1902
         'SELECT *
1903
-        FROM ' . prefixTable('items') . '
1903
+        FROM ' . prefixTable('items').'
1904 1904
         WHERE perso = 0'
1905 1905
     );
1906 1906
 
@@ -1924,15 +1924,15 @@  discard block
 block discarded – undo
1924 1924
     // Loop on logs
1925 1925
     $rows = DB::query(
1926 1926
         'SELECT increment_id
1927
-        FROM ' . prefixTable('log_items') . '
1927
+        FROM ' . prefixTable('log_items').'
1928 1928
         WHERE raison LIKE "at_pw :%" AND encryption_type = "teampass_aes"
1929
-        LIMIT ' . $post_start . ', ' . $post_length
1929
+        LIMIT ' . $post_start.', '.$post_length
1930 1930
     );
1931 1931
     foreach ($rows as $record) {
1932 1932
         // Get itemKey from current user
1933 1933
         $currentUserKey = DB::queryFirstRow(
1934 1934
             'SELECT share_key
1935
-            FROM ' . prefixTable('sharekeys_logs') . '
1935
+            FROM ' . prefixTable('sharekeys_logs').'
1936 1936
             WHERE object_id = %i AND user_id = %i',
1937 1937
             $record['increment_id'],
1938 1938
             $_SESSION['user_id']
@@ -1959,7 +1959,7 @@  discard block
 block discarded – undo
1959 1959
             if ((int) $post_user_id !== (int) $_SESSION['user_id']) {
1960 1960
                 $currentUserKey = DB::queryFirstRow(
1961 1961
                     'SELECT increment_id
1962
-                    FROM ' . prefixTable('sharekeys_items') . '
1962
+                    FROM ' . prefixTable('sharekeys_items').'
1963 1963
                     WHERE object_id = %i AND user_id = %i',
1964 1964
                     $record['id'],
1965 1965
                     $post_user_id
@@ -1981,7 +1981,7 @@  discard block
 block discarded – undo
1981 1981
     // SHould we change step?
1982 1982
     DB::query(
1983 1983
         'SELECT increment_id
1984
-        FROM ' . prefixTable('log_items') . '
1984
+        FROM ' . prefixTable('log_items').'
1985 1985
         WHERE raison LIKE "at_pw :%" AND encryption_type = "teampass_aes"'
1986 1986
     );
1987 1987
 
@@ -2005,15 +2005,15 @@  discard block
 block discarded – undo
2005 2005
     // Loop on fields
2006 2006
     $rows = DB::query(
2007 2007
         'SELECT id
2008
-        FROM ' . prefixTable('categories_items') . '
2008
+        FROM ' . prefixTable('categories_items').'
2009 2009
         WHERE encryption_type = "teampass_aes"
2010
-        LIMIT ' . $post_start . ', ' . $post_length
2010
+        LIMIT ' . $post_start.', '.$post_length
2011 2011
     );
2012 2012
     foreach ($rows as $record) {
2013 2013
         // Get itemKey from current user
2014 2014
         $currentUserKey = DB::queryFirstRow(
2015 2015
             'SELECT share_key
2016
-            FROM ' . prefixTable('sharekeys_fields') . '
2016
+            FROM ' . prefixTable('sharekeys_fields').'
2017 2017
             WHERE object_id = %i AND user_id = %i',
2018 2018
             $record['id'],
2019 2019
             $_SESSION['user_id']
@@ -2040,7 +2040,7 @@  discard block
 block discarded – undo
2040 2040
             if ((int) $post_user_id !== (int) $_SESSION['user_id']) {
2041 2041
                 $currentUserKey = DB::queryFirstRow(
2042 2042
                     'SELECT increment_id
2043
-                    FROM ' . prefixTable('sharekeys_items') . '
2043
+                    FROM ' . prefixTable('sharekeys_items').'
2044 2044
                     WHERE object_id = %i AND user_id = %i',
2045 2045
                     $record['id'],
2046 2046
                     $post_user_id
@@ -2062,7 +2062,7 @@  discard block
 block discarded – undo
2062 2062
     // SHould we change step?
2063 2063
     DB::query(
2064 2064
         'SELECT *
2065
-        FROM ' . prefixTable('categories_items') . '
2065
+        FROM ' . prefixTable('categories_items').'
2066 2066
         WHERE encryption_type = "teampass_aes"'
2067 2067
     );
2068 2068
 
@@ -2086,14 +2086,14 @@  discard block
 block discarded – undo
2086 2086
     // Loop on suggestions
2087 2087
     $rows = DB::query(
2088 2088
         'SELECT id
2089
-        FROM ' . prefixTable('suggestion') . '
2090
-        LIMIT ' . $post_start . ', ' . $post_length
2089
+        FROM ' . prefixTable('suggestion').'
2090
+        LIMIT ' . $post_start.', '.$post_length
2091 2091
     );
2092 2092
     foreach ($rows as $record) {
2093 2093
         // Get itemKey from current user
2094 2094
         $currentUserKey = DB::queryFirstRow(
2095 2095
             'SELECT share_key
2096
-            FROM ' . prefixTable('sharekeys_suggestions') . '
2096
+            FROM ' . prefixTable('sharekeys_suggestions').'
2097 2097
             WHERE object_id = %i AND user_id = %i',
2098 2098
             $record['id'],
2099 2099
             $_SESSION['user_id']
@@ -2120,7 +2120,7 @@  discard block
 block discarded – undo
2120 2120
             if ((int) $post_user_id !== (int) $_SESSION['user_id']) {
2121 2121
                 $currentUserKey = DB::queryFirstRow(
2122 2122
                     'SELECT increment_id
2123
-                    FROM ' . prefixTable('sharekeys_items') . '
2123
+                    FROM ' . prefixTable('sharekeys_items').'
2124 2124
                     WHERE object_id = %i AND user_id = %i',
2125 2125
                     $record['id'],
2126 2126
                     $post_user_id
@@ -2165,15 +2165,15 @@  discard block
 block discarded – undo
2165 2165
     // Loop on files
2166 2166
     $rows = DB::query(
2167 2167
         'SELECT id
2168
-        FROM ' . prefixTable('files') . '
2169
-        WHERE status = "' . TP_ENCRYPTION_NAME . '"
2170
-        LIMIT ' . $post_start . ', ' . $post_length
2168
+        FROM ' . prefixTable('files').'
2169
+        WHERE status = "' . TP_ENCRYPTION_NAME.'"
2170
+        LIMIT ' . $post_start.', '.$post_length
2171 2171
     ); //aes_encryption
2172 2172
     foreach ($rows as $record) {
2173 2173
         // Get itemKey from current user
2174 2174
         $currentUserKey = DB::queryFirstRow(
2175 2175
             'SELECT share_key
2176
-            FROM ' . prefixTable('sharekeys_files') . '
2176
+            FROM ' . prefixTable('sharekeys_files').'
2177 2177
             WHERE object_id = %i AND user_id = %i',
2178 2178
             $record['id'],
2179 2179
             $_SESSION['user_id']
@@ -2200,7 +2200,7 @@  discard block
 block discarded – undo
2200 2200
             if ((int) $post_user_id !== (int) $_SESSION['user_id']) {
2201 2201
                 $currentUserKey = DB::queryFirstRow(
2202 2202
                     'SELECT increment_id
2203
-                    FROM ' . prefixTable('sharekeys_items') . '
2203
+                    FROM ' . prefixTable('sharekeys_items').'
2204 2204
                     WHERE object_id = %i AND user_id = %i',
2205 2205
                     $record['id'],
2206 2206
                     $post_user_id
@@ -2222,8 +2222,8 @@  discard block
 block discarded – undo
2222 2222
     // SHould we change step?
2223 2223
     DB::query(
2224 2224
         'SELECT *
2225
-        FROM ' . prefixTable('files') . '
2226
-        WHERE status = "' . TP_ENCRYPTION_NAME . '"'
2225
+        FROM ' . prefixTable('files').'
2226
+        WHERE status = "' . TP_ENCRYPTION_NAME.'"'
2227 2227
     );
2228 2228
 
2229 2229
     $next_start = (int) $post_start + (int) $post_length;
@@ -2255,16 +2255,16 @@  discard block
 block discarded – undo
2255 2255
     if (count($_SESSION['personal_folders']) > 0) {
2256 2256
         $rows = DB::query(
2257 2257
             'SELECT id, pw
2258
-            FROM ' . prefixTable('items') . '
2258
+            FROM ' . prefixTable('items').'
2259 2259
             WHERE perso = 1 AND id_tree IN %ls
2260
-            LIMIT ' . $post_start . ', ' . $post_length,
2260
+            LIMIT ' . $post_start.', '.$post_length,
2261 2261
             $_SESSION['personal_folders']
2262 2262
         );
2263 2263
         foreach ($rows as $record) {
2264 2264
             // Get itemKey from current user
2265 2265
             $currentUserKey = DB::queryFirstRow(
2266 2266
                 'SELECT share_key, increment_id
2267
-                FROM ' . prefixTable('sharekeys_items') . '
2267
+                FROM ' . prefixTable('sharekeys_items').'
2268 2268
                 WHERE object_id = %i AND user_id = %i',
2269 2269
                 $record['id'],
2270 2270
                 $_SESSION['user_id']
@@ -2291,7 +2291,7 @@  discard block
 block discarded – undo
2291 2291
                 if ((int) $post_user_id !== (int) $_SESSION['user_id']) {
2292 2292
                     $currentUserKey = DB::queryFirstRow(
2293 2293
                         'SELECT increment_id
2294
-                        FROM ' . prefixTable('sharekeys_items') . '
2294
+                        FROM ' . prefixTable('sharekeys_items').'
2295 2295
                         WHERE object_id = %i AND user_id = %i',
2296 2296
                         $record['id'],
2297 2297
                         $post_user_id
@@ -2314,7 +2314,7 @@  discard block
 block discarded – undo
2314 2314
     // SHould we change step?
2315 2315
     DB::query(
2316 2316
         'SELECT *
2317
-        FROM ' . prefixTable('items') . '
2317
+        FROM ' . prefixTable('items').'
2318 2318
         WHERE perso = 0'
2319 2319
     );
2320 2320
 
@@ -2338,7 +2338,7 @@  discard block
 block discarded – undo
2338 2338
         // Check if user exists
2339 2339
         $userInfo = DB::queryFirstRow(
2340 2340
             'SELECT public_key, encrypted_psk
2341
-            FROM ' . prefixTable('users') . '
2341
+            FROM ' . prefixTable('users').'
2342 2342
             WHERE id = %i',
2343 2343
             $post_user_id
2344 2344
         );
@@ -2363,9 +2363,9 @@  discard block
 block discarded – undo
2363 2363
                 // Loop on persoanl items
2364 2364
                 $rows = DB::query(
2365 2365
                     'SELECT id, pw
2366
-                    FROM ' . prefixTable('items') . '
2366
+                    FROM ' . prefixTable('items').'
2367 2367
                     WHERE perso = 1 AND id_tree IN %ls
2368
-                    LIMIT ' . $post_start . ', ' . $post_length,
2368
+                    LIMIT ' . $post_start.', '.$post_length,
2369 2369
                     $_SESSION['personal_folders']
2370 2370
                 );
2371 2371
                 $countUserPersonalItems = DB::count();
@@ -2408,7 +2408,7 @@  discard block
 block discarded – undo
2408 2408
                         // Loop on files
2409 2409
                         $rows = DB::query(
2410 2410
                             'SELECT id, file
2411
-                            FROM ' . prefixTable('files') . '
2411
+                            FROM ' . prefixTable('files').'
2412 2412
                             WHERE status != %s
2413 2413
                             AND id_item = %i',
2414 2414
                             TP_ENCRYPTION_NAME,
@@ -2419,14 +2419,14 @@  discard block
 block discarded – undo
2419 2419
                             // Now decrypt the file
2420 2420
                             prepareFileWithDefuse(
2421 2421
                                 'decrypt',
2422
-                                $SETTINGS['path_to_upload_folder'] . '/' . $record2['file'],
2423
-                                $SETTINGS['path_to_upload_folder'] . '/' . $record2['file'] . '.delete',
2422
+                                $SETTINGS['path_to_upload_folder'].'/'.$record2['file'],
2423
+                                $SETTINGS['path_to_upload_folder'].'/'.$record2['file'].'.delete',
2424 2424
                                 $SETTINGS,
2425 2425
                                 $post_user_psk
2426 2426
                             );
2427 2427
 
2428 2428
                             // Encrypt the file
2429
-                            $encryptedFile = encryptFile($record2['file'] . '.delete', $SETTINGS['path_to_upload_folder']);
2429
+                            $encryptedFile = encryptFile($record2['file'].'.delete', $SETTINGS['path_to_upload_folder']);
2430 2430
 
2431 2431
                             DB::update(
2432 2432
                                 prefixTable('files'),
@@ -2449,7 +2449,7 @@  discard block
 block discarded – undo
2449 2449
                             );
2450 2450
 
2451 2451
                             // Unlink original file
2452
-                            unlink($SETTINGS['path_to_upload_folder'] . '/' . $record2['file']);
2452
+                            unlink($SETTINGS['path_to_upload_folder'].'/'.$record2['file']);
2453 2453
                         }
2454 2454
                     }
2455 2455
                 }
@@ -2518,7 +2518,7 @@  discard block
 block discarded – undo
2518 2518
         // Get user info
2519 2519
         $userData = DB::queryFirstRow(
2520 2520
             'SELECT '.$post_fields.'
2521
-            FROM ' . prefixTable('users') . '
2521
+            FROM ' . prefixTable('users').'
2522 2522
             WHERE id = %i',
2523 2523
             $post_user_id
2524 2524
         );
@@ -2553,7 +2553,7 @@  discard block
 block discarded – undo
2553 2553
         // Get user info
2554 2554
         $userData = DB::queryFirstRow(
2555 2555
             'SELECT auth_type, login, private_key
2556
-            FROM ' . prefixTable('users') . '
2556
+            FROM ' . prefixTable('users').'
2557 2557
             WHERE id = %i',
2558 2558
             $post_user_id
2559 2559
         );
@@ -2564,7 +2564,7 @@  discard block
 block discarded – undo
2564 2564
             $privateKey = decryptPrivateKey($post_current_pwd, $userData['private_key']);
2565 2565
 
2566 2566
             // Load superGlobals
2567
-            include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
2567
+            include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
2568 2568
             $superGlobal = new protect\SuperGlobal\SuperGlobal();
2569 2569
 
2570 2570
             if ($superGlobal->get('private_key', 'SESSION', 'user') === $privateKey) {
@@ -2597,7 +2597,7 @@  discard block
 block discarded – undo
2597 2597
                 return prepareExchangedData(
2598 2598
                     array(
2599 2599
                         'error' => false,
2600
-                        'message' => langHdl('done'),'',
2600
+                        'message' => langHdl('done'), '',
2601 2601
                     ),
2602 2602
                     'encode'
2603 2603
                 );
@@ -2635,7 +2635,7 @@  discard block
 block discarded – undo
2635 2635
         // Get user info
2636 2636
         $userData = DB::queryFirstRow(
2637 2637
             'SELECT auth_type, login, private_key, special
2638
-            FROM ' . prefixTable('users') . '
2638
+            FROM ' . prefixTable('users').'
2639 2639
             WHERE id = %i',
2640 2640
             $post_user_id
2641 2641
         );
@@ -2665,14 +2665,14 @@  discard block
 block discarded – undo
2665 2665
                 );
2666 2666
 
2667 2667
                 // Load superGlobals
2668
-                include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
2668
+                include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
2669 2669
                 $superGlobal = new protect\SuperGlobal\SuperGlobal();
2670 2670
                 $superGlobal->put('private_key', $privateKey, 'SESSION', 'user');
2671 2671
 
2672 2672
                 return prepareExchangedData(
2673 2673
                     array(
2674 2674
                         'error' => false,
2675
-                        'message' => langHdl('done'),'',
2675
+                        'message' => langHdl('done'), '',
2676 2676
                     ),
2677 2677
                     'encode'
2678 2678
                 );
@@ -2696,14 +2696,14 @@  discard block
 block discarded – undo
2696 2696
             // Get one item
2697 2697
             $record = DB::queryFirstRow(
2698 2698
                 'SELECT id, pw
2699
-                FROM ' . prefixTable('items') . '
2699
+                FROM ' . prefixTable('items').'
2700 2700
                 WHERE perso = 0'
2701 2701
             );
2702 2702
 
2703 2703
             // Get itemKey from current user
2704 2704
             $currentUserKey = DB::queryFirstRow(
2705 2705
                 'SELECT share_key, increment_id
2706
-                FROM ' . prefixTable('sharekeys_items') . '
2706
+                FROM ' . prefixTable('sharekeys_items').'
2707 2707
                 WHERE object_id = %i AND user_id = %i',
2708 2708
                 $record['id'],
2709 2709
                 $post_user_id
@@ -2731,7 +2731,7 @@  discard block
 block discarded – undo
2731 2731
                     );
2732 2732
                     
2733 2733
                     // Load superGlobals
2734
-                    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
2734
+                    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
2735 2735
                     $superGlobal = new protect\SuperGlobal\SuperGlobal();
2736 2736
                     $superGlobal->put('private_key', $privateKey, 'SESSION', 'user');
2737 2737
 
@@ -2785,7 +2785,7 @@  discard block
 block discarded – undo
2785 2785
             $_SESSION['user_id']
2786 2786
         );
2787 2787
         // Return data
2788
-        return '[{"new_value":"' . $_SESSION['sessionDuration'] . '"}]';
2788
+        return '[{"new_value":"'.$_SESSION['sessionDuration'].'"}]';
2789 2789
     }
2790 2790
     
2791 2791
     return '[{"new_value":"expired"}]';
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
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
                                     console.log('User has to regenerate keys')
118 118
                                     // HIde
119 119
                                     $('.content-header, .content').addClass('hidden');
120
-                                    $('#dialog-user-temporary-code-info').html('<i class="icon fas fa-info mr-2"></i><?php echo langHdl('renecyption_expected');?>');
120
+                                    $('#dialog-user-temporary-code-info').html('<i class="icon fas fa-info mr-2"></i><?php echo langHdl('renecyption_expected'); ?>');
121 121
 
122 122
                                     // Show passwords inputs and form
123 123
                                     $('#dialog-user-temporary-code').removeClass('hidden');
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 
132 132
                                     // Show passwords inputs and form
133 133
                                     $('#dialog-user-change-password-info')
134
-                                        .html('<i class="icon fas fa-info mr-2"></i><?php echo langHdl('user_has_to_change_password_info');?>')
134
+                                        .html('<i class="icon fas fa-info mr-2"></i><?php echo langHdl('user_has_to_change_password_info'); ?>')
135 135
                                         .removeClass('hidden');
136 136
                                     $('#dialog-user-change-password').removeClass('hidden');
137 137
 
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 
145 145
                                     // Show passwords inputs and form
146 146
                                     $('#dialog-ldap-user-change-password-info')
147
-                                        .html('<i class="icon fas fa-info mr-2"></i><?php echo langHdl('ldap_user_has_changed_his_password');?>')
147
+                                        .html('<i class="icon fas fa-info mr-2"></i><?php echo langHdl('ldap_user_has_changed_his_password'); ?>')
148 148
                                         .removeClass('hidden');
149 149
                                     $('#dialog-ldap-user-change-password').removeClass('hidden');
150 150
                                     
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
         console.log('User has to regenerate keys')
219 219
         // HIde
220 220
         $('.content-header, .content').addClass('hidden');
221
-        $('#dialog-user-temporary-code-info').html('<i class="icon fas fa-info mr-2"></i><?php echo langHdl('renecyption_expected');?>');
221
+        $('#dialog-user-temporary-code-info').html('<i class="icon fas fa-info mr-2"></i><?php echo langHdl('renecyption_expected'); ?>');
222 222
 
223 223
         // Show passwords inputs and form
224 224
         $('#dialog-user-temporary-code').removeClass('hidden');
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
             {
297 297
                 if (step === 'psk') {
298 298
                     // Inform user
299
-                    $("#user-current-defuse-psk-progress").html('<b><?php echo langHdl('encryption_keys'); ?> </b> [' + start + ' - ' + (parseInt(start) + <?php echo NUMBER_ITEMS_IN_BATCH;?>) + '] ' +
299
+                    $("#user-current-defuse-psk-progress").html('<b><?php echo langHdl('encryption_keys'); ?> </b> [' + start + ' - ' + (parseInt(start) + <?php echo NUMBER_ITEMS_IN_BATCH; ?>) + '] ' +
300 300
                         '... <?php echo langHdl('please_wait'); ?><i class="fas fa-spinner fa-pulse ml-3 text-primary"></i>');
301 301
 
302 302
                     var data = {'userPsk' : $('#user-current-defuse-psk').val()};
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
                         "sources/main.queries.php", {
306 306
                             type: "user_psk_reencryption",
307 307
                             'start': start,
308
-                            'length': <?php echo NUMBER_ITEMS_IN_BATCH;?>,
308
+                            'length': <?php echo NUMBER_ITEMS_IN_BATCH; ?>,
309 309
                             userId: userId,
310 310
                             data: prepareExchangedData(JSON.stringify(data), "encode", "<?php echo $_SESSION['key']; ?>"),
311 311
                             key: '<?php echo $_SESSION['key']; ?>'
@@ -794,15 +794,15 @@  discard block
 block discarded – undo
794 794
             // Prepare data
795 795
             var data = {
796 796
                 'receipt': $('#temp-user-email').val(),
797
-                'subject': '[Teampass] <?php echo langHdl('your_new_password');?>',
798
-                'body': '<?php echo langHdl('email_body_temporary_login_password');?>',
797
+                'subject': '[Teampass] <?php echo langHdl('your_new_password'); ?>',
798
+                'body': '<?php echo langHdl('email_body_temporary_login_password'); ?>',
799 799
                 'pre_replace' : {
800 800
                     '#enc_code#' : $('#temp-user-pwd').val(),
801 801
                 }
802 802
             }
803 803
             console.log(data);
804 804
             // Prepare form
805
-            $('#dialog-admin-change-user-password-info').html('<?php echo langHdl('sending_email_message');?>');
805
+            $('#dialog-admin-change-user-password-info').html('<?php echo langHdl('sending_email_message'); ?>');
806 806
             toastr.remove();
807 807
             toastr.info(
808 808
                 '<?php echo langHdl('in_progress'); ?><i class="fas fa-circle-notch fa-spin fa-2x ml-3"></i>'
@@ -1270,7 +1270,7 @@  discard block
 block discarded – undo
1270 1270
             '#warningModal',
1271 1271
             '<i class="fas fa-clock fa-lg warning mr-2"></i><?php echo langHdl('index_add_one_hour'); ?>',
1272 1272
             '<div class="form-group">' +
1273
-            '<label for="warningModal-input" class="col-form-label"><?php echo langHdl('index_session_duration') . ' (' . langHdl('minutes') . ')'; ?>:</label>' +
1273
+            '<label for="warningModal-input" class="col-form-label"><?php echo langHdl('index_session_duration').' ('.langHdl('minutes').')'; ?>:</label>' +
1274 1274
             '<input type="text" class="form-control" id="warningModal-input" value="<?php echo isset($_SESSION['user']['session_duration']) === true ? (int) $_SESSION['user']['session_duration'] / 60 : 60; ?>">' +
1275 1275
             '</div>',
1276 1276
             '<?php echo langHdl('confirm'); ?>',
@@ -1522,13 +1522,13 @@  discard block
 block discarded – undo
1522 1522
         if (step !== 'finished') {
1523 1523
             // Inform user
1524 1524
             $("#"+divIdDialog+'-progress').html('<b><?php echo langHdl('encryption_keys'); ?> - ' +
1525
-                stepText + '</b> [' + start + ' - ' + (parseInt(start) + <?php echo NUMBER_ITEMS_IN_BATCH;?>) + '] ' +
1525
+                stepText + '</b> [' + start + ' - ' + (parseInt(start) + <?php echo NUMBER_ITEMS_IN_BATCH; ?>) + '] ' +
1526 1526
                 '... <?php echo langHdl('please_wait'); ?><i class="fas fa-spinner fa-pulse ml-3 text-primary"></i>');
1527 1527
 
1528 1528
             var data = {
1529 1529
                 'action': step,
1530 1530
                 'start': start,
1531
-                'length': <?php echo NUMBER_ITEMS_IN_BATCH;?>,
1531
+                'length': <?php echo NUMBER_ITEMS_IN_BATCH; ?>,
1532 1532
                 'user_id': userId,
1533 1533
             }
1534 1534
             // Do query
Please login to merge, or discard this patch.
pages/search.js.php 1 patch
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -2,30 +2,30 @@
 block discarded – undo
2 2
 
3 3
 declare(strict_types=1);
4 4
 
5
- /**
6
-  * Teampass - a collaborative passwords manager.
7
-  * ---
8
-  * This library is distributed in the hope that it will be useful,
9
-  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
-  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11
-  * ---
12
-  *
13
-  * @project   Teampass
14
-  *
15
-  * @file      search.js.php
16
-  * ---
17
-  *
18
-  * @author    Nils LaumaillĂ© ([email protected])
19
-  *
20
-  * @copyright 2009-2022 Teampass.net
21
-  *
22
-  * @license   https://spdx.org/licenses/GPL-3.0-only.html#licenseText GPL-3.0
23
-  * ---
24
-  *
25
-  * @see       https://www.teampass.net
26
-  */
27
-
28
- $var = [];
5
+    /**
6
+     * Teampass - a collaborative passwords manager.
7
+     * ---
8
+     * This library is distributed in the hope that it will be useful,
9
+     * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+     *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11
+     * ---
12
+     *
13
+     * @project   Teampass
14
+     *
15
+     * @file      search.js.php
16
+     * ---
17
+     *
18
+     * @author    Nils LaumaillĂ© ([email protected])
19
+     *
20
+     * @copyright 2009-2022 Teampass.net
21
+     *
22
+     * @license   https://spdx.org/licenses/GPL-3.0-only.html#licenseText GPL-3.0
23
+     * ---
24
+     *
25
+     * @see       https://www.teampass.net
26
+     */
27
+
28
+    $var = [];
29 29
 $var['hidden_asterisk'] = '<i class="fas fa-asterisk mr-2"></i><i class="fas fa-asterisk mr-2"></i><i class="fas fa-asterisk mr-2"></i><i class="fas fa-asterisk mr-2"></i><i class="fas fa-asterisk"></i>';
30 30
 
31 31
 ?>
Please login to merge, or discard this patch.
pages/profile.php 1 patch
Spacing   +38 added lines, -40 removed lines patch added patch discarded remove patch
@@ -43,16 +43,16 @@  discard block
 block discarded – undo
43 43
 }
44 44
 
45 45
 /* do checks */
46
-require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php';
46
+require_once $SETTINGS['cpassman_dir'].'/sources/checks.php';
47 47
 if (checkUser($_SESSION['user_id'], $_SESSION['key'], curPage($SETTINGS), $SETTINGS) === false) {
48 48
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
49
-    include $SETTINGS['cpassman_dir'] . '/error.php';
49
+    include $SETTINGS['cpassman_dir'].'/error.php';
50 50
     exit;
51 51
 }
52 52
 
53 53
 // Load template
54
-require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
55
-require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
54
+require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
55
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
56 56
 $superGlobal = new protect\SuperGlobal\SuperGlobal();
57 57
 // Prepare GET variables
58 58
 $get = [];
@@ -73,25 +73,25 @@  discard block
 block discarded – undo
73 73
 // prepare list of timezones
74 74
 $zones = timezone_list();
75 75
 // prepare list of languages
76
-$languages = DB::query('SELECT label FROM ' . prefixTable('languages') . ' ORDER BY label ASC');
76
+$languages = DB::query('SELECT label FROM '.prefixTable('languages').' ORDER BY label ASC');
77 77
 // Do some stats
78
-DB::query('SELECT id_item FROM ' . prefixTable('log_items') . ' WHERE action = "at_creation" AND  id_user = "' . $_SESSION['user_id'] . '"');
78
+DB::query('SELECT id_item FROM '.prefixTable('log_items').' WHERE action = "at_creation" AND  id_user = "'.$_SESSION['user_id'].'"');
79 79
 $userItemsNumber = DB::count();
80
-DB::query('SELECT id_item FROM ' . prefixTable('log_items') . ' WHERE action = "at_modification" AND  id_user = "' . $_SESSION['user_id'] . '"');
80
+DB::query('SELECT id_item FROM '.prefixTable('log_items').' WHERE action = "at_modification" AND  id_user = "'.$_SESSION['user_id'].'"');
81 81
 $userModificationNumber = DB::count();
82
-DB::query('SELECT id_item FROM ' . prefixTable('log_items') . ' WHERE action = "at_shown" AND  id_user = "' . $_SESSION['user_id'] . '"');
82
+DB::query('SELECT id_item FROM '.prefixTable('log_items').' WHERE action = "at_shown" AND  id_user = "'.$_SESSION['user_id'].'"');
83 83
 $userSeenItemsNumber = DB::count();
84
-DB::query('SELECT id_item FROM ' . prefixTable('log_items') . ' WHERE action = "at_password_shown" AND  id_user = "' . $_SESSION['user_id'] . '"');
84
+DB::query('SELECT id_item FROM '.prefixTable('log_items').' WHERE action = "at_password_shown" AND  id_user = "'.$_SESSION['user_id'].'"');
85 85
 $userSeenPasswordsNumber = DB::count();
86 86
 $userInfo = DB::queryFirstRow(
87 87
     'SELECT avatar 
88
-    FROM ' . prefixTable('users') . ' 
89
-    WHERE id = "' . $_SESSION['user_id'] . '"'
88
+    FROM ' . prefixTable('users').' 
89
+    WHERE id = "' . $_SESSION['user_id'].'"'
90 90
 );
91 91
 if (empty($userInfo['avatar']) === true) {
92
-    $avatar = $SETTINGS['cpassman_url'] . '/includes/images/photo.jpg';
92
+    $avatar = $SETTINGS['cpassman_url'].'/includes/images/photo.jpg';
93 93
 } else {
94
-    $avatar = $SETTINGS['cpassman_url'] . '/includes/avatars/' . $userInfo['avatar'];
94
+    $avatar = $SETTINGS['cpassman_url'].'/includes/avatars/'.$userInfo['avatar'];
95 95
 }
96 96
 
97 97
 // Get Groups name
@@ -99,8 +99,8 @@  discard block
 block discarded – undo
99 99
 foreach ($_SESSION['user_roles'] as $role) {
100 100
     $tmp = DB::queryFirstRow(
101 101
         'SELECT title 
102
-        FROM ' . prefixTable('roles_title') . ' 
103
-        WHERE id = "' . $role . '"'
102
+        FROM ' . prefixTable('roles_title').' 
103
+        WHERE id = "' . $role.'"'
104 104
     );
105 105
     if ($tmp !== null) {
106 106
         array_push($userParOfGroups, $tmp['title']);
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
                         <h3 id="profile-username" class="text-center">
145 145
                             <?php
146 146
                             if (isset($_SESSION['name']) === true && empty($_SESSION['name']) === false) {
147
-                                echo $_SESSION['name'] . ' ' . $_SESSION['lastname'];
147
+                                echo $_SESSION['name'].' '.$_SESSION['lastname'];
148 148
                             } else {
149 149
                                 echo $_SESSION['login'];
150 150
                             }
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
                                             } else {
212 212
                                                 echo date('d/m/Y', (int) $_SESSION['last_connection']);
213 213
                                             }
214
-                                            echo ' ' . langHdl('at') . ' ';
214
+                                            echo ' '.langHdl('at').' ';
215 215
                                             if (isset($SETTINGS['time_format']) === true) {
216 216
                                                 echo date($SETTINGS['time_format'], (int) $_SESSION['last_connection']);
217 217
                                             } else {
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
                                         </a>
222 222
                                     </li>
223 223
                                     <?php
224
-                                    if (isset($_SESSION['last_pw_change']) && ! empty($_SESSION['last_pw_change'])) {
224
+                                    if (isset($_SESSION['last_pw_change']) && !empty($_SESSION['last_pw_change'])) {
225 225
                                         // Handle last password change string
226 226
                                         if (isset($_SESSION['last_pw_change']) === true) {
227 227
                                             if (isset($SETTINGS['date_format']) === true) {
@@ -241,12 +241,12 @@  discard block
 block discarded – undo
241 241
                                         ) {
242 242
                                             $numDaysBeforePwExpiration = '';
243 243
                                         } else {
244
-                                            $numDaysBeforePwExpiration = $LANG['index_pw_expiration'] . ' ' . $_SESSION['numDaysBeforePwExpiration'] . ' ' . $LANG['days'] . '.';
244
+                                            $numDaysBeforePwExpiration = $LANG['index_pw_expiration'].' '.$_SESSION['numDaysBeforePwExpiration'].' '.$LANG['days'].'.';
245 245
                                         }
246 246
                                         echo '
247 247
                                     <li class="list-group-item">
248
-                                        <b><i class="fas fa-calendar-alt fa-fw fa-lg mr-2"></i>' . langHdl('index_last_pw_change') . '</b>
249
-                                        <a class="float-right">' . $last_pw_change . ' ' . $numDaysBeforePwExpiration . '</a>
248
+                                        <b><i class="fas fa-calendar-alt fa-fw fa-lg mr-2"></i>' . langHdl('index_last_pw_change').'</b>
249
+                                        <a class="float-right">' . $last_pw_change.' '.$numDaysBeforePwExpiration.'</a>
250 250
                                     </li>';
251 251
                                     }
252 252
                                     ?>
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
                                     if (isset($SETTINGS['api']) === true && (int) $SETTINGS['api'] === 1) {
267 267
                                         echo '
268 268
                                     <li class="list-group-item">
269
-                                        <b><i class="fas fa-paper-plane fa-fw fa-lg mr-2"></i>' . langHdl('user_profile_api_key') . '</b>
269
+                                        <b><i class="fas fa-paper-plane fa-fw fa-lg mr-2"></i>' . langHdl('user_profile_api_key').'</b>
270 270
                                         <a class="float-right" id="profile-user-api-token">',
271 271
                                             isset($_SESSION['user']['api-key']) === true ? $_SESSION['user']['api-key'] : '',
272 272
                                             '</a>
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
                                     ) {
279 279
                                         echo '
280 280
                                     <li class="list-group-item">
281
-                                        <b><i class="fas fa-id-card-o fa-fw fa-lg mr-2"></i>' . langHdl('user_profile_agses_card_id') . '</b>
281
+                                        <b><i class="fas fa-id-card-o fa-fw fa-lg mr-2"></i>' . langHdl('user_profile_agses_card_id').'</b>
282 282
                                         <a class="float-right">',
283 283
                                             $_SESSION['user_agsescardid'] ?? '',
284 284
                                             '</a>
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
                                         <ul class="">
303 303
                                             <?php
304 304
                                                 foreach ($_SESSION['user']['unsuccessfull_login_attempts_list'] as $entry) {
305
-                                                    echo '<li class="">' . $entry . '</li>';
305
+                                                    echo '<li class="">'.$entry.'</li>';
306 306
                                                 } ?>
307 307
                                         </ul>
308 308
                                     </div>
@@ -315,12 +315,12 @@  discard block
 block discarded – undo
315 315
                                         <?php
316 316
                                         $rows = DB::query(
317 317
                                             'SELECT label AS labelAction, date, null
318
-                                                    FROM ' . prefixTable('log_system') . '
318
+                                                    FROM ' . prefixTable('log_system').'
319 319
                                                     WHERE qui = %i
320 320
                                                     UNION
321 321
                                                     SELECT l.action, l.date, i.label AS itemLabel
322
-                                                    FROM ' . prefixTable('log_items') . ' AS l
323
-                                                    INNER JOIN ' . prefixTable('items') . ' AS i ON (l.id_item = i.id)
322
+                                                    FROM ' . prefixTable('log_items').' AS l
323
+                                                    INNER JOIN ' . prefixTable('items').' AS i ON (l.id_item = i.id)
324 324
                                                     WHERE l.id_user = %i AND l.action IN ("at_access")
325 325
                                                     ORDER BY date DESC
326 326
                                                     LIMIT 0, 40',
@@ -334,9 +334,9 @@  discard block
 block discarded – undo
334 334
                                                 $text = langHdl($record['labelAction']);
335 335
                                             }
336 336
                                             if (empty($record['NULL']) === false) {
337
-                                                $text .= ' ' . langHdl('for') . ' <span class="font-weight-light">' . addslashes($record['NULL']) . '</span>';
337
+                                                $text .= ' '.langHdl('for').' <span class="font-weight-light">'.addslashes($record['NULL']).'</span>';
338 338
                                             }
339
-                                            echo '<li class="list-group-item">' . date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['date']) . ' - ' . $text . '</li>';
339
+                                            echo '<li class="list-group-item">'.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['date']).' - '.$text.'</li>';
340 340
                                         }
341 341
                                         ?>
342 342
                                     </ul>
@@ -374,11 +374,10 @@  discard block
 block discarded – undo
374 374
                                                 <?php
375 375
                                                 foreach ($zones as $key => $zone) {
376 376
                                                     echo '
377
-                                                <option value="' . $key . '"',
377
+                                                <option value="' . $key.'"',
378 378
                                                     isset($_SESSION['user_timezone']) === true && $_SESSION['user_timezone'] === $key ?
379
-                                                    ' selected' :
380
-                                                    (isset($SETTINGS['timezone']) === true && $SETTINGS['timezone'] === $key ? ' selected' : ''),
381
-                                                '>' . $zone . '</option>';
379
+                                                    ' selected' : (isset($SETTINGS['timezone']) === true && $SETTINGS['timezone'] === $key ? ' selected' : ''),
380
+                                                '>'.$zone.'</option>';
382 381
                                                 }
383 382
                                                 ?>
384 383
                                             </select>
@@ -390,11 +389,10 @@  discard block
 block discarded – undo
390 389
                                             <select class="form-control" id="profile-user-language">
391 390
                                                 <?php
392 391
                                                 foreach ($languages as $language) {
393
-                                                    echo '<option value="' . $language['label'] . '"',
392
+                                                    echo '<option value="'.$language['label'].'"',
394 393
                                                     $_SESSION['user_language'] === strtolower($language['label']) ?
395
-                                                    ' selected="selected"' :
396
-                                                    ($SETTINGS['default_language'] === strtolower($language['label']) ? ' selected="selected"' : ''),
397
-                                                '>' . $language['label'] . '</option>';
394
+                                                    ' selected="selected"' : ($SETTINGS['default_language'] === strtolower($language['label']) ? ' selected="selected"' : ''),
395
+                                                '>'.$language['label'].'</option>';
398 396
                                                 }
399 397
                                                 ?>
400 398
                                             </select>
@@ -406,10 +404,10 @@  discard block
 block discarded – undo
406 404
                                         <div class="col-sm-10">
407 405
                                             <select class="form-control" id="profile-user-treeloadstrategy">
408 406
                                                 <option value="<?php echo langHdl('sequential'); ?>"
409
-                                                    <?php echo isset($_SESSION['user_treeloadstrategy']) === true && $_SESSION['user_treeloadstrategy'] === 'sequential' ? ' selected' : '';?>
407
+                                                    <?php echo isset($_SESSION['user_treeloadstrategy']) === true && $_SESSION['user_treeloadstrategy'] === 'sequential' ? ' selected' : ''; ?>
410 408
                                                 ><?php echo langHdl('sequential'); ?></option>
411 409
                                                 <option value="<?php echo langHdl('full'); ?>"
412
-                                                    <?php echo isset($_SESSION['user_treeloadstrategy']) === true && $_SESSION['user_treeloadstrategy'] === 'full' ? ' selected' : '';?>
410
+                                                    <?php echo isset($_SESSION['user_treeloadstrategy']) === true && $_SESSION['user_treeloadstrategy'] === 'full' ? ' selected' : ''; ?>
413 411
                                                 ><?php echo langHdl('full'); ?></option>
414 412
                                             </select>
415 413
                                         </div>
@@ -443,7 +441,7 @@  discard block
 block discarded – undo
443 441
                                                 <button type="button" class="btn btn-warning float-right ml-2" id="profile-avatar-file"><?php echo langHdl('upload_new_avatar'); ?></button>
444 442
                                                 <?php
445 443
                                                 if (isset($SETTINGS['api']) === true && (int) $SETTINGS['api'] === 1) {
446
-                                                    echo '<button type="button" class="btn btn-warning float-right" id="profile-button-api_token">' . langHdl('generate_api_token') . '</button>';
444
+                                                    echo '<button type="button" class="btn btn-warning float-right" id="profile-button-api_token">'.langHdl('generate_api_token').'</button>';
447 445
                                                 }
448 446
                                                 ?>
449 447
                                                 <div id="profile-avatar-file-container" class="hidden"></div>
Please login to merge, or discard this patch.
pages/profile.js.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -43,11 +43,11 @@  discard block
 block discarded – undo
43 43
 }
44 44
 
45 45
 /* do checks */
46
-require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php';
46
+require_once $SETTINGS['cpassman_dir'].'/sources/checks.php';
47 47
 if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'profile', $SETTINGS) === false) {
48 48
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
49 49
     //not allowed page
50
-    include $SETTINGS['cpassman_dir'] . '/error.php';
50
+    include $SETTINGS['cpassman_dir'].'/error.php';
51 51
     exit;
52 52
 }
53 53
 ?>
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
                     $('#profile-username').html($('#profile-user-name').val() + ' ' + $('#profile-user-lastname').val());
213 213
 
214 214
                     // reload page in case of language change
215
-                    if ($('#profile-user-language').val().toLowerCase() !== '<?php echo $_SESSION['user_language'];?>') {
215
+                    if ($('#profile-user-language').val().toLowerCase() !== '<?php echo $_SESSION['user_language']; ?>') {
216 216
                         // prepare reload
217 217
                         $(this).delay(3000).queue(function() {
218 218
                             document.location.href = "index.php?page=profile";
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
                         // Inform user
224 224
                         toastr.remove();
225 225
                         toastr.info(
226
-                            '<?php echo langHdl('alert_page_will_reload') . ' ... ' . langHdl('please_wait'); ?>',
226
+                            '<?php echo langHdl('alert_page_will_reload').' ... '.langHdl('please_wait'); ?>',
227 227
                             '', {
228 228
                                 timeOut: 3000,
229 229
                                 progressBar: true
Please login to merge, or discard this patch.
index.php 1 patch
Spacing   +81 added lines, -81 removed lines patch added patch discarded remove patch
@@ -72,8 +72,8 @@  discard block
 block discarded – undo
72 72
 }
73 73
 
74 74
 // Include files
75
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
76
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
75
+require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
76
+require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php';
77 77
 // Quick major version check -> upgrade needed?
78 78
 if (isset($SETTINGS['cpassman_version']) === true && version_compare(TP_VERSION, $SETTINGS['cpassman_version']) > 0) {
79 79
     // Perform redirection
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
     exit;
87 87
 }
88 88
 
89
-require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
89
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
90 90
 $superGlobal = new protect\SuperGlobal\SuperGlobal();
91 91
 
92 92
 if (isset($SETTINGS['cpassman_url']) === false || $SETTINGS['cpassman_url'] === '') {
@@ -94,8 +94,8 @@  discard block
 block discarded – undo
94 94
 }
95 95
 
96 96
 // Include files
97
-require_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
98
-require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
97
+require_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
98
+require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
99 99
 // Open MYSQL database connection
100 100
 require_once './includes/libraries/Database/Meekrodb/db.class.php';
101 101
 if (defined('DB_PASSWD_CLEAR') === false) {
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 DB::$port = DB_PORT;
109 109
 DB::$encoding = DB_ENCODING;
110 110
 // Load Core library
111
-require_once $SETTINGS['cpassman_dir'] . '/sources/core.php';
111
+require_once $SETTINGS['cpassman_dir'].'/sources/core.php';
112 112
 // Prepare POST variables
113 113
 $post_language = filter_input(INPUT_POST, 'language', FILTER_SANITIZE_STRING);
114 114
 // Prepare superGlobal variables
@@ -138,8 +138,8 @@  discard block
 block discarded – undo
138 138
     //get default language
139 139
     $dataLanguage = DB::queryFirstRow(
140 140
         'SELECT m.valeur AS valeur, l.flag AS flag
141
-        FROM ' . prefixTable('misc') . ' AS m
142
-        INNER JOIN ' . prefixTable('languages') . ' AS l ON (m.valeur = l.name)
141
+        FROM ' . prefixTable('misc').' AS m
142
+        INNER JOIN ' . prefixTable('languages').' AS l ON (m.valeur = l.name)
143 143
         WHERE m.type=%s_type AND m.intitule=%s_intitule',
144 144
         [
145 145
             'type' => 'admin',
@@ -181,23 +181,23 @@  discard block
 block discarded – undo
181 181
 
182 182
 // Load user languages files
183 183
 if (in_array($session_user_language, $languagesList) === true) {
184
-    if (file_exists($SETTINGS['cpassman_dir'] . '/includes/language/' . $session_user_language . '.php') === true) {
185
-        $_SESSION['teampass']['lang'] = include $SETTINGS['cpassman_dir'] . '/includes/language/' . $session_user_language . '.php';
184
+    if (file_exists($SETTINGS['cpassman_dir'].'/includes/language/'.$session_user_language.'.php') === true) {
185
+        $_SESSION['teampass']['lang'] = include $SETTINGS['cpassman_dir'].'/includes/language/'.$session_user_language.'.php';
186 186
     }
187 187
 } else {
188 188
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
189 189
     //not allowed page
190
-    include $SETTINGS['cpassman_dir'] . '/error.php';
190
+    include $SETTINGS['cpassman_dir'].'/error.php';
191 191
 }
192 192
 
193 193
 // load 2FA Google
194 194
 if (isset($SETTINGS['google_authentication']) === true && $SETTINGS['google_authentication'] === '1') {
195
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/TwoFactorAuth/TwoFactorAuth.php';
195
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/TwoFactorAuth/TwoFactorAuth.php';
196 196
 }
197 197
 
198 198
 // load 2FA Yubico
199 199
 if (isset($SETTINGS['yubico_authentication']) === true && $SETTINGS['yubico_authentication'] === '1') {
200
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/Yubico/Yubico.php';
200
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/Yubico/Yubico.php';
201 201
 }
202 202
 
203 203
 // Some template adjust
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
     <!-- Toastr -->
255 255
     <link rel="stylesheet" href="plugins/toastr/toastr.min.css" />
256 256
     <!-- favicon -->
257
-    <link rel="shortcut icon" type="image/png" href="<?php echo $SETTINGS['favicon'];?>"/>
257
+    <link rel="shortcut icon" type="image/png" href="<?php echo $SETTINGS['favicon']; ?>"/>
258 258
 </head>
259 259
 
260 260
 
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
             ),
286 286
             'SESSION'
287 287
         );
288
-        include $SETTINGS['cpassman_dir'] . '/error.php';
288
+        include $SETTINGS['cpassman_dir'].'/error.php';
289 289
     }
290 290
 } elseif (
291 291
     $session_validite_pw !== null
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
                         <div class="dropdown show">
330 330
                             <a class="btn btn-primary dropdown-toggle" href="#" data-toggle="dropdown">
331 331
                                 <?php
332
-                                    echo $session_name . '&nbsp;' . $session_lastname; ?>
332
+                                    echo $session_name.'&nbsp;'.$session_lastname; ?>
333 333
                             </a>
334 334
 
335 335
                             <div class="dropdown-menu dropdown-menu-right">
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
             <!-- Main Sidebar Container -->
368 368
             <aside class="main-sidebar sidebar-dark-primary elevation-4">
369 369
                 <!-- Brand Logo -->
370
-                <a href="<?php echo $SETTINGS['cpassman_url'] . '/index.php?page=items'; ?>" class="brand-link">
370
+                <a href="<?php echo $SETTINGS['cpassman_url'].'/index.php?page=items'; ?>" class="brand-link">
371 371
                     <img src="includes/images/teampass-logo2-home.png" alt="Teampass Logo" class="brand-image">
372 372
                     <span class="brand-text font-weight-light"><?php echo TP_TOOL_NAME; ?></span>
373 373
                 </a>
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
                         <a href="#" data-name="items" class="nav-link', $get['page'] === 'items' ? ' active' : '', '">
386 386
                         <i class="nav-icon fas fa-key"></i>
387 387
                         <p>
388
-                            ' . langHdl('pw') . '
388
+                            ' . langHdl('pw').'
389 389
                         </p>
390 390
                         </a>
391 391
                     </li>';
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
                         <a href="#" data-name="import" class="nav-link', $get['page'] === 'import' ? ' active' : '', '">
402 402
                         <i class="nav-icon fas fa-file-import"></i>
403 403
                         <p>
404
-                            ' . langHdl('import') . '
404
+                            ' . langHdl('import').'
405 405
                         </p>
406 406
                         </a>
407 407
                     </li>';
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
                         <a href="#" data-name="export" class="nav-link', $get['page'] === 'export' ? ' active' : '', '">
423 423
                         <i class="nav-icon fas fa-file-export"></i>
424 424
                         <p>
425
-                            ' . langHdl('export') . '
425
+                            ' . langHdl('export').'
426 426
                         </p>
427 427
                         </a>
428 428
                     </li>';
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
                         <a href="#" data-name="search" class="nav-link', $get['page'] === 'search' ? ' active' : '', '">
450 450
                         <i class="nav-icon fas fa-search"></i>
451 451
                         <p>
452
-                            ' . langHdl('find') . '
452
+                            ' . langHdl('find').'
453 453
                         </p>
454 454
                         </a>
455 455
                     </li>';
@@ -466,7 +466,7 @@  discard block
 block discarded – undo
466 466
                         <a href="#" data-name="favourites" class="nav-link', $get['page'] === 'admin' ? ' favourites' : '', '">
467 467
                         <i class="nav-icon fas fa-star"></i>
468 468
                         <p>
469
-                            ' . langHdl('favorites') . '
469
+                            ' . langHdl('favorites').'
470 470
                         </p>
471 471
                         </a>
472 472
                     </li>';
@@ -496,7 +496,7 @@  discard block
 block discarded – undo
496 496
                         <a href="#" data-name="suggestion" class="nav-link', $get['page'] === 'suggestion' ? ' active' : '', '">
497 497
                         <i class="nav-icon fas fa-lightbulb"></i>
498 498
                         <p>
499
-                            ' . langHdl('suggestion_menu') . '
499
+                            ' . langHdl('suggestion_menu').'
500 500
                         </p>
501 501
                         </a>
502 502
                     </li>';
@@ -509,7 +509,7 @@  discard block
 block discarded – undo
509 509
                         <a href="#" data-name="admin" class="nav-link', $get['page'] === 'admin' ? ' active' : '', '">
510 510
                         <i class="nav-icon fas fa-info"></i>
511 511
                         <p>
512
-                            ' . langHdl('admin_main') . '
512
+                            ' . langHdl('admin_main').'
513 513
                         </p>
514 514
                         </a>
515 515
                     </li>
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
                         <a href="#" class="nav-link">
518 518
                             <i class="nav-icon fas fa-wrench"></i>
519 519
                             <p>
520
-                                ' . langHdl('admin_settings') . '
520
+                                ' . langHdl('admin_settings').'
521 521
                                 <i class="fas fa-angle-left right"></i>
522 522
                             </p>
523 523
                         </a>
@@ -525,55 +525,55 @@  discard block
 block discarded – undo
525 525
                             <li class="nav-item">
526 526
                                 <a href="#" data-name="options" class="nav-link', $get['page'] === 'options' ? ' active' : '', '">
527 527
                                     <i class="fas fa-check-double nav-icon"></i>
528
-                                    <p>' . langHdl('options') . '</p>
528
+                                    <p>' . langHdl('options').'</p>
529 529
                                 </a>
530 530
                             </li>
531 531
                             <li class="nav-item">
532 532
                                 <a href="#" data-name="2fa" class="nav-link', $get['page'] === '2fa' ? ' active' : '', '">
533 533
                                     <i class="fas fa-qrcode nav-icon"></i>
534
-                                    <p>' . langHdl('mfa_short') . '</p>
534
+                                    <p>' . langHdl('mfa_short').'</p>
535 535
                                 </a>
536 536
                             </li>
537 537
                             <li class="nav-item">
538 538
                                 <a href="#" data-name="api" class="nav-link', $get['page'] === 'api' ? ' active' : '', '">
539 539
                                     <i class="fas fa-cubes nav-icon"></i>
540
-                                    <p>' . langHdl('api') . '</p>
540
+                                    <p>' . langHdl('api').'</p>
541 541
                                 </a>
542 542
                             </li>
543 543
                             <li class="nav-item">
544 544
                                 <a href="#" data-name="backups" class="nav-link', $get['page'] === 'backups' ? ' active' : '', '">
545 545
                                     <i class="fas fa-database nav-icon"></i>
546
-                                    <p>' . langHdl('backups') . '</p>
546
+                                    <p>' . langHdl('backups').'</p>
547 547
                                 </a>
548 548
                             </li>
549 549
                             <li class="nav-item">
550 550
                                 <a href="#" data-name="emails" class="nav-link', $get['page'] === 'emails' ? ' active' : '', '">
551 551
                                     <i class="fas fa-envelope nav-icon"></i>
552
-                                    <p>' . langHdl('emails') . '</p>
552
+                                    <p>' . langHdl('emails').'</p>
553 553
                                 </a>
554 554
                             </li>
555 555
                             <li class="nav-item">
556 556
                                 <a href="#" data-name="fields" class="nav-link', $get['page'] === 'fields' ? ' active' : '', '">
557 557
                                     <i class="fas fa-keyboard nav-icon"></i>
558
-                                    <p>' . langHdl('fields') . '</p>
558
+                                    <p>' . langHdl('fields').'</p>
559 559
                                 </a>
560 560
                             </li>
561 561
                             <li class="nav-item">
562 562
                                 <a href="#" data-name="ldap" class="nav-link', $get['page'] === 'ldap' ? ' active' : '', '">
563 563
                                     <i class="fas fa-id-card nav-icon"></i>
564
-                                    <p>' . langHdl('ldap') . '</p>
564
+                                    <p>' . langHdl('ldap').'</p>
565 565
                                 </a>
566 566
                             </li>
567 567
                             <li class="nav-item">
568 568
                                 <a href="#" data-name="uploads" class="nav-link', $get['page'] === 'uploads' ? ' active' : '', '">
569 569
                                     <i class="fas fa-file-upload nav-icon"></i>
570
-                                    <p>' . langHdl('uploads') . '</p>
570
+                                    <p>' . langHdl('uploads').'</p>
571 571
                                 </a>
572 572
                             </li>
573 573
                             <li class="nav-item">
574 574
                                 <a href="#" data-name="statistics" class="nav-link', $get['page'] === 'statistics' ? ' active' : '', '">
575 575
                                     <i class="fas fa-chart-bar nav-icon"></i>
576
-                                    <p>' . langHdl('statistics') . '</p>
576
+                                    <p>' . langHdl('statistics').'</p>
577 577
                                 </a>
578 578
                             </li>
579 579
                         </ul>
@@ -582,7 +582,7 @@  discard block
 block discarded – undo
582 582
                         <a href="#" data-name="actions" class="nav-link', $get['page'] === 'actions' ? ' active' : '', '">
583 583
                         <i class="nav-icon fas fa-cogs"></i>
584 584
                         <p>
585
-                            ' . langHdl('actions') . '
585
+                            ' . langHdl('actions').'
586 586
                         </p>
587 587
                         </a>
588 588
                     </li>';
@@ -598,7 +598,7 @@  discard block
 block discarded – undo
598 598
                         <a href="#" data-name="folders" class="nav-link', $get['page'] === 'folders' ? ' active' : '', '">
599 599
                         <i class="nav-icon fas fa-folder-open"></i>
600 600
                         <p>
601
-                            ' . langHdl('folders') . '
601
+                            ' . langHdl('folders').'
602 602
                         </p>
603 603
                         </a>
604 604
                     </li>
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
                         <a href="#" data-name="roles" class="nav-link', $get['page'] === 'roles' ? ' active' : '', '">
607 607
                         <i class="nav-icon fas fa-graduation-cap"></i>
608 608
                         <p>
609
-                            ' . langHdl('roles') . '
609
+                            ' . langHdl('roles').'
610 610
                         </p>
611 611
                         </a>
612 612
                     </li>
@@ -614,38 +614,38 @@  discard block
 block discarded – undo
614 614
                         <a href="#" data-name="users" class="nav-link', $get['page'] === 'users' ? ' active' : '', '">
615 615
                         <i class="nav-icon fas fa-users"></i>
616 616
                         <p>
617
-                            ' . langHdl('users') . '
617
+                            ' . langHdl('users').'
618 618
                         </p>
619 619
                         </a>
620 620
                     </li>
621 621
                     <li class="nav-item has-treeview', $menuUtilities === true ? ' menu-open' : '', '">
622 622
                         <a href="#" class="nav-link">
623 623
                         <i class="nav-icon fas fa-cubes"></i>
624
-                        <p>' . langHdl('admin_views') . '<i class="fas fa-angle-left right"></i></p>
624
+                        <p>' . langHdl('admin_views').'<i class="fas fa-angle-left right"></i></p>
625 625
                         </a>
626 626
                         <ul class="nav nav-treeview">
627 627
                           <li class="nav-item">
628 628
                             <a href="#" data-name="utilities.renewal" class="nav-link', $get['page'] === 'utilities.renewal' ? ' active' : '', '">
629 629
                               <i class="far fa-calendar-alt nav-icon"></i>
630
-                              <p>' . langHdl('renewal') . '</p>
630
+                              <p>' . langHdl('renewal').'</p>
631 631
                             </a>
632 632
                           </li>
633 633
                           <li class="nav-item">
634 634
                             <a href="#" data-name="utilities.deletion" class="nav-link', $get['page'] === 'utilities.deletion' ? ' active' : '', '">
635 635
                               <i class="fas fa-trash-alt nav-icon"></i>
636
-                              <p>' . langHdl('deletion') . '</p>
636
+                              <p>' . langHdl('deletion').'</p>
637 637
                             </a>
638 638
                           </li>
639 639
                           <li class="nav-item">
640 640
                             <a href="#" data-name="utilities.logs" class="nav-link', $get['page'] === 'utilities.logs' ? ' active' : '', '">
641 641
                               <i class="fas fa-history nav-icon"></i>
642
-                              <p>' . langHdl('logs') . '</p>
642
+                              <p>' . langHdl('logs').'</p>
643 643
                             </a>
644 644
                           </li>
645 645
                           <li class="nav-item">
646 646
                             <a href="#" data-name="utilities.database" class="nav-link', $get['page'] === 'utilities.database' ? ' active' : '', '">
647 647
                               <i class="fas fa-database nav-icon"></i>
648
-                              <p>' . langHdl('database') . '</p>
648
+                              <p>' . langHdl('database').'</p>
649 649
                             </a>
650 650
                           </li>
651 651
                         </ul>
@@ -656,10 +656,10 @@  discard block
 block discarded – undo
656 656
                     <!-- /.sidebar-menu -->
657 657
                 <div class="menu-footer">
658 658
                     <div class="" id="sidebar-footer">
659
-                        <i class="fas fa-clock-o mr-2 infotip text-info pointer" title="<?php echo langHdl('server_time') . ' ' .
660
-                            date($SETTINGS['date_format'], (int) $server['request_time']) . ' - ' .
659
+                        <i class="fas fa-clock-o mr-2 infotip text-info pointer" title="<?php echo langHdl('server_time').' '.
660
+                            date($SETTINGS['date_format'], (int) $server['request_time']).' - '.
661 661
                             date($SETTINGS['time_format'], (int) $server['request_time']); ?>"></i>
662
-                        <i class="fas fa-users mr-2 infotip text-info pointer" title="<?php echo $session_nb_users_online . ' ' . langHdl('users_online'); ?>"></i>
662
+                        <i class="fas fa-users mr-2 infotip text-info pointer" title="<?php echo $session_nb_users_online.' '.langHdl('users_online'); ?>"></i>
663 663
                         <a href="<?php echo READTHEDOC_URL; ?>" target="_blank" class="text-info"><i class="fas fa-book mr-2 infotip" title="<?php echo langHdl('documentation_canal'); ?> ReadTheDocs"></i></a>
664 664
                         <a href="<?php echo REDDIT_URL; ?>" target="_blank" class="text-info"><i class="fab fa-reddit-alien mr-2 infotip" title="<?php echo langHdl('admin_help'); ?>"></i></a>
665 665
                         <i class="fas fa-bug infotip pointer text-info" title="<?php echo langHdl('bugs_page'); ?>" onclick="generateBugReport()"></i>
@@ -962,18 +962,18 @@  discard block
 block discarded – undo
962 962
                     } elseif ($get['page'] === 'items') {
963 963
                         // SHow page with Items
964 964
                         if ((int) $session_user_admin !== 1) {
965
-                            include $SETTINGS['cpassman_dir'] . '/pages/items.php';
965
+                            include $SETTINGS['cpassman_dir'].'/pages/items.php';
966 966
                         } elseif ((int) $session_user_admin === 1) {
967
-                            include $SETTINGS['cpassman_dir'] . '/pages/admin.php';
967
+                            include $SETTINGS['cpassman_dir'].'/pages/admin.php';
968 968
                         } else {
969 969
                             $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
970 970
                             //not allowed page
971
-                            include $SETTINGS['cpassman_dir'] . '/error.php';
971
+                            include $SETTINGS['cpassman_dir'].'/error.php';
972 972
                         }
973 973
                     } elseif (in_array($get['page'], array_keys($mngPages)) === true) {
974 974
                         // Define if user is allowed to see management pages
975 975
                         if ($session_user_admin === 1) {
976
-                            include $SETTINGS['cpassman_dir'] . '/pages/' . $mngPages[$get['page']];
976
+                            include $SETTINGS['cpassman_dir'].'/pages/'.$mngPages[$get['page']];
977 977
                         } elseif ($session_user_manager === 1 || $session_user_human_resources === 1) {
978 978
                             if ($get['page'] !== 'manage_main'
979 979
                                 && $get['page'] !== 'manage_settings'
@@ -982,15 +982,15 @@  discard block
 block discarded – undo
982 982
                             } else {
983 983
                                 $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
984 984
                                 //not allowed page
985
-                                include $SETTINGS['cpassman_dir'] . '/error.php';
985
+                                include $SETTINGS['cpassman_dir'].'/error.php';
986 986
                             }
987 987
                         } else {
988 988
                             $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
989 989
                             //not allowed page
990
-                            include $SETTINGS['cpassman_dir'] . '/error.php';
990
+                            include $SETTINGS['cpassman_dir'].'/error.php';
991 991
                         }
992 992
                     } elseif (empty($get['page']) === false) {
993
-                        include $SETTINGS['cpassman_dir'] . '/pages/' . $get['page'] . '.php';
993
+                        include $SETTINGS['cpassman_dir'].'/pages/'.$get['page'].'.php';
994 994
                     } else {
995 995
                         $_SESSION['error']['code'] = ERR_NOT_EXIST;
996 996
                         //page doesn't exist
@@ -1080,7 +1080,7 @@  discard block
 block discarded – undo
1080 1080
     $superGlobal->put('initialUrl', '', 'SESSION');
1081 1081
 
1082 1082
     // LOGIN form
1083
-    include $SETTINGS['cpassman_dir'] . '/includes/core/login.php';
1083
+    include $SETTINGS['cpassman_dir'].'/includes/core/login.php';
1084 1084
 }
1085 1085
 
1086 1086
     ?>
@@ -1270,61 +1270,61 @@  discard block
 block discarded – undo
1270 1270
     isset($_SESSION['CPM']) === true
1271 1271
     && isset($SETTINGS['cpassman_dir']) === true
1272 1272
 ) {
1273
-    include_once $SETTINGS['cpassman_dir'] . '/includes/core/load.js.php';
1273
+    include_once $SETTINGS['cpassman_dir'].'/includes/core/load.js.php';
1274 1274
     if ($menuAdmin === true) {
1275
-        include_once $SETTINGS['cpassman_dir'] . '/pages/admin.js.php';
1275
+        include_once $SETTINGS['cpassman_dir'].'/pages/admin.js.php';
1276 1276
         if ($get['page'] === '2fa') {
1277
-            include_once $SETTINGS['cpassman_dir'] . '/pages/2fa.js.php';
1277
+            include_once $SETTINGS['cpassman_dir'].'/pages/2fa.js.php';
1278 1278
         } elseif ($get['page'] === 'api') {
1279
-            include_once $SETTINGS['cpassman_dir'] . '/pages/api.js.php';
1279
+            include_once $SETTINGS['cpassman_dir'].'/pages/api.js.php';
1280 1280
         } elseif ($get['page'] === 'backups') {
1281
-            include_once $SETTINGS['cpassman_dir'] . '/pages/backups.js.php';
1281
+            include_once $SETTINGS['cpassman_dir'].'/pages/backups.js.php';
1282 1282
         } elseif ($get['page'] === 'emails') {
1283
-            include_once $SETTINGS['cpassman_dir'] . '/pages/emails.js.php';
1283
+            include_once $SETTINGS['cpassman_dir'].'/pages/emails.js.php';
1284 1284
         } elseif ($get['page'] === 'ldap') {
1285
-            include_once $SETTINGS['cpassman_dir'] . '/pages/ldap.js.php';
1285
+            include_once $SETTINGS['cpassman_dir'].'/pages/ldap.js.php';
1286 1286
         } elseif ($get['page'] === 'uploads') {
1287
-            include_once $SETTINGS['cpassman_dir'] . '/pages/uploads.js.php';
1287
+            include_once $SETTINGS['cpassman_dir'].'/pages/uploads.js.php';
1288 1288
         } elseif ($get['page'] === 'actions') {
1289
-            include_once $SETTINGS['cpassman_dir'] . '/pages/actions.js.php';
1289
+            include_once $SETTINGS['cpassman_dir'].'/pages/actions.js.php';
1290 1290
         } elseif ($get['page'] === 'fields') {
1291
-            include_once $SETTINGS['cpassman_dir'] . '/pages/fields.js.php';
1291
+            include_once $SETTINGS['cpassman_dir'].'/pages/fields.js.php';
1292 1292
         } elseif ($get['page'] === 'options') {
1293
-            include_once $SETTINGS['cpassman_dir'] . '/pages/options.js.php';
1293
+            include_once $SETTINGS['cpassman_dir'].'/pages/options.js.php';
1294 1294
         } elseif ($get['page'] === 'statistics') {
1295
-            include_once $SETTINGS['cpassman_dir'] . '/pages/statistics.js.php';
1295
+            include_once $SETTINGS['cpassman_dir'].'/pages/statistics.js.php';
1296 1296
         }
1297 1297
     } elseif (isset($get['page']) === true && $get['page'] !== '') {
1298 1298
         if ($get['page'] === 'items') {
1299
-            include_once $SETTINGS['cpassman_dir'] . '/pages/items.js.php';
1299
+            include_once $SETTINGS['cpassman_dir'].'/pages/items.js.php';
1300 1300
         } elseif ($get['page'] === 'import') {
1301
-            include_once $SETTINGS['cpassman_dir'] . '/pages/import.js.php';
1301
+            include_once $SETTINGS['cpassman_dir'].'/pages/import.js.php';
1302 1302
         } elseif ($get['page'] === 'export') {
1303
-            include_once $SETTINGS['cpassman_dir'] . '/pages/export.js.php';
1303
+            include_once $SETTINGS['cpassman_dir'].'/pages/export.js.php';
1304 1304
         } elseif ($get['page'] === 'offline') {
1305
-            include_once $SETTINGS['cpassman_dir'] . '/pages/offline.js.php';
1305
+            include_once $SETTINGS['cpassman_dir'].'/pages/offline.js.php';
1306 1306
         } elseif ($get['page'] === 'search') {
1307
-            include_once $SETTINGS['cpassman_dir'] . '/pages/search.js.php';
1307
+            include_once $SETTINGS['cpassman_dir'].'/pages/search.js.php';
1308 1308
         } elseif ($get['page'] === 'profile') {
1309
-            include_once $SETTINGS['cpassman_dir'] . '/pages/profile.js.php';
1309
+            include_once $SETTINGS['cpassman_dir'].'/pages/profile.js.php';
1310 1310
         } elseif ($get['page'] === 'favourites') {
1311
-            include_once $SETTINGS['cpassman_dir'] . '/pages/favorites.js.php';
1311
+            include_once $SETTINGS['cpassman_dir'].'/pages/favorites.js.php';
1312 1312
         } elseif ($get['page'] === 'folders') {
1313
-            include_once $SETTINGS['cpassman_dir'] . '/pages/folders.js.php';
1313
+            include_once $SETTINGS['cpassman_dir'].'/pages/folders.js.php';
1314 1314
         } elseif ($get['page'] === 'users') {
1315
-            include_once $SETTINGS['cpassman_dir'] . '/pages/users.js.php';
1315
+            include_once $SETTINGS['cpassman_dir'].'/pages/users.js.php';
1316 1316
         } elseif ($get['page'] === 'roles') {
1317
-            include_once $SETTINGS['cpassman_dir'] . '/pages/roles.js.php';
1317
+            include_once $SETTINGS['cpassman_dir'].'/pages/roles.js.php';
1318 1318
         } elseif ($get['page'] === 'utilities.deletion') {
1319
-            include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.deletion.js.php';
1319
+            include_once $SETTINGS['cpassman_dir'].'/pages/utilities.deletion.js.php';
1320 1320
         } elseif ($get['page'] === 'utilities.logs') {
1321
-            include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.logs.js.php';
1321
+            include_once $SETTINGS['cpassman_dir'].'/pages/utilities.logs.js.php';
1322 1322
         } elseif ($get['page'] === 'utilities.database') {
1323
-            include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.database.js.php';
1323
+            include_once $SETTINGS['cpassman_dir'].'/pages/utilities.database.js.php';
1324 1324
         } elseif ($get['page'] === 'utilities.renewal') {
1325
-            include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.renewal.js.php';
1325
+            include_once $SETTINGS['cpassman_dir'].'/pages/utilities.renewal.js.php';
1326 1326
         }
1327 1327
     } else {
1328
-        include_once $SETTINGS['cpassman_dir'] . '/includes/core/login.js.php';
1328
+        include_once $SETTINGS['cpassman_dir'].'/includes/core/login.js.php';
1329 1329
     }
1330 1330
 }
Please login to merge, or discard this patch.
sources/ldap.queries.php 1 patch
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -45,26 +45,26 @@  discard block
 block discarded – undo
45 45
 }
46 46
 
47 47
 /* do checks */
48
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
49
-require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php';
48
+require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php';
49
+require_once $SETTINGS['cpassman_dir'].'/sources/checks.php';
50 50
 if (!checkUser($_SESSION['user_id'], $_SESSION['key'], 'ldap', $SETTINGS)) {
51 51
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED; //not allowed page
52
-    include $SETTINGS['cpassman_dir'] . '/error.php';
52
+    include $SETTINGS['cpassman_dir'].'/error.php';
53 53
     exit();
54 54
 }
55 55
 
56
-require_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php';
57
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
58
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/tp.config.php';
56
+require_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php';
57
+require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
58
+require_once $SETTINGS['cpassman_dir'].'/includes/config/tp.config.php';
59 59
 
60 60
 header('Content-type: text/html; charset=utf-8');
61 61
 header('Cache-Control: no-cache, no-store, must-revalidate');
62 62
 
63
-require_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
64
-require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
63
+require_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
64
+require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
65 65
 
66 66
 // connect to the server
67
-require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
67
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
68 68
 if (defined('DB_PASSWD_CLEAR') === false) {
69 69
     define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
70 70
 }
@@ -124,39 +124,39 @@  discard block
 block discarded – undo
124 124
         ];
125 125
 
126 126
         // Load expected libraries
127
-        require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/helpers.php';
128
-        require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Traits/Macroable.php';
129
-        require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Arr.php';
130
-        require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Symfony/contracts/Translation/TranslatorInterface.php';
131
-        require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/CarbonTimeZone.php';
132
-        require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Units.php';
133
-        require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Week.php';
134
-        require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Timestamp.php';
135
-        require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Test.php';
136
-        require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/ObjectInitialisation.php';
137
-        require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Serialization.php';
138
-        require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/IntervalRounding.php';
139
-        require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Rounding.php';
140
-        require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Localization.php';
141
-        require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Options.php';
142
-        require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Cast.php';
143
-        require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Mutability.php';
144
-        require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Modifiers.php';
145
-        require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Mixin.php';
146
-        require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Macro.php';
147
-        require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Difference.php';
148
-        require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Creator.php';
149
-        require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Converter.php';
150
-        require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Comparison.php';
151
-        require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Boundaries.php';
152
-        require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Date.php';
153
-        require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/CarbonInterface.php';
154
-        require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Carbon.php';
155
-        require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/DetectsErrors.php';
156
-        require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/Connection.php';
157
-        require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/LdapInterface.php';
158
-        require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/HandlesConnection.php';
159
-        require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/LdapBase.php';
127
+        require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/helpers.php';
128
+        require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Traits/Macroable.php';
129
+        require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Arr.php';
130
+        require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Symfony/contracts/Translation/TranslatorInterface.php';
131
+        require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/CarbonTimeZone.php';
132
+        require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Units.php';
133
+        require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Week.php';
134
+        require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Timestamp.php';
135
+        require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Test.php';
136
+        require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/ObjectInitialisation.php';
137
+        require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Serialization.php';
138
+        require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/IntervalRounding.php';
139
+        require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Rounding.php';
140
+        require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Localization.php';
141
+        require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Options.php';
142
+        require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Cast.php';
143
+        require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Mutability.php';
144
+        require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Modifiers.php';
145
+        require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Mixin.php';
146
+        require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Macro.php';
147
+        require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Difference.php';
148
+        require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Creator.php';
149
+        require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Converter.php';
150
+        require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Comparison.php';
151
+        require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Boundaries.php';
152
+        require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Date.php';
153
+        require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/CarbonInterface.php';
154
+        require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Carbon.php';
155
+        require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/DetectsErrors.php';
156
+        require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/Connection.php';
157
+        require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/LdapInterface.php';
158
+        require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/HandlesConnection.php';
159
+        require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/LdapBase.php';
160 160
 
161 161
         $ad = new SplClassLoader('LdapRecord', '../includes/libraries');
162 162
         $ad->register();
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
             echo prepareExchangedData(
172 172
                 array(
173 173
                     'error' => true,
174
-                    'message' => "Error : ".$error->getErrorCode()." - ".$error->getErrorMessage(). "<br>".$error->getDiagnosticMessage(),
174
+                    'message' => "Error : ".$error->getErrorCode()." - ".$error->getErrorMessage()."<br>".$error->getDiagnosticMessage(),
175 175
                 ),
176 176
                 'encode'
177 177
             );
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
             echo prepareExchangedData(
190 190
                 array(
191 191
                     'error' => true,
192
-                    'message' => "Error : ".$e->withDetailedError($e),//->detailedError(),
192
+                    'message' => "Error : ".$e->withDetailedError($e), //->detailedError(),
193 193
                 ),
194 194
                 'encode'
195 195
             );
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
             echo prepareExchangedData(
209 209
                 array(
210 210
                     'error' => true,
211
-                    'message' => "Error : ".$error->getErrorCode()." - ".$error->getErrorMessage(). "<br>".$error->getDiagnosticMessage(),
211
+                    'message' => "Error : ".$error->getErrorCode()." - ".$error->getErrorMessage()."<br>".$error->getDiagnosticMessage(),
212 212
                 ),
213 213
                 'encode'
214 214
             );
Please login to merge, or discard this patch.
sources/users.queries.php 2 patches
Spacing   +145 added lines, -145 removed lines patch added patch discarded remove patch
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
 }
48 48
 
49 49
 /* do checks */
50
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
51
-require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php';
50
+require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php';
51
+require_once $SETTINGS['cpassman_dir'].'/sources/checks.php';
52 52
 $isprofileupdate = filter_input(INPUT_POST, 'isprofileupdate', FILTER_SANITIZE_STRING);
53 53
 if (
54 54
     checkUser($_SESSION['user_id'], $_SESSION['key'], 'profile', $SETTINGS) === false
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         || $isprofileupdate === false
60 60
     ) {
61 61
         $_SESSION['error']['code'] = ERR_NOT_ALLOWED; //not allowed page
62
-        include $SETTINGS['cpassman_dir'] . '/error.php';
62
+        include $SETTINGS['cpassman_dir'].'/error.php';
63 63
         exit();
64 64
     } else {
65 65
         // Do special check to allow user to change attributes of his profile
@@ -68,20 +68,20 @@  discard block
 block discarded – undo
68 68
             || checkUser($_SESSION['user_id'], $_SESSION['key'], 'profile', $SETTINGS) === false
69 69
         ) {
70 70
             $_SESSION['error']['code'] = ERR_NOT_ALLOWED; //not allowed page
71
-            include $SETTINGS['cpassman_dir'] . '/error.php';
71
+            include $SETTINGS['cpassman_dir'].'/error.php';
72 72
             exit();
73 73
         }
74 74
     }
75 75
 }
76 76
 
77
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
77
+require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
78 78
 header('Content-type: text/html; charset=utf-8');
79
-require_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php';
80
-require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
81
-require_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
79
+require_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php';
80
+require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
81
+require_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
82 82
 
83 83
 // Connect to mysql server
84
-require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
84
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
85 85
 if (defined('DB_PASSWD_CLEAR') === false) {
86 86
     define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
87 87
 }
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
             // Prepare variables
131 131
             $login = filter_var($dataReceived['login'], FILTER_SANITIZE_STRING);
132 132
             $email = filter_var($dataReceived['email'], FILTER_SANITIZE_EMAIL);
133
-            $password = '';//filter_var($dataReceived['pw'], FILTER_SANITIZE_STRING);
133
+            $password = ''; //filter_var($dataReceived['pw'], FILTER_SANITIZE_STRING);
134 134
             $lastname = filter_var($dataReceived['lastname'], FILTER_SANITIZE_STRING);
135 135
             $name = filter_var($dataReceived['name'], FILTER_SANITIZE_STRING);
136 136
             $is_admin = filter_var($dataReceived['admin'], FILTER_SANITIZE_NUMBER_INT);
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
             // Check if user already exists
160 160
             $data = DB::query(
161 161
                 'SELECT id, fonction_id, groupes_interdits, groupes_visibles
162
-                FROM ' . prefixTable('users') . '
162
+                FROM ' . prefixTable('users').'
163 163
                 WHERE login = %s',
164 164
                 $login
165 165
             );
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
 
376 376
             // Get info about user to delete
377 377
             $data_user = DB::queryfirstrow(
378
-                'SELECT admin, isAdministratedByRole FROM ' . prefixTable('users') . '
378
+                'SELECT admin, isAdministratedByRole FROM '.prefixTable('users').'
379 379
                 WHERE id = %i',
380 380
                 $post_id
381 381
             );
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
                 );
395 395
                 // delete personal folder and subfolders
396 396
                 $data = DB::queryfirstrow(
397
-                    'SELECT id FROM ' . prefixTable('nested_tree') . '
397
+                    'SELECT id FROM '.prefixTable('nested_tree').'
398 398
                     WHERE title = %s AND personal_folder = %i',
399 399
                     $post_id,
400 400
                     '1'
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
                         DB::delete(prefixTable('nested_tree'), 'id = %i AND personal_folder = %i', $folder->id, '1');
408 408
                         // delete items & logs
409 409
                         $items = DB::query(
410
-                            'SELECT id FROM ' . prefixTable('items') . '
410
+                            'SELECT id FROM '.prefixTable('items').'
411 411
                             WHERE id_tree=%i AND perso = %i',
412 412
                             $folder->id,
413 413
                             '1'
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
 
465 465
             // Get info about user to delete
466 466
             $data_user = DB::queryfirstrow(
467
-                'SELECT admin, isAdministratedByRole FROM ' . prefixTable('users') . '
467
+                'SELECT admin, isAdministratedByRole FROM '.prefixTable('users').'
468 468
                 WHERE id = %i',
469 469
                 $post_id
470 470
             );
@@ -506,7 +506,7 @@  discard block
 block discarded – undo
506 506
 
507 507
             // Get info about user to delete
508 508
             $data_user = DB::queryfirstrow(
509
-                'SELECT admin, isAdministratedByRole FROM ' . prefixTable('users') . '
509
+                'SELECT admin, isAdministratedByRole FROM '.prefixTable('users').'
510 510
                 WHERE id = %i',
511 511
                 $post_id
512 512
             );
@@ -549,7 +549,7 @@  discard block
 block discarded – undo
549 549
             // Get info about user to delete
550 550
             $data_user = DB::queryfirstrow(
551 551
                 'SELECT admin, isAdministratedByRole, can_manage_all_users, gestionnaire
552
-                FROM ' . prefixTable('users') . '
552
+                FROM ' . prefixTable('users').'
553 553
                 WHERE id = %i',
554 554
                 $post_id
555 555
             );
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
 
594 594
             // Get info about user to delete
595 595
             $data_user = DB::queryfirstrow(
596
-                'SELECT admin, isAdministratedByRole FROM ' . prefixTable('users') . '
596
+                'SELECT admin, isAdministratedByRole FROM '.prefixTable('users').'
597 597
                 WHERE id = %i',
598 598
                 $post_id
599 599
             );
@@ -636,7 +636,7 @@  discard block
 block discarded – undo
636 636
             // Get info about user to delete
637 637
             $data_user = DB::queryfirstrow(
638 638
                 'SELECT admin, isAdministratedByRole, gestionnaire
639
-                FROM ' . prefixTable('users') . '
639
+                FROM ' . prefixTable('users').'
640 640
                 WHERE id = %i',
641 641
                 $post_id
642 642
             );
@@ -679,7 +679,7 @@  discard block
 block discarded – undo
679 679
             // Get info about user to delete
680 680
             $data_user = DB::queryfirstrow(
681 681
                 'SELECT admin, isAdministratedByRole, gestionnaire
682
-                FROM ' . prefixTable('users') . '
682
+                FROM ' . prefixTable('users').'
683 683
                 WHERE id = %i',
684 684
                 $post_id
685 685
             );
@@ -719,7 +719,7 @@  discard block
 block discarded – undo
719 719
             // Get info about user to delete
720 720
             $data_user = DB::queryfirstrow(
721 721
                 'SELECT admin, isAdministratedByRole, gestionnaire
722
-                FROM ' . prefixTable('users') . '
722
+                FROM ' . prefixTable('users').'
723 723
                 WHERE id = %i',
724 724
                 $post_id
725 725
             );
@@ -758,7 +758,7 @@  discard block
 block discarded – undo
758 758
             $return = array();
759 759
             // Check if folder exists
760 760
             $data = DB::query(
761
-                'SELECT * FROM ' . prefixTable('nested_tree') . '
761
+                'SELECT * FROM '.prefixTable('nested_tree').'
762 762
                 WHERE title = %s AND parent_id = %i',
763 763
                 filter_input(INPUT_POST, 'domain', FILTER_SANITIZE_STRING),
764 764
                 '0'
@@ -771,7 +771,7 @@  discard block
 block discarded – undo
771 771
             }
772 772
             // Check if role exists
773 773
             $data = DB::query(
774
-                'SELECT * FROM ' . prefixTable('roles_title') . '
774
+                'SELECT * FROM '.prefixTable('roles_title').'
775 775
                 WHERE title = %s',
776 776
                 filter_input(INPUT_POST, 'domain', FILTER_SANITIZE_STRING)
777 777
             );
@@ -791,7 +791,7 @@  discard block
 block discarded – undo
791 791
         case 'user_log_items':
792 792
             $nb_pages = 1;
793 793
             $logs = $sql_filter = '';
794
-            $pages = '<table style=\'border-top:1px solid #969696;\'><tr><td>' . langHdl('pages') . '&nbsp;:&nbsp;</td>';
794
+            $pages = '<table style=\'border-top:1px solid #969696;\'><tr><td>'.langHdl('pages').'&nbsp;:&nbsp;</td>';
795 795
 
796 796
             // Prepare POST variables
797 797
             $post_nb_items_by_page = filter_input(INPUT_POST, 'nb_items_by_page', FILTER_SANITIZE_NUMBER_INT);
@@ -803,14 +803,14 @@  discard block
 block discarded – undo
803 803
                     && !empty(filter_input(INPUT_POST, 'filter', FILTER_SANITIZE_STRING))
804 804
                     && filter_input(INPUT_POST, 'filter', FILTER_SANITIZE_STRING) !== 'all'
805 805
                 ) {
806
-                    $sql_filter = " AND l.action = '" . filter_input(INPUT_POST, 'filter', FILTER_SANITIZE_STRING) . "'";
806
+                    $sql_filter = " AND l.action = '".filter_input(INPUT_POST, 'filter', FILTER_SANITIZE_STRING)."'";
807 807
                 }
808 808
                 // get number of pages
809 809
                 DB::query(
810 810
                     'SELECT *
811
-                    FROM ' . prefixTable('log_items') . ' as l
812
-                    INNER JOIN ' . prefixTable('items') . ' as i ON (l.id_item=i.id)
813
-                    INNER JOIN ' . prefixTable('users') . ' as u ON (l.id_user=u.id)
811
+                    FROM ' . prefixTable('log_items').' as l
812
+                    INNER JOIN ' . prefixTable('items').' as i ON (l.id_item=i.id)
813
+                    INNER JOIN ' . prefixTable('users').' as u ON (l.id_user=u.id)
814 814
                     WHERE l.id_user = %i ' . $sql_filter,
815 815
                     filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT)
816 816
                 );
@@ -828,19 +828,19 @@  discard block
 block discarded – undo
828 828
                 // launch query
829 829
                 $rows = DB::query(
830 830
                     'SELECT l.date as date, u.login as login, i.label as label, l.action as action
831
-                    FROM ' . prefixTable('log_items') . ' as l
832
-                    INNER JOIN ' . prefixTable('items') . ' as i ON (l.id_item=i.id)
833
-                    INNER JOIN ' . prefixTable('users') . ' as u ON (l.id_user=u.id)
834
-                    WHERE l.id_user = %i ' . $sql_filter . '
831
+                    FROM ' . prefixTable('log_items').' as l
832
+                    INNER JOIN ' . prefixTable('items').' as i ON (l.id_item=i.id)
833
+                    INNER JOIN ' . prefixTable('users').' as u ON (l.id_user=u.id)
834
+                    WHERE l.id_user = %i ' . $sql_filter.'
835 835
                     ORDER BY date DESC
836
-                    LIMIT ' . intval($start) . ',' . intval($post_nb_items_by_page),
836
+                    LIMIT ' . intval($start).','.intval($post_nb_items_by_page),
837 837
                     filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT)
838 838
                 );
839 839
             } else {
840 840
                 // get number of pages
841 841
                 DB::query(
842 842
                     'SELECT *
843
-                    FROM ' . prefixTable('log_system') . '
843
+                    FROM ' . prefixTable('log_system').'
844 844
                     WHERE type = %s AND field_1=%i',
845 845
                     'user_mngt',
846 846
                     filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT)
@@ -859,7 +859,7 @@  discard block
 block discarded – undo
859 859
                 // launch query
860 860
                 $rows = DB::query(
861 861
                     'SELECT *
862
-                    FROM ' . prefixTable('log_system') . '
862
+                    FROM ' . prefixTable('log_system').'
863 863
                     WHERE type = %s AND field_1 = %i
864 864
                     ORDER BY date DESC
865 865
                     LIMIT %i, %i',
@@ -873,7 +873,7 @@  discard block
 block discarded – undo
873 873
             if (isset($counter) && $counter != 0) {
874 874
                 $nb_pages = ceil($counter / intval($post_nb_items_by_page));
875 875
                 for ($i = 1; $i <= $nb_pages; ++$i) {
876
-                    $pages .= '<td onclick=\'displayLogs(' . $i . ',\"' . $post_scope . '\")\'><span style=\'cursor:pointer;' . (filter_input(INPUT_POST, 'page', FILTER_SANITIZE_NUMBER_INT) === $i ? 'font-weight:bold;font-size:18px;\'>' . $i : '\'>' . $i) . '</span></td>';
876
+                    $pages .= '<td onclick=\'displayLogs('.$i.',\"'.$post_scope.'\")\'><span style=\'cursor:pointer;'.(filter_input(INPUT_POST, 'page', FILTER_SANITIZE_NUMBER_INT) === $i ? 'font-weight:bold;font-size:18px;\'>'.$i : '\'>'.$i).'</span></td>';
877 877
                 }
878 878
             }
879 879
             $pages .= '</tr></table>';
@@ -882,7 +882,7 @@  discard block
 block discarded – undo
882 882
                     if ($post_scope === 'user_mngt') {
883 883
                         $user = DB::queryfirstrow(
884 884
                             'SELECT login
885
-                            from ' . prefixTable('users') . '
885
+                            from ' . prefixTable('users').'
886 886
                             WHERE id=%i',
887 887
                             $record['qui']
888 888
                         );
@@ -892,7 +892,7 @@  discard block
 block discarded – undo
892 892
                         if ($tmp[0] == 'at_user_initial_pwd_changed') {
893 893
                             $label = langHdl('log_user_initial_pwd_changed');
894 894
                         } elseif ($tmp[0] == 'at_user_email_changed') {
895
-                            $label = langHdl('log_user_email_changed') . $tmp[1];
895
+                            $label = langHdl('log_user_email_changed').$tmp[1];
896 896
                         } elseif ($tmp[0] == 'at_user_added') {
897 897
                             $label = langHdl('log_user_created');
898 898
                         } elseif ($tmp[0] == 'at_user_locked') {
@@ -903,14 +903,14 @@  discard block
 block discarded – undo
903 903
                             $label = langHdl('log_user_pwd_changed');
904 904
                         }
905 905
                         // prepare log
906
-                        $logs .= '<tr><td>' . date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['date']) . '</td><td align=\"center\">' . $label . '</td><td align=\"center\">' . $user['login'] . '</td><td align=\"center\"></td></tr>';
906
+                        $logs .= '<tr><td>'.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['date']).'</td><td align=\"center\">'.$label.'</td><td align=\"center\">'.$user['login'].'</td><td align=\"center\"></td></tr>';
907 907
                     } else {
908
-                        $logs .= '<tr><td>' . date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['date']) . '</td><td align=\"center\">' . str_replace('"', '\"', $record['label']) . '</td><td align=\"center\">' . $record['login'] . '</td><td align=\"center\">' . langHdl($record['action']) . '</td></tr>';
908
+                        $logs .= '<tr><td>'.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['date']).'</td><td align=\"center\">'.str_replace('"', '\"', $record['label']).'</td><td align=\"center\">'.$record['login'].'</td><td align=\"center\">'.langHdl($record['action']).'</td></tr>';
909 909
                     }
910 910
                 }
911 911
             }
912 912
 
913
-            echo '[ { "table_logs": "' . ($logs) . '", "pages": "' . ($pages) . '", "error" : "no" } ]';
913
+            echo '[ { "table_logs": "'.($logs).'", "pages": "'.($pages).'", "error" : "no" } ]';
914 914
             break;
915 915
 
916 916
             /*
@@ -935,7 +935,7 @@  discard block
 block discarded – undo
935 935
             } else {
936 936
                 // Get folder id for Admin
937 937
                 $admin_folder = DB::queryFirstRow(
938
-                    'SELECT id FROM ' . prefixTable('nested_tree') . '
938
+                    'SELECT id FROM '.prefixTable('nested_tree').'
939 939
                     WHERE title = %i AND personal_folder = %i',
940 940
                     intval($_SESSION['user_id']),
941 941
                     '1'
@@ -946,15 +946,15 @@  discard block
 block discarded – undo
946 946
                     // Get each Items in PF
947 947
                     $rows = DB::query(
948 948
                         'SELECT i.pw, i.label, l.id_user
949
-                        FROM ' . prefixTable('items') . ' as i
950
-                        LEFT JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item=i.id)
949
+                        FROM ' . prefixTable('items').' as i
950
+                        LEFT JOIN ' . prefixTable('log_items').' as l ON (l.id_item=i.id)
951 951
                         WHERE l.action = %s AND i.perso=%i AND i.id_tree=%i',
952 952
                         'at_creation',
953 953
                         '1',
954 954
                         intval($folder->id)
955 955
                     );
956 956
                     foreach ($rows as $record) {
957
-                        echo $record['label'] . ' - ';
957
+                        echo $record['label'].' - ';
958 958
                         // Change user
959 959
                         DB::update(
960 960
                             prefixTable('log_items'),
@@ -989,7 +989,7 @@  discard block
 block discarded – undo
989 989
             // Get info about user to delete
990 990
             $data_user = DB::queryfirstrow(
991 991
                 'SELECT admin, isAdministratedByRole, gestionnaire
992
-                FROM ' . prefixTable('users') . '
992
+                FROM ' . prefixTable('users').'
993 993
                 WHERE id = %i',
994 994
                 $post_user_id
995 995
             );
@@ -1026,7 +1026,7 @@  discard block
 block discarded – undo
1026 1026
 
1027 1027
             // Do
1028 1028
             $rows = DB::query(
1029
-                'SELECT id FROM ' . prefixTable('users') . '
1029
+                'SELECT id FROM '.prefixTable('users').'
1030 1030
                 WHERE timestamp != %s AND admin != %i',
1031 1031
                 '',
1032 1032
                 '1'
@@ -1035,7 +1035,7 @@  discard block
 block discarded – undo
1035 1035
                 // Get info about user to delete
1036 1036
                 $data_user = DB::queryfirstrow(
1037 1037
                     'SELECT admin, isAdministratedByRole, gestionnaire
1038
-                    FROM ' . prefixTable('users') . '
1038
+                    FROM ' . prefixTable('users').'
1039 1039
                     WHERE id = %i',
1040 1040
                     $record['id']
1041 1041
                 );
@@ -1093,7 +1093,7 @@  discard block
 block discarded – undo
1093 1093
             // Get info about user
1094 1094
             $rowUser = DB::queryfirstrow(
1095 1095
                 'SELECT *
1096
-                FROM ' . prefixTable('users') . '
1096
+                FROM ' . prefixTable('users').'
1097 1097
                 WHERE id = %i',
1098 1098
                 $post_id
1099 1099
             );
@@ -1111,7 +1111,7 @@  discard block
 block discarded – undo
1111 1111
                 $arrFldAllowed = array();
1112 1112
 
1113 1113
                 //Build tree
1114
-                $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries');
1114
+                $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries');
1115 1115
                 $tree->register();
1116 1116
                 $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title');
1117 1117
 
@@ -1122,7 +1122,7 @@  discard block
 block discarded – undo
1122 1122
                 // array of roles for actual user
1123 1123
                 $my_functions = explode(';', $_SESSION['fonction_id']);
1124 1124
 
1125
-                $rows = DB::query('SELECT id,title,creator_id FROM ' . prefixTable('roles_title'));
1125
+                $rows = DB::query('SELECT id,title,creator_id FROM '.prefixTable('roles_title'));
1126 1126
                 foreach ($rows as $record) {
1127 1127
                     if (
1128 1128
                         (int) $_SESSION['is_admin'] === 1
@@ -1158,7 +1158,7 @@  discard block
 block discarded – undo
1158 1158
                 $rolesList = array();
1159 1159
                 $managedBy = array();
1160 1160
                 $selected = '';
1161
-                $rows = DB::query('SELECT id,title FROM ' . prefixTable('roles_title') . ' ORDER BY title ASC');
1161
+                $rows = DB::query('SELECT id,title FROM '.prefixTable('roles_title').' ORDER BY title ASC');
1162 1162
                 foreach ($rows as $reccord) {
1163 1163
                     $rolesList[$reccord['id']] = array('id' => $reccord['id'], 'title' => $reccord['title']);
1164 1164
                 }
@@ -1189,7 +1189,7 @@  discard block
 block discarded – undo
1189 1189
                         array_push(
1190 1190
                             $managedBy,
1191 1191
                             array(
1192
-                                'title' => langHdl('managers_of') . ' ' . $fonction['title'],
1192
+                                'title' => langHdl('managers_of').' '.$fonction['title'],
1193 1193
                                 'id' => $fonction['id'],
1194 1194
                                 'selected' => $selected,
1195 1195
                             )
@@ -1271,9 +1271,9 @@  discard block
 block discarded – undo
1271 1271
 
1272 1272
                 // get USER STATUS
1273 1273
                 if ($rowUser['disabled'] == 1) {
1274
-                    $arrData['info'] = langHdl('user_info_locked') . '<br><input type="checkbox" value="unlock" name="1" class="chk">&nbsp;<label for="1">' . langHdl('user_info_unlock_question') . '</label><br><input type="checkbox"  value="delete" id="account_delete" class="chk mr-2" name="2" onclick="confirmDeletion()">label for="2">' . langHdl('user_info_delete_question') . '</label>';
1274
+                    $arrData['info'] = langHdl('user_info_locked').'<br><input type="checkbox" value="unlock" name="1" class="chk">&nbsp;<label for="1">'.langHdl('user_info_unlock_question').'</label><br><input type="checkbox"  value="delete" id="account_delete" class="chk mr-2" name="2" onclick="confirmDeletion()">label for="2">'.langHdl('user_info_delete_question').'</label>';
1275 1275
                 } else {
1276
-                    $arrData['info'] = langHdl('user_info_active') . '<br><input type="checkbox" value="lock" class="chk">&nbsp;' . langHdl('user_info_lock_question');
1276
+                    $arrData['info'] = langHdl('user_info_active').'<br><input type="checkbox" value="lock" class="chk">&nbsp;'.langHdl('user_info_lock_question');
1277 1277
                 }
1278 1278
 
1279 1279
                 $arrData['error'] = false;
@@ -1365,7 +1365,7 @@  discard block
 block discarded – undo
1365 1365
                 // count number of admins
1366 1366
                 $users = DB::query(
1367 1367
                     'SELECT id
1368
-                    FROM ' . prefixTable('users') . '
1368
+                    FROM ' . prefixTable('users').'
1369 1369
                     WHERE admin = 1 AND email != "" AND pw != ""'
1370 1370
                 );
1371 1371
                 if (DB::count() === 1) {
@@ -1451,7 +1451,7 @@  discard block
 block discarded – undo
1451 1451
 
1452 1452
             // Get info about user to delete
1453 1453
             $data_user = DB::queryfirstrow(
1454
-                'SELECT admin, isAdministratedByRole FROM ' . prefixTable('users') . '
1454
+                'SELECT admin, isAdministratedByRole FROM '.prefixTable('users').'
1455 1455
                 WHERE id = %i',
1456 1456
                 $post_id
1457 1457
             );
@@ -1472,7 +1472,7 @@  discard block
 block discarded – undo
1472 1472
                     );
1473 1473
                     // delete personal folder and subfolders
1474 1474
                     $data = DB::queryfirstrow(
1475
-                        'SELECT id FROM ' . prefixTable('nested_tree') . '
1475
+                        'SELECT id FROM '.prefixTable('nested_tree').'
1476 1476
                         WHERE title = %s AND personal_folder = %i',
1477 1477
                         $post_id,
1478 1478
                         '1'
@@ -1485,7 +1485,7 @@  discard block
 block discarded – undo
1485 1485
                             DB::delete(prefixTable('nested_tree'), 'id = %i AND personal_folder = %i', $folder->id, '1');
1486 1486
                             // delete items & logs
1487 1487
                             $items = DB::query(
1488
-                                'SELECT id FROM ' . prefixTable('items') . '
1488
+                                'SELECT id FROM '.prefixTable('items').'
1489 1489
                                 WHERE id_tree=%i AND perso = %i',
1490 1490
                                 $folder->id,
1491 1491
                                 '1'
@@ -1506,7 +1506,7 @@  discard block
 block discarded – undo
1506 1506
                 } else {
1507 1507
                     // Get old data about user
1508 1508
                     $oldData = DB::queryfirstrow(
1509
-                        'SELECT * FROM ' . prefixTable('users') . '
1509
+                        'SELECT * FROM '.prefixTable('users').'
1510 1510
                         WHERE id = %i',
1511 1511
                         $post_id
1512 1512
                     );
@@ -1536,7 +1536,7 @@  discard block
 block discarded – undo
1536 1536
 
1537 1537
                     // update LOG
1538 1538
                     if ($oldData['email'] !== $post_email) {
1539
-                        logEvents($SETTINGS, 'user_mngt', 'at_user_email_changed:' . $oldData['email'], (string) $_SESSION['user_id'], $_SESSION['login'], $post_id);
1539
+                        logEvents($SETTINGS, 'user_mngt', 'at_user_email_changed:'.$oldData['email'], (string) $_SESSION['user_id'], $_SESSION['login'], $post_id);
1540 1540
                     }
1541 1541
                 }
1542 1542
                 echo prepareExchangedData(
@@ -1591,7 +1591,7 @@  discard block
 block discarded – undo
1591 1591
 
1592 1592
             // Get info about user to delete
1593 1593
             $data_user = DB::queryfirstrow(
1594
-                'SELECT admin, isAdministratedByRole FROM ' . prefixTable('users') . '
1594
+                'SELECT admin, isAdministratedByRole FROM '.prefixTable('users').'
1595 1595
                 WHERE id = %i',
1596 1596
                 $post_id
1597 1597
             );
@@ -1641,7 +1641,7 @@  discard block
 block discarded – undo
1641 1641
             }
1642 1642
 
1643 1643
             DB::queryfirstrow(
1644
-                'SELECT * FROM ' . prefixTable('users') . '
1644
+                'SELECT * FROM '.prefixTable('users').'
1645 1645
                 WHERE login = %s',
1646 1646
                 filter_input(INPUT_POST, 'login', FILTER_SANITIZE_STRING)
1647 1647
             );
@@ -1690,14 +1690,14 @@  discard block
 block discarded – undo
1690 1690
             $arrData = array();
1691 1691
 
1692 1692
             //Build tree
1693
-            $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries');
1693
+            $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries');
1694 1694
             $tree->register();
1695 1695
             $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title');
1696 1696
 
1697 1697
             // get User info
1698 1698
             $rowUser = DB::queryFirstRow(
1699 1699
                 'SELECT login, name, lastname, email, disabled, fonction_id, groupes_interdits, groupes_visibles, isAdministratedByRole, avatar_thumb
1700
-                FROM ' . prefixTable('users') . '
1700
+                FROM ' . prefixTable('users').'
1701 1701
                 WHERE id = %i',
1702 1702
                 $post_id
1703 1703
             );
@@ -1715,7 +1715,7 @@  discard block
 block discarded – undo
1715 1715
                 // refine folders based upon roles
1716 1716
                 $rows = DB::query(
1717 1717
                     'SELECT folder_id, type
1718
-                    FROM ' . prefixTable('roles_values') . '
1718
+                    FROM ' . prefixTable('roles_values').'
1719 1719
                     WHERE role_id IN %ls
1720 1720
                     ORDER BY folder_id ASC',
1721 1721
                     $arrData['functions']
@@ -1738,7 +1738,7 @@  discard block
 block discarded – undo
1738 1738
                 }
1739 1739
 
1740 1740
                 // add allowed folders
1741
-                foreach($arrData['allowed_folders'] as $Fld) {
1741
+                foreach ($arrData['allowed_folders'] as $Fld) {
1742 1742
                     array_push($arrFolders, array('id' => $Fld, 'type' => 'W', 'special' => true));
1743 1743
                 }
1744 1744
 
@@ -1749,7 +1749,7 @@  discard block
 block discarded – undo
1749 1749
                             // get folder name
1750 1750
                             $row = DB::queryFirstRow(
1751 1751
                                 'SELECT title, nlevel, id
1752
-                                FROM ' . prefixTable('nested_tree') . '
1752
+                                FROM ' . prefixTable('nested_tree').'
1753 1753
                                 WHERE id = %i',
1754 1754
                                 $fld['id']
1755 1755
                             );
@@ -1762,36 +1762,36 @@  discard block
 block discarded – undo
1762 1762
 
1763 1763
                             // manage right icon
1764 1764
                             if ($fld['type'] == 'W') {
1765
-                                $label = '<i class="fas fa-indent infotip text-success mr-2" title="' . langHdl('write') . '"></i>' .
1766
-                                    '<i class="fas fa-edit infotip text-success mr-2" title="' . langHdl('edit') . '"></i>' .
1767
-                                    '<i class="fas fa-eraser infotip text-success" title="' . langHdl('delete') . '"></i>';
1765
+                                $label = '<i class="fas fa-indent infotip text-success mr-2" title="'.langHdl('write').'"></i>'.
1766
+                                    '<i class="fas fa-edit infotip text-success mr-2" title="'.langHdl('edit').'"></i>'.
1767
+                                    '<i class="fas fa-eraser infotip text-success" title="'.langHdl('delete').'"></i>';
1768 1768
                             } elseif ($fld['type'] == 'ND') {
1769
-                                $label = '<i class="fas fa-indent infotip text-warning mr-2" title="' . langHdl('write') . '"></i>' .
1770
-                                    '<i class="fas fa-edit infotip text-success mr-2" title="' . langHdl('edit') . '"></i>' .
1771
-                                    '<i class="fas fa-eraser infotip text-danger" title="' . langHdl('no_delete') . '"></i>';
1769
+                                $label = '<i class="fas fa-indent infotip text-warning mr-2" title="'.langHdl('write').'"></i>'.
1770
+                                    '<i class="fas fa-edit infotip text-success mr-2" title="'.langHdl('edit').'"></i>'.
1771
+                                    '<i class="fas fa-eraser infotip text-danger" title="'.langHdl('no_delete').'"></i>';
1772 1772
                             } elseif ($fld['type'] == 'NE') {
1773
-                                $label = '<i class="fas fa-indent infotip text-warning mr-2" title="' . langHdl('write') . '"></i>' .
1774
-                                    '<i class="fas fa-edit infotip text-danger mr-2" title="' . langHdl('no_edit') . '"></i>' .
1775
-                                    '<i class="fas fa-eraser infotip text-success" title="' . langHdl('delete') . '"></i>';
1773
+                                $label = '<i class="fas fa-indent infotip text-warning mr-2" title="'.langHdl('write').'"></i>'.
1774
+                                    '<i class="fas fa-edit infotip text-danger mr-2" title="'.langHdl('no_edit').'"></i>'.
1775
+                                    '<i class="fas fa-eraser infotip text-success" title="'.langHdl('delete').'"></i>';
1776 1776
                             } elseif ($fld['type'] == 'NDNE') {
1777
-                                $label = '<i class="fas fa-indent infotip text-warning mr-2" title="' . langHdl('write') . '"></i>' .
1778
-                                    '<i class="fas fa-edit infotip text-danger mr-2" title="' . langHdl('no_edit') . '"></i>' .
1779
-                                    '<i class="fas fa-eraser infotip text-danger" title="' . langHdl('no_delete') . '"></i>';
1777
+                                $label = '<i class="fas fa-indent infotip text-warning mr-2" title="'.langHdl('write').'"></i>'.
1778
+                                    '<i class="fas fa-edit infotip text-danger mr-2" title="'.langHdl('no_edit').'"></i>'.
1779
+                                    '<i class="fas fa-eraser infotip text-danger" title="'.langHdl('no_delete').'"></i>';
1780 1780
                             } else {
1781
-                                $label = '<i class="fas fa-eye infotip text-info mr-2" title="' . langHdl('read') . '"></i>';
1781
+                                $label = '<i class="fas fa-eye infotip text-info mr-2" title="'.langHdl('read').'"></i>';
1782 1782
                             }
1783 1783
 
1784
-                            $html .= '<tr><td>' . $ident . $row['title'] .
1785
-                                ' <small class="text-info">[' . $row['id'] . ']</small>'.
1786
-                                ($fld['special'] === true ? '<i class="fas fa-user-tag infotip text-primary ml-5" title="' . langHdl('user_specific_right') . '"></i>' : '').
1787
-                                '</td><td>' . $label . '</td></tr>';
1784
+                            $html .= '<tr><td>'.$ident.$row['title'].
1785
+                                ' <small class="text-info">['.$row['id'].']</small>'.
1786
+                                ($fld['special'] === true ? '<i class="fas fa-user-tag infotip text-primary ml-5" title="'.langHdl('user_specific_right').'"></i>' : '').
1787
+                                '</td><td>'.$label.'</td></tr>';
1788 1788
                             break;
1789 1789
                         }
1790 1790
                     }
1791 1791
                 }
1792 1792
 
1793
-                $html_full = '<table id="table-folders" class="table table-bordered table-striped dt-responsive nowrap" style="width:100%"><tbody>' .
1794
-                    $html . '</tbody></table>';
1793
+                $html_full = '<table id="table-folders" class="table table-bordered table-striped dt-responsive nowrap" style="width:100%"><tbody>'.
1794
+                    $html.'</tbody></table>';
1795 1795
             } else {
1796 1796
                 $html_full = '';
1797 1797
             }
@@ -1837,7 +1837,7 @@  discard block
 block discarded – undo
1837 1837
             if ((int) $_SESSION['is_admin'] === 0 && (int) $_SESSION['user_can_manage_all_users'] === 0) {
1838 1838
                 $rows = DB::query(
1839 1839
                     'SELECT *
1840
-                    FROM ' . prefixTable('users') . '
1840
+                    FROM ' . prefixTable('users').'
1841 1841
                     WHERE admin = %i AND isAdministratedByRole IN %ls',
1842 1842
                     '0',
1843 1843
                     array_filter($_SESSION['user_roles'])
@@ -1845,7 +1845,7 @@  discard block
 block discarded – undo
1845 1845
             } else {
1846 1846
                 $rows = DB::query(
1847 1847
                     'SELECT *
1848
-                    FROM ' . prefixTable('users') . '
1848
+                    FROM ' . prefixTable('users').'
1849 1849
                     WHERE admin = %i',
1850 1850
                     '0'
1851 1851
                 );
@@ -1857,7 +1857,7 @@  discard block
 block discarded – undo
1857 1857
                 $groupIds = [];
1858 1858
                 foreach (explode(';', $record['fonction_id']) as $group) {
1859 1859
                     $tmp = DB::queryfirstrow(
1860
-                        'SELECT id, title FROM ' . prefixTable('roles_title') . '
1860
+                        'SELECT id, title FROM '.prefixTable('roles_title').'
1861 1861
                         WHERE id = %i',
1862 1862
                         $group
1863 1863
                     );
@@ -1869,7 +1869,7 @@  discard block
 block discarded – undo
1869 1869
 
1870 1870
                 // Get managed_by
1871 1871
                 $managedBy = DB::queryfirstrow(
1872
-                    'SELECT id, title FROM ' . prefixTable('roles_title') . '
1872
+                    'SELECT id, title FROM '.prefixTable('roles_title').'
1873 1873
                     WHERE id = %i',
1874 1874
                     $record['isAdministratedByRole']
1875 1875
                 );
@@ -1879,7 +1879,7 @@  discard block
 block discarded – undo
1879 1879
                 $foldersAllowedIds = [];
1880 1880
                 foreach (explode(';', $record['groupes_visibles']) as $role) {
1881 1881
                     $tmp = DB::queryfirstrow(
1882
-                        'SELECT id, title FROM ' . prefixTable('nested_tree') . '
1882
+                        'SELECT id, title FROM '.prefixTable('nested_tree').'
1883 1883
                         WHERE id = %i',
1884 1884
                         $role
1885 1885
                     );
@@ -1892,7 +1892,7 @@  discard block
 block discarded – undo
1892 1892
                 $foldersForbiddenIds = [];
1893 1893
                 foreach (explode(';', $record['groupes_interdits']) as $role) {
1894 1894
                     $tmp = DB::queryfirstrow(
1895
-                        'SELECT id, title FROM ' . prefixTable('nested_tree') . '
1895
+                        'SELECT id, title FROM '.prefixTable('nested_tree').'
1896 1896
                         WHERE id = %i',
1897 1897
                         $role
1898 1898
                     );
@@ -1910,7 +1910,7 @@  discard block
 block discarded – undo
1910 1910
                         'login' => $record['login'],
1911 1911
                         'groups' => implode(', ', $groups),
1912 1912
                         'groupIds' => $groupIds,
1913
-                        'managedBy' => $managedBy=== null ? langHdl('administrator') : $managedBy['title'],
1913
+                        'managedBy' => $managedBy === null ? langHdl('administrator') : $managedBy['title'],
1914 1914
                         'managedById' => $managedBy === null ? 0 : $managedBy['id'],
1915 1915
                         'foldersAllowed' => implode(', ', $foldersAllowed),
1916 1916
                         'foldersAllowedIds' => $foldersAllowedIds,
@@ -1988,7 +1988,7 @@  discard block
 block discarded – undo
1988 1988
 
1989 1989
             // Get info about user
1990 1990
             $data_user = DB::queryfirstrow(
1991
-                'SELECT admin, isAdministratedByRole FROM ' . prefixTable('users') . '
1991
+                'SELECT admin, isAdministratedByRole FROM '.prefixTable('users').'
1992 1992
                 WHERE id = %i',
1993 1993
                 $post_source_id
1994 1994
             );
@@ -2148,14 +2148,14 @@  discard block
 block discarded – undo
2148 2148
             if (empty($post_context) === false && $post_context === 'add_one_role_to_user') {
2149 2149
                 $data_user = DB::queryfirstrow(
2150 2150
                     'SELECT fonction_id
2151
-                    FROM ' . prefixTable('users') . '
2151
+                    FROM ' . prefixTable('users').'
2152 2152
                     WHERE id = %i',
2153 2153
                     $post_user_id
2154 2154
                 );
2155 2155
 
2156 2156
                 if ($data_user) {
2157 2157
                     // Ensure array is unique
2158
-                    $post_new_value = str_replace(',', ';', $data_user['fonction_id']) . ';' . $post_new_value;
2158
+                    $post_new_value = str_replace(',', ';', $data_user['fonction_id']).';'.$post_new_value;
2159 2159
                     $post_new_value = implode(';', array_unique(explode(';', $post_new_value)));
2160 2160
                 } else {
2161 2161
                     // User not found
@@ -2210,7 +2210,7 @@  discard block
 block discarded – undo
2210 2210
             if (filter_input(INPUT_POST, 'step', FILTER_SANITIZE_STRING) === 'refresh') {
2211 2211
                 $record = DB::queryFirstRow(
2212 2212
                     'SELECT user_ip_lastdate
2213
-                    FROM ' . prefixTable('users') . '
2213
+                    FROM ' . prefixTable('users').'
2214 2214
                     WHERE id = %i',
2215 2215
                     $_SESSION['user_id']
2216 2216
                 );
@@ -2302,39 +2302,39 @@  discard block
 block discarded – undo
2302 2302
             ];
2303 2303
 
2304 2304
             // Load expected libraries
2305
-            require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Traits/Macroable.php';
2306
-            require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Arr.php';
2307
-            require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Symfony/contracts/Translation/TranslatorInterface.php';
2308
-            require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/CarbonTimeZone.php';
2309
-            require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Units.php';
2310
-            require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Week.php';
2311
-            require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Timestamp.php';
2312
-            require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Test.php';
2313
-            require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/ObjectInitialisation.php';
2314
-            require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Serialization.php';
2315
-            require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/IntervalRounding.php';
2316
-            require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Rounding.php';
2317
-            require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Localization.php';
2318
-            require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Options.php';
2319
-            require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Cast.php';
2320
-            require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Mutability.php';
2321
-            require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Modifiers.php';
2322
-            require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Mixin.php';
2323
-            require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Macro.php';
2324
-            require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Difference.php';
2325
-            require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Creator.php';
2326
-            require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Converter.php';
2327
-            require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Comparison.php';
2328
-            require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Boundaries.php';
2329
-            require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Date.php';
2330
-            require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/CarbonInterface.php';
2331
-            require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Carbon.php';
2332
-            require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/DetectsErrors.php';
2333
-            require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/Connection.php';
2334
-            require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/LdapInterface.php';
2335
-            require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/LdapBase.php';
2336
-            require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/HandlesConnection.php';
2337
-            require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/Ldap.php';
2305
+            require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Traits/Macroable.php';
2306
+            require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Arr.php';
2307
+            require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Symfony/contracts/Translation/TranslatorInterface.php';
2308
+            require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/CarbonTimeZone.php';
2309
+            require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Units.php';
2310
+            require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Week.php';
2311
+            require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Timestamp.php';
2312
+            require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Test.php';
2313
+            require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/ObjectInitialisation.php';
2314
+            require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Serialization.php';
2315
+            require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/IntervalRounding.php';
2316
+            require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Rounding.php';
2317
+            require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Localization.php';
2318
+            require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Options.php';
2319
+            require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Cast.php';
2320
+            require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Mutability.php';
2321
+            require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Modifiers.php';
2322
+            require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Mixin.php';
2323
+            require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Macro.php';
2324
+            require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Difference.php';
2325
+            require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Creator.php';
2326
+            require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Converter.php';
2327
+            require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Comparison.php';
2328
+            require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Boundaries.php';
2329
+            require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Date.php';
2330
+            require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/CarbonInterface.php';
2331
+            require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Carbon.php';
2332
+            require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/DetectsErrors.php';
2333
+            require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/Connection.php';
2334
+            require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/LdapInterface.php';
2335
+            require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/LdapBase.php';
2336
+            require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/HandlesConnection.php';
2337
+            require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/Ldap.php';
2338 2338
 
2339 2339
             $ad = new SplClassLoader('LdapRecord', '../includes/libraries');
2340 2340
             $ad->register();
@@ -2350,7 +2350,7 @@  discard block
 block discarded – undo
2350 2350
                 echo prepareExchangedData(
2351 2351
                     array(
2352 2352
                         'error' => true,
2353
-                        'message' => "Error : ".$error->getErrorCode()." - ".$error->getErrorMessage(). "<br>".$error->getDiagnosticMessage(),
2353
+                        'message' => "Error : ".$error->getErrorCode()." - ".$error->getErrorMessage()."<br>".$error->getDiagnosticMessage(),
2354 2354
                     ),
2355 2355
                     'encode'
2356 2356
                 );
@@ -2381,12 +2381,12 @@  discard block
 block discarded – undo
2381 2381
                 ['objectclass', '=', 'posixaccount'],
2382 2382
             ], null, null, 'or')->get();
2383 2383
             
2384
-            foreach($users as $i => $adUser) {
2384
+            foreach ($users as $i => $adUser) {
2385 2385
                 if (isset($adUser[$SETTINGS['ldap_user_attribute']]) === false) continue;
2386 2386
                 
2387 2387
                 // Build the list of all groups in AD
2388 2388
                 if (isset($adUser['memberof']) === true) {
2389
-                    foreach($adUser['memberof'] as $j => $adUserGroup) {
2389
+                    foreach ($adUser['memberof'] as $j => $adUserGroup) {
2390 2390
                         if (empty($adUserGroup) === false && $j !== "count") {
2391 2391
                             $adGroup = substr($adUserGroup, 3, strpos($adUserGroup, ',') - 3);
2392 2392
                             if (in_array($adGroup, $adRoles) === false && empty($adGroup) === false) {
@@ -2402,7 +2402,7 @@  discard block
 block discarded – undo
2402 2402
                     // Get his ID
2403 2403
                     DB::queryfirstrow(
2404 2404
                         'SELECT id, fonction_id, auth_type
2405
-                        FROM ' . prefixTable('users') . '
2405
+                        FROM ' . prefixTable('users').'
2406 2406
                         WHERE login = %s',
2407 2407
                         $userLogin
2408 2408
                     );
@@ -2437,7 +2437,7 @@  discard block
 block discarded – undo
2437 2437
             }
2438 2438
 
2439 2439
             // Get all groups in Teampass
2440
-            $rows = DB::query('SELECT id,title FROM ' . prefixTable('roles_title'));
2440
+            $rows = DB::query('SELECT id,title FROM '.prefixTable('roles_title'));
2441 2441
             foreach ($rows as $record) {
2442 2442
                 array_push(
2443 2443
                     $teampassRoles,
@@ -2503,7 +2503,7 @@  discard block
 block discarded – undo
2503 2503
             // Check if user already exists
2504 2504
             $data = DB::query(
2505 2505
                 'SELECT id, fonction_id, groupes_interdits, groupes_visibles
2506
-                FROM ' . prefixTable('users') . '
2506
+                FROM ' . prefixTable('users').'
2507 2507
                 WHERE login = %s',
2508 2508
                 $post_login
2509 2509
             );
@@ -2607,7 +2607,7 @@  discard block
 block discarded – undo
2607 2607
                 );
2608 2608
 
2609 2609
                 // Rebuild tree
2610
-                $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries');
2610
+                $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries');
2611 2611
                 $tree->register();
2612 2612
                 $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title');
2613 2613
                 $tree->rebuild();
@@ -2677,7 +2677,7 @@  discard block
 block discarded – undo
2677 2677
             // Check if user already exists
2678 2678
             DB::query(
2679 2679
                 'SELECT id
2680
-                FROM ' . prefixTable('users') . '
2680
+                FROM ' . prefixTable('users').'
2681 2681
                 WHERE id = %i',
2682 2682
                 $post_id
2683 2683
             );
@@ -2753,7 +2753,7 @@  discard block
 block discarded – undo
2753 2753
             // Check if user already exists
2754 2754
             $userInfo = DB::queryfirstrow(
2755 2755
                 'SELECT id, private_key, public_key
2756
-                FROM ' . prefixTable('users') . '
2756
+                FROM ' . prefixTable('users').'
2757 2757
                 WHERE id = %i',
2758 2758
                 $post_userid
2759 2759
             );
@@ -2800,7 +2800,7 @@  discard block
 block discarded – undo
2800 2800
             if (count($_SESSION['personal_folders']) > 0) {
2801 2801
                 DB::query(
2802 2802
                     'SELECT id
2803
-                    FROM ' . prefixTable('items') . '
2803
+                    FROM ' . prefixTable('items').'
2804 2804
                     WHERE id_tree IN %ls',
2805 2805
                     $_SESSION['personal_folders']
2806 2806
                 );
@@ -2878,7 +2878,7 @@  discard block
 block discarded – undo
2878 2878
             // Check if user already exists
2879 2879
             DB::query(
2880 2880
                 'SELECT id
2881
-                FROM ' . prefixTable('users') . '
2881
+                FROM ' . prefixTable('users').'
2882 2882
                 WHERE id = %i',
2883 2883
                 $post_id
2884 2884
             );
@@ -2972,7 +2972,7 @@  discard block
 block discarded – undo
2972 2972
 
2973 2973
     // Get info about user
2974 2974
     $data_user = DB::queryfirstrow(
2975
-        'SELECT admin, isAdministratedByRole FROM ' . prefixTable('users') . '
2975
+        'SELECT admin, isAdministratedByRole FROM '.prefixTable('users').'
2976 2976
         WHERE id = %i',
2977 2977
         $value[1]
2978 2978
     );
@@ -3005,7 +3005,7 @@  discard block
 block discarded – undo
3005 3005
             logEvents(
3006 3006
                 $SETTINGS,
3007 3007
                 'user_mngt',
3008
-                'at_user_new_' . $value[0] . ':' . $value[1],
3008
+                'at_user_new_'.$value[0].':'.$value[1],
3009 3009
                 (string) $_SESSION['user_id'],
3010 3010
                 $_SESSION['login'],
3011 3011
                 filter_input(INPUT_POST, 'id', FILTER_SANITIZE_STRING)
@@ -3037,7 +3037,7 @@  discard block
 block discarded – undo
3037 3037
 
3038 3038
     // Get info about user
3039 3039
     $data_user = DB::queryfirstrow(
3040
-        'SELECT admin, isAdministratedByRole FROM ' . prefixTable('users') . '
3040
+        'SELECT admin, isAdministratedByRole FROM '.prefixTable('users').'
3041 3041
         WHERE id = %i',
3042 3042
         $value[1]
3043 3043
     );
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2382,7 +2382,9 @@
 block discarded – undo
2382 2382
             ], null, null, 'or')->get();
2383 2383
             
2384 2384
             foreach($users as $i => $adUser) {
2385
-                if (isset($adUser[$SETTINGS['ldap_user_attribute']]) === false) continue;
2385
+                if (isset($adUser[$SETTINGS['ldap_user_attribute']]) === false) {
2386
+                    continue;
2387
+                }
2386 2388
                 
2387 2389
                 // Build the list of all groups in AD
2388 2390
                 if (isset($adUser['memberof']) === true) {
Please login to merge, or discard this patch.