Passed
Push — teampass_3.0 ( 2c08f5...ae6be7 )
by Nils
04:47
created
sources/identify.php 1 patch
Spacing   +91 added lines, -91 removed lines patch added patch discarded remove patch
@@ -44,23 +44,23 @@  discard block
 block discarded – undo
44 44
     throw new Exception("Error file '/includes/config/tp.config.php' not exists", 1);
45 45
 }
46 46
 
47
-if (! isset($SETTINGS['cpassman_dir']) || empty($SETTINGS['cpassman_dir']) === true || $SETTINGS['cpassman_dir'] === '.') {
47
+if (!isset($SETTINGS['cpassman_dir']) || empty($SETTINGS['cpassman_dir']) === true || $SETTINGS['cpassman_dir'] === '.') {
48 48
     $SETTINGS = [];
49 49
     $SETTINGS['cpassman_dir'] = '..';
50 50
 }
51 51
 
52
-require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
53
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
54
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
52
+require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
53
+require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php';
54
+require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
55 55
 
56 56
 // If Debug then clean the files
57 57
 if (DEBUGLDAP === true) {
58
-    define('DEBUGLDAPFILE', $SETTINGS['path_to_files_folder'] . '/ldap.debug.txt');
58
+    define('DEBUGLDAPFILE', $SETTINGS['path_to_files_folder'].'/ldap.debug.txt');
59 59
     $fp = fopen(DEBUGLDAPFILE, 'w');
60 60
     fclose($fp);
61 61
 }
62 62
 if (DEBUGDUO === true) {
63
-    define('DEBUGDUOFILE', $SETTINGS['path_to_files_folder'] . '/duo.debug.txt');
63
+    define('DEBUGDUOFILE', $SETTINGS['path_to_files_folder'].'/duo.debug.txt');
64 64
     $fp = fopen(DEBUGDUOFILE, 'w');
65 65
     fclose($fp);
66 66
 }
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 if (defined('DB_PASSWD_CLEAR') === false) {
77 77
     define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
78 78
 }
79
-require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
79
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
80 80
 if (defined('DB_PASSWD_CLEAR') === false) {
81 81
     define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
82 82
 }
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
     // Get DUO keys
96 96
     $duoData = DB::query(
97 97
         'SELECT intitule, valeur
98
-        FROM ' . prefixTable('misc') . '
98
+        FROM ' . prefixTable('misc').'
99 99
         WHERE type = %s',
100 100
         'duoSecurity'
101 101
     );
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
     }
106 106
 
107 107
     // load library
108
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/DuoSecurity/Duo.php';
108
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/DuoSecurity/Duo.php';
109 109
     $sig_request = Duo::signRequest(
110 110
         $_GLOBALS['IKEY'],
111 111
         $_GLOBALS['SKEY'],
@@ -116,16 +116,16 @@  discard block
 block discarded – undo
116 116
         debugIdentify(
117 117
             DEBUGDUO,
118 118
             DEBUGDUOFILE,
119
-            "\n\n-----\n\n" .
120
-                'sig request : ' . $post_login . "\n" .
121
-                'resp : ' . $sig_request . "\n"
119
+            "\n\n-----\n\n".
120
+                'sig request : '.$post_login."\n".
121
+                'resp : '.$sig_request."\n"
122 122
         );
123 123
     }
124 124
 
125 125
     // load csrfprotector
126
-    $csrfp_config = include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/csrfp/libs/csrfp.config.php';
126
+    $csrfp_config = include_once $SETTINGS['cpassman_dir'].'/includes/libraries/csrfp/libs/csrfp.config.php';
127 127
     // return result
128
-    echo '[{"sig_request" : "' . $sig_request . '" , "csrfp_token" : "' . $csrfp_config['CSRFP_TOKEN'] . '" , "csrfp_key" : "' . filter_var($_COOKIE[$csrfp_config['CSRFP_TOKEN']], FILTER_SANITIZE_STRING) . '"}]';
128
+    echo '[{"sig_request" : "'.$sig_request.'" , "csrfp_token" : "'.$csrfp_config['CSRFP_TOKEN'].'" , "csrfp_key" : "'.filter_var($_COOKIE[$csrfp_config['CSRFP_TOKEN']], FILTER_SANITIZE_STRING).'"}]';
129 129
 // ---
130 130
     // ---
131 131
 } elseif ($post_type === 'identify_duo_user_check') {
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
     //--------
136 136
 
137 137
     // load library
138
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/DuoSecurity/Duo.php';
138
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/DuoSecurity/Duo.php';
139 139
     $authenticated_username = Duo::verifyResponse(
140 140
         $SETTINGS['duo_ikey'],
141 141
         $SETTINGS['duo_skey'],
@@ -146,9 +146,9 @@  discard block
 block discarded – undo
146 146
         debugIdentify(
147 147
             DEBUGDUO,
148 148
             DEBUGDUOFILE,
149
-            "\n\n-----\n\n" .
150
-                'sig response : ' . $post_sig_response . "\n" .
151
-                'resp : ' . $authenticated_username . "\n"
149
+            "\n\n-----\n\n".
150
+                'sig response : '.$post_sig_response."\n".
151
+                'resp : '.$authenticated_username."\n"
152 152
         );
153 153
     }
154 154
 
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
             // is user in Teampass?
160 160
             DB::queryfirstrow(
161 161
                 'SELECT id
162
-                FROM ' . prefixTable('users') . '
162
+                FROM ' . prefixTable('users').'
163 163
                 WHERE login = %s',
164 164
                 $post_login
165 165
             );
@@ -169,9 +169,9 @@  discard block
 block discarded – undo
169 169
             }
170 170
         }
171 171
 
172
-        echo '[{"authenticated_username" : "' . $authenticated_username . '"}]';
172
+        echo '[{"authenticated_username" : "'.$authenticated_username.'"}]';
173 173
     } else {
174
-        echo '[{"authenticated_username" : "' . $authenticated_username . '"}]';
174
+        echo '[{"authenticated_username" : "'.$authenticated_username.'"}]';
175 175
     }
176 176
     // ---
177 177
     // ---
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
     }
198 198
 
199 199
     // Load superGlobals
200
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
200
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
201 201
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
202 202
     // Prepare GET variables
203 203
     $sessionPwdAttempts = $superGlobal->get('pwd_attempts', 'SESSION');
@@ -285,19 +285,19 @@  discard block
 block discarded – undo
285 285
     } else {
286 286
         throw new Exception("Error file '/includes/config/tp.config.php' not exists", 1);
287 287
     }
288
-    include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
289
-    include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
290
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
288
+    include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
289
+    include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
290
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
291 291
     
292 292
     header('Content-type: text/html; charset=utf-8');
293 293
     error_reporting(E_ERROR);
294 294
 
295 295
     // Load AntiXSS
296
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/AntiXSS.php';
296
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/AntiXSS.php';
297 297
     $antiXss = new voku\helper\AntiXSS();
298 298
 
299 299
     // Load superGlobals
300
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
300
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
301 301
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
302 302
 
303 303
     // Prepare GET variables
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
     $server['PHP_AUTH_PW'] = $superGlobal->get('PHP_AUTH_PW', 'SERVER');
312 312
 
313 313
     // connect to the server
314
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
314
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
315 315
     DB::$host = DB_HOST;
316 316
     DB::$user = DB_USER;
317 317
     DB::$password = defined('DB_PASSWD_CLEAR') === false ? defuseReturnDecrypted(DB_PASSWD, $SETTINGS) : DB_PASSWD_CLEAR;
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
     DB::$port = DB_PORT;
320 320
     DB::$encoding = DB_ENCODING;
321 321
     // User's language loading
322
-    include_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $sessionUserLanguage . '.php';
322
+    include_once $SETTINGS['cpassman_dir'].'/includes/language/'.$sessionUserLanguage.'.php';
323 323
     
324 324
     // decrypt and retreive data in JSON format
325 325
     if (empty($sessionKey) === true) {
@@ -447,7 +447,7 @@  discard block
 block discarded – undo
447 447
         //$arrAttempts = array();
448 448
         $rows = DB::query(
449 449
             'SELECT date
450
-            FROM ' . prefixTable('log_system') . "
450
+            FROM ' . prefixTable('log_system')."
451 451
             WHERE field_1 = %s
452 452
             AND type = 'failed_auth'
453 453
             AND label = 'password_is_not_correct'
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
463 463
             foreach ($rows as $record) {
464 464
                 array_push(
465 465
                     $arrAttempts,
466
-                    date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['date'])
466
+                    date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['date'])
467 467
                 );
468 468
             }
469 469
         }
@@ -601,7 +601,7 @@  discard block
 block discarded – undo
601 601
         foreach ($superGlobal->get('user_roles', 'SESSION') as $role) {
602 602
             $resRoles = DB::queryFirstRow(
603 603
                 'SELECT title, complexity
604
-                FROM ' . prefixTable('roles_title') . '
604
+                FROM ' . prefixTable('roles_title').'
605 605
                 WHERE id=%i',
606 606
                 $role
607 607
             );
@@ -622,7 +622,7 @@  discard block
 block discarded – undo
622 622
 
623 623
         // build complete array of roles
624 624
         $superGlobal->put('arr_roles_full', [], 'SESSION');
625
-        $rows = DB::query('SELECT id, title FROM ' . prefixTable('roles_title') . ' ORDER BY title ASC');
625
+        $rows = DB::query('SELECT id, title FROM '.prefixTable('roles_title').' ORDER BY title ASC');
626 626
         foreach ($rows as $record) {
627 627
             $superGlobal->put(
628 628
                 $record['id'],
@@ -713,10 +713,10 @@  discard block
 block discarded – undo
713 713
         $superGlobal->put('latest_items_tab', [], 'SESSION');
714 714
         $superGlobal->put('nb_roles', 0, 'SESSION');
715 715
         foreach ($superGlobal->get('latest_items', 'SESSION') as $item) {
716
-            if (! empty($item)) {
716
+            if (!empty($item)) {
717 717
                 $dataLastItems = DB::queryFirstRow(
718 718
                     'SELECT id,label,id_tree
719
-                    FROM ' . prefixTable('items') . '
719
+                    FROM ' . prefixTable('items').'
720 720
                     WHERE id=%i',
721 721
                     $item
722 722
                 );
@@ -725,7 +725,7 @@  discard block
 block discarded – undo
725 725
                     [
726 726
                         'id' => $item,
727 727
                         'label' => $dataLastItems['label'],
728
-                        'url' => 'index.php?page=items&group=' . $dataLastItems['id_tree'] . '&id=' . $item,
728
+                        'url' => 'index.php?page=items&group='.$dataLastItems['id_tree'].'&id='.$item,
729 729
                     ],
730 730
                     'SESSION',
731 731
                     'latest_items_tab'
@@ -742,12 +742,12 @@  discard block
 block discarded – undo
742 742
         ) {
743 743
             // get all Admin users
744 744
             $receivers = '';
745
-            $rows = DB::query('SELECT email FROM ' . prefixTable('users') . " WHERE admin = %i and email != ''", 1);
745
+            $rows = DB::query('SELECT email FROM '.prefixTable('users')." WHERE admin = %i and email != ''", 1);
746 746
             foreach ($rows as $record) {
747 747
                 if (empty($receivers)) {
748 748
                     $receivers = $record['email'];
749 749
                 } else {
750
-                    $receivers = ',' . $record['email'];
750
+                    $receivers = ','.$record['email'];
751 751
                 }
752 752
             }
753 753
             // Add email to table
@@ -763,7 +763,7 @@  discard block
 block discarded – undo
763 763
                             '#tp_time#',
764 764
                         ],
765 765
                         [
766
-                            ' ' . $superGlobal->get('login', 'SESSION') . ' (IP: ' . getClientIpServer() . ')',
766
+                            ' '.$superGlobal->get('login', 'SESSION').' (IP: '.getClientIpServer().')',
767 767
                             date($SETTINGS['date_format'], (int) $superGlobal->get('last_connection', 'SESSION')),
768 768
                             date($SETTINGS['time_format'], (int) $superGlobal->get('last_connection', 'SESSION')),
769 769
                         ],
@@ -981,44 +981,44 @@  discard block
 block discarded – undo
981 981
     }
982 982
 
983 983
     // Load expected libraries
984
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Illuminate/Contracts/Auth/Authenticatable.php';
985
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Traits/EnumeratesValues.php';
986
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Traits/Macroable.php';
987
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/helpers.php';
988
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Arr.php';
989
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Contracts/Support/Jsonable.php';
990
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Contracts/Support/Arrayable.php';
991
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Enumerable.php';
992
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Collection.php';
993
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/CarbonTimeZone.php';
994
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Units.php';
995
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Week.php';
996
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Timestamp.php';
997
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Test.php';
998
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/ObjectInitialisation.php';
999
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Serialization.php';
1000
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/IntervalRounding.php';
1001
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Rounding.php';
1002
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Localization.php';
1003
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Options.php';
1004
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Cast.php';
1005
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Mutability.php';
1006
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Modifiers.php';
1007
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Mixin.php';
1008
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Macro.php';
1009
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Difference.php';
1010
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Creator.php';
1011
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Converter.php';
1012
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Comparison.php';
1013
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Boundaries.php';
1014
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Date.php';
1015
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/CarbonInterface.php';
1016
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Carbon.php';
1017
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/DetectsErrors.php';
1018
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/Connection.php';
1019
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/LdapInterface.php';
1020
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/LdapBase.php';
1021
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/Ldap.php';
984
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Illuminate/Contracts/Auth/Authenticatable.php';
985
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Traits/EnumeratesValues.php';
986
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Traits/Macroable.php';
987
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/helpers.php';
988
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Arr.php';
989
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Contracts/Support/Jsonable.php';
990
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Contracts/Support/Arrayable.php';
991
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Enumerable.php';
992
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Collection.php';
993
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/CarbonTimeZone.php';
994
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Units.php';
995
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Week.php';
996
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Timestamp.php';
997
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Test.php';
998
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/ObjectInitialisation.php';
999
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Serialization.php';
1000
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/IntervalRounding.php';
1001
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Rounding.php';
1002
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Localization.php';
1003
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Options.php';
1004
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Cast.php';
1005
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Mutability.php';
1006
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Modifiers.php';
1007
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Mixin.php';
1008
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Macro.php';
1009
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Difference.php';
1010
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Creator.php';
1011
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Converter.php';
1012
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Comparison.php';
1013
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Boundaries.php';
1014
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Date.php';
1015
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/CarbonInterface.php';
1016
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Carbon.php';
1017
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/DetectsErrors.php';
1018
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/Connection.php';
1019
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/LdapInterface.php';
1020
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/LdapBase.php';
1021
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/Ldap.php';
1022 1022
     $ad = new SplClassLoader('LdapRecord', '../includes/libraries');
1023 1023
     $ad->register();
1024 1024
     $connection = new Connection($config);
@@ -1030,7 +1030,7 @@  discard block
 block discarded – undo
1030 1030
         $error = $e->getDetailedError();
1031 1031
         return [
1032 1032
             'error' => true,
1033
-            'message' => langHdl('error').' : '.$error->getErrorCode().' - '.$error->getErrorMessage(). '<br>'.$error->getDiagnosticMessage().' '.$config['username'],
1033
+            'message' => langHdl('error').' : '.$error->getErrorCode().' - '.$error->getErrorMessage().'<br>'.$error->getDiagnosticMessage().' '.$config['username'],
1034 1034
 
1035 1035
         ];
1036 1036
     }
@@ -1058,7 +1058,7 @@  discard block
 block discarded – undo
1058 1058
     }
1059 1059
 
1060 1060
     // load passwordLib library
1061
-    $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'] . '/includes/libraries');
1061
+    $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'].'/includes/libraries');
1062 1062
     $pwdlib->register();
1063 1063
     $pwdlib = new PasswordLib\PasswordLib();
1064 1064
     $hashedPassword = $pwdlib->createPasswordHash($passwordClear);
@@ -1123,7 +1123,7 @@  discard block
 block discarded – undo
1123 1123
 function yubicoMFACheck($dataReceived, string $userInfo, array $SETTINGS): array
1124 1124
 {
1125 1125
     // Load superGlobals
1126
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1126
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1127 1127
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
1128 1128
     $sessionAdmin = $superGlobal->get('user_admin', 'SESSION');
1129 1129
     $sessionUrl = $superGlobal->get('initial_url', 'SESSION');
@@ -1162,7 +1162,7 @@  discard block
 block discarded – undo
1162 1162
     }
1163 1163
 
1164 1164
     // Now check yubico validity
1165
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/Yubico/Yubico.php';
1165
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/Yubico/Yubico.php';
1166 1166
     $yubi = new Auth_Yubico($yubico_user_id, $yubico_user_key);
1167 1167
     $auth = $yubi->verify($yubico_key);
1168 1168
     //, null, null, null, 60
@@ -1214,7 +1214,7 @@  discard block
 block discarded – undo
1214 1214
             'gestionnaire' => '0',
1215 1215
             'can_manage_all_users' => '0',
1216 1216
             'personal_folder' => $SETTINGS['enable_pf_feature'] === '1' ? '1' : '0',
1217
-            'fonction_id' => (empty($retLDAP['user_info_from_ad'][0]['commonGroupsLdapVsTeampass']) === false ? $retLDAP['user_info_from_ad'][0]['commonGroupsLdapVsTeampass'] . ';' : '') . (isset($SETTINGS['ldap_new_user_role']) === true ? $SETTINGS['ldap_new_user_role'] : '0'),
1217
+            'fonction_id' => (empty($retLDAP['user_info_from_ad'][0]['commonGroupsLdapVsTeampass']) === false ? $retLDAP['user_info_from_ad'][0]['commonGroupsLdapVsTeampass'].';' : '').(isset($SETTINGS['ldap_new_user_role']) === true ? $SETTINGS['ldap_new_user_role'] : '0'),
1218 1218
             'groupes_interdits' => '',
1219 1219
             'groupes_visibles' => '',
1220 1220
             'last_pw_change' => (int) time(),
@@ -1239,7 +1239,7 @@  discard block
 block discarded – undo
1239 1239
             ]
1240 1240
         );
1241 1241
         // Rebuild tree
1242
-        $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries');
1242
+        $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries');
1243 1243
         $tree->register();
1244 1244
         $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title');
1245 1245
         $tree->rebuild();
@@ -1270,13 +1270,13 @@  discard block
 block discarded – undo
1270 1270
         && empty($dataReceived['GACode']) === false
1271 1271
     ) {
1272 1272
         // Load superGlobals
1273
-        include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1273
+        include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1274 1274
         $superGlobal = new protect\SuperGlobal\SuperGlobal();
1275 1275
         $sessionAdmin = $superGlobal->get('user_admin', 'SESSION');
1276 1276
         $sessionUrl = $superGlobal->get('initial_url', 'SESSION');
1277 1277
         $sessionPwdAttempts = $superGlobal->get('pwd_attempts', 'SESSION');
1278 1278
         // load library
1279
-        include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/TwoFactorAuth/TwoFactorAuth.php';
1279
+        include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/TwoFactorAuth/TwoFactorAuth.php';
1280 1280
         // create new instance
1281 1281
         $tfa = new Authentication\TwoFactorAuth\TwoFactorAuth($SETTINGS['ga_website_name']);
1282 1282
         // Init
@@ -1298,7 +1298,7 @@  discard block
 block discarded – undo
1298 1298
             $mfaMessage = langHdl('ga_flash_qr_and_login');
1299 1299
             // generate new QR
1300 1300
             $new_2fa_qr = $tfa->getQRCodeImageAsDataUri(
1301
-                'Teampass - ' . $username,
1301
+                'Teampass - '.$username,
1302 1302
                 $userInfo['ga']
1303 1303
             );
1304 1304
             // clear temporary code from DB
@@ -1311,7 +1311,7 @@  discard block
 block discarded – undo
1311 1311
                 $userInfo['id']
1312 1312
             );
1313 1313
             $firstTime = [
1314
-                'value' => '<img src="' . $new_2fa_qr . '">',
1314
+                'value' => '<img src="'.$new_2fa_qr.'">',
1315 1315
                 'user_admin' => isset($sessionAdmin) ? (int) $sessionAdmin : '',
1316 1316
                 'initial_url' => isset($sessionUrl) === true ? $sessionUrl : '',
1317 1317
                 'pwd_attempts' => (int) $sessionPwdAttempts,
@@ -1363,8 +1363,8 @@  discard block
 block discarded – undo
1363 1363
     // Set to false
1364 1364
     $userPasswordVerified = false;
1365 1365
     // load passwordLib library
1366
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
1367
-    $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'] . '/includes/libraries');
1366
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
1367
+    $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'].'/includes/libraries');
1368 1368
     $pwdlib->register();
1369 1369
     $pwdlib = new PasswordLib\PasswordLib();
1370 1370
     // Check if old encryption used
@@ -1495,7 +1495,7 @@  discard block
 block discarded – undo
1495 1495
     // Brute force management
1496 1496
     if ($sessionPwdAttempts > 3) {
1497 1497
         // Load superGlobals
1498
-        include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1498
+        include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1499 1499
         $superGlobal = new protect\SuperGlobal\SuperGlobal();
1500 1500
         $superGlobal->put('next_possible_pwd_attempts', time() + 10, 'SESSION');
1501 1501
         $superGlobal->put('pwd_attempts', 0, 'SESSION');
@@ -1537,7 +1537,7 @@  discard block
 block discarded – undo
1537 1537
     // Check if user exists
1538 1538
     $userInfo = DB::queryFirstRow(
1539 1539
         'SELECT *
1540
-        FROM ' . prefixTable('users') . ' WHERE login=%s',
1540
+        FROM ' . prefixTable('users').' WHERE login=%s',
1541 1541
         $username
1542 1542
     );
1543 1543
     
Please login to merge, or discard this patch.
sources/main.functions.php 2 patches
Indentation   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -133,21 +133,21 @@  discard block
 block discarded – undo
133 133
 
134 134
     // Check if class already exists
135 135
     if (!class_exists('Defuse\Crypto\Crypto', false)) {
136
-		include_once $path . 'Exception/CryptoException.php';
137
-		include_once $path . 'Exception/BadFormatException.php';
138
-		include_once $path . 'Exception/EnvironmentIsBrokenException.php';
139
-		include_once $path . 'Exception/IOException.php';
140
-		include_once $path . 'Exception/WrongKeyOrModifiedCiphertextException.php';
141
-		include_once $path . 'Crypto.php';
142
-		include_once $path . 'Encoding.php';
143
-		include_once $path . 'DerivedKeys.php';
144
-		include_once $path . 'Key.php';
145
-		include_once $path . 'KeyOrPassword.php';
146
-		include_once $path . 'File.php';
147
-		include_once $path . 'RuntimeTests.php';
148
-		include_once $path . 'KeyProtectedByPassword.php';
149
-		include_once $path . 'Core.php';
150
-	}
136
+        include_once $path . 'Exception/CryptoException.php';
137
+        include_once $path . 'Exception/BadFormatException.php';
138
+        include_once $path . 'Exception/EnvironmentIsBrokenException.php';
139
+        include_once $path . 'Exception/IOException.php';
140
+        include_once $path . 'Exception/WrongKeyOrModifiedCiphertextException.php';
141
+        include_once $path . 'Crypto.php';
142
+        include_once $path . 'Encoding.php';
143
+        include_once $path . 'DerivedKeys.php';
144
+        include_once $path . 'Key.php';
145
+        include_once $path . 'KeyOrPassword.php';
146
+        include_once $path . 'File.php';
147
+        include_once $path . 'RuntimeTests.php';
148
+        include_once $path . 'KeyProtectedByPassword.php';
149
+        include_once $path . 'Core.php';
150
+    }
151 151
     
152 152
     // convert KEY
153 153
     $key = \Defuse\Crypto\Key::loadFromAsciiSafeString($ascii_key);
@@ -194,21 +194,21 @@  discard block
 block discarded – undo
194 194
 
195 195
     // Check if class already exists
196 196
     if (!class_exists('Defuse\Crypto\Crypto', false)) {
197
-		include_once $path . 'Exception/CryptoException.php';
198
-		include_once $path . 'Exception/BadFormatException.php';
199
-		include_once $path . 'Exception/EnvironmentIsBrokenException.php';
200
-		include_once $path . 'Exception/IOException.php';
201
-		include_once $path . 'Exception/WrongKeyOrModifiedCiphertextException.php';
202
-		include_once $path . 'Crypto.php';
203
-		include_once $path . 'Encoding.php';
204
-		include_once $path . 'DerivedKeys.php';
205
-		include_once $path . 'Key.php';
206
-		include_once $path . 'KeyOrPassword.php';
207
-		include_once $path . 'File.php';
208
-		include_once $path . 'RuntimeTests.php';
209
-		include_once $path . 'KeyProtectedByPassword.php';
210
-		include_once $path . 'Core.php';
211
-	}
197
+        include_once $path . 'Exception/CryptoException.php';
198
+        include_once $path . 'Exception/BadFormatException.php';
199
+        include_once $path . 'Exception/EnvironmentIsBrokenException.php';
200
+        include_once $path . 'Exception/IOException.php';
201
+        include_once $path . 'Exception/WrongKeyOrModifiedCiphertextException.php';
202
+        include_once $path . 'Crypto.php';
203
+        include_once $path . 'Encoding.php';
204
+        include_once $path . 'DerivedKeys.php';
205
+        include_once $path . 'Key.php';
206
+        include_once $path . 'KeyOrPassword.php';
207
+        include_once $path . 'File.php';
208
+        include_once $path . 'RuntimeTests.php';
209
+        include_once $path . 'KeyProtectedByPassword.php';
210
+        include_once $path . 'Core.php';
211
+    }
212 212
 
213 213
     $key = \Defuse\Crypto\Key::createNewRandomKey();
214 214
     $key = $key->saveToAsciiSafeString();
@@ -233,21 +233,21 @@  discard block
 block discarded – undo
233 233
 
234 234
     // Check if class already exists
235 235
     if (!class_exists('Defuse\Crypto\Crypto', false)) {
236
-		include_once $path . 'Exception/CryptoException.php';
237
-		include_once $path . 'Exception/BadFormatException.php';
238
-		include_once $path . 'Exception/EnvironmentIsBrokenException.php';
239
-		include_once $path . 'Exception/IOException.php';
240
-		include_once $path . 'Exception/WrongKeyOrModifiedCiphertextException.php';
241
-		include_once $path . 'Crypto.php';
242
-		include_once $path . 'Encoding.php';
243
-		include_once $path . 'DerivedKeys.php';
244
-		include_once $path . 'Key.php';
245
-		include_once $path . 'KeyOrPassword.php';
246
-		include_once $path . 'File.php';
247
-		include_once $path . 'RuntimeTests.php';
248
-		include_once $path . 'KeyProtectedByPassword.php';
249
-		include_once $path . 'Core.php';
250
-	}
236
+        include_once $path . 'Exception/CryptoException.php';
237
+        include_once $path . 'Exception/BadFormatException.php';
238
+        include_once $path . 'Exception/EnvironmentIsBrokenException.php';
239
+        include_once $path . 'Exception/IOException.php';
240
+        include_once $path . 'Exception/WrongKeyOrModifiedCiphertextException.php';
241
+        include_once $path . 'Crypto.php';
242
+        include_once $path . 'Encoding.php';
243
+        include_once $path . 'DerivedKeys.php';
244
+        include_once $path . 'Key.php';
245
+        include_once $path . 'KeyOrPassword.php';
246
+        include_once $path . 'File.php';
247
+        include_once $path . 'RuntimeTests.php';
248
+        include_once $path . 'KeyProtectedByPassword.php';
249
+        include_once $path . 'Core.php';
250
+    }
251 251
     $protected_key = \Defuse\Crypto\KeyProtectedByPassword::createRandomPasswordProtectedKey($psk);
252 252
     return $protected_key->saveToAsciiSafeString(); // save this in user table
253 253
 }
@@ -271,21 +271,21 @@  discard block
 block discarded – undo
271 271
 
272 272
     // Check if class already exists
273 273
     if (!class_exists('Defuse\Crypto\Crypto', false)) {
274
-		include_once $path . 'Exception/CryptoException.php';
275
-		include_once $path . 'Exception/BadFormatException.php';
276
-		include_once $path . 'Exception/EnvironmentIsBrokenException.php';
277
-		include_once $path . 'Exception/IOException.php';
278
-		include_once $path . 'Exception/WrongKeyOrModifiedCiphertextException.php';
279
-		include_once $path . 'Crypto.php';
280
-		include_once $path . 'Encoding.php';
281
-		include_once $path . 'DerivedKeys.php';
282
-		include_once $path . 'Key.php';
283
-		include_once $path . 'KeyOrPassword.php';
284
-		include_once $path . 'File.php';
285
-		include_once $path . 'RuntimeTests.php';
286
-		include_once $path . 'KeyProtectedByPassword.php';
287
-		include_once $path . 'Core.php';
288
-	}
274
+        include_once $path . 'Exception/CryptoException.php';
275
+        include_once $path . 'Exception/BadFormatException.php';
276
+        include_once $path . 'Exception/EnvironmentIsBrokenException.php';
277
+        include_once $path . 'Exception/IOException.php';
278
+        include_once $path . 'Exception/WrongKeyOrModifiedCiphertextException.php';
279
+        include_once $path . 'Crypto.php';
280
+        include_once $path . 'Encoding.php';
281
+        include_once $path . 'DerivedKeys.php';
282
+        include_once $path . 'Key.php';
283
+        include_once $path . 'KeyOrPassword.php';
284
+        include_once $path . 'File.php';
285
+        include_once $path . 'RuntimeTests.php';
286
+        include_once $path . 'KeyProtectedByPassword.php';
287
+        include_once $path . 'Core.php';
288
+    }
289 289
 
290 290
     try {
291 291
         $protected_key = \Defuse\Crypto\KeyProtectedByPassword::loadFromAsciiSafeString($protected_key_encoded);
@@ -2258,7 +2258,7 @@  discard block
 block discarded – undo
2258 2258
  * <tt>exec("find ".$path." -type d -exec chmod 755 {} \;");</tt>
2259 2259
  *
2260 2260
  * @author Jeppe Toustrup (tenzer at tenzer dot dk)
2261
-  *
2261
+ *
2262 2262
  * @param string $path      An either relative or absolute path to a file or directory which should be processed.
2263 2263
  * @param int    $filePerm The permissions any found files should get.
2264 2264
  * @param int    $dirPerm  The permissions any found folder should get.
Please login to merge, or discard this patch.
Spacing   +235 added lines, -235 removed lines patch added patch discarded remove patch
@@ -122,31 +122,31 @@  discard block
 block discarded – undo
122 122
  */
123 123
 function cryption(string $message, string $ascii_key, string $type, array $SETTINGS): array
124 124
 {
125
-    $ascii_key = empty($ascii_key) === true ? file_get_contents(SECUREPATH . '/teampass-seckey.txt') : $ascii_key;
125
+    $ascii_key = empty($ascii_key) === true ? file_get_contents(SECUREPATH.'/teampass-seckey.txt') : $ascii_key;
126 126
     $err = false;
127 127
     // load PhpEncryption library
128 128
     if (isset($SETTINGS['cpassman_dir']) === false || empty($SETTINGS['cpassman_dir']) === true) {
129 129
         $path = '../includes/libraries/Encryption/Encryption/';
130 130
     } else {
131
-        $path = $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/Encryption/';
131
+        $path = $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/';
132 132
     }
133 133
 
134 134
     // Check if class already exists
135 135
     if (!class_exists('Defuse\Crypto\Crypto', false)) {
136
-		include_once $path . 'Exception/CryptoException.php';
137
-		include_once $path . 'Exception/BadFormatException.php';
138
-		include_once $path . 'Exception/EnvironmentIsBrokenException.php';
139
-		include_once $path . 'Exception/IOException.php';
140
-		include_once $path . 'Exception/WrongKeyOrModifiedCiphertextException.php';
141
-		include_once $path . 'Crypto.php';
142
-		include_once $path . 'Encoding.php';
143
-		include_once $path . 'DerivedKeys.php';
144
-		include_once $path . 'Key.php';
145
-		include_once $path . 'KeyOrPassword.php';
146
-		include_once $path . 'File.php';
147
-		include_once $path . 'RuntimeTests.php';
148
-		include_once $path . 'KeyProtectedByPassword.php';
149
-		include_once $path . 'Core.php';
136
+		include_once $path.'Exception/CryptoException.php';
137
+		include_once $path.'Exception/BadFormatException.php';
138
+		include_once $path.'Exception/EnvironmentIsBrokenException.php';
139
+		include_once $path.'Exception/IOException.php';
140
+		include_once $path.'Exception/WrongKeyOrModifiedCiphertextException.php';
141
+		include_once $path.'Crypto.php';
142
+		include_once $path.'Encoding.php';
143
+		include_once $path.'DerivedKeys.php';
144
+		include_once $path.'Key.php';
145
+		include_once $path.'KeyOrPassword.php';
146
+		include_once $path.'File.php';
147
+		include_once $path.'RuntimeTests.php';
148
+		include_once $path.'KeyProtectedByPassword.php';
149
+		include_once $path.'Core.php';
150 150
 	}
151 151
     
152 152
     // convert KEY
@@ -194,20 +194,20 @@  discard block
 block discarded – undo
194 194
 
195 195
     // Check if class already exists
196 196
     if (!class_exists('Defuse\Crypto\Crypto', false)) {
197
-		include_once $path . 'Exception/CryptoException.php';
198
-		include_once $path . 'Exception/BadFormatException.php';
199
-		include_once $path . 'Exception/EnvironmentIsBrokenException.php';
200
-		include_once $path . 'Exception/IOException.php';
201
-		include_once $path . 'Exception/WrongKeyOrModifiedCiphertextException.php';
202
-		include_once $path . 'Crypto.php';
203
-		include_once $path . 'Encoding.php';
204
-		include_once $path . 'DerivedKeys.php';
205
-		include_once $path . 'Key.php';
206
-		include_once $path . 'KeyOrPassword.php';
207
-		include_once $path . 'File.php';
208
-		include_once $path . 'RuntimeTests.php';
209
-		include_once $path . 'KeyProtectedByPassword.php';
210
-		include_once $path . 'Core.php';
197
+		include_once $path.'Exception/CryptoException.php';
198
+		include_once $path.'Exception/BadFormatException.php';
199
+		include_once $path.'Exception/EnvironmentIsBrokenException.php';
200
+		include_once $path.'Exception/IOException.php';
201
+		include_once $path.'Exception/WrongKeyOrModifiedCiphertextException.php';
202
+		include_once $path.'Crypto.php';
203
+		include_once $path.'Encoding.php';
204
+		include_once $path.'DerivedKeys.php';
205
+		include_once $path.'Key.php';
206
+		include_once $path.'KeyOrPassword.php';
207
+		include_once $path.'File.php';
208
+		include_once $path.'RuntimeTests.php';
209
+		include_once $path.'KeyProtectedByPassword.php';
210
+		include_once $path.'Core.php';
211 211
 	}
212 212
 
213 213
     $key = \Defuse\Crypto\Key::createNewRandomKey();
@@ -233,20 +233,20 @@  discard block
 block discarded – undo
233 233
 
234 234
     // Check if class already exists
235 235
     if (!class_exists('Defuse\Crypto\Crypto', false)) {
236
-		include_once $path . 'Exception/CryptoException.php';
237
-		include_once $path . 'Exception/BadFormatException.php';
238
-		include_once $path . 'Exception/EnvironmentIsBrokenException.php';
239
-		include_once $path . 'Exception/IOException.php';
240
-		include_once $path . 'Exception/WrongKeyOrModifiedCiphertextException.php';
241
-		include_once $path . 'Crypto.php';
242
-		include_once $path . 'Encoding.php';
243
-		include_once $path . 'DerivedKeys.php';
244
-		include_once $path . 'Key.php';
245
-		include_once $path . 'KeyOrPassword.php';
246
-		include_once $path . 'File.php';
247
-		include_once $path . 'RuntimeTests.php';
248
-		include_once $path . 'KeyProtectedByPassword.php';
249
-		include_once $path . 'Core.php';
236
+		include_once $path.'Exception/CryptoException.php';
237
+		include_once $path.'Exception/BadFormatException.php';
238
+		include_once $path.'Exception/EnvironmentIsBrokenException.php';
239
+		include_once $path.'Exception/IOException.php';
240
+		include_once $path.'Exception/WrongKeyOrModifiedCiphertextException.php';
241
+		include_once $path.'Crypto.php';
242
+		include_once $path.'Encoding.php';
243
+		include_once $path.'DerivedKeys.php';
244
+		include_once $path.'Key.php';
245
+		include_once $path.'KeyOrPassword.php';
246
+		include_once $path.'File.php';
247
+		include_once $path.'RuntimeTests.php';
248
+		include_once $path.'KeyProtectedByPassword.php';
249
+		include_once $path.'Core.php';
250 250
 	}
251 251
     $protected_key = \Defuse\Crypto\KeyProtectedByPassword::createRandomPasswordProtectedKey($psk);
252 252
     return $protected_key->saveToAsciiSafeString(); // save this in user table
@@ -271,20 +271,20 @@  discard block
 block discarded – undo
271 271
 
272 272
     // Check if class already exists
273 273
     if (!class_exists('Defuse\Crypto\Crypto', false)) {
274
-		include_once $path . 'Exception/CryptoException.php';
275
-		include_once $path . 'Exception/BadFormatException.php';
276
-		include_once $path . 'Exception/EnvironmentIsBrokenException.php';
277
-		include_once $path . 'Exception/IOException.php';
278
-		include_once $path . 'Exception/WrongKeyOrModifiedCiphertextException.php';
279
-		include_once $path . 'Crypto.php';
280
-		include_once $path . 'Encoding.php';
281
-		include_once $path . 'DerivedKeys.php';
282
-		include_once $path . 'Key.php';
283
-		include_once $path . 'KeyOrPassword.php';
284
-		include_once $path . 'File.php';
285
-		include_once $path . 'RuntimeTests.php';
286
-		include_once $path . 'KeyProtectedByPassword.php';
287
-		include_once $path . 'Core.php';
274
+		include_once $path.'Exception/CryptoException.php';
275
+		include_once $path.'Exception/BadFormatException.php';
276
+		include_once $path.'Exception/EnvironmentIsBrokenException.php';
277
+		include_once $path.'Exception/IOException.php';
278
+		include_once $path.'Exception/WrongKeyOrModifiedCiphertextException.php';
279
+		include_once $path.'Crypto.php';
280
+		include_once $path.'Encoding.php';
281
+		include_once $path.'DerivedKeys.php';
282
+		include_once $path.'Key.php';
283
+		include_once $path.'KeyOrPassword.php';
284
+		include_once $path.'File.php';
285
+		include_once $path.'RuntimeTests.php';
286
+		include_once $path.'KeyProtectedByPassword.php';
287
+		include_once $path.'Core.php';
288 288
 	}
289 289
 
290 290
     try {
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
  */
326 326
 function trimElement($chaine, string $element): string
327 327
 {
328
-    if (! empty($chaine)) {
328
+    if (!empty($chaine)) {
329 329
         if (is_array($chaine) === true) {
330 330
             $chaine = implode(';', $chaine);
331 331
         }
@@ -371,8 +371,8 @@  discard block
 block discarded – undo
371 371
  */
372 372
 function db_error_handler(array $params): void
373 373
 {
374
-    echo 'Error: ' . $params['error'] . "<br>\n";
375
-    echo 'Query: ' . $params['query'] . "<br>\n";
374
+    echo 'Error: '.$params['error']."<br>\n";
375
+    echo 'Query: '.$params['query']."<br>\n";
376 376
     throw new Exception('Error - Query', 1);
377 377
 }
378 378
 
@@ -394,12 +394,12 @@  discard block
 block discarded – undo
394 394
     $SETTINGS
395 395
 ) {
396 396
     //load ClassLoader
397
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
397
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
398 398
     // Load superglobal
399
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
399
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
400 400
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
401 401
     //Connect to DB
402
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
402
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
403 403
     if (defined('DB_PASSWD_CLEAR') === false) {
404 404
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
405 405
     }
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
     DB::$port = DB_PORT;
411 411
     DB::$encoding = DB_ENCODING;
412 412
     //Build tree
413
-    $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries');
413
+    $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries');
414 414
     $tree->register();
415 415
     $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title');
416 416
     // Check if user is ADMINISTRATOR
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
 function identAdmin($idFonctions, $SETTINGS, $tree)
454 454
 {
455 455
     // Load superglobal
456
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
456
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
457 457
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
458 458
     // Init
459 459
     $groupesVisibles = [];
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
     $globalsVisibleFolders = $superGlobal->get('groupes_visibles', 'SESSION');
473 473
     $globalsPersonalVisibleFolders = $superGlobal->get('personal_visible_groups', 'SESSION');
474 474
     // Get list of Folders
475
-    $rows = DB::query('SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE personal_folder = %i', 0);
475
+    $rows = DB::query('SELECT id FROM '.prefixTable('nested_tree').' WHERE personal_folder = %i', 0);
476 476
     foreach ($rows as $record) {
477 477
         array_push($groupesVisibles, $record['id']);
478 478
     }
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
     }
492 492
     // Get ID of personal folder
493 493
     $persfld = DB::queryfirstrow(
494
-        'SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE title = %s',
494
+        'SELECT id FROM '.prefixTable('nested_tree').' WHERE title = %s',
495 495
         $globalsUserId
496 496
     );
497 497
     if (empty($persfld['id']) === false) {
@@ -512,20 +512,20 @@  discard block
 block discarded – undo
512 512
     // get complete list of ROLES
513 513
     $tmp = explode(';', $idFonctions);
514 514
     $rows = DB::query(
515
-        'SELECT * FROM ' . prefixTable('roles_title') . '
515
+        'SELECT * FROM '.prefixTable('roles_title').'
516 516
         ORDER BY title ASC'
517 517
     );
518 518
     foreach ($rows as $record) {
519
-        if (! empty($record['id']) && ! in_array($record['id'], $tmp)) {
519
+        if (!empty($record['id']) && !in_array($record['id'], $tmp)) {
520 520
             array_push($tmp, $record['id']);
521 521
         }
522 522
     }
523 523
     $superGlobal->put('fonction_id', implode(';', $tmp), 'SESSION');
524 524
     $superGlobal->put('is_admin', 1, 'SESSION');
525 525
     // Check if admin has created Folders and Roles
526
-    DB::query('SELECT * FROM ' . prefixTable('nested_tree') . '');
526
+    DB::query('SELECT * FROM '.prefixTable('nested_tree').'');
527 527
     $superGlobal->put('nb_folders', DB::count(), 'SESSION');
528
-    DB::query('SELECT * FROM ' . prefixTable('roles_title'));
528
+    DB::query('SELECT * FROM '.prefixTable('roles_title'));
529 529
     $superGlobal->put('nb_roles', DB::count(), 'SESSION');
530 530
 }
531 531
 
@@ -567,7 +567,7 @@  discard block
 block discarded – undo
567 567
     object $tree
568 568
 ) {
569 569
     // Load superglobal
570
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
570
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
571 571
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
572 572
     // Init
573 573
     $superGlobal->put('groupes_visibles', [], 'SESSION');
@@ -595,7 +595,7 @@  discard block
 block discarded – undo
595 595
     // Get list of folders depending on Roles
596 596
     $rows = DB::query(
597 597
         'SELECT *
598
-        FROM ' . prefixTable('roles_values') . '
598
+        FROM ' . prefixTable('roles_values').'
599 599
         WHERE role_id IN %li AND type IN %ls',
600 600
         $userRoles,
601 601
         ['W', 'ND', 'NE', 'NDNE', 'R']
@@ -620,10 +620,10 @@  discard block
 block discarded – undo
620 620
     // Does this user is allowed to see other items
621 621
     $inc = 0;
622 622
     $rows = DB::query(
623
-        'SELECT id, id_tree FROM ' . prefixTable('items') . '
623
+        'SELECT id, id_tree FROM '.prefixTable('items').'
624 624
             WHERE restricted_to LIKE %ss AND inactif = %s'.
625 625
             (count($allowedFolders) > 0 ? ' AND id_tree NOT IN ('.implode(',', $allowedFolders).')' : ''),
626
-        $globalsUserId . ';',
626
+        $globalsUserId.';',
627 627
         '0'
628 628
     );
629 629
     foreach ($rows as $record) {
@@ -637,8 +637,8 @@  discard block
 block discarded – undo
637 637
     // Check for the users roles if some specific rights exist on items
638 638
     $rows = DB::query(
639 639
         'SELECT i.id_tree, r.item_id
640
-        FROM ' . prefixTable('items') . ' as i
641
-        INNER JOIN ' . prefixTable('restriction_to_roles') . ' as r ON (r.item_id=i.id)
640
+        FROM ' . prefixTable('items').' as i
641
+        INNER JOIN ' . prefixTable('restriction_to_roles').' as r ON (r.item_id=i.id)
642 642
         WHERE r.role_id IN %li AND i.id_tree <> ""
643 643
         ORDER BY i.id_tree ASC',
644 644
         $userRoles
@@ -659,7 +659,7 @@  discard block
 block discarded – undo
659 659
     ) {
660 660
         $persoFld = DB::queryfirstrow(
661 661
             'SELECT id
662
-            FROM ' . prefixTable('nested_tree') . '
662
+            FROM ' . prefixTable('nested_tree').'
663 663
             WHERE title = %s AND personal_folder = %i'.
664 664
             (count($allowedFolders) > 0 ? ' AND id NOT IN ('.implode(',', $allowedFolders).')' : ''),
665 665
             $globalsUserId,
@@ -693,7 +693,7 @@  discard block
 block discarded – undo
693 693
     }
694 694
     $persoFlds = DB::query(
695 695
         'SELECT id
696
-        FROM ' . prefixTable('nested_tree') . '
696
+        FROM ' . prefixTable('nested_tree').'
697 697
         WHERE %l',
698 698
         $where
699 699
     );
@@ -734,16 +734,16 @@  discard block
 block discarded – undo
734 734
         'SESSION'
735 735
     );
736 736
     // Folders and Roles numbers
737
-    DB::queryfirstrow('SELECT id FROM ' . prefixTable('nested_tree') . '');
737
+    DB::queryfirstrow('SELECT id FROM '.prefixTable('nested_tree').'');
738 738
     $superGlobal->put('nb_folders', DB::count(), 'SESSION');
739
-    DB::queryfirstrow('SELECT id FROM ' . prefixTable('roles_title'));
739
+    DB::queryfirstrow('SELECT id FROM '.prefixTable('roles_title'));
740 740
     $superGlobal->put('nb_roles', DB::count(), 'SESSION');
741 741
     // check if change proposals on User's items
742 742
     if (isset($SETTINGS['enable_suggestion']) === true && (int) $SETTINGS['enable_suggestion'] === 1) {
743 743
         DB::query(
744 744
             'SELECT *
745
-            FROM ' . prefixTable('items_change') . ' AS c
746
-            LEFT JOIN ' . prefixTable('log_items') . ' AS i ON (c.item_id = i.id_item)
745
+            FROM ' . prefixTable('items_change').' AS c
746
+            LEFT JOIN ' . prefixTable('log_items').' AS i ON (c.item_id = i.id_item)
747 747
             WHERE i.action = %s AND i.id_user = %i',
748 748
             'at_creation',
749 749
             $globalsUserId
@@ -787,9 +787,9 @@  discard block
 block discarded – undo
787 787
  */
788 788
 function cacheTableRefresh(array $SETTINGS): void
789 789
 {
790
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
790
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
791 791
     //Connect to DB
792
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
792
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
793 793
     if (defined('DB_PASSWD_CLEAR') === false) {
794 794
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
795 795
     }
@@ -804,12 +804,12 @@  discard block
 block discarded – undo
804 804
     $tree->register();
805 805
     $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title');
806 806
     // truncate table
807
-    DB::query('TRUNCATE TABLE ' . prefixTable('cache'));
807
+    DB::query('TRUNCATE TABLE '.prefixTable('cache'));
808 808
     // reload date
809 809
     $rows = DB::query(
810 810
         'SELECT *
811
-        FROM ' . prefixTable('items') . ' as i
812
-        INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id)
811
+        FROM ' . prefixTable('items').' as i
812
+        INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id)
813 813
         AND l.action = %s
814 814
         AND i.inactif = %i',
815 815
         'at_creation',
@@ -821,18 +821,18 @@  discard block
 block discarded – undo
821 821
             $tags = '';
822 822
             $itemTags = DB::query(
823 823
                 'SELECT tag
824
-                            FROM ' . prefixTable('tags') . '
824
+                            FROM ' . prefixTable('tags').'
825 825
                             WHERE item_id = %i AND tag != ""',
826 826
                 $record['id']
827 827
             );
828 828
             foreach ($itemTags as $itemTag) {
829
-                $tags .= $itemTag['tag'] . ' ';
829
+                $tags .= $itemTag['tag'].' ';
830 830
             }
831 831
 
832 832
             // Get renewal period
833 833
             $resNT = DB::queryfirstrow(
834 834
                 'SELECT renewal_period
835
-                FROM ' . prefixTable('nested_tree') . '
835
+                FROM ' . prefixTable('nested_tree').'
836 836
                 WHERE id = %i',
837 837
                 $record['id_tree']
838 838
             );
@@ -845,7 +845,7 @@  discard block
 block discarded – undo
845 845
                     // Is this a User id?
846 846
                     $user = DB::queryfirstrow(
847 847
                         'SELECT id, login
848
-                        FROM ' . prefixTable('users') . '
848
+                        FROM ' . prefixTable('users').'
849 849
                         WHERE id = %i',
850 850
                         $elem->title
851 851
                     );
@@ -863,11 +863,11 @@  discard block
 block discarded – undo
863 863
                     'id' => $record['id'],
864 864
                     'label' => $record['label'],
865 865
                     'description' => $record['description'] ?? '',
866
-                    'url' => isset($record['url']) && ! empty($record['url']) ? $record['url'] : '0',
866
+                    'url' => isset($record['url']) && !empty($record['url']) ? $record['url'] : '0',
867 867
                     'tags' => $tags,
868 868
                     'id_tree' => $record['id_tree'],
869 869
                     'perso' => $record['perso'],
870
-                    'restricted_to' => isset($record['restricted_to']) && ! empty($record['restricted_to']) ? $record['restricted_to'] : '0',
870
+                    'restricted_to' => isset($record['restricted_to']) && !empty($record['restricted_to']) ? $record['restricted_to'] : '0',
871 871
                     'login' => $record['login'] ?? '',
872 872
                     'folder' => implode(' > ', $folder),
873 873
                     'author' => $record['id_user'],
@@ -887,12 +887,12 @@  discard block
 block discarded – undo
887 887
  */
888 888
 function cacheTableUpdate(array $SETTINGS, ?int $ident = null): void
889 889
 {
890
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
890
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
891 891
     // Load superglobal
892
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
892
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
893 893
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
894 894
     //Connect to DB
895
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
895
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
896 896
     if (defined('DB_PASSWD_CLEAR') === false) {
897 897
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
898 898
     }
@@ -909,7 +909,7 @@  discard block
 block discarded – undo
909 909
     // get new value from db
910 910
     $data = DB::queryfirstrow(
911 911
         'SELECT label, description, id_tree, perso, restricted_to, login, url
912
-        FROM ' . prefixTable('items') . '
912
+        FROM ' . prefixTable('items').'
913 913
         WHERE id=%i',
914 914
         $ident
915 915
     );
@@ -917,12 +917,12 @@  discard block
 block discarded – undo
917 917
     $tags = '';
918 918
     $itemTags = DB::query(
919 919
         'SELECT tag
920
-            FROM ' . prefixTable('tags') . '
920
+            FROM ' . prefixTable('tags').'
921 921
             WHERE item_id = %i AND tag != ""',
922 922
         $ident
923 923
     );
924 924
     foreach ($itemTags as $itemTag) {
925
-        $tags .= $itemTag['tag'] . ' ';
925
+        $tags .= $itemTag['tag'].' ';
926 926
     }
927 927
     // form id_tree to full foldername
928 928
     $folder = [];
@@ -933,7 +933,7 @@  discard block
 block discarded – undo
933 933
             // Is this a User id?
934 934
             $user = DB::queryfirstrow(
935 935
                 'SELECT id, login
936
-                FROM ' . prefixTable('users') . '
936
+                FROM ' . prefixTable('users').'
937 937
                 WHERE id = %i',
938 938
                 $elem->title
939 939
             );
@@ -951,10 +951,10 @@  discard block
 block discarded – undo
951 951
             'label' => $data['label'],
952 952
             'description' => $data['description'],
953 953
             'tags' => $tags,
954
-            'url' => isset($data['url']) && ! empty($data['url']) ? $data['url'] : '0',
954
+            'url' => isset($data['url']) && !empty($data['url']) ? $data['url'] : '0',
955 955
             'id_tree' => $data['id_tree'],
956 956
             'perso' => $data['perso'],
957
-            'restricted_to' => isset($data['restricted_to']) && ! empty($data['restricted_to']) ? $data['restricted_to'] : '0',
957
+            'restricted_to' => isset($data['restricted_to']) && !empty($data['restricted_to']) ? $data['restricted_to'] : '0',
958 958
             'login' => $data['login'] ?? '',
959 959
             'folder' => implode(' » ', $folder),
960 960
             'author' => $superGlobal->get('user_id', 'SESSION'),
@@ -972,14 +972,14 @@  discard block
 block discarded – undo
972 972
  */
973 973
 function cacheTableAdd(array $SETTINGS, ?int $ident = null): void
974 974
 {
975
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
975
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
976 976
     // Load superglobal
977
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
977
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
978 978
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
979 979
     // Get superglobals
980 980
     $globalsUserId = $superGlobal->get('user_id', 'SESSION');
981 981
     //Connect to DB
982
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
982
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
983 983
     if (defined('DB_PASSWD_CLEAR') === false) {
984 984
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
985 985
     }
@@ -996,8 +996,8 @@  discard block
 block discarded – undo
996 996
     // get new value from db
997 997
     $data = DB::queryFirstRow(
998 998
         'SELECT i.label, i.description, i.id_tree as id_tree, i.perso, i.restricted_to, i.id, i.login, i.url, l.date
999
-        FROM ' . prefixTable('items') . ' as i
1000
-        INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id)
999
+        FROM ' . prefixTable('items').' as i
1000
+        INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id)
1001 1001
         WHERE i.id = %i
1002 1002
         AND l.action = %s',
1003 1003
         $ident,
@@ -1007,12 +1007,12 @@  discard block
 block discarded – undo
1007 1007
     $tags = '';
1008 1008
     $itemTags = DB::query(
1009 1009
         'SELECT tag
1010
-            FROM ' . prefixTable('tags') . '
1010
+            FROM ' . prefixTable('tags').'
1011 1011
             WHERE item_id = %i AND tag != ""',
1012 1012
         $ident
1013 1013
     );
1014 1014
     foreach ($itemTags as $itemTag) {
1015
-        $tags .= $itemTag['tag'] . ' ';
1015
+        $tags .= $itemTag['tag'].' ';
1016 1016
     }
1017 1017
     // form id_tree to full foldername
1018 1018
     $folder = [];
@@ -1023,7 +1023,7 @@  discard block
 block discarded – undo
1023 1023
             // Is this a User id?
1024 1024
             $user = DB::queryfirstrow(
1025 1025
                 'SELECT id, login
1026
-                FROM ' . prefixTable('users') . '
1026
+                FROM ' . prefixTable('users').'
1027 1027
                 WHERE id = %i',
1028 1028
                 $elem->title
1029 1029
             );
@@ -1042,7 +1042,7 @@  discard block
 block discarded – undo
1042 1042
             'label' => $data['label'],
1043 1043
             'description' => $data['description'],
1044 1044
             'tags' => isset($tags) && empty($tags) === false ? $tags : 'None',
1045
-            'url' => isset($data['url']) && ! empty($data['url']) ? $data['url'] : '0',
1045
+            'url' => isset($data['url']) && !empty($data['url']) ? $data['url'] : '0',
1046 1046
             'id_tree' => $data['id_tree'],
1047 1047
             'perso' => isset($data['perso']) && empty($data['perso']) === false && $data['perso'] !== 'None' ? $data['perso'] : '0',
1048 1048
             'restricted_to' => isset($data['restricted_to']) && empty($data['restricted_to']) === false ? $data['restricted_to'] : '0',
@@ -1064,52 +1064,52 @@  discard block
 block discarded – undo
1064 1064
 function getStatisticsData(array $SETTINGS): array
1065 1065
 {
1066 1066
     DB::query(
1067
-        'SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE personal_folder = %i',
1067
+        'SELECT id FROM '.prefixTable('nested_tree').' WHERE personal_folder = %i',
1068 1068
         0
1069 1069
     );
1070 1070
     $counter_folders = DB::count();
1071 1071
     DB::query(
1072
-        'SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE personal_folder = %i',
1072
+        'SELECT id FROM '.prefixTable('nested_tree').' WHERE personal_folder = %i',
1073 1073
         1
1074 1074
     );
1075 1075
     $counter_folders_perso = DB::count();
1076 1076
     DB::query(
1077
-        'SELECT id FROM ' . prefixTable('items') . ' WHERE perso = %i',
1077
+        'SELECT id FROM '.prefixTable('items').' WHERE perso = %i',
1078 1078
         0
1079 1079
     );
1080 1080
     $counter_items = DB::count();
1081 1081
         DB::query(
1082
-        'SELECT id FROM ' . prefixTable('items') . ' WHERE perso = %i',
1082
+        'SELECT id FROM '.prefixTable('items').' WHERE perso = %i',
1083 1083
         1
1084 1084
     );
1085 1085
     $counter_items_perso = DB::count();
1086 1086
         DB::query(
1087
-        'SELECT id FROM ' . prefixTable('users') . ''
1087
+        'SELECT id FROM '.prefixTable('users').''
1088 1088
     );
1089 1089
     $counter_users = DB::count();
1090 1090
         DB::query(
1091
-        'SELECT id FROM ' . prefixTable('users') . ' WHERE admin = %i',
1091
+        'SELECT id FROM '.prefixTable('users').' WHERE admin = %i',
1092 1092
         1
1093 1093
     );
1094 1094
     $admins = DB::count();
1095 1095
     DB::query(
1096
-        'SELECT id FROM ' . prefixTable('users') . ' WHERE gestionnaire = %i',
1096
+        'SELECT id FROM '.prefixTable('users').' WHERE gestionnaire = %i',
1097 1097
         1
1098 1098
     );
1099 1099
     $managers = DB::count();
1100 1100
     DB::query(
1101
-        'SELECT id FROM ' . prefixTable('users') . ' WHERE read_only = %i',
1101
+        'SELECT id FROM '.prefixTable('users').' WHERE read_only = %i',
1102 1102
         1
1103 1103
     );
1104 1104
     $readOnly = DB::count();
1105 1105
     // list the languages
1106 1106
     $usedLang = [];
1107 1107
     $tp_languages = DB::query(
1108
-        'SELECT name FROM ' . prefixTable('languages')
1108
+        'SELECT name FROM '.prefixTable('languages')
1109 1109
     );
1110 1110
     foreach ($tp_languages as $tp_language) {
1111 1111
         DB::query(
1112
-            'SELECT * FROM ' . prefixTable('users') . ' WHERE user_language = %s',
1112
+            'SELECT * FROM '.prefixTable('users').' WHERE user_language = %s',
1113 1113
             $tp_language['name']
1114 1114
         );
1115 1115
         $usedLang[$tp_language['name']] = round((DB::count() * 100 / $counter_users), 0);
@@ -1118,12 +1118,12 @@  discard block
 block discarded – undo
1118 1118
     // get list of ips
1119 1119
     $usedIp = [];
1120 1120
     $tp_ips = DB::query(
1121
-        'SELECT user_ip FROM ' . prefixTable('users')
1121
+        'SELECT user_ip FROM '.prefixTable('users')
1122 1122
     );
1123 1123
     foreach ($tp_ips as $ip) {
1124 1124
         if (array_key_exists($ip['user_ip'], $usedIp)) {
1125 1125
             $usedIp[$ip['user_ip']] += $usedIp[$ip['user_ip']];
1126
-        } elseif (! empty($ip['user_ip']) && $ip['user_ip'] !== 'none') {
1126
+        } elseif (!empty($ip['user_ip']) && $ip['user_ip'] !== 'none') {
1127 1127
             $usedIp[$ip['user_ip']] = 1;
1128 1128
         }
1129 1129
     }
@@ -1189,14 +1189,14 @@  discard block
 block discarded – undo
1189 1189
     }
1190 1190
 
1191 1191
     // Load settings
1192
-    include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
1192
+    include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
1193 1193
     // Load superglobal
1194
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1194
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1195 1195
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
1196 1196
     // Get user language
1197
-    include_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $superGlobal->get('user_language', 'SESSION') . '.php';
1197
+    include_once $SETTINGS['cpassman_dir'].'/includes/language/'.$superGlobal->get('user_language', 'SESSION').'.php';
1198 1198
     // Load library
1199
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
1199
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
1200 1200
     // load PHPMailer
1201 1201
     $mail = new SplClassLoader('PHPMailer\PHPMailer', '../includes/libraries');
1202 1202
     $mail->register();
@@ -1204,7 +1204,7 @@  discard block
 block discarded – undo
1204 1204
     
1205 1205
     try {
1206 1206
         // send to user
1207
-        $mail->setLanguage('en', $SETTINGS['cpassman_dir'] . '/includes/libraries/PHPMailer/PHPMailer/language/');
1207
+        $mail->setLanguage('en', $SETTINGS['cpassman_dir'].'/includes/libraries/PHPMailer/PHPMailer/language/');
1208 1208
         $mail->SMTPDebug = isset($SETTINGS['email_debug_level']) === true ? $SETTINGS['email_debug_level'] : 0;
1209 1209
         $mail->Port = $SETTINGS['email_port'];
1210 1210
         //COULD BE USED
@@ -1304,7 +1304,7 @@  discard block
 block discarded – undo
1304 1304
         <table width="600" cellpadding="0" cellspacing="0" border="0" class="container" bgcolor="#ffffff" style="border-spacing: 0; border-bottom: 1px solid #e0e0e0; box-shadow: 0 0 3px #ddd; color: #434343; font-family: Helvetica, Verdana, sans-serif;">
1305 1305
         <tr><td class="container-padding" bgcolor="#ffffff" style="border-collapse: collapse; border-left: 1px solid #e0e0e0; background-color: #ffffff; padding-left: 30px; padding-right: 30px;">
1306 1306
         <br><div style="float:right;">' .
1307
-        $textMail .
1307
+        $textMail.
1308 1308
         '<br><br></td></tr></table>
1309 1309
     </td></tr></table>
1310 1310
     <br></body></html>';
@@ -1315,7 +1315,7 @@  discard block
 block discarded – undo
1315 1315
  */
1316 1316
 function generateKey(): string
1317 1317
 {
1318
-    return substr(md5(rand() . rand()), 0, 15);
1318
+    return substr(md5(rand().rand()), 0, 15);
1319 1319
 }
1320 1320
 
1321 1321
 /**
@@ -1386,7 +1386,7 @@  discard block
 block discarded – undo
1386 1386
 {
1387 1387
     array_walk_recursive(
1388 1388
         $array,
1389
-        static function (&$item): void {
1389
+        static function(&$item): void {
1390 1390
             if (mb_detect_encoding((string) $item, 'utf-8', true) === false) {
1391 1391
                 $item = utf8_encode($item);
1392 1392
             }
@@ -1421,7 +1421,7 @@  discard block
 block discarded – undo
1421 1421
     }
1422 1422
 
1423 1423
     // Load superglobal
1424
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1424
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1425 1425
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
1426 1426
     // Get superglobals
1427 1427
     if ($key !== null) {
@@ -1432,9 +1432,9 @@  discard block
 block discarded – undo
1432 1432
     }
1433 1433
 
1434 1434
     //load ClassLoader
1435
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
1435
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
1436 1436
     //Load AES
1437
-    $aes = new SplClassLoader('Encryption\Crypt', $SETTINGS['cpassman_dir'] . '/includes/libraries');
1437
+    $aes = new SplClassLoader('Encryption\Crypt', $SETTINGS['cpassman_dir'].'/includes/libraries');
1438 1438
     $aes->register();
1439 1439
     if ($type === 'encode' && is_array($data) === true) {
1440 1440
         // Ensure UTF8 format
@@ -1504,8 +1504,8 @@  discard block
 block discarded – undo
1504 1504
  */
1505 1505
 function prefixTable(string $table): string
1506 1506
 {
1507
-    $safeTable = htmlspecialchars(DB_PREFIX . $table);
1508
-    if (! empty($safeTable)) {
1507
+    $safeTable = htmlspecialchars(DB_PREFIX.$table);
1508
+    if (!empty($safeTable)) {
1509 1509
         // sanitize string
1510 1510
         return $safeTable;
1511 1511
     }
@@ -1533,13 +1533,13 @@  discard block
 block discarded – undo
1533 1533
     bool $lowercase = false,
1534 1534
     array $SETTINGS = []
1535 1535
 ): string {
1536
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
1537
-    $generator = new SplClassLoader('PasswordGenerator\Generator', $SETTINGS['cpassman_dir'] . '/includes/libraries');
1536
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
1537
+    $generator = new SplClassLoader('PasswordGenerator\Generator', $SETTINGS['cpassman_dir'].'/includes/libraries');
1538 1538
     $generator->register();
1539 1539
     $generator = new PasswordGenerator\Generator\ComputerPasswordGenerator();
1540 1540
     // Is PHP7 being used?
1541 1541
     if (version_compare(PHP_VERSION, '7.0.0', '>=')) {
1542
-        $php7generator = new SplClassLoader('PasswordGenerator\RandomGenerator', $SETTINGS['cpassman_dir'] . '/includes/libraries');
1542
+        $php7generator = new SplClassLoader('PasswordGenerator\RandomGenerator', $SETTINGS['cpassman_dir'].'/includes/libraries');
1543 1543
         $php7generator->register();
1544 1544
         $generator->setRandomGenerator(new PasswordGenerator\RandomGenerator\Php7RandomGenerator());
1545 1545
     }
@@ -1569,7 +1569,7 @@  discard block
 block discarded – undo
1569 1569
 function send_syslog($message, $host, $port, $component = 'teampass'): void
1570 1570
 {
1571 1571
     $sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
1572
-    $syslog_message = '<123>' . date('M d H:i:s ') . $component . ': ' . $message;
1572
+    $syslog_message = '<123>'.date('M d H:i:s ').$component.': '.$message;
1573 1573
     socket_sendto($sock, $syslog_message, strlen($syslog_message), 0, $host, $port);
1574 1574
     socket_close($sock);
1575 1575
 }
@@ -1591,7 +1591,7 @@  discard block
 block discarded – undo
1591 1591
     }
1592 1592
 
1593 1593
     // include librairies & connect to DB
1594
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
1594
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
1595 1595
     if (defined('DB_PASSWD_CLEAR') === false) {
1596 1596
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
1597 1597
     }
@@ -1615,14 +1615,14 @@  discard block
 block discarded – undo
1615 1615
     if (isset($SETTINGS['syslog_enable']) === true && (int) $SETTINGS['syslog_enable'] === 1) {
1616 1616
         if ($type === 'user_mngt') {
1617 1617
             send_syslog(
1618
-                'action=' . str_replace('at_', '', $label) . ' attribute=user user=' . $who . ' userid="' . $login . '" change="' . $field_1 . '" ',
1618
+                'action='.str_replace('at_', '', $label).' attribute=user user='.$who.' userid="'.$login.'" change="'.$field_1.'" ',
1619 1619
                 $SETTINGS['syslog_host'],
1620 1620
                 $SETTINGS['syslog_port'],
1621 1621
                 'teampass'
1622 1622
             );
1623 1623
         } else {
1624 1624
             send_syslog(
1625
-                'action=' . $type . ' attribute=' . $label . ' user=' . $who . ' userid="' . $login . '" ',
1625
+                'action='.$type.' attribute='.$label.' user='.$who.' userid="'.$login.'" ',
1626 1626
                 $SETTINGS['syslog_host'],
1627 1627
                 $SETTINGS['syslog_port'],
1628 1628
                 'teampass'
@@ -1654,7 +1654,7 @@  discard block
 block discarded – undo
1654 1654
     ?string $encryption_type = null
1655 1655
 ): void {
1656 1656
     // include librairies & connect to DB
1657
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
1657
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
1658 1658
     if (defined('DB_PASSWD_CLEAR') === false) {
1659 1659
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
1660 1660
     }
@@ -1698,7 +1698,7 @@  discard block
 block discarded – undo
1698 1698
         if (empty($item_label) === true) {
1699 1699
             $dataItem = DB::queryfirstrow(
1700 1700
                 'SELECT id, id_tree, label
1701
-                FROM ' . prefixTable('items') . '
1701
+                FROM ' . prefixTable('items').'
1702 1702
                 WHERE id = %i',
1703 1703
                 $item_id
1704 1704
             );
@@ -1706,11 +1706,11 @@  discard block
 block discarded – undo
1706 1706
         }
1707 1707
 
1708 1708
         send_syslog(
1709
-            'action=' . str_replace('at_', '', $action) .
1710
-                ' attribute=' . str_replace('at_', '', $attribute[0]) .
1711
-                ' itemno=' . $item_id .
1712
-                ' user=' . is_null($login) === true ? '' : addslashes((string) $login) .
1713
-                ' itemname="' . addslashes($item_label) . '"',
1709
+            'action='.str_replace('at_', '', $action).
1710
+                ' attribute='.str_replace('at_', '', $attribute[0]).
1711
+                ' itemno='.$item_id.
1712
+                ' user='.is_null($login) === true ? '' : addslashes((string) $login).
1713
+                ' itemname="'.addslashes($item_label).'"',
1714 1714
             $SETTINGS['syslog_host'],
1715 1715
             $SETTINGS['syslog_port'],
1716 1716
             'teampass'
@@ -1736,7 +1736,7 @@  discard block
 block discarded – undo
1736 1736
         && $action === 'at_shown'
1737 1737
     ) {
1738 1738
         // Load superglobal
1739
-        include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1739
+        include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1740 1740
         $superGlobal = new protect\SuperGlobal\SuperGlobal();
1741 1741
         // Get superglobals
1742 1742
         $globalsLastname = $superGlobal->get('lastname', 'SESSION');
@@ -1745,7 +1745,7 @@  discard block
 block discarded – undo
1745 1745
         // Get info about item
1746 1746
         $dataItem = DB::queryfirstrow(
1747 1747
             'SELECT id, id_tree, label
1748
-            FROM ' . prefixTable('items') . '
1748
+            FROM ' . prefixTable('items').'
1749 1749
             WHERE id = %i',
1750 1750
             $item_id
1751 1751
         );
@@ -1759,9 +1759,9 @@  discard block
 block discarded – undo
1759 1759
                 'body' => str_replace(
1760 1760
                     ['#tp_user#', '#tp_item#', '#tp_link#'],
1761 1761
                     [
1762
-                        addslashes($globalsName . ' ' . $globalsLastname),
1762
+                        addslashes($globalsName.' '.$globalsLastname),
1763 1763
                         addslashes($item_label),
1764
-                        $SETTINGS['cpassman_url'] . '/index.php?page=items&group=' . $dataItem['id_tree'] . '&id=' . $item_id,
1764
+                        $SETTINGS['cpassman_url'].'/index.php?page=items&group='.$dataItem['id_tree'].'&id='.$item_id,
1765 1765
                     ],
1766 1766
                     langHdl('email_on_open_notification_mail')
1767 1767
                 ),
@@ -1783,7 +1783,7 @@  discard block
 block discarded – undo
1783 1783
 function notifyChangesToSubscribers(int $item_id, string $label, array $changes, array $SETTINGS): void
1784 1784
 {
1785 1785
     // Load superglobal
1786
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1786
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1787 1787
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
1788 1788
     // Get superglobals
1789 1789
     $globalsUserId = $superGlobal->get('user_id', 'SESSION');
@@ -1793,8 +1793,8 @@  discard block
 block discarded – undo
1793 1793
     $notification = DB::queryOneColumn(
1794 1794
         'email',
1795 1795
         'SELECT *
1796
-        FROM ' . prefixTable('notification') . ' AS n
1797
-        INNER JOIN ' . prefixTable('users') . ' AS u ON (n.user_id = u.id)
1796
+        FROM ' . prefixTable('notification').' AS n
1797
+        INNER JOIN ' . prefixTable('users').' AS u ON (n.user_id = u.id)
1798 1798
         WHERE n.item_id = %i AND n.user_id != %i',
1799 1799
         $item_id,
1800 1800
         $globalsUserId
@@ -1805,7 +1805,7 @@  discard block
 block discarded – undo
1805 1805
         // Get list of changes
1806 1806
         $htmlChanges = '<ul>';
1807 1807
         foreach ($changes as $change) {
1808
-            $htmlChanges .= '<li>' . $change . '</li>';
1808
+            $htmlChanges .= '<li>'.$change.'</li>';
1809 1809
         }
1810 1810
         $htmlChanges .= '</ul>';
1811 1811
         // send email
@@ -1836,7 +1836,7 @@  discard block
 block discarded – undo
1836 1836
 function geItemReadablePath(int $id_tree, string $label, array $SETTINGS): string
1837 1837
 {
1838 1838
     // Class loader
1839
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
1839
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
1840 1840
     //Load Tree
1841 1841
     $tree = new SplClassLoader('Tree\NestedTree', '../includes/libraries');
1842 1842
     $tree->register();
@@ -1845,15 +1845,15 @@  discard block
 block discarded – undo
1845 1845
     $path = '';
1846 1846
     foreach ($arbo as $elem) {
1847 1847
         if (empty($path) === true) {
1848
-            $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES) . ' ';
1848
+            $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES).' ';
1849 1849
         } else {
1850
-            $path .= '&#8594; ' . htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
1850
+            $path .= '&#8594; '.htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
1851 1851
         }
1852 1852
     }
1853 1853
 
1854 1854
     // Build text to show user
1855 1855
     if (empty($label) === false) {
1856
-        return empty($path) === true ? addslashes($label) : addslashes($label) . ' (' . $path . ')';
1856
+        return empty($path) === true ? addslashes($label) : addslashes($label).' ('.$path.')';
1857 1857
     }
1858 1858
     return empty($path) === true ? '' : $path;
1859 1859
 }
@@ -1908,9 +1908,9 @@  discard block
 block discarded – undo
1908 1908
  */
1909 1909
 function handleConfigFile($action, $SETTINGS, $field = null, $value = null)
1910 1910
 {
1911
-    $tp_config_file = $SETTINGS['cpassman_dir'] . '/includes/config/tp.config.php';
1911
+    $tp_config_file = $SETTINGS['cpassman_dir'].'/includes/config/tp.config.php';
1912 1912
     // include librairies & connect to DB
1913
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
1913
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
1914 1914
     if (defined('DB_PASSWD_CLEAR') === false) {
1915 1915
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
1916 1916
     }
@@ -1923,8 +1923,8 @@  discard block
 block discarded – undo
1923 1923
     if (file_exists($tp_config_file) === false || $action === 'rebuild') {
1924 1924
         // perform a copy
1925 1925
         if (file_exists($tp_config_file)) {
1926
-            if (! copy($tp_config_file, $tp_config_file . '.' . date('Y_m_d_His', time()))) {
1927
-                return "ERROR: Could not copy file '" . $tp_config_file . "'";
1926
+            if (!copy($tp_config_file, $tp_config_file.'.'.date('Y_m_d_His', time()))) {
1927
+                return "ERROR: Could not copy file '".$tp_config_file."'";
1928 1928
             }
1929 1929
         }
1930 1930
 
@@ -1934,11 +1934,11 @@  discard block
 block discarded – undo
1934 1934
         $data[1] = "global \$SETTINGS;\n";
1935 1935
         $data[2] = "\$SETTINGS = array (\n";
1936 1936
         $rows = DB::query(
1937
-            'SELECT * FROM ' . prefixTable('misc') . ' WHERE type=%s',
1937
+            'SELECT * FROM '.prefixTable('misc').' WHERE type=%s',
1938 1938
             'admin'
1939 1939
         );
1940 1940
         foreach ($rows as $record) {
1941
-            array_push($data, "    '" . $record['intitule'] . "' => '" . $record['valeur'] . "',\n");
1941
+            array_push($data, "    '".$record['intitule']."' => '".$record['valeur']."',\n");
1942 1942
         }
1943 1943
         array_push($data, ");\n");
1944 1944
         $data = array_unique($data);
@@ -1952,15 +1952,15 @@  discard block
 block discarded – undo
1952 1952
                 break;
1953 1953
             }
1954 1954
 
1955
-            if (stristr($line, "'" . $field . "' => '")) {
1956
-                $data[$inc] = "    '" . $field . "' => '" . filter_var($value, FILTER_SANITIZE_STRING) . "',\n";
1955
+            if (stristr($line, "'".$field."' => '")) {
1956
+                $data[$inc] = "    '".$field."' => '".filter_var($value, FILTER_SANITIZE_STRING)."',\n";
1957 1957
                 $bFound = true;
1958 1958
                 break;
1959 1959
             }
1960 1960
             ++$inc;
1961 1961
         }
1962 1962
         if ($bFound === false) {
1963
-            $data[$inc] = "    '" . $field . "' => '" . filter_var($value, FILTER_SANITIZE_STRING) . "',\n);\n";
1963
+            $data[$inc] = "    '".$field."' => '".filter_var($value, FILTER_SANITIZE_STRING)."',\n);\n";
1964 1964
         }
1965 1965
     }
1966 1966
 
@@ -1986,7 +1986,7 @@  discard block
 block discarded – undo
1986 1986
 {
1987 1987
     global $SETTINGS;
1988 1988
     /* LOAD CPASSMAN SETTINGS */
1989
-    if (! isset($SETTINGS['loaded']) || $SETTINGS['loaded'] !== 1) {
1989
+    if (!isset($SETTINGS['loaded']) || $SETTINGS['loaded'] !== 1) {
1990 1990
         $SETTINGS = [];
1991 1991
         $SETTINGS['duplicate_folder'] = 0;
1992 1992
         //by default, this is set to 0;
@@ -1996,7 +1996,7 @@  discard block
 block discarded – undo
1996 1996
         //by default, this value is set to 5;
1997 1997
         $settings = [];
1998 1998
         $rows = DB::query(
1999
-            'SELECT * FROM ' . prefixTable('misc') . ' WHERE type=%s_type OR type=%s_type2',
1999
+            'SELECT * FROM '.prefixTable('misc').' WHERE type=%s_type OR type=%s_type2',
2000 2000
             [
2001 2001
                 'type' => 'admin',
2002 2002
                 'type2' => 'settings',
@@ -2023,7 +2023,7 @@  discard block
 block discarded – undo
2023 2023
     $source_cf = [];
2024 2024
     $rows = DB::QUERY(
2025 2025
         'SELECT id_category
2026
-            FROM ' . prefixTable('categories_folders') . '
2026
+            FROM ' . prefixTable('categories_folders').'
2027 2027
             WHERE id_folder = %i',
2028 2028
         $source_id
2029 2029
     );
@@ -2034,7 +2034,7 @@  discard block
 block discarded – undo
2034 2034
     $target_cf = [];
2035 2035
     $rows = DB::QUERY(
2036 2036
         'SELECT id_category
2037
-            FROM ' . prefixTable('categories_folders') . '
2037
+            FROM ' . prefixTable('categories_folders').'
2038 2038
             WHERE id_folder = %i',
2039 2039
         $target_id
2040 2040
     );
@@ -2069,9 +2069,9 @@  discard block
 block discarded – undo
2069 2069
     $password = null
2070 2070
 ) {
2071 2071
     // Load AntiXSS
2072
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/AntiXSS.php';
2073
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/ASCII.php';
2074
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/UTF8.php';
2072
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/AntiXSS.php';
2073
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/ASCII.php';
2074
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/UTF8.php';
2075 2075
     $antiXss = new voku\helper\AntiXSS();
2076 2076
     // Protect against bad inputs
2077 2077
     if (is_array($source_file) === true || is_array($target_file) === true) {
@@ -2083,7 +2083,7 @@  discard block
 block discarded – undo
2083 2083
     $target_file = $antiXss->xss_clean($target_file);
2084 2084
     if (empty($password) === true || is_null($password) === true) {
2085 2085
         // get KEY to define password
2086
-        $ascii_key = file_get_contents(SECUREPATH . '/teampass-seckey.txt');
2086
+        $ascii_key = file_get_contents(SECUREPATH.'/teampass-seckey.txt');
2087 2087
         $password = \Defuse\Crypto\Key::loadFromAsciiSafeString($ascii_key);
2088 2088
     }
2089 2089
 
@@ -2128,15 +2128,15 @@  discard block
 block discarded – undo
2128 2128
 ) {
2129 2129
     // load PhpEncryption library
2130 2130
     $path_to_encryption = '/includes/libraries/Encryption/Encryption/';
2131
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Crypto.php';
2132
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Encoding.php';
2133
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'DerivedKeys.php';
2134
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Key.php';
2135
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'KeyOrPassword.php';
2136
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'File.php';
2137
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'RuntimeTests.php';
2138
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'KeyProtectedByPassword.php';
2139
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Core.php';
2131
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Crypto.php';
2132
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Encoding.php';
2133
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'DerivedKeys.php';
2134
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Key.php';
2135
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'KeyOrPassword.php';
2136
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'File.php';
2137
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'RuntimeTests.php';
2138
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'KeyProtectedByPassword.php';
2139
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Core.php';
2140 2140
     try {
2141 2141
         \Defuse\Crypto\File::encryptFileWithPassword(
2142 2142
             $source_file,
@@ -2173,15 +2173,15 @@  discard block
 block discarded – undo
2173 2173
 ) {
2174 2174
     // load PhpEncryption library
2175 2175
     $path_to_encryption = '/includes/libraries/Encryption/Encryption/';
2176
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Crypto.php';
2177
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Encoding.php';
2178
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'DerivedKeys.php';
2179
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Key.php';
2180
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'KeyOrPassword.php';
2181
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'File.php';
2182
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'RuntimeTests.php';
2183
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'KeyProtectedByPassword.php';
2184
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Core.php';
2176
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Crypto.php';
2177
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Encoding.php';
2178
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'DerivedKeys.php';
2179
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Key.php';
2180
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'KeyOrPassword.php';
2181
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'File.php';
2182
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'RuntimeTests.php';
2183
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'KeyProtectedByPassword.php';
2184
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Core.php';
2185 2185
     try {
2186 2186
         \Defuse\Crypto\File::decryptFileWithPassword(
2187 2187
             $source_file,
@@ -2226,9 +2226,9 @@  discard block
 block discarded – undo
2226 2226
 function fileDelete(string $file, array $SETTINGS): void
2227 2227
 {
2228 2228
     // Load AntiXSS
2229
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/ASCII.php';
2230
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/UTF8.php';
2231
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/AntiXSS.php';
2229
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/ASCII.php';
2230
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/UTF8.php';
2231
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/AntiXSS.php';
2232 2232
     $antiXss = new voku\helper\AntiXSS();
2233 2233
     $file = $antiXss->xss_clean($file);
2234 2234
     if (is_file($file)) {
@@ -2272,7 +2272,7 @@  discard block
 block discarded – undo
2272 2272
 
2273 2273
 function recursiveChmod($path, $filePerm = 0644, $dirPerm = 0755) {
2274 2274
     // Check if the path exists
2275
-    if (! file_exists($path)) {
2275
+    if (!file_exists($path)) {
2276 2276
         return false;
2277 2277
     }
2278 2278
 
@@ -2307,7 +2307,7 @@  discard block
 block discarded – undo
2307 2307
  */
2308 2308
 function accessToItemIsGranted(int $item_id, $SETTINGS)
2309 2309
 {
2310
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
2310
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
2311 2311
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
2312 2312
     // Prepare superGlobal variables
2313 2313
     $session_groupes_visibles = $superGlobal->get('groupes_visibles', 'SESSION');
@@ -2315,7 +2315,7 @@  discard block
 block discarded – undo
2315 2315
     // Load item data
2316 2316
     $data = DB::queryFirstRow(
2317 2317
         'SELECT id_tree
2318
-        FROM ' . prefixTable('items') . '
2318
+        FROM ' . prefixTable('items').'
2319 2319
         WHERE id = %i',
2320 2320
         $item_id
2321 2321
     );
@@ -2388,8 +2388,8 @@  discard block
 block discarded – undo
2388 2388
 function performDBQuery(array $SETTINGS, string $fields, string $table): array
2389 2389
 {
2390 2390
     // include librairies & connect to DB
2391
-    include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
2392
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
2391
+    include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
2392
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
2393 2393
     if (defined('DB_PASSWD_CLEAR') === false) {
2394 2394
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
2395 2395
     }
@@ -2401,7 +2401,7 @@  discard block
 block discarded – undo
2401 2401
     DB::$encoding = DB_ENCODING;
2402 2402
     // Insert log in DB
2403 2403
     return DB::query(
2404
-        'SELECT ' . $fields . '
2404
+        'SELECT '.$fields.'
2405 2405
         FROM ' . prefixTable($table)
2406 2406
     );
2407 2407
 }
@@ -2414,11 +2414,11 @@  discard block
 block discarded – undo
2414 2414
 function formatSizeUnits(int $bytes): string
2415 2415
 {
2416 2416
     if ($bytes >= 1073741824) {
2417
-        $bytes = number_format($bytes / 1073741824, 2) . ' GB';
2417
+        $bytes = number_format($bytes / 1073741824, 2).' GB';
2418 2418
     } elseif ($bytes >= 1048576) {
2419
-        $bytes = number_format($bytes / 1048576, 2) . ' MB';
2419
+        $bytes = number_format($bytes / 1048576, 2).' MB';
2420 2420
     } elseif ($bytes >= 1024) {
2421
-        $bytes = number_format($bytes / 1024, 2) . ' KB';
2421
+        $bytes = number_format($bytes / 1024, 2).' KB';
2422 2422
     } elseif ($bytes > 1) {
2423 2423
         $bytes .= ' bytes';
2424 2424
     } elseif ($bytes === 1) {
@@ -2609,14 +2609,14 @@  discard block
 block discarded – undo
2609 2609
 
2610 2610
     // Encrypt the file content
2611 2611
     $plaintext = file_get_contents(
2612
-        filter_var($fileInPath . '/' . $fileInName, FILTER_SANITIZE_URL)
2612
+        filter_var($fileInPath.'/'.$fileInName, FILTER_SANITIZE_URL)
2613 2613
     );
2614 2614
     $ciphertext = $cipher->encrypt($plaintext);
2615 2615
     // Save new file
2616 2616
     $hash = md5($plaintext);
2617
-    $fileOut = $fileInPath . '/' . TP_FILE_PREFIX . $hash;
2617
+    $fileOut = $fileInPath.'/'.TP_FILE_PREFIX.$hash;
2618 2618
     file_put_contents($fileOut, $ciphertext);
2619
-    unlink($fileInPath . '/' . $fileInName);
2619
+    unlink($fileInPath.'/'.$fileInName);
2620 2620
     return [
2621 2621
         'fileHash' => base64_encode($hash),
2622 2622
         'objectKey' => base64_encode($objectKey),
@@ -2632,7 +2632,7 @@  discard block
 block discarded – undo
2632 2632
  */
2633 2633
 function decryptFile(string $fileName, string $filePath, string $key): string
2634 2634
 {
2635
-    if (! defined('FILE_BUFFER_SIZE')) {
2635
+    if (!defined('FILE_BUFFER_SIZE')) {
2636 2636
         define('FILE_BUFFER_SIZE', 128 * 1024);
2637 2637
     }
2638 2638
 
@@ -2651,7 +2651,7 @@  discard block
 block discarded – undo
2651 2651
     $cipher->enableContinuousBuffer();
2652 2652
     $cipher->disablePadding();
2653 2653
     // Get file content
2654
-    $ciphertext = file_get_contents($filePath . '/' . TP_FILE_PREFIX . $fileName);
2654
+    $ciphertext = file_get_contents($filePath.'/'.TP_FILE_PREFIX.$fileName);
2655 2655
     // Decrypt file content and return
2656 2656
     return base64_encode($cipher->decrypt($ciphertext));
2657 2657
 }
@@ -2701,8 +2701,8 @@  discard block
 block discarded – undo
2701 2701
     array $SETTINGS
2702 2702
 ): void {
2703 2703
     // include librairies & connect to DB
2704
-    include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
2705
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
2704
+    include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
2705
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
2706 2706
     if (defined('DB_PASSWD_CLEAR') === false) {
2707 2707
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
2708 2708
     }
@@ -2719,7 +2719,7 @@  discard block
 block discarded – undo
2719 2719
         $post_object_id
2720 2720
     );
2721 2721
     // Superglobals
2722
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
2722
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
2723 2723
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
2724 2724
     // Prepare superGlobal variables
2725 2725
     $sessionPpersonaFolders = $superGlobal->get('personal_folders', 'SESSION');
@@ -2744,8 +2744,8 @@  discard block
 block discarded – undo
2744 2744
         // Create sharekey for each user
2745 2745
         $users = DB::query(
2746 2746
             'SELECT id, public_key
2747
-            FROM ' . prefixTable('users') . '
2748
-            WHERE id NOT IN ("' . OTV_USER_ID . '","' . SSH_USER_ID . '","' . API_USER_ID . '")
2747
+            FROM ' . prefixTable('users').'
2748
+            WHERE id NOT IN ("' . OTV_USER_ID.'","'.SSH_USER_ID.'","'.API_USER_ID.'")
2749 2749
             AND public_key != ""'
2750 2750
         );
2751 2751
         foreach ($users as $user) {
@@ -2773,7 +2773,7 @@  discard block
 block discarded – undo
2773 2773
 function isBase64(string $str): bool
2774 2774
 {
2775 2775
     $str = (string) trim($str);
2776
-    if (! isset($str[0])) {
2776
+    if (!isset($str[0])) {
2777 2777
         return false;
2778 2778
     }
2779 2779
 
@@ -2841,13 +2841,13 @@  discard block
 block discarded – undo
2841 2841
         ],
2842 2842
     ];
2843 2843
     // Load expected libraries
2844
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Traits/Macroable.php';
2845
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Arr.php';
2846
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/DetectsErrors.php';
2847
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/Connection.php';
2848
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/LdapInterface.php';
2849
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/LdapBase.php';
2850
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/Ldap.php';
2844
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Traits/Macroable.php';
2845
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Arr.php';
2846
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/DetectsErrors.php';
2847
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/Connection.php';
2848
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/LdapInterface.php';
2849
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/LdapBase.php';
2850
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/Ldap.php';
2851 2851
     $ad = new SplClassLoader('LdapRecord', '../includes/libraries');
2852 2852
     $ad->register();
2853 2853
     $connection = new Connection($config);
@@ -2856,7 +2856,7 @@  discard block
 block discarded – undo
2856 2856
         $connection->connect();
2857 2857
     } catch (\LdapRecord\Auth\BindException $e) {
2858 2858
         $error = $e->getDetailedError();
2859
-        echo 'Error : '.$error->getErrorCode().' - '.$error->getErrorMessage(). '<br>'.$error->getDiagnosticMessage();
2859
+        echo 'Error : '.$error->getErrorCode().' - '.$error->getErrorMessage().'<br>'.$error->getDiagnosticMessage();
2860 2860
         return false;
2861 2861
     }
2862 2862
 
@@ -2869,7 +2869,7 @@  discard block
 block discarded – undo
2869 2869
         }
2870 2870
     } catch (\LdapRecord\Auth\BindException $e) {
2871 2871
         $error = $e->getDetailedError();
2872
-        echo 'Error : '.$error->getErrorCode().' - '.$error->getErrorMessage(). '<br>'.$error->getDiagnosticMessage();
2872
+        echo 'Error : '.$error->getErrorCode().' - '.$error->getErrorMessage().'<br>'.$error->getDiagnosticMessage();
2873 2873
         return false;
2874 2874
     }
2875 2875
 
@@ -2887,8 +2887,8 @@  discard block
 block discarded – undo
2887 2887
 function deleteUserObjetsKeys(int $userId, array $SETTINGS): bool
2888 2888
 {
2889 2889
     // include librairies & connect to DB
2890
-    include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
2891
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
2890
+    include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
2891
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
2892 2892
     if (defined('DB_PASSWD_CLEAR') === false) {
2893 2893
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
2894 2894
     }
@@ -2946,7 +2946,7 @@  discard block
 block discarded – undo
2946 2946
         foreach (DateTimeZone::listIdentifiers() as $timezone) {
2947 2947
             $now->setTimezone(new DateTimeZone($timezone));
2948 2948
             $offsets[] = $offset = $now->getOffset();
2949
-            $timezones[$timezone] = '(' . format_GMT_offset($offset) . ') ' . format_timezone_name($timezone);
2949
+            $timezones[$timezone] = '('.format_GMT_offset($offset).') '.format_timezone_name($timezone);
2950 2950
         }
2951 2951
 
2952 2952
         array_multisort($offsets, $timezones);
@@ -2966,7 +2966,7 @@  discard block
 block discarded – undo
2966 2966
 {
2967 2967
     $hours = intval($offset / 3600);
2968 2968
     $minutes = abs(intval($offset % 3600 / 60));
2969
-    return 'GMT' . ($offset ? sprintf('%+03d:%02d', $hours, $minutes) : '');
2969
+    return 'GMT'.($offset ? sprintf('%+03d:%02d', $hours, $minutes) : '');
2970 2970
 }
2971 2971
 
2972 2972
 /**
Please login to merge, or discard this patch.
pages/profile.php 1 patch
Spacing   +38 added lines, -40 removed lines patch added patch discarded remove patch
@@ -43,16 +43,16 @@  discard block
 block discarded – undo
43 43
 }
44 44
 
45 45
 /* do checks */
46
-require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php';
46
+require_once $SETTINGS['cpassman_dir'].'/sources/checks.php';
47 47
 if (checkUser($_SESSION['user_id'], $_SESSION['key'], curPage($SETTINGS), $SETTINGS) === false) {
48 48
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
49
-    include $SETTINGS['cpassman_dir'] . '/error.php';
49
+    include $SETTINGS['cpassman_dir'].'/error.php';
50 50
     exit;
51 51
 }
52 52
 
53 53
 // Load template
54
-require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
55
-require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
54
+require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
55
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
56 56
 $superGlobal = new protect\SuperGlobal\SuperGlobal();
57 57
 // Prepare GET variables
58 58
 $get = [];
@@ -73,25 +73,25 @@  discard block
 block discarded – undo
73 73
 // prepare list of timezones
74 74
 $zones = timezone_list();
75 75
 // prepare list of languages
76
-$languages = DB::query('SELECT label FROM ' . prefixTable('languages') . ' ORDER BY label ASC');
76
+$languages = DB::query('SELECT label FROM '.prefixTable('languages').' ORDER BY label ASC');
77 77
 // Do some stats
78
-DB::query('SELECT id_item FROM ' . prefixTable('log_items') . ' WHERE action = "at_creation" AND  id_user = "' . $_SESSION['user_id'] . '"');
78
+DB::query('SELECT id_item FROM '.prefixTable('log_items').' WHERE action = "at_creation" AND  id_user = "'.$_SESSION['user_id'].'"');
79 79
 $userItemsNumber = DB::count();
80
-DB::query('SELECT id_item FROM ' . prefixTable('log_items') . ' WHERE action = "at_modification" AND  id_user = "' . $_SESSION['user_id'] . '"');
80
+DB::query('SELECT id_item FROM '.prefixTable('log_items').' WHERE action = "at_modification" AND  id_user = "'.$_SESSION['user_id'].'"');
81 81
 $userModificationNumber = DB::count();
82
-DB::query('SELECT id_item FROM ' . prefixTable('log_items') . ' WHERE action = "at_shown" AND  id_user = "' . $_SESSION['user_id'] . '"');
82
+DB::query('SELECT id_item FROM '.prefixTable('log_items').' WHERE action = "at_shown" AND  id_user = "'.$_SESSION['user_id'].'"');
83 83
 $userSeenItemsNumber = DB::count();
84
-DB::query('SELECT id_item FROM ' . prefixTable('log_items') . ' WHERE action = "at_password_shown" AND  id_user = "' . $_SESSION['user_id'] . '"');
84
+DB::query('SELECT id_item FROM '.prefixTable('log_items').' WHERE action = "at_password_shown" AND  id_user = "'.$_SESSION['user_id'].'"');
85 85
 $userSeenPasswordsNumber = DB::count();
86 86
 $userInfo = DB::queryFirstRow(
87 87
     'SELECT avatar 
88
-    FROM ' . prefixTable('users') . ' 
89
-    WHERE id = "' . $_SESSION['user_id'] . '"'
88
+    FROM ' . prefixTable('users').' 
89
+    WHERE id = "' . $_SESSION['user_id'].'"'
90 90
 );
91 91
 if (empty($userInfo['avatar']) === true) {
92
-    $avatar = $SETTINGS['cpassman_url'] . '/includes/images/photo.jpg';
92
+    $avatar = $SETTINGS['cpassman_url'].'/includes/images/photo.jpg';
93 93
 } else {
94
-    $avatar = $SETTINGS['cpassman_url'] . '/includes/avatars/' . $userInfo['avatar'];
94
+    $avatar = $SETTINGS['cpassman_url'].'/includes/avatars/'.$userInfo['avatar'];
95 95
 }
96 96
 
97 97
 // Get Groups name
@@ -99,8 +99,8 @@  discard block
 block discarded – undo
99 99
 foreach ($_SESSION['user_roles'] as $role) {
100 100
     $tmp = DB::queryFirstRow(
101 101
         'SELECT title 
102
-        FROM ' . prefixTable('roles_title') . ' 
103
-        WHERE id = "' . $role . '"'
102
+        FROM ' . prefixTable('roles_title').' 
103
+        WHERE id = "' . $role.'"'
104 104
     );
105 105
     if ($tmp !== null) {
106 106
         array_push($userParOfGroups, $tmp['title']);
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
                         <h3 id="profile-username" class="text-center">
145 145
                             <?php
146 146
                             if (isset($_SESSION['name']) === true && empty($_SESSION['name']) === false) {
147
-                                echo $_SESSION['name'] . ' ' . $_SESSION['lastname'];
147
+                                echo $_SESSION['name'].' '.$_SESSION['lastname'];
148 148
                             } else {
149 149
                                 echo $_SESSION['login'];
150 150
                             }
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
                                             } else {
212 212
                                                 echo date('d/m/Y', (int) $_SESSION['last_connection']);
213 213
                                             }
214
-                                            echo ' ' . langHdl('at') . ' ';
214
+                                            echo ' '.langHdl('at').' ';
215 215
                                             if (isset($SETTINGS['time_format']) === true) {
216 216
                                                 echo date($SETTINGS['time_format'], (int) $_SESSION['last_connection']);
217 217
                                             } else {
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
                                         </a>
222 222
                                     </li>
223 223
                                     <?php
224
-                                    if (isset($_SESSION['last_pw_change']) && ! empty($_SESSION['last_pw_change'])) {
224
+                                    if (isset($_SESSION['last_pw_change']) && !empty($_SESSION['last_pw_change'])) {
225 225
                                         // Handle last password change string
226 226
                                         if (isset($_SESSION['last_pw_change']) === true) {
227 227
                                             if (isset($SETTINGS['date_format']) === true) {
@@ -241,12 +241,12 @@  discard block
 block discarded – undo
241 241
                                         ) {
242 242
                                             $numDaysBeforePwExpiration = '';
243 243
                                         } else {
244
-                                            $numDaysBeforePwExpiration = $LANG['index_pw_expiration'] . ' ' . $_SESSION['numDaysBeforePwExpiration'] . ' ' . $LANG['days'] . '.';
244
+                                            $numDaysBeforePwExpiration = $LANG['index_pw_expiration'].' '.$_SESSION['numDaysBeforePwExpiration'].' '.$LANG['days'].'.';
245 245
                                         }
246 246
                                         echo '
247 247
                                     <li class="list-group-item">
248
-                                        <b><i class="fas fa-calendar-alt fa-fw fa-lg mr-2"></i>' . langHdl('index_last_pw_change') . '</b>
249
-                                        <a class="float-right">' . $last_pw_change . ' ' . $numDaysBeforePwExpiration . '</a>
248
+                                        <b><i class="fas fa-calendar-alt fa-fw fa-lg mr-2"></i>' . langHdl('index_last_pw_change').'</b>
249
+                                        <a class="float-right">' . $last_pw_change.' '.$numDaysBeforePwExpiration.'</a>
250 250
                                     </li>';
251 251
                                     }
252 252
                                     ?>
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
                                     if (isset($SETTINGS['api']) === true && (int) $SETTINGS['api'] === 1) {
267 267
                                         echo '
268 268
                                     <li class="list-group-item">
269
-                                        <b><i class="fas fa-paper-plane fa-fw fa-lg mr-2"></i>' . langHdl('user_profile_api_key') . '</b>
269
+                                        <b><i class="fas fa-paper-plane fa-fw fa-lg mr-2"></i>' . langHdl('user_profile_api_key').'</b>
270 270
                                         <a class="float-right" id="profile-user-api-token">',
271 271
                                             isset($_SESSION['user']['api-key']) === true ? $_SESSION['user']['api-key'] : '',
272 272
                                             '</a>
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
                                     ) {
279 279
                                         echo '
280 280
                                     <li class="list-group-item">
281
-                                        <b><i class="fas fa-id-card-o fa-fw fa-lg mr-2"></i>' . langHdl('user_profile_agses_card_id') . '</b>
281
+                                        <b><i class="fas fa-id-card-o fa-fw fa-lg mr-2"></i>' . langHdl('user_profile_agses_card_id').'</b>
282 282
                                         <a class="float-right">',
283 283
                                             $_SESSION['user_agsescardid'] ?? '',
284 284
                                             '</a>
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
                                         <ul class="">
303 303
                                             <?php
304 304
                                                 foreach ($_SESSION['user']['unsuccessfull_login_attempts_list'] as $entry) {
305
-                                                    echo '<li class="">' . $entry . '</li>';
305
+                                                    echo '<li class="">'.$entry.'</li>';
306 306
                                                 } ?>
307 307
                                         </ul>
308 308
                                     </div>
@@ -315,12 +315,12 @@  discard block
 block discarded – undo
315 315
                                         <?php
316 316
                                         $rows = DB::query(
317 317
                                             'SELECT label AS labelAction, date, null
318
-                                                    FROM ' . prefixTable('log_system') . '
318
+                                                    FROM ' . prefixTable('log_system').'
319 319
                                                     WHERE qui = %i
320 320
                                                     UNION
321 321
                                                     SELECT l.action, l.date, i.label AS itemLabel
322
-                                                    FROM ' . prefixTable('log_items') . ' AS l
323
-                                                    INNER JOIN ' . prefixTable('items') . ' AS i ON (l.id_item = i.id)
322
+                                                    FROM ' . prefixTable('log_items').' AS l
323
+                                                    INNER JOIN ' . prefixTable('items').' AS i ON (l.id_item = i.id)
324 324
                                                     WHERE l.id_user = %i AND l.action IN ("at_access")
325 325
                                                     ORDER BY date DESC
326 326
                                                     LIMIT 0, 40',
@@ -334,9 +334,9 @@  discard block
 block discarded – undo
334 334
                                                 $text = langHdl($record['labelAction']);
335 335
                                             }
336 336
                                             if (empty($record['NULL']) === false) {
337
-                                                $text .= ' ' . langHdl('for') . ' <span class="font-weight-light">' . addslashes($record['NULL']) . '</span>';
337
+                                                $text .= ' '.langHdl('for').' <span class="font-weight-light">'.addslashes($record['NULL']).'</span>';
338 338
                                             }
339
-                                            echo '<li class="list-group-item">' . date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['date']) . ' - ' . $text . '</li>';
339
+                                            echo '<li class="list-group-item">'.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['date']).' - '.$text.'</li>';
340 340
                                         }
341 341
                                         ?>
342 342
                                     </ul>
@@ -374,11 +374,10 @@  discard block
 block discarded – undo
374 374
                                                 <?php
375 375
                                                 foreach ($zones as $key => $zone) {
376 376
                                                     echo '
377
-                                                <option value="' . $key . '"',
377
+                                                <option value="' . $key.'"',
378 378
                                                     isset($_SESSION['user_timezone']) === true && $_SESSION['user_timezone'] === $key ?
379
-                                                    ' selected' :
380
-                                                    (isset($SETTINGS['timezone']) === true && $SETTINGS['timezone'] === $key ? ' selected' : ''),
381
-                                                '>' . $zone . '</option>';
379
+                                                    ' selected' : (isset($SETTINGS['timezone']) === true && $SETTINGS['timezone'] === $key ? ' selected' : ''),
380
+                                                '>'.$zone.'</option>';
382 381
                                                 }
383 382
                                                 ?>
384 383
                                             </select>
@@ -390,11 +389,10 @@  discard block
 block discarded – undo
390 389
                                             <select class="form-control" id="profile-user-language">
391 390
                                                 <?php
392 391
                                                 foreach ($languages as $language) {
393
-                                                    echo '<option value="' . $language['label'] . '"',
392
+                                                    echo '<option value="'.$language['label'].'"',
394 393
                                                     $_SESSION['user_language'] === strtolower($language['label']) ?
395
-                                                    ' selected="selected"' :
396
-                                                    ($SETTINGS['default_language'] === strtolower($language['label']) ? ' selected="selected"' : ''),
397
-                                                '>' . $language['label'] . '</option>';
394
+                                                    ' selected="selected"' : ($SETTINGS['default_language'] === strtolower($language['label']) ? ' selected="selected"' : ''),
395
+                                                '>'.$language['label'].'</option>';
398 396
                                                 }
399 397
                                                 ?>
400 398
                                             </select>
@@ -406,10 +404,10 @@  discard block
 block discarded – undo
406 404
                                         <div class="col-sm-10">
407 405
                                             <select class="form-control" id="profile-user-treeloadstrategy">
408 406
                                                 <option value="<?php echo langHdl('sequential'); ?>"
409
-                                                    <?php echo isset($_SESSION['user_treeloadstrategy']) === true && $_SESSION['user_treeloadstrategy'] === 'sequential' ? ' selected' : '';?>
407
+                                                    <?php echo isset($_SESSION['user_treeloadstrategy']) === true && $_SESSION['user_treeloadstrategy'] === 'sequential' ? ' selected' : ''; ?>
410 408
                                                 ><?php echo langHdl('sequential'); ?></option>
411 409
                                                 <option value="<?php echo langHdl('full'); ?>"
412
-                                                    <?php echo isset($_SESSION['user_treeloadstrategy']) === true && $_SESSION['user_treeloadstrategy'] === 'full' ? ' selected' : '';?>
410
+                                                    <?php echo isset($_SESSION['user_treeloadstrategy']) === true && $_SESSION['user_treeloadstrategy'] === 'full' ? ' selected' : ''; ?>
413 411
                                                 ><?php echo langHdl('full'); ?></option>
414 412
                                             </select>
415 413
                                         </div>
@@ -443,7 +441,7 @@  discard block
 block discarded – undo
443 441
                                                 <button type="button" class="btn btn-warning float-right ml-2" id="profile-avatar-file"><?php echo langHdl('upload_new_avatar'); ?></button>
444 442
                                                 <?php
445 443
                                                 if (isset($SETTINGS['api']) === true && (int) $SETTINGS['api'] === 1) {
446
-                                                    echo '<button type="button" class="btn btn-warning float-right" id="profile-button-api_token">' . langHdl('generate_api_token') . '</button>';
444
+                                                    echo '<button type="button" class="btn btn-warning float-right" id="profile-button-api_token">'.langHdl('generate_api_token').'</button>';
447 445
                                                 }
448 446
                                                 ?>
449 447
                                                 <div id="profile-avatar-file-container" class="hidden"></div>
Please login to merge, or discard this patch.
pages/profile.js.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -43,11 +43,11 @@  discard block
 block discarded – undo
43 43
 }
44 44
 
45 45
 /* do checks */
46
-require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php';
46
+require_once $SETTINGS['cpassman_dir'].'/sources/checks.php';
47 47
 if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'profile', $SETTINGS) === false) {
48 48
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
49 49
     //not allowed page
50
-    include $SETTINGS['cpassman_dir'] . '/error.php';
50
+    include $SETTINGS['cpassman_dir'].'/error.php';
51 51
     exit;
52 52
 }
53 53
 ?>
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
                     $('#profile-username').html($('#profile-user-name').val() + ' ' + $('#profile-user-lastname').val());
213 213
 
214 214
                     // reload page in case of language change
215
-                    if ($('#profile-user-language').val().toLowerCase() !== '<?php echo $_SESSION['user_language'];?>') {
215
+                    if ($('#profile-user-language').val().toLowerCase() !== '<?php echo $_SESSION['user_language']; ?>') {
216 216
                         // prepare reload
217 217
                         $(this).delay(3000).queue(function() {
218 218
                             document.location.href = "index.php?page=profile";
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
                         // Inform user
224 224
                         toastr.remove();
225 225
                         toastr.info(
226
-                            '<?php echo langHdl('alert_page_will_reload') . ' ... ' . langHdl('please_wait'); ?>',
226
+                            '<?php echo langHdl('alert_page_will_reload').' ... '.langHdl('please_wait'); ?>',
227 227
                             '', {
228 228
                                 timeOut: 3000,
229 229
                                 progressBar: true
Please login to merge, or discard this patch.
index.php 1 patch
Spacing   +81 added lines, -81 removed lines patch added patch discarded remove patch
@@ -72,8 +72,8 @@  discard block
 block discarded – undo
72 72
 }
73 73
 
74 74
 // Include files
75
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
76
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
75
+require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
76
+require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php';
77 77
 // Quick major version check -> upgrade needed?
78 78
 if (isset($SETTINGS['cpassman_version']) === true && version_compare(TP_VERSION, $SETTINGS['cpassman_version']) > 0) {
79 79
     // Perform redirection
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
     exit;
87 87
 }
88 88
 
89
-require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
89
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
90 90
 $superGlobal = new protect\SuperGlobal\SuperGlobal();
91 91
 
92 92
 if (isset($SETTINGS['cpassman_url']) === false || $SETTINGS['cpassman_url'] === '') {
@@ -94,8 +94,8 @@  discard block
 block discarded – undo
94 94
 }
95 95
 
96 96
 // Include files
97
-require_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
98
-require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
97
+require_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
98
+require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
99 99
 // Open MYSQL database connection
100 100
 require_once './includes/libraries/Database/Meekrodb/db.class.php';
101 101
 if (defined('DB_PASSWD_CLEAR') === false) {
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 DB::$port = DB_PORT;
109 109
 DB::$encoding = DB_ENCODING;
110 110
 // Load Core library
111
-require_once $SETTINGS['cpassman_dir'] . '/sources/core.php';
111
+require_once $SETTINGS['cpassman_dir'].'/sources/core.php';
112 112
 // Prepare POST variables
113 113
 $post_language = filter_input(INPUT_POST, 'language', FILTER_SANITIZE_STRING);
114 114
 // Prepare superGlobal variables
@@ -138,8 +138,8 @@  discard block
 block discarded – undo
138 138
     //get default language
139 139
     $dataLanguage = DB::queryFirstRow(
140 140
         'SELECT m.valeur AS valeur, l.flag AS flag
141
-        FROM ' . prefixTable('misc') . ' AS m
142
-        INNER JOIN ' . prefixTable('languages') . ' AS l ON (m.valeur = l.name)
141
+        FROM ' . prefixTable('misc').' AS m
142
+        INNER JOIN ' . prefixTable('languages').' AS l ON (m.valeur = l.name)
143 143
         WHERE m.type=%s_type AND m.intitule=%s_intitule',
144 144
         [
145 145
             'type' => 'admin',
@@ -181,23 +181,23 @@  discard block
 block discarded – undo
181 181
 
182 182
 // Load user languages files
183 183
 if (in_array($session_user_language, $languagesList) === true) {
184
-    if (file_exists($SETTINGS['cpassman_dir'] . '/includes/language/' . $session_user_language . '.php') === true) {
185
-        $_SESSION['teampass']['lang'] = include $SETTINGS['cpassman_dir'] . '/includes/language/' . $session_user_language . '.php';
184
+    if (file_exists($SETTINGS['cpassman_dir'].'/includes/language/'.$session_user_language.'.php') === true) {
185
+        $_SESSION['teampass']['lang'] = include $SETTINGS['cpassman_dir'].'/includes/language/'.$session_user_language.'.php';
186 186
     }
187 187
 } else {
188 188
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
189 189
     //not allowed page
190
-    include $SETTINGS['cpassman_dir'] . '/error.php';
190
+    include $SETTINGS['cpassman_dir'].'/error.php';
191 191
 }
192 192
 
193 193
 // load 2FA Google
194 194
 if (isset($SETTINGS['google_authentication']) === true && $SETTINGS['google_authentication'] === '1') {
195
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/TwoFactorAuth/TwoFactorAuth.php';
195
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/TwoFactorAuth/TwoFactorAuth.php';
196 196
 }
197 197
 
198 198
 // load 2FA Yubico
199 199
 if (isset($SETTINGS['yubico_authentication']) === true && $SETTINGS['yubico_authentication'] === '1') {
200
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/Yubico/Yubico.php';
200
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/Yubico/Yubico.php';
201 201
 }
202 202
 
203 203
 // Some template adjust
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
     <!-- Toastr -->
255 255
     <link rel="stylesheet" href="plugins/toastr/toastr.min.css" />
256 256
     <!-- favicon -->
257
-    <link rel="shortcut icon" type="image/png" href="<?php echo $SETTINGS['favicon'];?>"/>
257
+    <link rel="shortcut icon" type="image/png" href="<?php echo $SETTINGS['favicon']; ?>"/>
258 258
 </head>
259 259
 
260 260
 
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
             ),
286 286
             'SESSION'
287 287
         );
288
-        include $SETTINGS['cpassman_dir'] . '/error.php';
288
+        include $SETTINGS['cpassman_dir'].'/error.php';
289 289
     }
290 290
 } elseif (
291 291
     $session_validite_pw !== null
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
                         <div class="dropdown show">
330 330
                             <a class="btn btn-primary dropdown-toggle" href="#" data-toggle="dropdown">
331 331
                                 <?php
332
-                                    echo $session_name . '&nbsp;' . $session_lastname; ?>
332
+                                    echo $session_name.'&nbsp;'.$session_lastname; ?>
333 333
                             </a>
334 334
 
335 335
                             <div class="dropdown-menu dropdown-menu-right">
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
             <!-- Main Sidebar Container -->
368 368
             <aside class="main-sidebar sidebar-dark-primary elevation-4">
369 369
                 <!-- Brand Logo -->
370
-                <a href="<?php echo $SETTINGS['cpassman_url'] . '/index.php?page=items'; ?>" class="brand-link">
370
+                <a href="<?php echo $SETTINGS['cpassman_url'].'/index.php?page=items'; ?>" class="brand-link">
371 371
                     <img src="includes/images/teampass-logo2-home.png" alt="Teampass Logo" class="brand-image">
372 372
                     <span class="brand-text font-weight-light"><?php echo TP_TOOL_NAME; ?></span>
373 373
                 </a>
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
                         <a href="#" data-name="items" class="nav-link', $get['page'] === 'items' ? ' active' : '', '">
386 386
                         <i class="nav-icon fas fa-key"></i>
387 387
                         <p>
388
-                            ' . langHdl('pw') . '
388
+                            ' . langHdl('pw').'
389 389
                         </p>
390 390
                         </a>
391 391
                     </li>';
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
                         <a href="#" data-name="import" class="nav-link', $get['page'] === 'import' ? ' active' : '', '">
402 402
                         <i class="nav-icon fas fa-file-import"></i>
403 403
                         <p>
404
-                            ' . langHdl('import') . '
404
+                            ' . langHdl('import').'
405 405
                         </p>
406 406
                         </a>
407 407
                     </li>';
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
                         <a href="#" data-name="export" class="nav-link', $get['page'] === 'export' ? ' active' : '', '">
423 423
                         <i class="nav-icon fas fa-file-export"></i>
424 424
                         <p>
425
-                            ' . langHdl('export') . '
425
+                            ' . langHdl('export').'
426 426
                         </p>
427 427
                         </a>
428 428
                     </li>';
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
                         <a href="#" data-name="search" class="nav-link', $get['page'] === 'search' ? ' active' : '', '">
450 450
                         <i class="nav-icon fas fa-search"></i>
451 451
                         <p>
452
-                            ' . langHdl('find') . '
452
+                            ' . langHdl('find').'
453 453
                         </p>
454 454
                         </a>
455 455
                     </li>';
@@ -466,7 +466,7 @@  discard block
 block discarded – undo
466 466
                         <a href="#" data-name="favourites" class="nav-link', $get['page'] === 'admin' ? ' favourites' : '', '">
467 467
                         <i class="nav-icon fas fa-star"></i>
468 468
                         <p>
469
-                            ' . langHdl('favorites') . '
469
+                            ' . langHdl('favorites').'
470 470
                         </p>
471 471
                         </a>
472 472
                     </li>';
@@ -496,7 +496,7 @@  discard block
 block discarded – undo
496 496
                         <a href="#" data-name="suggestion" class="nav-link', $get['page'] === 'suggestion' ? ' active' : '', '">
497 497
                         <i class="nav-icon fas fa-lightbulb"></i>
498 498
                         <p>
499
-                            ' . langHdl('suggestion_menu') . '
499
+                            ' . langHdl('suggestion_menu').'
500 500
                         </p>
501 501
                         </a>
502 502
                     </li>';
@@ -509,7 +509,7 @@  discard block
 block discarded – undo
509 509
                         <a href="#" data-name="admin" class="nav-link', $get['page'] === 'admin' ? ' active' : '', '">
510 510
                         <i class="nav-icon fas fa-info"></i>
511 511
                         <p>
512
-                            ' . langHdl('admin_main') . '
512
+                            ' . langHdl('admin_main').'
513 513
                         </p>
514 514
                         </a>
515 515
                     </li>
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
                         <a href="#" class="nav-link">
518 518
                             <i class="nav-icon fas fa-wrench"></i>
519 519
                             <p>
520
-                                ' . langHdl('admin_settings') . '
520
+                                ' . langHdl('admin_settings').'
521 521
                                 <i class="fas fa-angle-left right"></i>
522 522
                             </p>
523 523
                         </a>
@@ -525,55 +525,55 @@  discard block
 block discarded – undo
525 525
                             <li class="nav-item">
526 526
                                 <a href="#" data-name="options" class="nav-link', $get['page'] === 'options' ? ' active' : '', '">
527 527
                                     <i class="fas fa-check-double nav-icon"></i>
528
-                                    <p>' . langHdl('options') . '</p>
528
+                                    <p>' . langHdl('options').'</p>
529 529
                                 </a>
530 530
                             </li>
531 531
                             <li class="nav-item">
532 532
                                 <a href="#" data-name="2fa" class="nav-link', $get['page'] === '2fa' ? ' active' : '', '">
533 533
                                     <i class="fas fa-qrcode nav-icon"></i>
534
-                                    <p>' . langHdl('mfa_short') . '</p>
534
+                                    <p>' . langHdl('mfa_short').'</p>
535 535
                                 </a>
536 536
                             </li>
537 537
                             <li class="nav-item">
538 538
                                 <a href="#" data-name="api" class="nav-link', $get['page'] === 'api' ? ' active' : '', '">
539 539
                                     <i class="fas fa-cubes nav-icon"></i>
540
-                                    <p>' . langHdl('api') . '</p>
540
+                                    <p>' . langHdl('api').'</p>
541 541
                                 </a>
542 542
                             </li>
543 543
                             <li class="nav-item">
544 544
                                 <a href="#" data-name="backups" class="nav-link', $get['page'] === 'backups' ? ' active' : '', '">
545 545
                                     <i class="fas fa-database nav-icon"></i>
546
-                                    <p>' . langHdl('backups') . '</p>
546
+                                    <p>' . langHdl('backups').'</p>
547 547
                                 </a>
548 548
                             </li>
549 549
                             <li class="nav-item">
550 550
                                 <a href="#" data-name="emails" class="nav-link', $get['page'] === 'emails' ? ' active' : '', '">
551 551
                                     <i class="fas fa-envelope nav-icon"></i>
552
-                                    <p>' . langHdl('emails') . '</p>
552
+                                    <p>' . langHdl('emails').'</p>
553 553
                                 </a>
554 554
                             </li>
555 555
                             <li class="nav-item">
556 556
                                 <a href="#" data-name="fields" class="nav-link', $get['page'] === 'fields' ? ' active' : '', '">
557 557
                                     <i class="fas fa-keyboard nav-icon"></i>
558
-                                    <p>' . langHdl('fields') . '</p>
558
+                                    <p>' . langHdl('fields').'</p>
559 559
                                 </a>
560 560
                             </li>
561 561
                             <li class="nav-item">
562 562
                                 <a href="#" data-name="ldap" class="nav-link', $get['page'] === 'ldap' ? ' active' : '', '">
563 563
                                     <i class="fas fa-id-card nav-icon"></i>
564
-                                    <p>' . langHdl('ldap') . '</p>
564
+                                    <p>' . langHdl('ldap').'</p>
565 565
                                 </a>
566 566
                             </li>
567 567
                             <li class="nav-item">
568 568
                                 <a href="#" data-name="uploads" class="nav-link', $get['page'] === 'uploads' ? ' active' : '', '">
569 569
                                     <i class="fas fa-file-upload nav-icon"></i>
570
-                                    <p>' . langHdl('uploads') . '</p>
570
+                                    <p>' . langHdl('uploads').'</p>
571 571
                                 </a>
572 572
                             </li>
573 573
                             <li class="nav-item">
574 574
                                 <a href="#" data-name="statistics" class="nav-link', $get['page'] === 'statistics' ? ' active' : '', '">
575 575
                                     <i class="fas fa-chart-bar nav-icon"></i>
576
-                                    <p>' . langHdl('statistics') . '</p>
576
+                                    <p>' . langHdl('statistics').'</p>
577 577
                                 </a>
578 578
                             </li>
579 579
                         </ul>
@@ -582,7 +582,7 @@  discard block
 block discarded – undo
582 582
                         <a href="#" data-name="actions" class="nav-link', $get['page'] === 'actions' ? ' active' : '', '">
583 583
                         <i class="nav-icon fas fa-cogs"></i>
584 584
                         <p>
585
-                            ' . langHdl('actions') . '
585
+                            ' . langHdl('actions').'
586 586
                         </p>
587 587
                         </a>
588 588
                     </li>';
@@ -598,7 +598,7 @@  discard block
 block discarded – undo
598 598
                         <a href="#" data-name="folders" class="nav-link', $get['page'] === 'folders' ? ' active' : '', '">
599 599
                         <i class="nav-icon fas fa-folder-open"></i>
600 600
                         <p>
601
-                            ' . langHdl('folders') . '
601
+                            ' . langHdl('folders').'
602 602
                         </p>
603 603
                         </a>
604 604
                     </li>
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
                         <a href="#" data-name="roles" class="nav-link', $get['page'] === 'roles' ? ' active' : '', '">
607 607
                         <i class="nav-icon fas fa-graduation-cap"></i>
608 608
                         <p>
609
-                            ' . langHdl('roles') . '
609
+                            ' . langHdl('roles').'
610 610
                         </p>
611 611
                         </a>
612 612
                     </li>
@@ -614,38 +614,38 @@  discard block
 block discarded – undo
614 614
                         <a href="#" data-name="users" class="nav-link', $get['page'] === 'users' ? ' active' : '', '">
615 615
                         <i class="nav-icon fas fa-users"></i>
616 616
                         <p>
617
-                            ' . langHdl('users') . '
617
+                            ' . langHdl('users').'
618 618
                         </p>
619 619
                         </a>
620 620
                     </li>
621 621
                     <li class="nav-item has-treeview', $menuUtilities === true ? ' menu-open' : '', '">
622 622
                         <a href="#" class="nav-link">
623 623
                         <i class="nav-icon fas fa-cubes"></i>
624
-                        <p>' . langHdl('admin_views') . '<i class="fas fa-angle-left right"></i></p>
624
+                        <p>' . langHdl('admin_views').'<i class="fas fa-angle-left right"></i></p>
625 625
                         </a>
626 626
                         <ul class="nav nav-treeview">
627 627
                           <li class="nav-item">
628 628
                             <a href="#" data-name="utilities.renewal" class="nav-link', $get['page'] === 'utilities.renewal' ? ' active' : '', '">
629 629
                               <i class="far fa-calendar-alt nav-icon"></i>
630
-                              <p>' . langHdl('renewal') . '</p>
630
+                              <p>' . langHdl('renewal').'</p>
631 631
                             </a>
632 632
                           </li>
633 633
                           <li class="nav-item">
634 634
                             <a href="#" data-name="utilities.deletion" class="nav-link', $get['page'] === 'utilities.deletion' ? ' active' : '', '">
635 635
                               <i class="fas fa-trash-alt nav-icon"></i>
636
-                              <p>' . langHdl('deletion') . '</p>
636
+                              <p>' . langHdl('deletion').'</p>
637 637
                             </a>
638 638
                           </li>
639 639
                           <li class="nav-item">
640 640
                             <a href="#" data-name="utilities.logs" class="nav-link', $get['page'] === 'utilities.logs' ? ' active' : '', '">
641 641
                               <i class="fas fa-history nav-icon"></i>
642
-                              <p>' . langHdl('logs') . '</p>
642
+                              <p>' . langHdl('logs').'</p>
643 643
                             </a>
644 644
                           </li>
645 645
                           <li class="nav-item">
646 646
                             <a href="#" data-name="utilities.database" class="nav-link', $get['page'] === 'utilities.database' ? ' active' : '', '">
647 647
                               <i class="fas fa-database nav-icon"></i>
648
-                              <p>' . langHdl('database') . '</p>
648
+                              <p>' . langHdl('database').'</p>
649 649
                             </a>
650 650
                           </li>
651 651
                         </ul>
@@ -656,10 +656,10 @@  discard block
 block discarded – undo
656 656
                     <!-- /.sidebar-menu -->
657 657
                 <div class="menu-footer">
658 658
                     <div class="" id="sidebar-footer">
659
-                        <i class="fas fa-clock-o mr-2 infotip text-info pointer" title="<?php echo langHdl('server_time') . ' ' .
660
-                            date($SETTINGS['date_format'], (int) $server['request_time']) . ' - ' .
659
+                        <i class="fas fa-clock-o mr-2 infotip text-info pointer" title="<?php echo langHdl('server_time').' '.
660
+                            date($SETTINGS['date_format'], (int) $server['request_time']).' - '.
661 661
                             date($SETTINGS['time_format'], (int) $server['request_time']); ?>"></i>
662
-                        <i class="fas fa-users mr-2 infotip text-info pointer" title="<?php echo $session_nb_users_online . ' ' . langHdl('users_online'); ?>"></i>
662
+                        <i class="fas fa-users mr-2 infotip text-info pointer" title="<?php echo $session_nb_users_online.' '.langHdl('users_online'); ?>"></i>
663 663
                         <a href="<?php echo READTHEDOC_URL; ?>" target="_blank" class="text-info"><i class="fas fa-book mr-2 infotip" title="<?php echo langHdl('documentation_canal'); ?> ReadTheDocs"></i></a>
664 664
                         <a href="<?php echo REDDIT_URL; ?>" target="_blank" class="text-info"><i class="fab fa-reddit-alien mr-2 infotip" title="<?php echo langHdl('admin_help'); ?>"></i></a>
665 665
                         <i class="fas fa-bug infotip pointer text-info" title="<?php echo langHdl('bugs_page'); ?>" onclick="generateBugReport()"></i>
@@ -962,18 +962,18 @@  discard block
 block discarded – undo
962 962
                     } elseif ($get['page'] === 'items') {
963 963
                         // SHow page with Items
964 964
                         if ((int) $session_user_admin !== 1) {
965
-                            include $SETTINGS['cpassman_dir'] . '/pages/items.php';
965
+                            include $SETTINGS['cpassman_dir'].'/pages/items.php';
966 966
                         } elseif ((int) $session_user_admin === 1) {
967
-                            include $SETTINGS['cpassman_dir'] . '/pages/admin.php';
967
+                            include $SETTINGS['cpassman_dir'].'/pages/admin.php';
968 968
                         } else {
969 969
                             $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
970 970
                             //not allowed page
971
-                            include $SETTINGS['cpassman_dir'] . '/error.php';
971
+                            include $SETTINGS['cpassman_dir'].'/error.php';
972 972
                         }
973 973
                     } elseif (in_array($get['page'], array_keys($mngPages)) === true) {
974 974
                         // Define if user is allowed to see management pages
975 975
                         if ($session_user_admin === 1) {
976
-                            include $SETTINGS['cpassman_dir'] . '/pages/' . $mngPages[$get['page']];
976
+                            include $SETTINGS['cpassman_dir'].'/pages/'.$mngPages[$get['page']];
977 977
                         } elseif ($session_user_manager === 1 || $session_user_human_resources === 1) {
978 978
                             if ($get['page'] !== 'manage_main'
979 979
                                 && $get['page'] !== 'manage_settings'
@@ -982,15 +982,15 @@  discard block
 block discarded – undo
982 982
                             } else {
983 983
                                 $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
984 984
                                 //not allowed page
985
-                                include $SETTINGS['cpassman_dir'] . '/error.php';
985
+                                include $SETTINGS['cpassman_dir'].'/error.php';
986 986
                             }
987 987
                         } else {
988 988
                             $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
989 989
                             //not allowed page
990
-                            include $SETTINGS['cpassman_dir'] . '/error.php';
990
+                            include $SETTINGS['cpassman_dir'].'/error.php';
991 991
                         }
992 992
                     } elseif (empty($get['page']) === false) {
993
-                        include $SETTINGS['cpassman_dir'] . '/pages/' . $get['page'] . '.php';
993
+                        include $SETTINGS['cpassman_dir'].'/pages/'.$get['page'].'.php';
994 994
                     } else {
995 995
                         $_SESSION['error']['code'] = ERR_NOT_EXIST;
996 996
                         //page doesn't exist
@@ -1080,7 +1080,7 @@  discard block
 block discarded – undo
1080 1080
     $superGlobal->put('initialUrl', '', 'SESSION');
1081 1081
 
1082 1082
     // LOGIN form
1083
-    include $SETTINGS['cpassman_dir'] . '/includes/core/login.php';
1083
+    include $SETTINGS['cpassman_dir'].'/includes/core/login.php';
1084 1084
 }
1085 1085
 
1086 1086
     ?>
@@ -1270,61 +1270,61 @@  discard block
 block discarded – undo
1270 1270
     isset($_SESSION['CPM']) === true
1271 1271
     && isset($SETTINGS['cpassman_dir']) === true
1272 1272
 ) {
1273
-    include_once $SETTINGS['cpassman_dir'] . '/includes/core/load.js.php';
1273
+    include_once $SETTINGS['cpassman_dir'].'/includes/core/load.js.php';
1274 1274
     if ($menuAdmin === true) {
1275
-        include_once $SETTINGS['cpassman_dir'] . '/pages/admin.js.php';
1275
+        include_once $SETTINGS['cpassman_dir'].'/pages/admin.js.php';
1276 1276
         if ($get['page'] === '2fa') {
1277
-            include_once $SETTINGS['cpassman_dir'] . '/pages/2fa.js.php';
1277
+            include_once $SETTINGS['cpassman_dir'].'/pages/2fa.js.php';
1278 1278
         } elseif ($get['page'] === 'api') {
1279
-            include_once $SETTINGS['cpassman_dir'] . '/pages/api.js.php';
1279
+            include_once $SETTINGS['cpassman_dir'].'/pages/api.js.php';
1280 1280
         } elseif ($get['page'] === 'backups') {
1281
-            include_once $SETTINGS['cpassman_dir'] . '/pages/backups.js.php';
1281
+            include_once $SETTINGS['cpassman_dir'].'/pages/backups.js.php';
1282 1282
         } elseif ($get['page'] === 'emails') {
1283
-            include_once $SETTINGS['cpassman_dir'] . '/pages/emails.js.php';
1283
+            include_once $SETTINGS['cpassman_dir'].'/pages/emails.js.php';
1284 1284
         } elseif ($get['page'] === 'ldap') {
1285
-            include_once $SETTINGS['cpassman_dir'] . '/pages/ldap.js.php';
1285
+            include_once $SETTINGS['cpassman_dir'].'/pages/ldap.js.php';
1286 1286
         } elseif ($get['page'] === 'uploads') {
1287
-            include_once $SETTINGS['cpassman_dir'] . '/pages/uploads.js.php';
1287
+            include_once $SETTINGS['cpassman_dir'].'/pages/uploads.js.php';
1288 1288
         } elseif ($get['page'] === 'actions') {
1289
-            include_once $SETTINGS['cpassman_dir'] . '/pages/actions.js.php';
1289
+            include_once $SETTINGS['cpassman_dir'].'/pages/actions.js.php';
1290 1290
         } elseif ($get['page'] === 'fields') {
1291
-            include_once $SETTINGS['cpassman_dir'] . '/pages/fields.js.php';
1291
+            include_once $SETTINGS['cpassman_dir'].'/pages/fields.js.php';
1292 1292
         } elseif ($get['page'] === 'options') {
1293
-            include_once $SETTINGS['cpassman_dir'] . '/pages/options.js.php';
1293
+            include_once $SETTINGS['cpassman_dir'].'/pages/options.js.php';
1294 1294
         } elseif ($get['page'] === 'statistics') {
1295
-            include_once $SETTINGS['cpassman_dir'] . '/pages/statistics.js.php';
1295
+            include_once $SETTINGS['cpassman_dir'].'/pages/statistics.js.php';
1296 1296
         }
1297 1297
     } elseif (isset($get['page']) === true && $get['page'] !== '') {
1298 1298
         if ($get['page'] === 'items') {
1299
-            include_once $SETTINGS['cpassman_dir'] . '/pages/items.js.php';
1299
+            include_once $SETTINGS['cpassman_dir'].'/pages/items.js.php';
1300 1300
         } elseif ($get['page'] === 'import') {
1301
-            include_once $SETTINGS['cpassman_dir'] . '/pages/import.js.php';
1301
+            include_once $SETTINGS['cpassman_dir'].'/pages/import.js.php';
1302 1302
         } elseif ($get['page'] === 'export') {
1303
-            include_once $SETTINGS['cpassman_dir'] . '/pages/export.js.php';
1303
+            include_once $SETTINGS['cpassman_dir'].'/pages/export.js.php';
1304 1304
         } elseif ($get['page'] === 'offline') {
1305
-            include_once $SETTINGS['cpassman_dir'] . '/pages/offline.js.php';
1305
+            include_once $SETTINGS['cpassman_dir'].'/pages/offline.js.php';
1306 1306
         } elseif ($get['page'] === 'search') {
1307
-            include_once $SETTINGS['cpassman_dir'] . '/pages/search.js.php';
1307
+            include_once $SETTINGS['cpassman_dir'].'/pages/search.js.php';
1308 1308
         } elseif ($get['page'] === 'profile') {
1309
-            include_once $SETTINGS['cpassman_dir'] . '/pages/profile.js.php';
1309
+            include_once $SETTINGS['cpassman_dir'].'/pages/profile.js.php';
1310 1310
         } elseif ($get['page'] === 'favourites') {
1311
-            include_once $SETTINGS['cpassman_dir'] . '/pages/favorites.js.php';
1311
+            include_once $SETTINGS['cpassman_dir'].'/pages/favorites.js.php';
1312 1312
         } elseif ($get['page'] === 'folders') {
1313
-            include_once $SETTINGS['cpassman_dir'] . '/pages/folders.js.php';
1313
+            include_once $SETTINGS['cpassman_dir'].'/pages/folders.js.php';
1314 1314
         } elseif ($get['page'] === 'users') {
1315
-            include_once $SETTINGS['cpassman_dir'] . '/pages/users.js.php';
1315
+            include_once $SETTINGS['cpassman_dir'].'/pages/users.js.php';
1316 1316
         } elseif ($get['page'] === 'roles') {
1317
-            include_once $SETTINGS['cpassman_dir'] . '/pages/roles.js.php';
1317
+            include_once $SETTINGS['cpassman_dir'].'/pages/roles.js.php';
1318 1318
         } elseif ($get['page'] === 'utilities.deletion') {
1319
-            include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.deletion.js.php';
1319
+            include_once $SETTINGS['cpassman_dir'].'/pages/utilities.deletion.js.php';
1320 1320
         } elseif ($get['page'] === 'utilities.logs') {
1321
-            include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.logs.js.php';
1321
+            include_once $SETTINGS['cpassman_dir'].'/pages/utilities.logs.js.php';
1322 1322
         } elseif ($get['page'] === 'utilities.database') {
1323
-            include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.database.js.php';
1323
+            include_once $SETTINGS['cpassman_dir'].'/pages/utilities.database.js.php';
1324 1324
         } elseif ($get['page'] === 'utilities.renewal') {
1325
-            include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.renewal.js.php';
1325
+            include_once $SETTINGS['cpassman_dir'].'/pages/utilities.renewal.js.php';
1326 1326
         }
1327 1327
     } else {
1328
-        include_once $SETTINGS['cpassman_dir'] . '/includes/core/login.js.php';
1328
+        include_once $SETTINGS['cpassman_dir'].'/includes/core/login.js.php';
1329 1329
     }
1330 1330
 }
Please login to merge, or discard this patch.