Passed
Push — wip_sessions ( b55e55...384f5b )
by Nils
05:05
created
sources/main.queries.php 1 patch
Spacing   +99 added lines, -99 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 ) {
71 71
     // Not allowed page
72 72
     $session->set('system-error_code', ERR_NOT_ALLOWED);
73
-    include $SETTINGS['cpassman_dir'] . '/error.php';
73
+    include $SETTINGS['cpassman_dir'].'/error.php';
74 74
     exit;
75 75
 }
76 76
 
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
  * @param string $post_key
294 294
  * @return string
295 295
  */
296
-function userHandler(string $post_type, array|null|string $dataReceived, array $SETTINGS, string $post_key): string
296
+function userHandler(string $post_type, array | null | string $dataReceived, array $SETTINGS, string $post_key): string
297 297
 {
298 298
     $session = SessionManager::getSession();
299 299
 
@@ -533,7 +533,7 @@  discard block
 block discarded – undo
533 533
             $pwdlib = new PasswordLib();
534 534
             // generate key
535 535
             $key = $pwdlib->getRandomToken(filter_input(INPUT_POST, 'size', FILTER_SANITIZE_NUMBER_INT));
536
-            return '[{"key" : "' . htmlentities($key, ENT_QUOTES) . '"}]';
536
+            return '[{"key" : "'.htmlentities($key, ENT_QUOTES).'"}]';
537 537
 
538 538
         /*
539 539
         * Launch user keys change on his demand
@@ -584,7 +584,7 @@  discard block
 block discarded – undo
584 584
  * @param array $SETTINGS
585 585
  * @return string
586 586
  */
587
-function systemHandler(string $post_type, array|null|string $dataReceived, array $SETTINGS): string
587
+function systemHandler(string $post_type, array | null | string $dataReceived, array $SETTINGS): string
588 588
 {
589 589
     $session = SessionManager::getSession();
590 590
     switch ($post_type) {
@@ -687,7 +687,7 @@  discard block
 block discarded – undo
687 687
                 )
688 688
             );
689 689
 
690
-            return '[{"token" : "' . $token . '"}]';
690
+            return '[{"token" : "'.$token.'"}]';
691 691
 
692 692
         /*
693 693
         * Default case
@@ -703,7 +703,7 @@  discard block
 block discarded – undo
703 703
 }
704 704
 
705 705
 
706
-function utilsHandler(string $post_type, array|null|string $dataReceived, array $SETTINGS): string
706
+function utilsHandler(string $post_type, array | null | string $dataReceived, array $SETTINGS): string
707 707
 {
708 708
     switch ($post_type) {
709 709
         /*
@@ -772,7 +772,7 @@  discard block
 block discarded – undo
772 772
         array(
773 773
             'error' => false,
774 774
             'timestamp' => $session->get('user-session_duration'),
775
-            'max_time_to_add' => intdiv((($maximum_session_expiration_time*60) - ((int) $session->get('user-session_duration') - time())), 60),
775
+            'max_time_to_add' => intdiv((($maximum_session_expiration_time * 60) - ((int) $session->get('user-session_duration') - time())), 60),
776 776
             'max_session_duration' => $maximum_session_expiration_time,
777 777
         ),
778 778
         'encode'
@@ -824,7 +824,7 @@  discard block
 block discarded – undo
824 824
     // get number of items
825 825
     DB::queryFirstRow(
826 826
         'SELECT increment_id
827
-        FROM ' . prefixTable('sharekeys_items') .
827
+        FROM ' . prefixTable('sharekeys_items').
828 828
         ' WHERE user_id = %i',
829 829
         $userId
830 830
     );
@@ -880,7 +880,7 @@  discard block
 block discarded – undo
880 880
         // check if expected security level is reached
881 881
         $dataUser = DB::queryfirstrow(
882 882
             'SELECT *
883
-            FROM ' . prefixTable('users') . ' WHERE id = %i',
883
+            FROM ' . prefixTable('users').' WHERE id = %i',
884 884
             $post_user_id
885 885
         );
886 886
 
@@ -901,8 +901,8 @@  discard block
 block discarded – undo
901 901
         if (empty($dataUser['fonction_id']) === false) {
902 902
             $data = DB::queryFirstRow(
903 903
                 'SELECT complexity
904
-                FROM ' . prefixTable('roles_title') . '
905
-                WHERE id IN (' . $dataUser['fonction_id'] . ')
904
+                FROM ' . prefixTable('roles_title').'
905
+                WHERE id IN (' . $dataUser['fonction_id'].')
906 906
                 ORDER BY complexity DESC'
907 907
             );
908 908
         } else {
@@ -915,8 +915,8 @@  discard block
 block discarded – undo
915 915
             return prepareExchangedData(
916 916
                 array(
917 917
                     'error' => true,
918
-                    'message' => '<div style="margin:10px 0 10px 15px;">' . $lang->get('complexity_level_not_reached') . '.<br>' .
919
-                        $lang->get('expected_complexity_level') . ': <b>' . TP_PW_COMPLEXITY[$data['complexity']][1] . '</b></div>',
918
+                    'message' => '<div style="margin:10px 0 10px 15px;">'.$lang->get('complexity_level_not_reached').'.<br>'.
919
+                        $lang->get('expected_complexity_level').': <b>'.TP_PW_COMPLEXITY[$data['complexity']][1].'</b></div>',
920 920
                 ),
921 921
                 'encode'
922 922
             );
@@ -1019,14 +1019,14 @@  discard block
 block discarded – undo
1019 1019
         // Get data about user
1020 1020
         $dataUser = DB::queryfirstrow(
1021 1021
             'SELECT id, email, pw
1022
-            FROM ' . prefixTable('users') . '
1022
+            FROM ' . prefixTable('users').'
1023 1023
             WHERE login = %s',
1024 1024
             $post_login
1025 1025
         );
1026 1026
     } else {
1027 1027
         $dataUser = DB::queryfirstrow(
1028 1028
             'SELECT id, login, email, pw
1029
-            FROM ' . prefixTable('users') . '
1029
+            FROM ' . prefixTable('users').'
1030 1030
             WHERE id = %i',
1031 1031
             $post_id
1032 1032
         );
@@ -1081,7 +1081,7 @@  discard block
 block discarded – undo
1081 1081
     // Check if token already used
1082 1082
     $dataToken = DB::queryfirstrow(
1083 1083
         'SELECT end_timestamp, reason
1084
-        FROM ' . prefixTable('tokens') . '
1084
+        FROM ' . prefixTable('tokens').'
1085 1085
         WHERE token = %s AND user_id = %i',
1086 1086
         $post_token,
1087 1087
         $dataUser['id']
@@ -1092,11 +1092,11 @@  discard block
 block discarded – undo
1092 1092
         return prepareExchangedData(
1093 1093
             array(
1094 1094
                 'error' => true,
1095
-                'message' => 'TOKEN already used',//$lang->get('no_email_set'),
1095
+                'message' => 'TOKEN already used', //$lang->get('no_email_set'),
1096 1096
             ),
1097 1097
             'encode'
1098 1098
         );
1099
-    } elseif(DB::count() === 0) {
1099
+    } elseif (DB::count() === 0) {
1100 1100
         // Store token for this action
1101 1101
         DB::insert(
1102 1102
             prefixTable('tokens'),
@@ -1158,7 +1158,7 @@  discard block
 block discarded – undo
1158 1158
                 'email' => $dataUser['email'],
1159 1159
                 'email_result' => str_replace(
1160 1160
                     '#email#',
1161
-                    '<b>' . obfuscateEmail($dataUser['email']) . '</b>',
1161
+                    '<b>'.obfuscateEmail($dataUser['email']).'</b>',
1162 1162
                     addslashes($lang->get('admin_email_result_ok'))
1163 1163
                 ),
1164 1164
             ),
@@ -1174,7 +1174,7 @@  discard block
 block discarded – undo
1174 1174
             'email' => $dataUser['email'],
1175 1175
             'email_result' => str_replace(
1176 1176
                 '#email#',
1177
-                '<b>' . obfuscateEmail($dataUser['email']) . '</b>',
1177
+                '<b>'.obfuscateEmail($dataUser['email']).'</b>',
1178 1178
                 addslashes($lang->get('admin_email_result_ok'))
1179 1179
             ),
1180 1180
         ),
@@ -1188,7 +1188,7 @@  discard block
 block discarded – undo
1188 1188
 {
1189 1189
     if (isKeyExistingAndEqual('enable_send_email_on_user_login', 1, $SETTINGS) === true) {
1190 1190
         $row = DB::queryFirstRow(
1191
-            'SELECT valeur FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s',
1191
+            'SELECT valeur FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s',
1192 1192
             'cron',
1193 1193
             'sending_emails'
1194 1194
         );
@@ -1196,7 +1196,7 @@  discard block
 block discarded – undo
1196 1196
         if ((int) (time() - $row['valeur']) >= 300 || (int) $row['valeur'] === 0) {
1197 1197
             $rows = DB::query(
1198 1198
                 'SELECT *
1199
-                FROM ' . prefixTable('emails') .
1199
+                FROM ' . prefixTable('emails').
1200 1200
                 ' WHERE status != %s',
1201 1201
                 'sent'
1202 1202
             );
@@ -1294,8 +1294,8 @@  discard block
 block discarded – undo
1294 1294
     $arr_html = array();
1295 1295
     $rows = DB::query(
1296 1296
         '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
1297
-        FROM ' . prefixTable('log_items') . ' AS l
1298
-        RIGHT JOIN ' . prefixTable('items') . ' AS i ON (l.id_item = i.id)
1297
+        FROM ' . prefixTable('log_items').' AS l
1298
+        RIGHT JOIN ' . prefixTable('items').' AS i ON (l.id_item = i.id)
1299 1299
         WHERE l.action = %s AND l.id_user = %i
1300 1300
         ORDER BY l.date DESC
1301 1301
         LIMIT 0, 100',
@@ -1327,7 +1327,7 @@  discard block
 block discarded – undo
1327 1327
     if (isKeyExistingAndEqual('enable_suggestion', 1, $SETTINGS) === true
1328 1328
         && ((int) $session->get('user-admin') === 1 || (int) $session->get('user-manager') === 1)
1329 1329
     ) {
1330
-        DB::query('SELECT * FROM ' . prefixTable('suggestion'));
1330
+        DB::query('SELECT * FROM '.prefixTable('suggestion'));
1331 1331
         $nb_suggestions_waiting = DB::count();
1332 1332
     }
1333 1333
 
@@ -1362,13 +1362,13 @@  discard block
 block discarded – undo
1362 1362
             if ($data === 'stat_languages') {
1363 1363
                 $tmp = '';
1364 1364
                 foreach ($stats_data[$data] as $key => $value) {
1365
-                    $tmp .= $tmp === '' ? $key . '-' . $value : ',' . $key . '-' . $value;
1365
+                    $tmp .= $tmp === '' ? $key.'-'.$value : ','.$key.'-'.$value;
1366 1366
                 }
1367 1367
                 $statsToSend[$data] = $tmp;
1368 1368
             } elseif ($data === 'stat_country') {
1369 1369
                 $tmp = '';
1370 1370
                 foreach ($stats_data[$data] as $key => $value) {
1371
-                    $tmp .= $tmp === '' ? $key . '-' . $value : ',' . $key . '-' . $value;
1371
+                    $tmp .= $tmp === '' ? $key.'-'.$value : ','.$key.'-'.$value;
1372 1372
                 }
1373 1373
                 $statsToSend[$data] = $tmp;
1374 1374
             } else {
@@ -1455,8 +1455,8 @@  discard block
 block discarded – undo
1455 1455
                 $url_found = substr($line, 19, strlen($line) - 22);
1456 1456
                 if (empty($url_found) === false) {
1457 1457
                     $tmp = parse_url($url_found);
1458
-                    $anonym_url = $tmp['scheme'] . '://<anonym_url>' . (isset($tmp['path']) === true ? $tmp['path'] : '');
1459
-                    $line = "'cpassman_url' => '" . $anonym_url . "\n";
1458
+                    $anonym_url = $tmp['scheme'].'://<anonym_url>'.(isset($tmp['path']) === true ? $tmp['path'] : '');
1459
+                    $line = "'cpassman_url' => '".$anonym_url."\n";
1460 1460
                 } else {
1461 1461
                     $line = "'cpassman_url' => \n";
1462 1462
                 }
@@ -1486,7 +1486,7 @@  discard block
 block discarded – undo
1486 1486
     $teampass_errors = '';
1487 1487
     $rows = DB::query(
1488 1488
         'SELECT label, date AS error_date
1489
-        FROM ' . prefixTable('log_system') . "
1489
+        FROM ' . prefixTable('log_system')."
1490 1490
         WHERE `type` LIKE 'error'
1491 1491
         ORDER BY `date` DESC
1492 1492
         LIMIT 0, 10"
@@ -1494,9 +1494,9 @@  discard block
 block discarded – undo
1494 1494
     if (DB::count() > 0) {
1495 1495
         foreach ($rows as $record) {
1496 1496
             if (empty($teampass_errors) === true) {
1497
-                $teampass_errors = ' * ' . date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['error_date']) . ' - ' . $record['label'];
1497
+                $teampass_errors = ' * '.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['error_date']).' - '.$record['label'];
1498 1498
             } else {
1499
-                $teampass_errors .= ' * ' . date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['error_date']) . ' - ' . $record['label'];
1499
+                $teampass_errors .= ' * '.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['error_date']).' - '.$record['label'];
1500 1500
             }
1501 1501
         }
1502 1502
     }
@@ -1505,7 +1505,7 @@  discard block
 block discarded – undo
1505 1505
 
1506 1506
     // Now prepare text
1507 1507
     $txt = '### Page on which it happened
1508
-' . $data['current_page'] . '
1508
+' . $data['current_page'].'
1509 1509
 
1510 1510
 ### Steps to reproduce
1511 1511
 1.
@@ -1520,39 +1520,39 @@  discard block
 block discarded – undo
1520 1520
 Tell us what happens instead
1521 1521
 
1522 1522
 ### Server configuration
1523
-**Operating system**: ' . php_uname() . '
1523
+**Operating system**: ' . php_uname().'
1524 1524
 
1525
-**Web server:** ' . $_SERVER['SERVER_SOFTWARE'] . '
1525
+**Web server:** ' . $_SERVER['SERVER_SOFTWARE'].'
1526 1526
 
1527
-**Database:** ' . ($link === false ? $lang->get('undefined') : mysqli_get_server_info($link)) . '
1527
+**Database:** ' . ($link === false ? $lang->get('undefined') : mysqli_get_server_info($link)).'
1528 1528
 
1529
-**PHP version:** ' . PHP_VERSION . '
1529
+**PHP version:** ' . PHP_VERSION.'
1530 1530
 
1531
-**Teampass version:** ' . TP_VERSION . '
1531
+**Teampass version:** ' . TP_VERSION.'
1532 1532
 
1533 1533
 **Teampass configuration file:**
1534 1534
 ```
1535
-' . $list_of_options . '
1535
+' . $list_of_options.'
1536 1536
 ```
1537 1537
 
1538 1538
 **Updated from an older Teampass or fresh install:**
1539 1539
 
1540 1540
 ### Client configuration
1541 1541
 
1542
-**Browser:** ' . $data['browser_name'] . ' - ' . $data['browser_version'] . '
1542
+**Browser:** ' . $data['browser_name'].' - '.$data['browser_version'].'
1543 1543
 
1544
-**Operating system:** ' . $data['os'] . ' - ' . $data['os_archi'] . 'bits
1544
+**Operating system:** ' . $data['os'].' - '.$data['os_archi'].'bits
1545 1545
 
1546 1546
 ### Logs
1547 1547
 
1548 1548
 #### Web server error log
1549 1549
 ```
1550
-' . $err['message'] . ' - ' . $err['file'] . ' (' . $err['line'] . ')
1550
+' . $err['message'].' - '.$err['file'].' ('.$err['line'].')
1551 1551
 ```
1552 1552
 
1553 1553
 #### Teampass 10 last system errors
1554 1554
 ```
1555
-' . $teampass_errors . '
1555
+' . $teampass_errors.'
1556 1556
 ```
1557 1557
 
1558 1558
 #### Log from the web-browser developer console (CTRL + SHIFT + i)
@@ -1592,7 +1592,7 @@  discard block
 block discarded – undo
1592 1592
         // Check if user exists
1593 1593
         $userInfo = DB::queryFirstRow(
1594 1594
             'SELECT public_key, private_key, pw, auth_type
1595
-            FROM ' . prefixTable('users') . '
1595
+            FROM ' . prefixTable('users').'
1596 1596
             WHERE id = %i',
1597 1597
             $post_user_id
1598 1598
         );
@@ -1601,9 +1601,9 @@  discard block
 block discarded – undo
1601 1601
             // Get one item
1602 1602
             $currentUserKey = DB::queryFirstRow(
1603 1603
                 'SELECT object_id, share_key, increment_id
1604
-                FROM ' . prefixTable('sharekeys_items') . ' AS si
1605
-                INNER JOIN ' . prefixTable('items') . ' AS i ON  (i.id = si.object_id)
1606
-                INNER JOIN ' . prefixTable('nested_tree') . ' AS nt ON  (i.id_tree = nt.id)
1604
+                FROM ' . prefixTable('sharekeys_items').' AS si
1605
+                INNER JOIN ' . prefixTable('items').' AS i ON  (i.id = si.object_id)
1606
+                INNER JOIN ' . prefixTable('nested_tree').' AS nt ON  (i.id_tree = nt.id)
1607 1607
                 WHERE user_id = %i AND nt.personal_folder = %i',
1608 1608
                 $post_user_id,
1609 1609
                 0
@@ -1702,7 +1702,7 @@  discard block
 block discarded – undo
1702 1702
         // Get user info
1703 1703
         $userData = DB::queryFirstRow(
1704 1704
             'SELECT private_key
1705
-            FROM ' . prefixTable('users') . '
1705
+            FROM ' . prefixTable('users').'
1706 1706
             WHERE id = %i',
1707 1707
             $post_user_id
1708 1708
         );
@@ -1767,7 +1767,7 @@  discard block
 block discarded – undo
1767 1767
         // Get user info
1768 1768
         $userData = DB::queryFirstRow(
1769 1769
             'SELECT email, auth_type, login
1770
-            FROM ' . prefixTable('users') . '
1770
+            FROM ' . prefixTable('users').'
1771 1771
             WHERE id = %i',
1772 1772
             $post_user_id
1773 1773
         );
@@ -1903,7 +1903,7 @@  discard block
 block discarded – undo
1903 1903
         // Get user info
1904 1904
         $userData = DB::queryFirstRow(
1905 1905
             'SELECT email, auth_type, login
1906
-            FROM ' . prefixTable('users') . '
1906
+            FROM ' . prefixTable('users').'
1907 1907
             WHERE id = %i',
1908 1908
             $post_user_id
1909 1909
         );
@@ -1968,7 +1968,7 @@  discard block
 block discarded – undo
1968 1968
         // Check if user exists
1969 1969
         DB::queryFirstRow(
1970 1970
             'SELECT *
1971
-            FROM ' . prefixTable('users') . '
1971
+            FROM ' . prefixTable('users').'
1972 1972
             WHERE id = %i',
1973 1973
             $post_user_id
1974 1974
         );
@@ -2037,7 +2037,7 @@  discard block
 block discarded – undo
2037 2037
         // Check if user exists
2038 2038
         $userInfo = DB::queryFirstRow(
2039 2039
             'SELECT public_key
2040
-            FROM ' . prefixTable('users') . '
2040
+            FROM ' . prefixTable('users').'
2041 2041
             WHERE id = %i',
2042 2042
             $post_user_id
2043 2043
         );
@@ -2185,15 +2185,15 @@  discard block
 block discarded – undo
2185 2185
     // Loop on items
2186 2186
     $rows = DB::query(
2187 2187
         'SELECT id, pw
2188
-        FROM ' . prefixTable('items') . '
2188
+        FROM ' . prefixTable('items').'
2189 2189
         WHERE perso = 0
2190
-        LIMIT ' . $post_start . ', ' . $post_length
2190
+        LIMIT ' . $post_start.', '.$post_length
2191 2191
     );
2192 2192
     foreach ($rows as $record) {
2193 2193
         // Get itemKey from current user
2194 2194
         $currentUserKey = DB::queryFirstRow(
2195 2195
             'SELECT share_key, increment_id
2196
-            FROM ' . prefixTable('sharekeys_items') . '
2196
+            FROM ' . prefixTable('sharekeys_items').'
2197 2197
             WHERE object_id = %i AND user_id = %i',
2198 2198
             $record['id'],
2199 2199
             $session->get('user-id')
@@ -2225,7 +2225,7 @@  discard block
 block discarded – undo
2225 2225
             if ((int) $post_user_id !== (int) $session->get('user-id')) {
2226 2226
                 $currentUserKey = DB::queryFirstRow(
2227 2227
                     'SELECT increment_id
2228
-                    FROM ' . prefixTable('sharekeys_items') . '
2228
+                    FROM ' . prefixTable('sharekeys_items').'
2229 2229
                     WHERE object_id = %i AND user_id = %i',
2230 2230
                     $record['id'],
2231 2231
                     $post_user_id
@@ -2258,7 +2258,7 @@  discard block
 block discarded – undo
2258 2258
     // SHould we change step?
2259 2259
     DB::query(
2260 2260
         'SELECT *
2261
-        FROM ' . prefixTable('items') . '
2261
+        FROM ' . prefixTable('items').'
2262 2262
         WHERE perso = 0'
2263 2263
     );
2264 2264
 
@@ -2283,15 +2283,15 @@  discard block
 block discarded – undo
2283 2283
     // Loop on logs
2284 2284
     $rows = DB::query(
2285 2285
         'SELECT increment_id
2286
-        FROM ' . prefixTable('log_items') . '
2286
+        FROM ' . prefixTable('log_items').'
2287 2287
         WHERE raison LIKE "at_pw :%" AND encryption_type = "teampass_aes"
2288
-        LIMIT ' . $post_start . ', ' . $post_length
2288
+        LIMIT ' . $post_start.', '.$post_length
2289 2289
     );
2290 2290
     foreach ($rows as $record) {
2291 2291
         // Get itemKey from current user
2292 2292
         $currentUserKey = DB::queryFirstRow(
2293 2293
             'SELECT share_key
2294
-            FROM ' . prefixTable('sharekeys_logs') . '
2294
+            FROM ' . prefixTable('sharekeys_logs').'
2295 2295
             WHERE object_id = %i AND user_id = %i',
2296 2296
             $record['increment_id'],
2297 2297
             $session->get('user-id')
@@ -2323,7 +2323,7 @@  discard block
 block discarded – undo
2323 2323
             if ((int) $post_user_id !== (int) $session->get('user-id')) {
2324 2324
                 $currentUserKey = DB::queryFirstRow(
2325 2325
                     'SELECT increment_id
2326
-                    FROM ' . prefixTable('sharekeys_items') . '
2326
+                    FROM ' . prefixTable('sharekeys_items').'
2327 2327
                     WHERE object_id = %i AND user_id = %i',
2328 2328
                     $record['id'],
2329 2329
                     $post_user_id
@@ -2345,7 +2345,7 @@  discard block
 block discarded – undo
2345 2345
     // SHould we change step?
2346 2346
     DB::query(
2347 2347
         'SELECT increment_id
2348
-        FROM ' . prefixTable('log_items') . '
2348
+        FROM ' . prefixTable('log_items').'
2349 2349
         WHERE raison LIKE "at_pw :%" AND encryption_type = "teampass_aes"'
2350 2350
     );
2351 2351
 
@@ -2370,15 +2370,15 @@  discard block
 block discarded – undo
2370 2370
     // Loop on fields
2371 2371
     $rows = DB::query(
2372 2372
         'SELECT id
2373
-        FROM ' . prefixTable('categories_items') . '
2373
+        FROM ' . prefixTable('categories_items').'
2374 2374
         WHERE encryption_type = "teampass_aes"
2375
-        LIMIT ' . $post_start . ', ' . $post_length
2375
+        LIMIT ' . $post_start.', '.$post_length
2376 2376
     );
2377 2377
     foreach ($rows as $record) {
2378 2378
         // Get itemKey from current user
2379 2379
         $currentUserKey = DB::queryFirstRow(
2380 2380
             'SELECT share_key
2381
-            FROM ' . prefixTable('sharekeys_fields') . '
2381
+            FROM ' . prefixTable('sharekeys_fields').'
2382 2382
             WHERE object_id = %i AND user_id = %i',
2383 2383
             $record['id'],
2384 2384
             $session->get('user-id')
@@ -2410,7 +2410,7 @@  discard block
 block discarded – undo
2410 2410
             if ((int) $post_user_id !== (int) $session->get('user-id')) {
2411 2411
                 $currentUserKey = DB::queryFirstRow(
2412 2412
                     'SELECT increment_id
2413
-                    FROM ' . prefixTable('sharekeys_items') . '
2413
+                    FROM ' . prefixTable('sharekeys_items').'
2414 2414
                     WHERE object_id = %i AND user_id = %i',
2415 2415
                     $record['id'],
2416 2416
                     $post_user_id
@@ -2432,7 +2432,7 @@  discard block
 block discarded – undo
2432 2432
     // SHould we change step?
2433 2433
     DB::query(
2434 2434
         'SELECT *
2435
-        FROM ' . prefixTable('categories_items') . '
2435
+        FROM ' . prefixTable('categories_items').'
2436 2436
         WHERE encryption_type = "teampass_aes"'
2437 2437
     );
2438 2438
 
@@ -2457,14 +2457,14 @@  discard block
 block discarded – undo
2457 2457
     // Loop on suggestions
2458 2458
     $rows = DB::query(
2459 2459
         'SELECT id
2460
-        FROM ' . prefixTable('suggestion') . '
2461
-        LIMIT ' . $post_start . ', ' . $post_length
2460
+        FROM ' . prefixTable('suggestion').'
2461
+        LIMIT ' . $post_start.', '.$post_length
2462 2462
     );
2463 2463
     foreach ($rows as $record) {
2464 2464
         // Get itemKey from current user
2465 2465
         $currentUserKey = DB::queryFirstRow(
2466 2466
             'SELECT share_key
2467
-            FROM ' . prefixTable('sharekeys_suggestions') . '
2467
+            FROM ' . prefixTable('sharekeys_suggestions').'
2468 2468
             WHERE object_id = %i AND user_id = %i',
2469 2469
             $record['id'],
2470 2470
             $session->get('user-id')
@@ -2496,7 +2496,7 @@  discard block
 block discarded – undo
2496 2496
             if ((int) $post_user_id !== (int) $session->get('user-id')) {
2497 2497
                 $currentUserKey = DB::queryFirstRow(
2498 2498
                     'SELECT increment_id
2499
-                    FROM ' . prefixTable('sharekeys_items') . '
2499
+                    FROM ' . prefixTable('sharekeys_items').'
2500 2500
                     WHERE object_id = %i AND user_id = %i',
2501 2501
                     $record['id'],
2502 2502
                     $post_user_id
@@ -2542,15 +2542,15 @@  discard block
 block discarded – undo
2542 2542
     // Loop on files
2543 2543
     $rows = DB::query(
2544 2544
         'SELECT id
2545
-        FROM ' . prefixTable('files') . '
2546
-        WHERE status = "' . TP_ENCRYPTION_NAME . '"
2547
-        LIMIT ' . $post_start . ', ' . $post_length
2545
+        FROM ' . prefixTable('files').'
2546
+        WHERE status = "' . TP_ENCRYPTION_NAME.'"
2547
+        LIMIT ' . $post_start.', '.$post_length
2548 2548
     ); //aes_encryption
2549 2549
     foreach ($rows as $record) {
2550 2550
         // Get itemKey from current user
2551 2551
         $currentUserKey = DB::queryFirstRow(
2552 2552
             'SELECT share_key
2553
-            FROM ' . prefixTable('sharekeys_files') . '
2553
+            FROM ' . prefixTable('sharekeys_files').'
2554 2554
             WHERE object_id = %i AND user_id = %i',
2555 2555
             $record['id'],
2556 2556
             $session->get('user-id')
@@ -2582,7 +2582,7 @@  discard block
 block discarded – undo
2582 2582
             if ((int) $post_user_id !== (int) $session->get('user-id')) {
2583 2583
                 $currentUserKey = DB::queryFirstRow(
2584 2584
                     'SELECT increment_id
2585
-                    FROM ' . prefixTable('sharekeys_items') . '
2585
+                    FROM ' . prefixTable('sharekeys_items').'
2586 2586
                     WHERE object_id = %i AND user_id = %i',
2587 2587
                     $record['id'],
2588 2588
                     $post_user_id
@@ -2604,8 +2604,8 @@  discard block
 block discarded – undo
2604 2604
     // SHould we change step?
2605 2605
     DB::query(
2606 2606
         'SELECT *
2607
-        FROM ' . prefixTable('files') . '
2608
-        WHERE status = "' . TP_ENCRYPTION_NAME . '"'
2607
+        FROM ' . prefixTable('files').'
2608
+        WHERE status = "' . TP_ENCRYPTION_NAME.'"'
2609 2609
     );
2610 2610
 
2611 2611
     $next_start = (int) $post_start + (int) $post_length;
@@ -2638,16 +2638,16 @@  discard block
 block discarded – undo
2638 2638
     if (count($session->get('user-personal_folders')) > 0) {
2639 2639
         $rows = DB::query(
2640 2640
             'SELECT id, pw
2641
-            FROM ' . prefixTable('items') . '
2641
+            FROM ' . prefixTable('items').'
2642 2642
             WHERE perso = 1 AND id_tree IN %ls
2643
-            LIMIT ' . $post_start . ', ' . $post_length,
2643
+            LIMIT ' . $post_start.', '.$post_length,
2644 2644
             $session->get('user-personal_folders')
2645 2645
         );
2646 2646
         foreach ($rows as $record) {
2647 2647
             // Get itemKey from current user
2648 2648
             $currentUserKey = DB::queryFirstRow(
2649 2649
                 'SELECT share_key, increment_id
2650
-                FROM ' . prefixTable('sharekeys_items') . '
2650
+                FROM ' . prefixTable('sharekeys_items').'
2651 2651
                 WHERE object_id = %i AND user_id = %i',
2652 2652
                 $record['id'],
2653 2653
                 $session->get('user-id')
@@ -2674,7 +2674,7 @@  discard block
 block discarded – undo
2674 2674
                 if ((int) $post_user_id !== (int) $session->get('user-id')) {
2675 2675
                     $currentUserKey = DB::queryFirstRow(
2676 2676
                         'SELECT increment_id
2677
-                        FROM ' . prefixTable('sharekeys_items') . '
2677
+                        FROM ' . prefixTable('sharekeys_items').'
2678 2678
                         WHERE object_id = %i AND user_id = %i',
2679 2679
                         $record['id'],
2680 2680
                         $post_user_id
@@ -2697,7 +2697,7 @@  discard block
 block discarded – undo
2697 2697
     // SHould we change step?
2698 2698
     DB::query(
2699 2699
         'SELECT *
2700
-        FROM ' . prefixTable('items') . '
2700
+        FROM ' . prefixTable('items').'
2701 2701
         WHERE perso = 0'
2702 2702
     );
2703 2703
 
@@ -2724,7 +2724,7 @@  discard block
 block discarded – undo
2724 2724
         // Check if user exists
2725 2725
         $userInfo = DB::queryFirstRow(
2726 2726
             'SELECT public_key, encrypted_psk
2727
-            FROM ' . prefixTable('users') . '
2727
+            FROM ' . prefixTable('users').'
2728 2728
             WHERE id = %i',
2729 2729
             $post_user_id
2730 2730
         );
@@ -2749,9 +2749,9 @@  discard block
 block discarded – undo
2749 2749
                 // Loop on persoanl items
2750 2750
                 $rows = DB::query(
2751 2751
                     'SELECT id, pw
2752
-                    FROM ' . prefixTable('items') . '
2752
+                    FROM ' . prefixTable('items').'
2753 2753
                     WHERE perso = 1 AND id_tree IN %ls
2754
-                    LIMIT ' . $post_start . ', ' . $post_length,
2754
+                    LIMIT ' . $post_start.', '.$post_length,
2755 2755
                     $session->get('user-personal_folders')
2756 2756
                 );
2757 2757
                 $countUserPersonalItems = DB::count();
@@ -2794,7 +2794,7 @@  discard block
 block discarded – undo
2794 2794
                         // Loop on files
2795 2795
                         $rows = DB::query(
2796 2796
                             'SELECT id, file
2797
-                            FROM ' . prefixTable('files') . '
2797
+                            FROM ' . prefixTable('files').'
2798 2798
                             WHERE status != %s
2799 2799
                             AND id_item = %i',
2800 2800
                             TP_ENCRYPTION_NAME,
@@ -2805,14 +2805,14 @@  discard block
 block discarded – undo
2805 2805
                             // Now decrypt the file
2806 2806
                             prepareFileWithDefuse(
2807 2807
                                 'decrypt',
2808
-                                $SETTINGS['path_to_upload_folder'] . '/' . $record2['file'],
2809
-                                $SETTINGS['path_to_upload_folder'] . '/' . $record2['file'] . '.delete',
2808
+                                $SETTINGS['path_to_upload_folder'].'/'.$record2['file'],
2809
+                                $SETTINGS['path_to_upload_folder'].'/'.$record2['file'].'.delete',
2810 2810
                                 $SETTINGS,
2811 2811
                                 $post_user_psk
2812 2812
                             );
2813 2813
 
2814 2814
                             // Encrypt the file
2815
-                            $encryptedFile = encryptFile($record2['file'] . '.delete', $SETTINGS['path_to_upload_folder']);
2815
+                            $encryptedFile = encryptFile($record2['file'].'.delete', $SETTINGS['path_to_upload_folder']);
2816 2816
 
2817 2817
                             DB::update(
2818 2818
                                 prefixTable('files'),
@@ -2835,7 +2835,7 @@  discard block
 block discarded – undo
2835 2835
                             );
2836 2836
 
2837 2837
                             // Unlink original file
2838
-                            unlink($SETTINGS['path_to_upload_folder'] . '/' . $record2['file']);
2838
+                            unlink($SETTINGS['path_to_upload_folder'].'/'.$record2['file']);
2839 2839
                         }
2840 2840
                     }
2841 2841
                 }
@@ -2907,7 +2907,7 @@  discard block
 block discarded – undo
2907 2907
         // Get user info
2908 2908
         $userData = DB::queryFirstRow(
2909 2909
             'SELECT '.$post_fields.'
2910
-            FROM ' . prefixTable('users') . '
2910
+            FROM ' . prefixTable('users').'
2911 2911
             WHERE id = %i',
2912 2912
             $post_user_id
2913 2913
         );
@@ -2954,7 +2954,7 @@  discard block
 block discarded – undo
2954 2954
         // Get user info
2955 2955
         $userData = DB::queryFirstRow(
2956 2956
             'SELECT auth_type, login, private_key
2957
-            FROM ' . prefixTable('users') . '
2957
+            FROM ' . prefixTable('users').'
2958 2958
             WHERE id = %i',
2959 2959
             $post_user_id
2960 2960
         );
@@ -3004,7 +3004,7 @@  discard block
 block discarded – undo
3004 3004
                 return prepareExchangedData(
3005 3005
                     array(
3006 3006
                         'error' => false,
3007
-                        'message' => $lang->get('done'),'',
3007
+                        'message' => $lang->get('done'), '',
3008 3008
                     ),
3009 3009
                     'encode'
3010 3010
                 );
@@ -3054,7 +3054,7 @@  discard block
 block discarded – undo
3054 3054
         // Get user info
3055 3055
         $userData = DB::queryFirstRow(
3056 3056
             'SELECT auth_type, login, private_key, special
3057
-            FROM ' . prefixTable('users') . '
3057
+            FROM ' . prefixTable('users').'
3058 3058
             WHERE id = %i',
3059 3059
             $post_user_id
3060 3060
         );
@@ -3088,7 +3088,7 @@  discard block
 block discarded – undo
3088 3088
                 return prepareExchangedData(
3089 3089
                     array(
3090 3090
                         'error' => false,
3091
-                        'message' => $lang->get('done'),'',
3091
+                        'message' => $lang->get('done'), '',
3092 3092
                     ),
3093 3093
                     'encode'
3094 3094
                 );
@@ -3112,14 +3112,14 @@  discard block
 block discarded – undo
3112 3112
             // Get one item
3113 3113
             $record = DB::queryFirstRow(
3114 3114
                 'SELECT id, pw
3115
-                FROM ' . prefixTable('items') . '
3115
+                FROM ' . prefixTable('items').'
3116 3116
                 WHERE perso = 0'
3117 3117
             );
3118 3118
 
3119 3119
             // Get itemKey from current user
3120 3120
             $currentUserKey = DB::queryFirstRow(
3121 3121
                 'SELECT share_key, increment_id
3122
-                FROM ' . prefixTable('sharekeys_items') . '
3122
+                FROM ' . prefixTable('sharekeys_items').'
3123 3123
                 WHERE object_id = %i AND user_id = %i',
3124 3124
                 $record['id'],
3125 3125
                 $post_user_id
@@ -3208,7 +3208,7 @@  discard block
 block discarded – undo
3208 3208
             $session->get('user-id')
3209 3209
         );
3210 3210
         // Return data
3211
-        return '[{"new_value":"' . $session->get('user-session_duration') . '"}]';
3211
+        return '[{"new_value":"'.$session->get('user-session_duration').'"}]';
3212 3212
     }
3213 3213
     
3214 3214
     return '[{"new_value":"expired"}]';
Please login to merge, or discard this patch.
index.php 1 patch
Spacing   +78 added lines, -78 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 }
78 78
 
79 79
 // Load functions
80
-require_once __DIR__. '/includes/config/include.php';
80
+require_once __DIR__.'/includes/config/include.php';
81 81
 require_once __DIR__.'/sources/main.functions.php';
82 82
 //error_log('>>>>> '.SessionManager::getCookieValue('PHPSESSID'));
83 83
 // init
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 $request = Request::createFromGlobals();
88 88
 
89 89
 $session->set('key', SessionManager::getCookieValue('PHPSESSID'));
90
-error_log('DEBUG : KEY sur index.php ' . $session->get('key')." -- ".SessionManager::getCookieValue('PHPSESSID'));
90
+error_log('DEBUG : KEY sur index.php '.$session->get('key')." -- ".SessionManager::getCookieValue('PHPSESSID'));
91 91
 
92 92
 // Quick major version check -> upgrade needed?
93 93
 if (isset($SETTINGS['teampass_version']) === true && version_compare(TP_VERSION, $SETTINGS['teampass_version']) > 0) {
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 }
107 107
 
108 108
 // Load Core library
109
-require_once $SETTINGS['cpassman_dir'] . '/sources/core.php';
109
+require_once $SETTINGS['cpassman_dir'].'/sources/core.php';
110 110
 // Prepare POST variables
111 111
 $post_language = filter_input(INPUT_POST, 'language', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
112 112
 $session_user_language = $session->get('user-language');
@@ -132,8 +132,8 @@  discard block
 block discarded – undo
132 132
     //get default language
133 133
     $dataLanguage = DB::queryFirstRow(
134 134
         'SELECT m.valeur AS valeur, l.flag AS flag
135
-        FROM ' . prefixTable('misc') . ' AS m
136
-        INNER JOIN ' . prefixTable('languages') . ' AS l ON (m.valeur = l.name)
135
+        FROM ' . prefixTable('misc').' AS m
136
+        INNER JOIN ' . prefixTable('languages').' AS l ON (m.valeur = l.name)
137 137
         WHERE m.type=%s_type AND m.intitule=%s_intitule',
138 138
         [
139 139
             'type' => 'admin',
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
         $session_user_language = $SETTINGS['default_language'];
165 165
     }
166 166
 }
167
-$lang = new Language($session_user_language, __DIR__. '/includes/language/'); 
167
+$lang = new Language($session_user_language, __DIR__.'/includes/language/'); 
168 168
 
169 169
 if (isset($SETTINGS['cpassman_dir']) === false || $SETTINGS['cpassman_dir'] === '') {
170 170
     $SETTINGS['cpassman_dir'] = __DIR__;
@@ -226,10 +226,10 @@  discard block
 block discarded – undo
226 226
     <!-- Toastr -->
227 227
     <link rel="stylesheet" href="plugins/toastr/toastr.min.css" />
228 228
     <!-- favicon -->
229
-    <link rel="shortcut icon" type="image/png" href="<?php echo $SETTINGS['favicon'];?>"/>
229
+    <link rel="shortcut icon" type="image/png" href="<?php echo $SETTINGS['favicon']; ?>"/>
230 230
     <!-- Custom style -->
231 231
     <?php
232
-    if (file_exists(__DIR__ . '/includes/css/custom.css') === true) {?>
232
+    if (file_exists(__DIR__.'/includes/css/custom.css') === true) {?>
233 233
         <link rel="stylesheet" href="includes/css/custom.css">
234 234
     <?php
235 235
     } ?>
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
                         <div class="dropdown show">
294 294
                             <a class="btn btn-primary dropdown-toggle" href="#" data-toggle="dropdown">
295 295
                                 <?php
296
-                                    echo $session_name . '&nbsp;' . $session_lastname; ?>
296
+                                    echo $session_name.'&nbsp;'.$session_lastname; ?>
297 297
                             </a>
298 298
 
299 299
                             <div class="dropdown-menu dropdown-menu-right">
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
                                     </a>
318 318
                                 <?php
319 319
                                     } ?>
320
-                                <a class="dropdown-item user-menu<?php echo (int) $session_user_admin === 1 ? ' hidden' : '';?>" href="#" data-name="generate-new_keys">
320
+                                <a class="dropdown-item user-menu<?php echo (int) $session_user_admin === 1 ? ' hidden' : ''; ?>" href="#" data-name="generate-new_keys">
321 321
                                     <i class="fa-solid fa-spray-can-sparkles fa-fw mr-2"></i><?php echo $lang->get('generate_new_keys'); ?>
322 322
                                 </a>
323 323
 
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
             <!-- Main Sidebar Container -->
347 347
             <aside class="main-sidebar sidebar-dark-primary elevation-4">
348 348
                 <!-- Brand Logo -->
349
-                <a href="<?php echo $SETTINGS['cpassman_url'] . '/index.php?page=' . ((int) $session_user_admin === 1 ? 'admin' : 'items'); ?>" class="brand-link">
349
+                <a href="<?php echo $SETTINGS['cpassman_url'].'/index.php?page='.((int) $session_user_admin === 1 ? 'admin' : 'items'); ?>" class="brand-link">
350 350
                     <img src="includes/images/teampass-logo2-home.png" alt="Teampass Logo" class="brand-image">
351 351
                     <span class="brand-text font-weight-light"><?php echo TP_TOOL_NAME; ?></span>
352 352
                 </a>
@@ -364,20 +364,20 @@  discard block
 block discarded – undo
364 364
                         <a href="#" data-name="items" class="nav-link', $get['page'] === 'items' ? ' active' : '', '">
365 365
                         <i class="nav-icon fa-solid fa-key"></i>
366 366
                         <p>
367
-                            ' . $lang->get('pw') . '
367
+                            ' . $lang->get('pw').'
368 368
                         </p>
369 369
                         </a>
370 370
                     </li>';
371 371
                                 }
372 372
 
373 373
     // IMPORT menu
374
-    if (isset($SETTINGS['allow_import']) === true && (int) $SETTINGS['allow_import'] === 1&& $session_user_admin === 0) {
374
+    if (isset($SETTINGS['allow_import']) === true && (int) $SETTINGS['allow_import'] === 1 && $session_user_admin === 0) {
375 375
         echo '
376 376
                     <li class="nav-item">
377 377
                         <a href="#" data-name="import" class="nav-link', $get['page'] === 'import' ? ' active' : '', '">
378 378
                         <i class="nav-icon fa-solid fa-file-import"></i>
379 379
                         <p>
380
-                            ' . $lang->get('import') . '
380
+                            ' . $lang->get('import').'
381 381
                         </p>
382 382
                         </a>
383 383
                     </li>';
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
                         <a href="#" data-name="export" class="nav-link', $get['page'] === 'export' ? ' active' : '', '">
399 399
                         <i class="nav-icon fa-solid fa-file-export"></i>
400 400
                         <p>
401
-                            ' . $lang->get('export') . '
401
+                            ' . $lang->get('export').'
402 402
                         </p>
403 403
                         </a>
404 404
                     </li>';
@@ -425,7 +425,7 @@  discard block
 block discarded – undo
425 425
                         <a href="#" data-name="search" class="nav-link', $get['page'] === 'search' ? ' active' : '', '">
426 426
                         <i class="nav-icon fa-solid fa-search"></i>
427 427
                         <p>
428
-                            ' . $lang->get('find') . '
428
+                            ' . $lang->get('find').'
429 429
                         </p>
430 430
                         </a>
431 431
                     </li>';
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
                         <a href="#" data-name="favourites" class="nav-link', $get['page'] === 'admin' ? ' favourites' : '', '">
442 442
                         <i class="nav-icon fa-solid fa-star"></i>
443 443
                         <p>
444
-                            ' . $lang->get('favorites') . '
444
+                            ' . $lang->get('favorites').'
445 445
                         </p>
446 446
                         </a>
447 447
                     </li>';
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
                         <a href="#" data-name="suggestion" class="nav-link', $get['page'] === 'suggestion' ? ' active' : '', '">
472 472
                         <i class="nav-icon fa-solid fa-lightbulb"></i>
473 473
                         <p>
474
-                            ' . $lang->get('suggestion_menu') . '
474
+                            ' . $lang->get('suggestion_menu').'
475 475
                         </p>
476 476
                         </a>
477 477
                     </li>';
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
                         <a href="#" data-name="admin" class="nav-link', $get['page'] === 'admin' ? ' active' : '', '">
485 485
                         <i class="nav-icon fa-solid fa-info"></i>
486 486
                         <p>
487
-                            ' . $lang->get('admin_main') . '
487
+                            ' . $lang->get('admin_main').'
488 488
                         </p>
489 489
                         </a>
490 490
                     </li>
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
                         <a href="#" class="nav-link">
493 493
                             <i class="nav-icon fa-solid fa-wrench"></i>
494 494
                             <p>
495
-                                ' . $lang->get('admin_settings') . '
495
+                                ' . $lang->get('admin_settings').'
496 496
                                 <i class="fa-solid fa-angle-left right"></i>
497 497
                             </p>
498 498
                         </a>
@@ -500,55 +500,55 @@  discard block
 block discarded – undo
500 500
                             <li class="nav-item">
501 501
                                 <a href="#" data-name="options" class="nav-link', $get['page'] === 'options' ? ' active' : '', '">
502 502
                                     <i class="fa-solid fa-check-double nav-icon"></i>
503
-                                    <p>' . $lang->get('options') . '</p>
503
+                                    <p>' . $lang->get('options').'</p>
504 504
                                 </a>
505 505
                             </li>
506 506
                             <li class="nav-item">
507 507
                                 <a href="#" data-name="2fa" class="nav-link', $get['page'] === '2fa' ? ' active' : '', '">
508 508
                                     <i class="fa-solid fa-qrcode nav-icon"></i>
509
-                                    <p>' . $lang->get('mfa_short') . '</p>
509
+                                    <p>' . $lang->get('mfa_short').'</p>
510 510
                                 </a>
511 511
                             </li>
512 512
                             <li class="nav-item">
513 513
                                 <a href="#" data-name="api" class="nav-link', $get['page'] === 'api' ? ' active' : '', '">
514 514
                                     <i class="fa-solid fa-cubes nav-icon"></i>
515
-                                    <p>' . $lang->get('api') . '</p>
515
+                                    <p>' . $lang->get('api').'</p>
516 516
                                 </a>
517 517
                             </li>
518 518
                             <li class="nav-item">
519 519
                                 <a href="#" data-name="backups" class="nav-link', $get['page'] === 'backups' ? ' active' : '', '">
520 520
                                     <i class="fa-solid fa-database nav-icon"></i>
521
-                                    <p>' . $lang->get('backups') . '</p>
521
+                                    <p>' . $lang->get('backups').'</p>
522 522
                                 </a>
523 523
                             </li>
524 524
                             <li class="nav-item">
525 525
                                 <a href="#" data-name="emails" class="nav-link', $get['page'] === 'emails' ? ' active' : '', '">
526 526
                                     <i class="fa-solid fa-envelope nav-icon"></i>
527
-                                    <p>' . $lang->get('emails') . '</p>
527
+                                    <p>' . $lang->get('emails').'</p>
528 528
                                 </a>
529 529
                             </li>
530 530
                             <li class="nav-item">
531 531
                                 <a href="#" data-name="fields" class="nav-link', $get['page'] === 'fields' ? ' active' : '', '">
532 532
                                     <i class="fa-solid fa-keyboard nav-icon"></i>
533
-                                    <p>' . $lang->get('fields') . '</p>
533
+                                    <p>' . $lang->get('fields').'</p>
534 534
                                 </a>
535 535
                             </li>
536 536
                             <li class="nav-item">
537 537
                                 <a href="#" data-name="ldap" class="nav-link', $get['page'] === 'ldap' ? ' active' : '', '">
538 538
                                     <i class="fa-solid fa-id-card nav-icon"></i>
539
-                                    <p>' . $lang->get('ldap') . '</p>
539
+                                    <p>' . $lang->get('ldap').'</p>
540 540
                                 </a>
541 541
                             </li>
542 542
                             <li class="nav-item">
543 543
                                 <a href="#" data-name="uploads" class="nav-link', $get['page'] === 'uploads' ? ' active' : '', '">
544 544
                                     <i class="fa-solid fa-file-upload nav-icon"></i>
545
-                                    <p>' . $lang->get('uploads') . '</p>
545
+                                    <p>' . $lang->get('uploads').'</p>
546 546
                                 </a>
547 547
                             </li>
548 548
                             <li class="nav-item">
549 549
                                 <a href="#" data-name="statistics" class="nav-link', $get['page'] === 'statistics' ? ' active' : '', '">
550 550
                                     <i class="fa-solid fa-chart-bar nav-icon"></i>
551
-                                    <p>' . $lang->get('statistics') . '</p>
551
+                                    <p>' . $lang->get('statistics').'</p>
552 552
                                 </a>
553 553
                             </li>
554 554
                         </ul>
@@ -559,7 +559,7 @@  discard block
 block discarded – undo
559 559
                     <li class="nav-item">
560 560
                         <a href="#" data-name="tasks" class="nav-link', $get['page'] === 'tasks' ? ' active' : '', '">
561 561
                         <i class="fa-solid fa-tasks nav-icon"></i>
562
-                        <p>' . $lang->get('tasks') . '</p>
562
+                        <p>' . $lang->get('tasks').'</p>
563 563
                         </a>
564 564
                     </li>';
565 565
                     }
@@ -575,7 +575,7 @@  discard block
 block discarded – undo
575 575
                         <a href="#" data-name="folders" class="nav-link', $get['page'] === 'folders' ? ' active' : '', '">
576 576
                         <i class="nav-icon fa-solid fa-folder-open"></i>
577 577
                         <p>
578
-                            ' . $lang->get('folders') . '
578
+                            ' . $lang->get('folders').'
579 579
                         </p>
580 580
                         </a>
581 581
                     </li>
@@ -583,7 +583,7 @@  discard block
 block discarded – undo
583 583
                         <a href="#" data-name="roles" class="nav-link', $get['page'] === 'roles' ? ' active' : '', '">
584 584
                         <i class="nav-icon fa-solid fa-graduation-cap"></i>
585 585
                         <p>
586
-                            ' . $lang->get('roles') . '
586
+                            ' . $lang->get('roles').'
587 587
                         </p>
588 588
                         </a>
589 589
                     </li>
@@ -591,38 +591,38 @@  discard block
 block discarded – undo
591 591
                         <a href="#" data-name="users" class="nav-link', $get['page'] === 'users' ? ' active' : '', '">
592 592
                         <i class="nav-icon fa-solid fa-users"></i>
593 593
                         <p>
594
-                            ' . $lang->get('users') . '
594
+                            ' . $lang->get('users').'
595 595
                         </p>
596 596
                         </a>
597 597
                     </li>
598 598
                     <li class="nav-item has-treeview', $menuUtilities === true ? ' menu-open' : '', '">
599 599
                         <a href="#" class="nav-link">
600 600
                         <i class="nav-icon fa-solid fa-cubes"></i>
601
-                        <p>' . $lang->get('admin_views') . '<i class="fa-solid fa-angle-left right"></i></p>
601
+                        <p>' . $lang->get('admin_views').'<i class="fa-solid fa-angle-left right"></i></p>
602 602
                         </a>
603 603
                         <ul class="nav nav-treeview">
604 604
                             <li class="nav-item">
605 605
                                 <a href="#" data-name="utilities.renewal" class="nav-link', $get['page'] === 'utilities.renewal' ? ' active' : '', '">
606 606
                                 <i class="far fa-calendar-alt nav-icon"></i>
607
-                                <p>' . $lang->get('renewal') . '</p>
607
+                                <p>' . $lang->get('renewal').'</p>
608 608
                                 </a>
609 609
                             </li>
610 610
                             <li class="nav-item">
611 611
                                 <a href="#" data-name="utilities.deletion" class="nav-link', $get['page'] === 'utilities.deletion' ? ' active' : '', '">
612 612
                                 <i class="fa-solid fa-trash-alt nav-icon"></i>
613
-                                <p>' . $lang->get('deletion') . '</p>
613
+                                <p>' . $lang->get('deletion').'</p>
614 614
                                 </a>
615 615
                             </li>
616 616
                             <li class="nav-item">
617 617
                                 <a href="#" data-name="utilities.logs" class="nav-link', $get['page'] === 'utilities.logs' ? ' active' : '', '">
618 618
                                 <i class="fa-solid fa-history nav-icon"></i>
619
-                                <p>' . $lang->get('logs') . '</p>
619
+                                <p>' . $lang->get('logs').'</p>
620 620
                                 </a>
621 621
                             </li>
622 622
                             <li class="nav-item">
623 623
                                 <a href="#" data-name="utilities.database" class="nav-link', $get['page'] === 'utilities.database' ? ' active' : '', '">
624 624
                                 <i class="fa-solid fa-database nav-icon"></i>
625
-                                <p>' . $lang->get('database') . '</p>
625
+                                <p>' . $lang->get('database').'</p>
626 626
                                 </a>
627 627
                             </li>
628 628
                         </ul>
@@ -633,10 +633,10 @@  discard block
 block discarded – undo
633 633
                     <!-- /.sidebar-menu -->
634 634
                 <div class="menu-footer">
635 635
                     <div class="" id="sidebar-footer">
636
-                        <i class="fa-solid fa-clock-o mr-2 infotip text-info pointer" title="<?php echo $lang->get('server_time') . ' ' .
637
-                            date($SETTINGS['date_format'], (int) $server['request_time']) . ' - ' .
636
+                        <i class="fa-solid fa-clock-o mr-2 infotip text-info pointer" title="<?php echo $lang->get('server_time').' '.
637
+                            date($SETTINGS['date_format'], (int) $server['request_time']).' - '.
638 638
                             date($SETTINGS['time_format'], (int) $server['request_time']); ?>"></i>
639
-                        <i class="fa-solid fa-users mr-2 infotip text-info pointer" title="<?php echo $session_nb_users_online . ' ' . $lang->get('users_online'); ?>"></i>
639
+                        <i class="fa-solid fa-users mr-2 infotip text-info pointer" title="<?php echo $session_nb_users_online.' '.$lang->get('users_online'); ?>"></i>
640 640
                         <a href="<?php echo DOCUMENTATION_URL; ?>" target="_blank" class="text-info"><i class="fa-solid fa-book mr-2 infotip" title="<?php echo $lang->get('documentation_canal'); ?>"></i></a>
641 641
                         <a href="<?php echo HELP_URL; ?>" target="_blank" class="text-info"><i class="fa-solid fa-life-ring mr-2 infotip" title="<?php echo $lang->get('admin_help'); ?>"></i></a>
642 642
                         <i class="fa-solid fa-bug infotip pointer text-info" title="<?php echo $lang->get('bugs_page'); ?>" onclick="generateBugReport()"></i>
@@ -940,18 +940,18 @@  discard block
 block discarded – undo
940 940
                     } elseif ($get['page'] === 'items') {
941 941
                         // SHow page with Items
942 942
                         if ((int) $session_user_admin !== 1) {
943
-                            include $SETTINGS['cpassman_dir'] . '/pages/items.php';
943
+                            include $SETTINGS['cpassman_dir'].'/pages/items.php';
944 944
                         } elseif ((int) $session_user_admin === 1) {
945
-                            include $SETTINGS['cpassman_dir'] . '/pages/admin.php';
945
+                            include $SETTINGS['cpassman_dir'].'/pages/admin.php';
946 946
                         } else {
947 947
                             $session->set('system-error_code', ERR_NOT_ALLOWED);
948 948
                             //not allowed page
949
-                            include $SETTINGS['cpassman_dir'] . '/error.php';
949
+                            include $SETTINGS['cpassman_dir'].'/error.php';
950 950
                         }
951 951
                     } elseif (in_array($get['page'], array_keys($mngPages)) === true) {
952 952
                         // Define if user is allowed to see management pages
953 953
                         if ($session_user_admin === 1) {
954
-                            include $SETTINGS['cpassman_dir'] . '/pages/' . $mngPages[$get['page']];
954
+                            include $SETTINGS['cpassman_dir'].'/pages/'.$mngPages[$get['page']];
955 955
                         } elseif ($session_user_manager === 1 || $session_user_human_resources === 1) {
956 956
                             if ($get['page'] !== 'manage_main'
957 957
                                 && $get['page'] !== 'manage_settings'
@@ -960,15 +960,15 @@  discard block
 block discarded – undo
960 960
                             } else {
961 961
                                 $session->set('system-error_code', ERR_NOT_ALLOWED);
962 962
                                 //not allowed page
963
-                                include $SETTINGS['cpassman_dir'] . '/error.php';
963
+                                include $SETTINGS['cpassman_dir'].'/error.php';
964 964
                             }
965 965
                         } else {
966 966
                             $session->set('system-error_code', ERR_NOT_ALLOWED);
967 967
                             //not allowed page
968
-                            include $SETTINGS['cpassman_dir'] . '/error.php';
968
+                            include $SETTINGS['cpassman_dir'].'/error.php';
969 969
                         }
970 970
                     } elseif (empty($get['page']) === false) {
971
-                        include $SETTINGS['cpassman_dir'] . '/pages/' . $get['page'] . '.php';
971
+                        include $SETTINGS['cpassman_dir'].'/pages/'.$get['page'].'.php';
972 972
                     } else {
973 973
                         $session->set('system-array_roles', ERR_NOT_EXIST);
974 974
                         //page doesn't exist
@@ -1017,7 +1017,7 @@  discard block
 block discarded – undo
1017 1017
         echo '
1018 1018
 <input type="hidden" id="temps_restant" value="', $session->get('user-session_duration') ?? '', '" />';
1019 1019
 // display an item in the context of OTV link
1020
-} elseif ((null === $session->get('user-validite_pw')|| empty($session->get('user-validite_pw')) === true || empty($session->get('user-id')) === true)
1020
+} elseif ((null === $session->get('user-validite_pw') || empty($session->get('user-validite_pw')) === true || empty($session->get('user-id')) === true)
1021 1021
     && empty($get['otv']) === false
1022 1022
 ) {
1023 1023
     // case where one-shot viewer
@@ -1036,7 +1036,7 @@  discard block
 block discarded – undo
1036 1036
                 FILTER_SANITIZE_URL
1037 1037
             )
1038 1038
         );
1039
-        include $SETTINGS['cpassman_dir'] . '/error.php';
1039
+        include $SETTINGS['cpassman_dir'].'/error.php';
1040 1040
     }
1041 1041
 } elseif (//(empty($session->get('user-id')) === false && $session->get('user-id') !== null) ||
1042 1042
         empty($session->get('user-id')) === true
@@ -1071,7 +1071,7 @@  discard block
 block discarded – undo
1071 1071
     //session_regenerate_id(true);
1072 1072
     error_log('index.php L1069');
1073 1073
     // LOGIN form
1074
-    include $SETTINGS['cpassman_dir'] . '/includes/core/login.php';
1074
+    include $SETTINGS['cpassman_dir'].'/includes/core/login.php';
1075 1075
 } else {
1076 1076
     // Clear session
1077 1077
     error_log('index.php L1074');
@@ -1291,61 +1291,61 @@  discard block
 block discarded – undo
1291 1291
 
1292 1292
 // Load links, css and javascripts
1293 1293
 if (isset($SETTINGS['cpassman_dir']) === true) {
1294
-    include_once $SETTINGS['cpassman_dir'] . '/includes/core/load.js.php';
1294
+    include_once $SETTINGS['cpassman_dir'].'/includes/core/load.js.php';
1295 1295
     if ($menuAdmin === true) {
1296
-        include_once $SETTINGS['cpassman_dir'] . '/pages/admin.js.php';
1296
+        include_once $SETTINGS['cpassman_dir'].'/pages/admin.js.php';
1297 1297
         if ($get['page'] === '2fa') {
1298
-            include_once $SETTINGS['cpassman_dir'] . '/pages/2fa.js.php';
1298
+            include_once $SETTINGS['cpassman_dir'].'/pages/2fa.js.php';
1299 1299
         } elseif ($get['page'] === 'api') {
1300
-            include_once $SETTINGS['cpassman_dir'] . '/pages/api.js.php';
1300
+            include_once $SETTINGS['cpassman_dir'].'/pages/api.js.php';
1301 1301
         } elseif ($get['page'] === 'backups') {
1302
-            include_once $SETTINGS['cpassman_dir'] . '/pages/backups.js.php';
1302
+            include_once $SETTINGS['cpassman_dir'].'/pages/backups.js.php';
1303 1303
         } elseif ($get['page'] === 'emails') {
1304
-            include_once $SETTINGS['cpassman_dir'] . '/pages/emails.js.php';
1304
+            include_once $SETTINGS['cpassman_dir'].'/pages/emails.js.php';
1305 1305
         } elseif ($get['page'] === 'ldap') {
1306
-            include_once $SETTINGS['cpassman_dir'] . '/pages/ldap.js.php';
1306
+            include_once $SETTINGS['cpassman_dir'].'/pages/ldap.js.php';
1307 1307
         } elseif ($get['page'] === 'uploads') {
1308
-            include_once $SETTINGS['cpassman_dir'] . '/pages/uploads.js.php';
1308
+            include_once $SETTINGS['cpassman_dir'].'/pages/uploads.js.php';
1309 1309
         } elseif ($get['page'] === 'fields') {
1310
-            include_once $SETTINGS['cpassman_dir'] . '/pages/fields.js.php';
1310
+            include_once $SETTINGS['cpassman_dir'].'/pages/fields.js.php';
1311 1311
         } elseif ($get['page'] === 'options') {
1312
-            include_once $SETTINGS['cpassman_dir'] . '/pages/options.js.php';
1312
+            include_once $SETTINGS['cpassman_dir'].'/pages/options.js.php';
1313 1313
         } elseif ($get['page'] === 'statistics') {
1314
-            include_once $SETTINGS['cpassman_dir'] . '/pages/statistics.js.php';
1314
+            include_once $SETTINGS['cpassman_dir'].'/pages/statistics.js.php';
1315 1315
         } elseif ($get['page'] === 'tasks') {
1316
-            include_once $SETTINGS['cpassman_dir'] . '/pages/tasks.js.php';
1316
+            include_once $SETTINGS['cpassman_dir'].'/pages/tasks.js.php';
1317 1317
         }
1318 1318
     } elseif (isset($get['page']) === true && $get['page'] !== '') {
1319 1319
         if ($get['page'] === 'items') {
1320
-            include_once $SETTINGS['cpassman_dir'] . '/pages/items.js.php';
1320
+            include_once $SETTINGS['cpassman_dir'].'/pages/items.js.php';
1321 1321
         } elseif ($get['page'] === 'import') {
1322
-            include_once $SETTINGS['cpassman_dir'] . '/pages/import.js.php';
1322
+            include_once $SETTINGS['cpassman_dir'].'/pages/import.js.php';
1323 1323
         } elseif ($get['page'] === 'export') {
1324
-            include_once $SETTINGS['cpassman_dir'] . '/pages/export.js.php';
1324
+            include_once $SETTINGS['cpassman_dir'].'/pages/export.js.php';
1325 1325
         } elseif ($get['page'] === 'offline') {
1326
-            include_once $SETTINGS['cpassman_dir'] . '/pages/offline.js.php';
1326
+            include_once $SETTINGS['cpassman_dir'].'/pages/offline.js.php';
1327 1327
         } elseif ($get['page'] === 'search') {
1328
-            include_once $SETTINGS['cpassman_dir'] . '/pages/search.js.php';
1328
+            include_once $SETTINGS['cpassman_dir'].'/pages/search.js.php';
1329 1329
         } elseif ($get['page'] === 'profile') {
1330
-            include_once $SETTINGS['cpassman_dir'] . '/pages/profile.js.php';
1330
+            include_once $SETTINGS['cpassman_dir'].'/pages/profile.js.php';
1331 1331
         } elseif ($get['page'] === 'favourites') {
1332
-            include_once $SETTINGS['cpassman_dir'] . '/pages/favorites.js.php';
1332
+            include_once $SETTINGS['cpassman_dir'].'/pages/favorites.js.php';
1333 1333
         } elseif ($get['page'] === 'folders') {
1334
-            include_once $SETTINGS['cpassman_dir'] . '/pages/folders.js.php';
1334
+            include_once $SETTINGS['cpassman_dir'].'/pages/folders.js.php';
1335 1335
         } elseif ($get['page'] === 'users') {
1336
-            include_once $SETTINGS['cpassman_dir'] . '/pages/users.js.php';
1336
+            include_once $SETTINGS['cpassman_dir'].'/pages/users.js.php';
1337 1337
         } elseif ($get['page'] === 'roles') {
1338
-            include_once $SETTINGS['cpassman_dir'] . '/pages/roles.js.php';
1338
+            include_once $SETTINGS['cpassman_dir'].'/pages/roles.js.php';
1339 1339
         } elseif ($get['page'] === 'utilities.deletion') {
1340
-            include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.deletion.js.php';
1340
+            include_once $SETTINGS['cpassman_dir'].'/pages/utilities.deletion.js.php';
1341 1341
         } elseif ($get['page'] === 'utilities.logs') {
1342
-            include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.logs.js.php';
1342
+            include_once $SETTINGS['cpassman_dir'].'/pages/utilities.logs.js.php';
1343 1343
         } elseif ($get['page'] === 'utilities.database') {
1344
-            include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.database.js.php';
1344
+            include_once $SETTINGS['cpassman_dir'].'/pages/utilities.database.js.php';
1345 1345
         } elseif ($get['page'] === 'utilities.renewal') {
1346
-            include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.renewal.js.php';
1346
+            include_once $SETTINGS['cpassman_dir'].'/pages/utilities.renewal.js.php';
1347 1347
         }
1348 1348
     } else {
1349
-        include_once $SETTINGS['cpassman_dir'] . '/includes/core/login.js.php';
1349
+        include_once $SETTINGS['cpassman_dir'].'/includes/core/login.js.php';
1350 1350
     }
1351 1351
 }
Please login to merge, or discard this patch.
sources/users.datatable.php 1 patch
Spacing   +12 added lines, -14 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 ) {
73 73
     // Not allowed page
74 74
     $session->set('system-error_code', ERR_NOT_ALLOWED);
75
-    include $SETTINGS['cpassman_dir'] . '/error.php';
75
+    include $SETTINGS['cpassman_dir'].'/error.php';
76 76
     exit;
77 77
 }
78 78
 
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
     if (isset($order['column']) && preg_match('#^(asc|desc)$#i', $order['dir'])) {
120 120
         $columnIndex = filter_var($order['column'], FILTER_SANITIZE_NUMBER_INT);
121 121
         $dir = filter_var($order['dir'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
122
-        $sOrder .= $aColumns[$columnIndex] . ' ' . $dir . ', ';
122
+        $sOrder .= $aColumns[$columnIndex].' '.$dir.', ';
123 123
     }
124 124
 
125 125
     $sOrder = substr_replace($sOrder, '', -2);
@@ -143,15 +143,15 @@  discard block
 block discarded – undo
143 143
 
144 144
 if ($letter !== '' && $letter !== 'None') {
145 145
     $sWhere .= ' AND (';
146
-    $sWhere .= $aColumns[1] . " LIKE '" . $letter . "%' OR ";
147
-    $sWhere .= $aColumns[2] . " LIKE '" . $letter . "%' OR ";
148
-    $sWhere .= $aColumns[3] . " LIKE '" . $letter . "%' ";
146
+    $sWhere .= $aColumns[1]." LIKE '".$letter."%' OR ";
147
+    $sWhere .= $aColumns[2]." LIKE '".$letter."%' OR ";
148
+    $sWhere .= $aColumns[3]." LIKE '".$letter."%' ";
149 149
     $sWhere .= ')';
150 150
 } elseif ($searchValue !== '') {
151 151
     $sWhere .= ' AND (';
152
-    $sWhere .= $aColumns[1] . " LIKE '" . $searchValue . "%' OR ";
153
-    $sWhere .= $aColumns[2] . " LIKE '" . $searchValue . "%' OR ";
154
-    $sWhere .= $aColumns[3] . " LIKE '" . $searchValue . "%' ";
152
+    $sWhere .= $aColumns[1]." LIKE '".$searchValue."%' OR ";
153
+    $sWhere .= $aColumns[2]." LIKE '".$searchValue."%' OR ";
154
+    $sWhere .= $aColumns[3]." LIKE '".$searchValue."%' ";
155 155
     $sWhere .= ')';
156 156
 }
157 157
 
@@ -239,22 +239,20 @@  discard block
 block discarded – undo
239 239
 
240 240
         // Get some infos about user
241 241
         $userDisplayInfos = 
242
-            (isset($userDate['date']) ? '<i class=\"fas fa-calendar-day infotip text-info ml-2\" title=\"'.$lang->get('creation_date').': '.date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $userDate['date']).'\"></i>' : '')
242
+            (isset($userDate['date']) ? '<i class=\"fas fa-calendar-day infotip text-info ml-2\" title=\"'.$lang->get('creation_date').': '.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $userDate['date']).'\"></i>' : '')
243 243
             .
244 244
             ((int) $record['last_connexion'] > 0 ? '<i class=\"far fa-clock infotip text-info ml-2\" title=\"'.$lang->get('index_last_seen').": ".
245
-            date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['last_connexion']).'\"></i>' : '')
245
+            date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['last_connexion']).'\"></i>' : '')
246 246
             .
247 247
             ((int) $record['user_ip'] > 0 ? '<i class=\"fas fa-street-view infotip text-info ml-1\" title=\"'.$lang->get('ip').": ".($record['user_ip']).'\"></i>' : '')
248 248
             .
249 249
             ($record['auth_type'] === 'ldap' ? '<i class=\"far fa-address-book infotip text-warning ml-1\" title=\"'.$lang->get('managed_through_ad').'\"></i>' : '')
250 250
             .
251 251
             ((in_array($record['id'], [OTV_USER_ID, TP_USER_ID, SSH_USER_ID, API_USER_ID]) === false && (int) $record['admin'] !== 1 && ((int) $SETTINGS['duo'] === 1 || (int) $SETTINGS['google_authentication'] === 1)) ?
252
-                ((int) $record['mfa_enabled'] === 1 ? '' : '<i class=\"fa-solid fa-fingerprint infotip ml-1\" style=\"color:Tomato\" title=\"'.$lang->get('mfa_disabled_for_user').'\"></i>') :
253
-                ''
252
+                ((int) $record['mfa_enabled'] === 1 ? '' : '<i class=\"fa-solid fa-fingerprint infotip ml-1\" style=\"color:Tomato\" title=\"'.$lang->get('mfa_disabled_for_user').'\"></i>') : ''
254 253
             ).
255 254
             ((in_array($record['id'], [OTV_USER_ID, TP_USER_ID, SSH_USER_ID, API_USER_ID]) === false && (int) $record['admin'] !== 1 && is_null($record['keys_recovery_time']) === true) ? 
256
-                '<i class=\"fa-solid fa-download infotip ml-1\" style=\"color:Tomato\" title=\"'.$lang->get('recovery_keys_not_downloaded').'\"></i>' :
257
-                ''
255
+                '<i class=\"fa-solid fa-download infotip ml-1\" style=\"color:Tomato\" title=\"'.$lang->get('recovery_keys_not_downloaded').'\"></i>' : ''
258 256
             );
259 257
         
260 258
         $sOutput .= '["<span data-id=\"'.$record['id'].'\" data-fullname=\"'.
Please login to merge, or discard this patch.
sources/expired.datatables.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 ) {
74 74
     // Not allowed page
75 75
     $session->set('system-error_code', ERR_NOT_ALLOWED);
76
-    include $SETTINGS['cpassman_dir'] . '/error.php';
76
+    include $SETTINGS['cpassman_dir'].'/error.php';
77 77
     exit;
78 78
 }
79 79
 
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 // Is a date sent?
99 99
 $dateCriteria = $request->query->get('dateCriteria');
100 100
 if ($dateCriteria !== null && !empty($dateCriteria)) {
101
-    $sWhere .= ' AND a.del_value < ' . round(filter_var($dateCriteria, FILTER_SANITIZE_NUMBER_INT) / 1000, 0);
101
+    $sWhere .= ' AND a.del_value < '.round(filter_var($dateCriteria, FILTER_SANITIZE_NUMBER_INT) / 1000, 0);
102 102
 }
103 103
 //echo $sWhere;
104 104
 /* BUILD QUERY */
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 $start = $request->query->getInt('start', 0);
108 108
 $length = $request->query->getInt('length', -1);
109 109
 if ($length !== -1) {
110
-    $sLimit = ' LIMIT ' . $start . ', ' . $length;
110
+    $sLimit = ' LIMIT '.$start.', '.$length;
111 111
 }
112 112
 
113 113
 //Ordering
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
         $columnIndex = filter_var($order[0]['column'], FILTER_SANITIZE_NUMBER_INT);
121 121
 
122 122
         if (array_key_exists($columnIndex, $aColumns)) {
123
-            $sOrder .= $aColumns[$columnIndex] . ' ' . $order[0]['dir'];
123
+            $sOrder .= $aColumns[$columnIndex].' '.$order[0]['dir'];
124 124
         }
125 125
 
126 126
         // Supprimez la virgule finale si elle existe
@@ -145,9 +145,9 @@  discard block
 block discarded – undo
145 145
 
146 146
     if ($letter !== '' && $letter !== 'None') {
147 147
         $sWhere .= ' AND ';
148
-        $sWhere .= $aColumns[1] . " LIKE '" . $letter . "%' OR ";
149
-        $sWhere .= $aColumns[2] . " LIKE '" . $letter . "%' OR ";
150
-        $sWhere .= $aColumns[3] . " LIKE '" . $letter . "%' ";
148
+        $sWhere .= $aColumns[1]." LIKE '".$letter."%' OR ";
149
+        $sWhere .= $aColumns[2]." LIKE '".$letter."%' OR ";
150
+        $sWhere .= $aColumns[3]." LIKE '".$letter."%' ";
151 151
     }
152 152
 }
153 153
 
@@ -159,26 +159,26 @@  discard block
 block discarded – undo
159 159
 
160 160
         if ($searchValue !== '') {
161 161
             $sWhere = ' AND ';
162
-            $sWhere .= $aColumns[1] . " LIKE '" . $searchValue . "%' OR ";
163
-            $sWhere .= $aColumns[2] . " LIKE '" . $searchValue . "%' OR ";
164
-            $sWhere .= $aColumns[3] . " LIKE '" . $searchValue . "%' ";
162
+            $sWhere .= $aColumns[1]." LIKE '".$searchValue."%' OR ";
163
+            $sWhere .= $aColumns[2]." LIKE '".$searchValue."%' OR ";
164
+            $sWhere .= $aColumns[3]." LIKE '".$searchValue."%' ";
165 165
         }
166 166
     }
167 167
 }
168 168
 
169 169
 $rows = DB::query(
170 170
     'SELECT a.item_id, i.label, a.del_value, i.id_tree
171
-    FROM ' . prefixTable('automatic_del') . ' AS a
172
-    INNER JOIN ' . prefixTable('items') . ' AS i ON (i.id = a.item_id)' .
171
+    FROM ' . prefixTable('automatic_del').' AS a
172
+    INNER JOIN ' . prefixTable('items').' AS i ON (i.id = a.item_id)'.
173 173
     $sWhere.
174 174
     (string) $sOrder
175 175
 );
176 176
 $iTotal = DB::count();
177 177
 $rows = DB::query(
178 178
     'SELECT a.item_id, i.label, a.del_value, i.id_tree
179
-    FROM ' . prefixTable('automatic_del') . ' AS a
180
-    INNER JOIN ' . prefixTable('items') . ' AS i ON (i.id = a.item_id)' .
181
-        $sWhere .
179
+    FROM ' . prefixTable('automatic_del').' AS a
180
+    INNER JOIN ' . prefixTable('items').' AS i ON (i.id = a.item_id)'.
181
+        $sWhere.
182 182
         $sLimit
183 183
 );
184 184
 $iFilteredTotal = DB::count();
@@ -196,18 +196,18 @@  discard block
 block discarded – undo
196 196
     // start the line
197 197
     $sOutput .= '[';
198 198
     // Column 1
199
-    $sOutput .= '"<i class=\"fas fa-external-link-alt pointer text-primary mr-2\" onclick=\"showItemCard($(this))\" data-item-id=\"' . $record['item_id'] . '\"  data-item-tree-id=\"' . $record['id_tree'] . '\"></i>", ';
199
+    $sOutput .= '"<i class=\"fas fa-external-link-alt pointer text-primary mr-2\" onclick=\"showItemCard($(this))\" data-item-id=\"'.$record['item_id'].'\"  data-item-tree-id=\"'.$record['id_tree'].'\"></i>", ';
200 200
     // Column 2
201
-    $sOutput .= '"' . $record['label'] . '", ';
201
+    $sOutput .= '"'.$record['label'].'", ';
202 202
     // Column 3
203
-    $sOutput .= '"' . date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['del_value']) . '", ';
203
+    $sOutput .= '"'.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['del_value']).'", ';
204 204
     // Column 4
205 205
     $path = [];
206 206
     $treeDesc = $tree->getPath($record['id_tree'], true);
207 207
     foreach ($treeDesc as $t) {
208 208
         array_push($path, $t->title);
209 209
     }
210
-    $sOutput .= '"' . implode('<i class=\"fas fa-angle-right ml-1 mr-1\"></i>', $path) . '"],';
210
+    $sOutput .= '"'.implode('<i class=\"fas fa-angle-right ml-1 mr-1\"></i>', $path).'"],';
211 211
 }
212 212
 
213 213
 if ($iTotal > 0) {
@@ -220,4 +220,4 @@  discard block
 block discarded – undo
220 220
 }
221 221
 
222 222
 // finalize output
223
-echo '{"recordsTotal": ' . $iTotal . ', "recordsFiltered": ' . $iFilteredTotal . ', "data": ' . $sOutput;
223
+echo '{"recordsTotal": '.$iTotal.', "recordsFiltered": '.$iFilteredTotal.', "data": '.$sOutput;
Please login to merge, or discard this patch.
sources/logs.datatables.php 1 patch
Spacing   +65 added lines, -66 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 ) {
72 72
     // Not allowed page
73 73
     $session->set('system-error_code', ERR_NOT_ALLOWED);
74
-    include $SETTINGS['cpassman_dir'] . '/error.php';
74
+    include $SETTINGS['cpassman_dir'].'/error.php';
75 75
     exit;
76 76
 }
77 77
 
@@ -115,9 +115,9 @@  discard block
 block discarded – undo
115 115
 
116 116
             $columnIndex = filter_var($order['column'], FILTER_SANITIZE_NUMBER_INT);
117 117
             $dir = filter_var($order['dir'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
118
-            $sOrder = 'ORDER BY ' . $aColumns[$columnIndex] . ' ' . $dir . ' ';
118
+            $sOrder = 'ORDER BY '.$aColumns[$columnIndex].' '.$dir.' ';
119 119
         } else {
120
-            $sOrder = 'ORDER BY ' . $aColumns[0] . ' DESC';
120
+            $sOrder = 'ORDER BY '.$aColumns[0].' DESC';
121 121
         }
122 122
     }
123 123
 
@@ -128,9 +128,9 @@  discard block
 block discarded – undo
128 128
         if ($searchValue !== '') {
129 129
             $sWhere .= ' AND (';
130 130
             foreach ($aColumns as $column) {
131
-                $sWhere .= $column . " LIKE '%" . $searchValue . "%' OR ";
131
+                $sWhere .= $column." LIKE '%".$searchValue."%' OR ";
132 132
             }
133
-            $sWhere = substr_replace($sWhere, '', -3) . ')';
133
+            $sWhere = substr_replace($sWhere, '', -3).')';
134 134
         }
135 135
     }
136 136
 
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
            * Output
156 156
         */
157 157
     $sOutput = '{';
158
-    $sOutput .= '"sEcho": '. (int) $request->query->get('draw') . ', ';
158
+    $sOutput .= '"sEcho": '.(int) $request->query->get('draw').', ';
159 159
     $sOutput .= '"iTotalRecords": '.$iTotal.', ';
160 160
     $sOutput .= '"iTotalDisplayRecords": '.$iTotal.', ';
161 161
     $sOutput .= '"aaData": ';
@@ -194,9 +194,9 @@  discard block
 block discarded – undo
194 194
 
195 195
         $columnIndex = filter_var($order['column'], FILTER_SANITIZE_NUMBER_INT);
196 196
         $dir = filter_var($order['dir'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
197
-        $sOrder = 'ORDER BY ' . $aColumns[$columnIndex] . ' ' . $dir . ' ';
197
+        $sOrder = 'ORDER BY '.$aColumns[$columnIndex].' '.$dir.' ';
198 198
     } else {
199
-        $sOrder = 'ORDER BY ' . $aColumns[0] . ' DESC';
199
+        $sOrder = 'ORDER BY '.$aColumns[0].' DESC';
200 200
     }
201 201
 
202 202
     // Filtering
@@ -205,9 +205,9 @@  discard block
 block discarded – undo
205 205
     if ($sSearch !== '') {
206 206
         $sWhere .= ' AND (';
207 207
         foreach ($aColumns as $i => $column) {
208
-            $sWhere .= $column . " LIKE '%". filter_var($sSearch, FILTER_SANITIZE_FULL_SPECIAL_CHARS) . "%' OR ";
208
+            $sWhere .= $column." LIKE '%".filter_var($sSearch, FILTER_SANITIZE_FULL_SPECIAL_CHARS)."%' OR ";
209 209
         }
210
-        $sWhere = substr_replace($sWhere, '', -3) . ')';
210
+        $sWhere = substr_replace($sWhere, '', -3).')';
211 211
     }
212 212
 
213 213
     $iTotal = DB::queryFirstField(
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
     $iFilteredTotal = DB::count();
231 231
     // Output
232 232
     $sOutput = '{';
233
-    $sOutput .= '"sEcho": '. (int) $request->query->get('draw') . ', ';
233
+    $sOutput .= '"sEcho": '.(int) $request->query->get('draw').', ';
234 234
     $sOutput .= '"iTotalRecords": '.$iTotal.', ';
235 235
     $sOutput .= '"iTotalDisplayRecords": '.$iTotal.', ';
236 236
     $sOutput .= '"aaData": ';
@@ -269,9 +269,9 @@  discard block
 block discarded – undo
269 269
 
270 270
         $columnIndex = filter_var($order['column'], FILTER_SANITIZE_NUMBER_INT);
271 271
         $dir = filter_var($order['dir'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
272
-        $sOrder = 'ORDER BY ' . $aColumns[$columnIndex] . ' ' . $dir . ' ';
272
+        $sOrder = 'ORDER BY '.$aColumns[$columnIndex].' '.$dir.' ';
273 273
     } else {
274
-        $sOrder = 'ORDER BY ' . $aColumns[0] . ' DESC';
274
+        $sOrder = 'ORDER BY '.$aColumns[0].' DESC';
275 275
     }
276 276
 
277 277
     // Filtering
@@ -280,9 +280,9 @@  discard block
 block discarded – undo
280 280
     if ($searchValue !== '') {
281 281
         $sWhere .= ' AND (';
282 282
         foreach ($aColumns as $column) {
283
-            $sWhere .= $column . " LIKE '%" . filter_var($searchValue, FILTER_SANITIZE_FULL_SPECIAL_CHARS) . "%' OR ";
283
+            $sWhere .= $column." LIKE '%".filter_var($searchValue, FILTER_SANITIZE_FULL_SPECIAL_CHARS)."%' OR ";
284 284
         }
285
-        $sWhere = substr_replace($sWhere, '', -3) . ')';
285
+        $sWhere = substr_replace($sWhere, '', -3).')';
286 286
     }
287 287
 
288 288
     $iTotal = DB::queryFirstField(
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
     $iFilteredTotal = DB::count();
306 306
     // Output
307 307
     $sOutput = '{';
308
-    $sOutput .= '"sEcho": '. (int) $request->query->get('draw') . ', ';
308
+    $sOutput .= '"sEcho": '.(int) $request->query->get('draw').', ';
309 309
     $sOutput .= '"iTotalRecords": '.$iTotal.', ';
310 310
     $sOutput .= '"iTotalDisplayRecords": '.$iTotal.', ';
311 311
     $sOutput .= '"aaData": ';
@@ -344,9 +344,9 @@  discard block
 block discarded – undo
344 344
         
345 345
         $columnIndex = filter_var($order['column'], FILTER_SANITIZE_NUMBER_INT);
346 346
         $dir = filter_var($order['dir'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
347
-        $sOrder = 'ORDER BY ' . $aColumns[$columnIndex] . ' ' . $dir . ' ';
347
+        $sOrder = 'ORDER BY '.$aColumns[$columnIndex].' '.$dir.' ';
348 348
     } else {
349
-        $sOrder = 'ORDER BY ' . $aColumns[0] . ' DESC';
349
+        $sOrder = 'ORDER BY '.$aColumns[0].' DESC';
350 350
     }
351 351
 
352 352
     // Filtering
@@ -355,9 +355,9 @@  discard block
 block discarded – undo
355 355
     if ($searchValue !== '') {
356 356
         $sWhere .= ' AND (';
357 357
         foreach ($aColumns as $column) {
358
-            $sWhere .= $column . " LIKE '%" . filter_var($searchValue, FILTER_SANITIZE_FULL_SPECIAL_CHARS) . "%' OR ";
358
+            $sWhere .= $column." LIKE '%".filter_var($searchValue, FILTER_SANITIZE_FULL_SPECIAL_CHARS)."%' OR ";
359 359
         }
360
-        $sWhere = substr_replace($sWhere, '', -3) . ')';
360
+        $sWhere = substr_replace($sWhere, '', -3).')';
361 361
     }
362 362
 
363 363
     $iTotal = DB::queryFirstField(
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
          * Output
380 380
         */
381 381
     $sOutput = '{';
382
-    $sOutput .= '"sEcho": '. (int) $request->query->get('draw') . ', ';
382
+    $sOutput .= '"sEcho": '.(int) $request->query->get('draw').', ';
383 383
     $sOutput .= '"iTotalRecords": '.$iTotal.', ';
384 384
     $sOutput .= '"iTotalDisplayRecords": '.$iTotal.', ';
385 385
     $sOutput .= '"aaData": [ ';
@@ -447,9 +447,9 @@  discard block
 block discarded – undo
447 447
 
448 448
         $columnIndex = filter_var($order['column'], FILTER_SANITIZE_NUMBER_INT);
449 449
         $dir = filter_var($order['dir'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
450
-        $sOrder = 'ORDER BY ' . $aColumns[$columnIndex] . ' ' . $dir . ' ';
450
+        $sOrder = 'ORDER BY '.$aColumns[$columnIndex].' '.$dir.' ';
451 451
     } else {
452
-        $sOrder = 'ORDER BY ' . $aColumns[0] . ' DESC';
452
+        $sOrder = 'ORDER BY '.$aColumns[0].' DESC';
453 453
     }
454 454
 
455 455
     // Filtering
@@ -459,12 +459,12 @@  discard block
 block discarded – undo
459 459
     if ($searchValue !== '') {
460 460
         $sWhere .= ' WHERE (';
461 461
         if (isset($search['column']) && $search['column'] !== 'all') {
462
-            $sWhere .= $search['column'] . " LIKE '%" . filter_var($searchValue, FILTER_SANITIZE_FULL_SPECIAL_CHARS) . "%') ";
462
+            $sWhere .= $search['column']." LIKE '%".filter_var($searchValue, FILTER_SANITIZE_FULL_SPECIAL_CHARS)."%') ";
463 463
         } else {
464 464
             foreach ($aColumns as $column) {
465
-                $sWhere .= $column . " LIKE '%" . filter_var($searchValue, FILTER_SANITIZE_FULL_SPECIAL_CHARS) . "%' OR ";
465
+                $sWhere .= $column." LIKE '%".filter_var($searchValue, FILTER_SANITIZE_FULL_SPECIAL_CHARS)."%' OR ";
466 466
             }
467
-            $sWhere = substr($sWhere, 0, -3) . ') ';
467
+            $sWhere = substr($sWhere, 0, -3).') ';
468 468
         }
469 469
     }
470 470
     
@@ -493,7 +493,7 @@  discard block
 block discarded – undo
493 493
     $iFilteredTotal = DB::count();
494 494
     // Output
495 495
     $sOutput = '{';
496
-    $sOutput .= '"sEcho": '. (int) $request->query->get('draw') . ', ';
496
+    $sOutput .= '"sEcho": '.(int) $request->query->get('draw').', ';
497 497
     $sOutput .= '"iTotalRecords": '.$iTotal.', ';
498 498
     $sOutput .= '"iTotalDisplayRecords": '.$iTotal.', ';
499 499
     $sOutput .= '"aaData": [ ';
@@ -542,9 +542,9 @@  discard block
 block discarded – undo
542 542
 
543 543
         $columnIndex = filter_var($order['column'], FILTER_SANITIZE_NUMBER_INT);
544 544
         $dir = filter_var($order['dir'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
545
-        $sOrder = 'ORDER BY ' . $aColumns[$columnIndex] . ' ' . $dir . ' ';
545
+        $sOrder = 'ORDER BY '.$aColumns[$columnIndex].' '.$dir.' ';
546 546
     } else {
547
-        $sOrder = 'ORDER BY ' . $aColumns[0] . ' DESC';
547
+        $sOrder = 'ORDER BY '.$aColumns[0].' DESC';
548 548
     }
549 549
 
550 550
     // Filtering
@@ -553,9 +553,9 @@  discard block
 block discarded – undo
553 553
     if ($searchValue !== '') {
554 554
         $sWhere .= ' AND (';
555 555
         foreach ($aColumns as $column) {
556
-            $sWhere .= $column . " LIKE '%" . filter_var($searchValue, FILTER_SANITIZE_FULL_SPECIAL_CHARS) . "%' OR ";
556
+            $sWhere .= $column." LIKE '%".filter_var($searchValue, FILTER_SANITIZE_FULL_SPECIAL_CHARS)."%' OR ";
557 557
         }
558
-        $sWhere = substr_replace($sWhere, '', -3) . ')';
558
+        $sWhere = substr_replace($sWhere, '', -3).')';
559 559
     }
560 560
 
561 561
     $iTotal = DB::queryFirstField(
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
         $iTotal = 0;
577 577
     }
578 578
     $sOutput = '{';
579
-    $sOutput .= '"sEcho": '. (int) $request->query->get('draw') . ', ';
579
+    $sOutput .= '"sEcho": '.(int) $request->query->get('draw').', ';
580 580
     $sOutput .= '"iTotalRecords": '.$iTotal.', ';
581 581
     $sOutput .= '"iTotalDisplayRecords": '.$iTotal.', ';
582 582
     $sOutput .= '"aaData": ';
@@ -618,9 +618,9 @@  discard block
 block discarded – undo
618 618
 
619 619
         $columnIndex = filter_var($order['column'], FILTER_SANITIZE_NUMBER_INT);
620 620
         $dir = filter_var($order['dir'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
621
-        $sOrder = 'ORDER BY ' . $aColumns[$columnIndex] . ' ' . $dir . ' ';
621
+        $sOrder = 'ORDER BY '.$aColumns[$columnIndex].' '.$dir.' ';
622 622
     } else {
623
-        $sOrder = 'ORDER BY ' . $aColumns[0] . ' DESC';
623
+        $sOrder = 'ORDER BY '.$aColumns[0].' DESC';
624 624
     }
625 625
 
626 626
     // Filtering
@@ -629,9 +629,9 @@  discard block
 block discarded – undo
629 629
     if ($searchValue !== '') {
630 630
         $sWhere .= ' AND (';
631 631
         foreach ($aColumns as $column) {
632
-            $sWhere .= $column . " LIKE '%" . filter_var($searchValue, FILTER_SANITIZE_FULL_SPECIAL_CHARS) . "%' OR ";
632
+            $sWhere .= $column." LIKE '%".filter_var($searchValue, FILTER_SANITIZE_FULL_SPECIAL_CHARS)."%' OR ";
633 633
         }
634
-        $sWhere = substr_replace($sWhere, '', -3) . ')';
634
+        $sWhere = substr_replace($sWhere, '', -3).')';
635 635
     }
636 636
 
637 637
     $iTotal = DB::queryFirstField(
@@ -653,7 +653,7 @@  discard block
 block discarded – undo
653 653
     $iFilteredTotal = DB::count();
654 654
     // Output
655 655
     $sOutput = '{';
656
-    $sOutput .= '"sEcho": '. (int) $request->query->get('draw') . ', ';
656
+    $sOutput .= '"sEcho": '.(int) $request->query->get('draw').', ';
657 657
     $sOutput .= '"iTotalRecords": '.$iTotal.', ';
658 658
     $sOutput .= '"iTotalDisplayRecords": '.$iTotal.', ';
659 659
     $sOutput .= '"aaData": ';
@@ -690,9 +690,9 @@  discard block
 block discarded – undo
690 690
 
691 691
         $columnIndex = filter_var($order['column'], FILTER_SANITIZE_NUMBER_INT);
692 692
         $dir = filter_var($order['dir'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
693
-        $sOrder = 'ORDER BY ' . $aColumns[$columnIndex] . ' ' . $dir . ' ';
693
+        $sOrder = 'ORDER BY '.$aColumns[$columnIndex].' '.$dir.' ';
694 694
     } else {
695
-        $sOrder = 'ORDER BY ' . $aColumns[0] . ' DESC';
695
+        $sOrder = 'ORDER BY '.$aColumns[0].' DESC';
696 696
     }
697 697
 
698 698
     // Filtering
@@ -701,9 +701,9 @@  discard block
 block discarded – undo
701 701
     if ($searchValue !== '') {
702 702
         $sWhere = ' WHERE (';
703 703
         foreach ($aColumns as $column) {
704
-            $sWhere .= $column . " LIKE '%" . filter_var($searchValue, FILTER_SANITIZE_FULL_SPECIAL_CHARS) . "%' OR ";
704
+            $sWhere .= $column." LIKE '%".filter_var($searchValue, FILTER_SANITIZE_FULL_SPECIAL_CHARS)."%' OR ";
705 705
         }
706
-        $sWhere = substr_replace($sWhere, '', -3) . ')';
706
+        $sWhere = substr_replace($sWhere, '', -3).')';
707 707
     }
708 708
 
709 709
     $iTotal = DB::queryFirstField(
@@ -726,7 +726,7 @@  discard block
 block discarded – undo
726 726
     $iFilteredTotal = DB::count();
727 727
     // Output
728 728
     $sOutput = '{';
729
-    $sOutput .= '"sEcho": '. (int) $request->query->get('draw') . ', ';
729
+    $sOutput .= '"sEcho": '.(int) $request->query->get('draw').', ';
730 730
     $sOutput .= '"iTotalRecords": '.$iTotal.', ';
731 731
     $sOutput .= '"iTotalDisplayRecords": '.$iTotal.', ';
732 732
     $sOutput .= '"aaData": ';
@@ -768,9 +768,9 @@  discard block
 block discarded – undo
768 768
 
769 769
         $columnIndex = filter_var($order['column'], FILTER_SANITIZE_NUMBER_INT);
770 770
         $dir = filter_var($order['dir'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
771
-        $sOrder = 'ORDER BY ' . $aColumns[$columnIndex] . ' ' . $dir . ' ';
771
+        $sOrder = 'ORDER BY '.$aColumns[$columnIndex].' '.$dir.' ';
772 772
     } else {
773
-        $sOrder = 'ORDER BY ' . $aColumns[0] . ' DESC';
773
+        $sOrder = 'ORDER BY '.$aColumns[0].' DESC';
774 774
     }
775 775
 
776 776
     // Where clause
@@ -779,9 +779,9 @@  discard block
 block discarded – undo
779 779
     if ($searchValue !== '') {
780 780
         $sWhere .= ' AND (';
781 781
         foreach ($aColumns as $column) {
782
-            $sWhere .= $column . " LIKE '%" . filter_var($searchValue, FILTER_SANITIZE_FULL_SPECIAL_CHARS) . "%' OR ";
782
+            $sWhere .= $column." LIKE '%".filter_var($searchValue, FILTER_SANITIZE_FULL_SPECIAL_CHARS)."%' OR ";
783 783
         }
784
-        $sWhere = substr_replace($sWhere, '', -3) . ') ';
784
+        $sWhere = substr_replace($sWhere, '', -3).') ';
785 785
     }
786 786
     $sWhere .= ') ';
787 787
     $iTotal = DB::queryFirstField(
@@ -799,7 +799,7 @@  discard block
 block discarded – undo
799 799
     $iFilteredTotal = DB::count();
800 800
     // Output
801 801
     $sOutput = '{';
802
-    $sOutput .= '"sEcho": '. (int) $request->query->get('draw') . ', ';
802
+    $sOutput .= '"sEcho": '.(int) $request->query->get('draw').', ';
803 803
     $sOutput .= '"iTotalRecords": '.$iTotal.', ';
804 804
     $sOutput .= '"iTotalDisplayRecords": '.$iTotal.', ';
805 805
     $sOutput .= '"aaData": ';
@@ -848,9 +848,9 @@  discard block
 block discarded – undo
848 848
 
849 849
         $columnIndex = filter_var($order['column'], FILTER_SANITIZE_NUMBER_INT);
850 850
         $dir = filter_var($order['dir'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
851
-        $sOrder = 'ORDER BY ' . $aColumns[$columnIndex] . ' ' . $dir . ' ';
851
+        $sOrder = 'ORDER BY '.$aColumns[$columnIndex].' '.$dir.' ';
852 852
     } else {
853
-        $sOrder = 'ORDER BY ' . $aColumns[0] . ' DESC';
853
+        $sOrder = 'ORDER BY '.$aColumns[0].' DESC';
854 854
     }
855 855
 
856 856
     // Where clause
@@ -859,9 +859,9 @@  discard block
 block discarded – undo
859 859
     if ($searchValue !== '') {
860 860
         $sWhere .= ' AND (';
861 861
         foreach ($aColumns as $column) {
862
-            $sWhere .= $column . " LIKE '%" . filter_var($searchValue, FILTER_SANITIZE_FULL_SPECIAL_CHARS) . "%' OR ";
862
+            $sWhere .= $column." LIKE '%".filter_var($searchValue, FILTER_SANITIZE_FULL_SPECIAL_CHARS)."%' OR ";
863 863
         }
864
-        $sWhere = substr_replace($sWhere, '', -3) . ')';
864
+        $sWhere = substr_replace($sWhere, '', -3).')';
865 865
     }
866 866
     $sWhere .= ') ';
867 867
     DB::debugmode(false);
@@ -882,7 +882,7 @@  discard block
 block discarded – undo
882 882
     $iFilteredTotal = DB::count();
883 883
     // Output
884 884
     $sOutput = '{';
885
-    $sOutput .= '"sEcho": '. (int) $request->query->get('draw') . ', ';
885
+    $sOutput .= '"sEcho": '.(int) $request->query->get('draw').', ';
886 886
     $sOutput .= '"iTotalRecords": '.$iTotal.', ';
887 887
     $sOutput .= '"iTotalDisplayRecords": '.$iTotal.', ';
888 888
     $sOutput .= '"aaData": ';
@@ -894,15 +894,15 @@  discard block
 block discarded – undo
894 894
         //col1
895 895
         $sOutput .= '"<span data-done=\"'.$record['is_in_progress'].'\" data-type=\"'.$record['process_type'].'\" data-process-id=\"'.$record['increment_id'].'\"></span>", ';
896 896
         //col2
897
-        $sOutput .= '"'.date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['created_at']).'", ';
897
+        $sOutput .= '"'.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['created_at']).'", ';
898 898
         //col3
899
-        $sOutput .= '"'.($record['updated_at'] === '' ? '-' : date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['updated_at'])).'", ';
899
+        $sOutput .= '"'.($record['updated_at'] === '' ? '-' : date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['updated_at'])).'", ';
900 900
         //col4
901 901
         $sOutput .= '"'.$record['process_type'].'", ';
902 902
         // col5
903 903
         if (in_array($record['process_type'], array('create_user_keys', 'item_copy')) === true) {
904 904
             $data_user = DB::queryfirstrow(
905
-                'SELECT name, lastname FROM ' . prefixTable('users') . '
905
+                'SELECT name, lastname FROM '.prefixTable('users').'
906 906
                 WHERE id = %i',
907 907
                 json_decode($record['arguments'], true)['new_user_id']
908 908
             );
@@ -934,9 +934,9 @@  discard block
 block discarded – undo
934 934
 
935 935
         $columnIndex = filter_var($order['column'], FILTER_SANITIZE_NUMBER_INT);
936 936
         $dir = filter_var($order['dir'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
937
-        $sOrder = 'ORDER BY ' . $aColumns[$columnIndex] . ' ' . $dir . ' ';
937
+        $sOrder = 'ORDER BY '.$aColumns[$columnIndex].' '.$dir.' ';
938 938
     } else {
939
-        $sOrder = 'ORDER BY ' . $aColumns[0] . ' DESC';
939
+        $sOrder = 'ORDER BY '.$aColumns[0].' DESC';
940 940
     }
941 941
 
942 942
     // Where clause
@@ -945,9 +945,9 @@  discard block
 block discarded – undo
945 945
     if ($searchValue !== '') {
946 946
         $sWhere .= ' AND (';
947 947
         foreach ($aColumns as $column) {
948
-            $sWhere .= $column . " LIKE '%" . filter_var($searchValue, FILTER_SANITIZE_FULL_SPECIAL_CHARS) . "%' OR ";
948
+            $sWhere .= $column." LIKE '%".filter_var($searchValue, FILTER_SANITIZE_FULL_SPECIAL_CHARS)."%' OR ";
949 949
         }
950
-        $sWhere = substr_replace($sWhere, '', -3) . ')';
950
+        $sWhere = substr_replace($sWhere, '', -3).')';
951 951
     }
952 952
     $sWhere .= ') ';
953 953
     
@@ -970,7 +970,7 @@  discard block
 block discarded – undo
970 970
     $iFilteredTotal = DB::count();
971 971
     // Output
972 972
     $sOutput = '{';
973
-    $sOutput .= '"sEcho": '. (int) $request->query->get('draw') . ', ';
973
+    $sOutput .= '"sEcho": '.(int) $request->query->get('draw').', ';
974 974
     $sOutput .= '"iTotalRecords": '.$iTotal.', ';
975 975
     $sOutput .= '"iTotalDisplayRecords": '.$iTotal.', ';
976 976
     $sOutput .= '"aaData": ';
@@ -986,13 +986,12 @@  discard block
 block discarded – undo
986 986
         //col1
987 987
         $sOutput .= '"", ';
988 988
         //col2
989
-        $sOutput .= '"'.date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['created_at']).'", ';
989
+        $sOutput .= '"'.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['created_at']).'", ';
990 990
         //col3
991 991
         $sOutput .= is_null($record['started_at']) === false ?
992
-            ('"'.date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['started_at']).'", ') :
993
-                ('"'.date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['created_at']).'", ');
992
+            ('"'.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['started_at']).'", ') : ('"'.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['created_at']).'", ');
994 993
         //col4
995
-        $sOutput .= '"'.date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['finished_at']).'", ';
994
+        $sOutput .= '"'.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['finished_at']).'", ';
996 995
         // col7
997 996
         $sOutput .= '"'.gmdate('H:i:s', (int) $record['finished_at'] - (is_null($record['started_at']) === false ? (int) $record['started_at'] : (int) $record['created_at'])).'",';
998 997
         //col5
@@ -1011,7 +1010,7 @@  discard block
 block discarded – undo
1011 1010
         $newUserId = array_key_exists('new_user_id', $arguments) ? $arguments['new_user_id'] : null;
1012 1011
         if ($record['process_type'] === 'create_user_keys' && is_null($newUserId) === false && empty($newUserId) === false) {
1013 1012
             $data_user = DB::queryfirstrow(
1014
-                'SELECT name, lastname, login FROM ' . prefixTable('users') . '
1013
+                'SELECT name, lastname, login FROM '.prefixTable('users').'
1015 1014
                 WHERE id = %i',
1016 1015
                 $newUserId
1017 1016
             );
@@ -1027,7 +1026,7 @@  discard block
 block discarded – undo
1027 1026
         } elseif ($record['process_type'] === 'user_build_cache_tree') {
1028 1027
             $user = json_decode($record['arguments'], true)['user_id'];
1029 1028
             $data_user = DB::queryfirstrow(
1030
-                'SELECT name, lastname, login FROM ' . prefixTable('users') . '
1029
+                'SELECT name, lastname, login FROM '.prefixTable('users').'
1031 1030
                 WHERE id = %i',
1032 1031
                 $user
1033 1032
             );
Please login to merge, or discard this patch.
pages/backups.js.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('backups') === false) {
69 69
     // Not allowed page
70 70
     $session->set('system-error_code', ERR_NOT_ALLOWED);
71
-    include $SETTINGS['cpassman_dir'] . '/error.php';
71
+    include $SETTINGS['cpassman_dir'].'/error.php';
72 72
     exit;
73 73
 }
74 74
 ?>
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
                             // ERROR
138 138
                             toastr.remove();
139 139
                             toastr.error(
140
-                                '<?php echo $lang->get('server_answer_error') . '<br />' . $lang->get('server_returned_data') . ':<br />'; ?>' + data.error,
140
+                                '<?php echo $lang->get('server_answer_error').'<br />'.$lang->get('server_returned_data').':<br />'; ?>' + data.error,
141 141
                                 '<?php echo $lang->get('error'); ?>', {
142 142
                                     timeOut: 5000,
143 143
                                     progressBar: true
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
                                         // error
165 165
                                         toastr.remove();
166 166
                                         toastr.error(
167
-                                            '<?php echo $lang->get('server_answer_error') . '<br />' . $lang->get('server_returned_data') . ':<br />'; ?>' + data.error,
167
+                                            '<?php echo $lang->get('server_answer_error').'<br />'.$lang->get('server_returned_data').':<br />'; ?>' + data.error,
168 168
                                             '<?php echo $lang->get('error'); ?>', {
169 169
                                                 timeOut: 5000,
170 170
                                                 progressBar: true
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
                             // ERROR
236 236
                             toastr.remove();
237 237
                             toastr.error(
238
-                                '<?php echo $lang->get('server_answer_error') . '<br />' . $lang->get('server_returned_data') . ':<br />'; ?>' + data.error,
238
+                                '<?php echo $lang->get('server_answer_error').'<br />'.$lang->get('server_returned_data').':<br />'; ?>' + data.error,
239 239
                                 '<?php echo $lang->get('error'); ?>', {
240 240
                                     timeOut: 5000,
241 241
                                     progressBar: true
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
     // PREPARE UPLOADER with plupload
272 272
 <?php
273 273
 $maxFileSize = (strrpos($SETTINGS['upload_maxfilesize'], 'mb') === false)
274
-    ? $SETTINGS['upload_maxfilesize'] . 'mb'
274
+    ? $SETTINGS['upload_maxfilesize'].'mb'
275 275
     : $SETTINGS['upload_maxfilesize'];
276 276
 ?>
277 277
 
Please login to merge, or discard this patch.
pages/utilities.logs.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('utilities.logs') === false) {
67 67
     // Not allowed page
68 68
     $session->set('system-error_code', ERR_NOT_ALLOWED);
69
-    include $SETTINGS['cpassman_dir'] . '/error.php';
69
+    include $SETTINGS['cpassman_dir'].'/error.php';
70 70
     exit;
71 71
 }
72 72
 
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
                                             echo $session->has('user-admin') && (int) $session->get('user-admin') && null !== $session->get('user-admin') && (int) $session->get('user-admin') === 1 ? '' : ' hidden';
204 204
                                             ?>">
205 205
                         <div class="form-group">
206
-                            <h5><i class="fas fa-broom mr-2"></i><?php echo $lang->get('purge') . ' ' . $lang->get('date_range'); ?></h5>
206
+                            <h5><i class="fas fa-broom mr-2"></i><?php echo $lang->get('purge').' '.$lang->get('date_range'); ?></h5>
207 207
                             <div class="input-group">
208 208
                                 <div class="input-group-prepend">
209 209
                                     <span class="input-group-text">
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
                                     <select class="form-control" id="purge-filter-user">
227 227
                                         <option value="-1"><?php echo $lang->get('all'); ?></option>
228 228
                                     <?php
229
-                                    $rows = DB::query('SELECT id, name, lastname FROM ' . prefixTable('users') . ' WHERE admin = 0');
229
+                                    $rows = DB::query('SELECT id, name, lastname FROM '.prefixTable('users').' WHERE admin = 0');
230 230
 foreach ($rows as $record) {
231 231
     echo '
232 232
                                         <option value="'.$record['id'].'">'.$record['name'].' '.$record['lastname'].'</option>';
Please login to merge, or discard this patch.
pages/profile.php 1 patch
Spacing   +33 added lines, -34 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('profile') === false) {
65 65
     // Not allowed page
66 66
     $session->set('system-error_code', ERR_NOT_ALLOWED);
67
-    include $SETTINGS['cpassman_dir'] . '/error.php';
67
+    include $SETTINGS['cpassman_dir'].'/error.php';
68 68
     exit;
69 69
 }
70 70
 
@@ -96,25 +96,25 @@  discard block
 block discarded – undo
96 96
 // prepare list of timezones
97 97
 $zones = timezone_list();
98 98
 // prepare list of languages
99
-$languages = DB::query('SELECT label, name FROM ' . prefixTable('languages') . ' ORDER BY label ASC');
99
+$languages = DB::query('SELECT label, name FROM '.prefixTable('languages').' ORDER BY label ASC');
100 100
 // Do some stats
101
-DB::query('SELECT id_item FROM ' . prefixTable('log_items') . ' WHERE action = "at_creation" AND  id_user = "' . $session->get('user-id') . '"');
101
+DB::query('SELECT id_item FROM '.prefixTable('log_items').' WHERE action = "at_creation" AND  id_user = "'.$session->get('user-id').'"');
102 102
 $userItemsNumber = DB::count();
103
-DB::query('SELECT id_item FROM ' . prefixTable('log_items') . ' WHERE action = "at_modification" AND  id_user = "' . $session->get('user-id') . '"');
103
+DB::query('SELECT id_item FROM '.prefixTable('log_items').' WHERE action = "at_modification" AND  id_user = "'.$session->get('user-id').'"');
104 104
 $userModificationNumber = DB::count();
105
-DB::query('SELECT id_item FROM ' . prefixTable('log_items') . ' WHERE action = "at_shown" AND  id_user = "' . $session->get('user-id') . '"');
105
+DB::query('SELECT id_item FROM '.prefixTable('log_items').' WHERE action = "at_shown" AND  id_user = "'.$session->get('user-id').'"');
106 106
 $userSeenItemsNumber = DB::count();
107
-DB::query('SELECT id_item FROM ' . prefixTable('log_items') . ' WHERE action = "at_password_shown" AND  id_user = "' . $session->get('user-id') . '"');
107
+DB::query('SELECT id_item FROM '.prefixTable('log_items').' WHERE action = "at_password_shown" AND  id_user = "'.$session->get('user-id').'"');
108 108
 $userSeenPasswordsNumber = DB::count();
109 109
 $userInfo = DB::queryFirstRow(
110 110
     'SELECT avatar, last_pw_change
111
-    FROM ' . prefixTable('users') . ' 
112
-    WHERE id = "' . $session->get('user-id') . '"'
111
+    FROM ' . prefixTable('users').' 
112
+    WHERE id = "' . $session->get('user-id').'"'
113 113
 );
114 114
 if (empty($userInfo['avatar']) === true) {
115
-    $avatar = $SETTINGS['cpassman_url'] . '/includes/images/photo.jpg';
115
+    $avatar = $SETTINGS['cpassman_url'].'/includes/images/photo.jpg';
116 116
 } else {
117
-    $avatar = $SETTINGS['cpassman_url'] . '/includes/avatars/' . $userInfo['avatar'];
117
+    $avatar = $SETTINGS['cpassman_url'].'/includes/avatars/'.$userInfo['avatar'];
118 118
 }
119 119
 
120 120
 // Get Groups name
@@ -122,8 +122,8 @@  discard block
 block discarded – undo
122 122
 foreach ($session->get('user-roles_array') as $role) {
123 123
     $tmp = DB::queryFirstRow(
124 124
         'SELECT title 
125
-        FROM ' . prefixTable('roles_title') . ' 
126
-        WHERE id = "' . $role . '"'
125
+        FROM ' . prefixTable('roles_title').' 
126
+        WHERE id = "' . $role.'"'
127 127
     );
128 128
     if ($tmp !== null) {
129 129
         array_push($userParOfGroups, $tmp['title']);
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
                         <h3 id="profile-username" class="text-center">
168 168
                             <?php
169 169
                             if (null !== $session->get('user-name') && empty($session->get('user-name')) === false) {
170
-                                echo $session->get('user-name') . ' ' . $session->get('user-lastname');
170
+                                echo $session->get('user-name').' '.$session->get('user-lastname');
171 171
                             } else {
172 172
                                 echo $session->get('user-login');
173 173
                             }
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
                                             } else {
236 236
                                                 echo date('d/m/Y', (int) $session->get('user-last_connection'));
237 237
                                             }
238
-                                            echo ' ' . $lang->get('at') . ' ';
238
+                                            echo ' '.$lang->get('at').' ';
239 239
                                             if (isset($SETTINGS['time_format']) === true) {
240 240
                                                 echo date($SETTINGS['time_format'], (int) $session->get('user-last_connection'));
241 241
                                             } else {
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
                                         </a>
246 246
                                     </li>
247 247
                                     <?php
248
-                                    if (null !== $session->get('user-last_pw_change') && ! empty($session->get('user-last_pw_change') === true)) {
248
+                                    if (null !== $session->get('user-last_pw_change') && !empty($session->get('user-last_pw_change') === true)) {
249 249
                                         // Handle last password change string
250 250
                                         if ($session->has('user-last_pw_change') && null !== $session->get('user-last_pw_change')) {
251 251
                                             if (isset($SETTINGS['date_format']) === true) {
@@ -265,12 +265,12 @@  discard block
 block discarded – undo
265 265
                                         ) {
266 266
                                             $numDaysBeforePwExpiration = '';
267 267
                                         } else {
268
-                                            $numDaysBeforePwExpiration = $LANG['index_pw_expiration'] . ' ' . $session->get('user-num_days_before_exp') . ' ' . $LANG['days'] . '.';
268
+                                            $numDaysBeforePwExpiration = $LANG['index_pw_expiration'].' '.$session->get('user-num_days_before_exp').' '.$LANG['days'].'.';
269 269
                                         }
270 270
                                         echo '
271 271
                                     <li class="list-group-item">
272
-                                        <b><i class="fas fa-calendar-alt fa-fw fa-lg mr-2"></i>' . $lang->get('index_last_pw_change') . '</b>
273
-                                        <a class="float-right">' . $last_pw_change . ' ' . $numDaysBeforePwExpiration . '</a>
272
+                                        <b><i class="fas fa-calendar-alt fa-fw fa-lg mr-2"></i>' . $lang->get('index_last_pw_change').'</b>
273
+                                        <a class="float-right">' . $last_pw_change.' '.$numDaysBeforePwExpiration.'</a>
274 274
                                     </li>';
275 275
                                     }
276 276
                                     ?>
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
                                     if (isset($SETTINGS['api']) === true && (int) $SETTINGS['api'] === 1) {
291 291
                                         echo '
292 292
                                     <li class="list-group-item">
293
-                                        <b><i class="fas fa-paper-plane fa-fw fa-lg mr-2"></i>' . $lang->get('user_profile_api_key') . '</b>
293
+                                        <b><i class="fas fa-paper-plane fa-fw fa-lg mr-2"></i>' . $lang->get('user_profile_api_key').'</b>
294 294
                                         <a class="float-right" id="profile-user-api-token">',
295 295
                                             null !== $session->get('user-api_key') ? $session->get('user-api_key') : '',
296 296
                                         '</a>
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
                                         <ul class="">
327 327
                                             <?php
328 328
                                                 foreach ($session->get('user-unsuccessfull_login_attempts_list') as $entry) {
329
-                                                    echo '<li class="">' . $entry . '</li>';
329
+                                                    echo '<li class="">'.$entry.'</li>';
330 330
                                                 } ?>
331 331
                                         </ul>
332 332
                                     </div>
@@ -339,12 +339,12 @@  discard block
 block discarded – undo
339 339
                                         <?php
340 340
                                         $rows = DB::query(
341 341
                                             'SELECT label AS labelAction, date, null
342
-                                                    FROM ' . prefixTable('log_system') . '
342
+                                                    FROM ' . prefixTable('log_system').'
343 343
                                                     WHERE qui = %i
344 344
                                                     UNION
345 345
                                                     SELECT l.action, l.date, i.label AS itemLabel
346
-                                                    FROM ' . prefixTable('log_items') . ' AS l
347
-                                                    INNER JOIN ' . prefixTable('items') . ' AS i ON (l.id_item = i.id)
346
+                                                    FROM ' . prefixTable('log_items').' AS l
347
+                                                    INNER JOIN ' . prefixTable('items').' AS i ON (l.id_item = i.id)
348 348
                                                     WHERE l.id_user = %i AND l.action IN ("at_access")
349 349
                                                     ORDER BY date DESC
350 350
                                                     LIMIT 0, 40',
@@ -358,9 +358,9 @@  discard block
 block discarded – undo
358 358
                                                 $text = $lang->get($record['labelAction']);
359 359
                                             }
360 360
                                             if (empty($record['NULL']) === false) {
361
-                                                $text .= ' ' . $lang->get('for') . ' <span class="font-weight-light">' . addslashes($record['NULL']) . '</span>';
361
+                                                $text .= ' '.$lang->get('for').' <span class="font-weight-light">'.addslashes($record['NULL']).'</span>';
362 362
                                             }
363
-                                            echo '<li class="list-group-item">' . date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['date']) . ' - ' . $text . '</li>';
363
+                                            echo '<li class="list-group-item">'.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['date']).' - '.$text.'</li>';
364 364
                                         }
365 365
                                         ?>
366 366
                                     </ul>
@@ -398,11 +398,10 @@  discard block
 block discarded – undo
398 398
                                                 <?php
399 399
                                                 foreach ($zones as $key => $zone) {
400 400
                                                     echo '
401
-                                                <option value="' . $key . '"',
401
+                                                <option value="' . $key.'"',
402 402
                                                     $session->has('user-timezone') && $session->get('user-timezone') && null !== $session->get('user-timezone') && $session->get('user-timezone') === $key ?
403
-                                                    ' selected' :
404
-                                                    (isset($SETTINGS['timezone']) === true && $SETTINGS['timezone'] === $key ? ' selected' : ''),
405
-                                                '>' . $zone . '</option>';
403
+                                                    ' selected' : (isset($SETTINGS['timezone']) === true && $SETTINGS['timezone'] === $key ? ' selected' : ''),
404
+                                                '>'.$zone.'</option>';
406 405
                                                 }
407 406
                                                 ?>
408 407
                                             </select>
@@ -414,10 +413,10 @@  discard block
 block discarded – undo
414 413
                                             <select class="form-control" id="profile-user-language">
415 414
                                                 <?php
416 415
                                                     foreach ($languages as $language) {
417
-                                                        echo '<option value="' . $language['name'] . '"',
416
+                                                        echo '<option value="'.$language['name'].'"',
418 417
                                                         strtolower($session->get('user-language')) === strtolower($language['name']) ?
419 418
                                                         ' selected="selected"' : '',
420
-                                                    '>' . $language['label'] . '</option>';
419
+                                                    '>'.$language['label'].'</option>';
421 420
                                                     }
422 421
                                                 ?>
423 422
                                             </select>
@@ -429,11 +428,11 @@  discard block
 block discarded – undo
429 428
                                         <div class="col-sm-10">
430 429
                                             <select class="form-control" id="profile-user-treeloadstrategy">
431 430
                                                 
432
-                                                <option value="sequential" <?php echo $session->has('user-tree_load_strategy') && $session->get('user-tree_load_strategy') && null !== $session->get('user-tree_load_strategy') && $session->get('user-tree_load_strategy') === 'sequential' ? ' selected' : '';?>>
431
+                                                <option value="sequential" <?php echo $session->has('user-tree_load_strategy') && $session->get('user-tree_load_strategy') && null !== $session->get('user-tree_load_strategy') && $session->get('user-tree_load_strategy') === 'sequential' ? ' selected' : ''; ?>>
433 432
                                                     <?php echo $lang->get('sequential'); ?>
434 433
                                                 </option>
435 434
                                                 
436
-                                                <option value="full" <?php echo $session->has('user-tree_load_strategy') && $session->get('user-tree_load_strategy') && null !== $session->get('user-tree_load_strategy') && $session->get('user-tree_load_strategy') === 'full' ? ' selected' : '';?>>
435
+                                                <option value="full" <?php echo $session->has('user-tree_load_strategy') && $session->get('user-tree_load_strategy') && null !== $session->get('user-tree_load_strategy') && $session->get('user-tree_load_strategy') === 'full' ? ' selected' : ''; ?>>
437 436
                                                     <?php echo $lang->get('full'); ?>
438 437
                                                 </option>
439 438
                                             </select>
@@ -468,7 +467,7 @@  discard block
 block discarded – undo
468 467
                                                 <button type="button" class="btn btn-warning float-right ml-2" id="profile-avatar-file"><?php echo $lang->get('upload_new_avatar'); ?></button>
469 468
                                                 <?php
470 469
                                                 if (isset($SETTINGS['api']) === true && (int) $SETTINGS['api'] === 1) {
471
-                                                    echo '<button type="button" class="btn btn-warning float-right" id="profile-button-api_token">' . $lang->get('generate_api_token') . '</button>';
470
+                                                    echo '<button type="button" class="btn btn-warning float-right" id="profile-button-api_token">'.$lang->get('generate_api_token').'</button>';
472 471
                                                 }
473 472
                                                 ?>
474 473
                                                 <div id="profile-avatar-file-container" class="hidden"></div>
Please login to merge, or discard this patch.
sources/core.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -54,16 +54,16 @@  discard block
 block discarded – undo
54 54
 {
55 55
     // Load AntiXSS
56 56
     $antiXss = new AntiXSS();
57
-    if (! headers_sent()) {    //If headers not sent yet... then do php redirect
58
-        header('Location: ' . $antiXss->xss_clean($url));
57
+    if (!headers_sent()) {    //If headers not sent yet... then do php redirect
58
+        header('Location: '.$antiXss->xss_clean($url));
59 59
     }
60 60
 
61 61
     //If headers are sent... do java redirect... if java disabled, do html redirect.
62 62
     echo '<script type="text/javascript">';
63
-    echo 'window.location.href="' . $antiXss->xss_clean($url) . '";';
63
+    echo 'window.location.href="'.$antiXss->xss_clean($url).'";';
64 64
     echo '</script>';
65 65
     echo '<noscript>';
66
-    echo '<meta http-equiv="refresh" content="0;url=' . $antiXss->xss_clean($url) . '" />';
66
+    echo '<meta http-equiv="refresh" content="0;url='.$antiXss->xss_clean($url).'" />';
67 67
     echo '</noscript>';
68 68
 }
69 69
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
     && isset($SETTINGS['enable_sts']) === true
90 90
     && (int) $SETTINGS['enable_sts'] === 1
91 91
 ) {
92
-    teampassRedirect('https://' . $server['http_host'] . $server['request_uri']);
92
+    teampassRedirect('https://'.$server['http_host'].$server['request_uri']);
93 93
 }
94 94
 
95 95
 // Load pwComplexity
@@ -110,11 +110,11 @@  discard block
 block discarded – undo
110 110
 // LOAD CPASSMAN SETTINGS
111 111
 if (
112 112
     isset($SETTINGS['cpassman_dir']) === true
113
-    && is_dir($SETTINGS['cpassman_dir'] . '/install') === true
113
+    && is_dir($SETTINGS['cpassman_dir'].'/install') === true
114 114
 ) {
115 115
     // Should we delete folder INSTALL?
116 116
     $row = DB::queryFirstRow(
117
-        'SELECT valeur FROM ' . prefixTable('misc') . ' WHERE type=%s AND intitule=%s',
117
+        'SELECT valeur FROM '.prefixTable('misc').' WHERE type=%s AND intitule=%s',
118 118
         'install',
119 119
         'clear_install_folder'
120 120
     );
@@ -132,11 +132,11 @@  discard block
 block discarded – undo
132 132
             if ($directories !== false) {
133 133
                 $files = array_diff($directories, ['.', '..']);
134 134
                 foreach ($files as $file) {
135
-                    if (is_dir($dir . '/' . $file)) {
136
-                        delTree($dir . '/' . $file);
135
+                    if (is_dir($dir.'/'.$file)) {
136
+                        delTree($dir.'/'.$file);
137 137
                     } else {
138 138
                         try {
139
-                            unlink($dir . '/' . $file);
139
+                            unlink($dir.'/'.$file);
140 140
                         } catch (Exception $e) {
141 141
                             // do nothing... php will ignore and continue
142 142
                         }
@@ -150,13 +150,13 @@  discard block
 block discarded – undo
150 150
             return false;
151 151
         }
152 152
 
153
-        if (is_dir($SETTINGS['cpassman_dir'] . '/install')) {
153
+        if (is_dir($SETTINGS['cpassman_dir'].'/install')) {
154 154
             // Set the permissions on the install directory and delete
155 155
             // is server Windows or Linux?
156 156
             if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
157
-                recursiveChmod($SETTINGS['cpassman_dir'] . '/install', 0755, 0440);
157
+                recursiveChmod($SETTINGS['cpassman_dir'].'/install', 0755, 0440);
158 158
             }
159
-            delTree($SETTINGS['cpassman_dir'] . '/install');
159
+            delTree($SETTINGS['cpassman_dir'].'/install');
160 160
         }
161 161
 
162 162
         // Delete temporary install table
@@ -174,10 +174,10 @@  discard block
 block discarded – undo
174 174
 // Load Languages stuff
175 175
 if (isset($languagesList) === false) {
176 176
     $languagesList = [];
177
-    $rows = DB::query('SELECT * FROM ' . prefixTable('languages') . ' GROUP BY name, label, code, flag, id ORDER BY name ASC');
177
+    $rows = DB::query('SELECT * FROM '.prefixTable('languages').' GROUP BY name, label, code, flag, id ORDER BY name ASC');
178 178
     foreach ($rows as $record) {
179 179
         array_push($languagesList, $record['name']);
180
-        if ($session->get('user-language') === $record['name'] ) {
180
+        if ($session->get('user-language') === $record['name']) {
181 181
             $session->set('user-language_flag', $record['flag']);
182 182
             $session->set('user-language_code', $record['code']);
183 183
             //$session->set('user-language_label', $record['label']);
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 // CHECK IF SESSION EXISTS AND IF SESSION IS VALID
236 236
 if (empty($session->get('user-session_duration')) === false) {
237 237
     $dataSession = DB::queryFirstRow(
238
-        'SELECT key_tempo FROM ' . prefixTable('users') . ' WHERE id=%i',
238
+        'SELECT key_tempo FROM '.prefixTable('users').' WHERE id=%i',
239 239
         $session->get('user-id')
240 240
     );
241 241
 } else {
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
     && ($session->has('user-admin') && $session->get('user-admin') && null !== $session->get('user-admin') && $session->get('user-admin') === 1)
300 300
 ) {
301 301
     $row = DB::queryFirstRow(
302
-        'SELECT valeur FROM ' . prefixTable('misc') . ' WHERE type=%s_type AND intitule=%s_intitule',
302
+        'SELECT valeur FROM '.prefixTable('misc').' WHERE type=%s_type AND intitule=%s_intitule',
303 303
         [
304 304
             'type' => 'admin',
305 305
             'intitule' => 'teampass_version',
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
 
341 341
         syslog(
342 342
             LOG_WARNING,
343
-            'Unlog user: ' . date('Y/m/d H:i:s') . " {$server['remote_addr']} ({$server['http_user_agent']})"
343
+            'Unlog user: '.date('Y/m/d H:i:s')." {$server['remote_addr']} ({$server['http_user_agent']})"
344 344
         );
345 345
         // erase session table
346 346
         $_SESSION = [];
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
 if ($session->has('user-timezone') && null !== $session->get('user-id') && empty($session->get('user-id')) === false) {
397 397
     // query on user
398 398
     $data = DB::queryfirstrow(
399
-        'SELECT login, admin, gestionnaire, can_manage_all_users, groupes_visibles, groupes_interdits, fonction_id, last_connexion, roles_from_ad_groups FROM ' . prefixTable('users') . ' WHERE id=%i',
399
+        'SELECT login, admin, gestionnaire, can_manage_all_users, groupes_visibles, groupes_interdits, fonction_id, last_connexion, roles_from_ad_groups FROM '.prefixTable('users').' WHERE id=%i',
400 400
         $session->get('user-id')
401 401
     );
402 402
     //Check if user has been deleted or unlogged
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
             $data['groupes_visibles'],
444 444
             $data['groupes_interdits'],
445 445
             $data['admin'],
446
-            is_null($data['roles_from_ad_groups']) === true ? $data['fonction_id'] : (empty($data['roles_from_ad_groups']) === true ? $data['fonction_id'] : $data['fonction_id'] . ';' . $data['roles_from_ad_groups']),
446
+            is_null($data['roles_from_ad_groups']) === true ? $data['fonction_id'] : (empty($data['roles_from_ad_groups']) === true ? $data['fonction_id'] : $data['fonction_id'].';'.$data['roles_from_ad_groups']),
447 447
             $SETTINGS
448 448
         );
449 449
         if ($session->has('user-can_create_root_folder') && (int) $session->get('user-can_create_root_folder') && null !== $session->get('user-can_create_root_folder') && (int) $session->get('user-can_create_root_folder') === 1) {
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
     $session->set('system-item_fields', []);
479 479
     $rows = DB::query(
480 480
         'SELECT *
481
-            FROM ' . prefixTable('categories') . '
481
+            FROM ' . prefixTable('categories').'
482 482
             WHERE level=%i',
483 483
         '0'
484 484
     );
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
         // get each field
488 488
         $rows2 = DB::query(
489 489
             'SELECT *
490
-            FROM ' . prefixTable('categories') . '
490
+            FROM ' . prefixTable('categories').'
491 491
             WHERE parent_id=%i
492 492
             ORDER BY `order` ASC',
493 493
             $record['id']
@@ -574,5 +574,5 @@  discard block
 block discarded – undo
574 574
 }
575 575
 
576 576
 /* CHECK NUMBER OF USER ONLINE */
577
-DB::query('SELECT * FROM ' . prefixTable('users') . ' WHERE timestamp>=%i', time() - 600);
577
+DB::query('SELECT * FROM '.prefixTable('users').' WHERE timestamp>=%i', time() - 600);
578 578
 $session->set('system-nb_users_online', DB::count());
Please login to merge, or discard this patch.