Passed
Push — teampass_3.0 ( f644bb...9dbfce )
by Nils
12:26
created
includes/core/login.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -48,13 +48,13 @@  discard block
 block discarded – undo
48 48
     <div class="login-logo">',
49 49
     isset($SETTINGS['custom_logo']) === true
50 50
         && empty($SETTINGS['custom_logo']) === false ?
51
-        '<img src="' . (string) $SETTINGS['custom_logo'] . '" alt="" style="text-align:center;" />' : '',
51
+        '<img src="'.(string) $SETTINGS['custom_logo'].'" alt="" style="text-align:center;" />' : '',
52 52
     '
53 53
         <div style="margin-top:20px;">
54 54
             <img src="includes/images/teampass-logo2-login.png" alt="Teampass Logo">
55 55
         </div>
56 56
         <div style="font-weight:bold;">
57
-            ' . TP_TOOL_NAME . '
57
+            ' . TP_TOOL_NAME.'
58 58
         </div>
59 59
     </div>
60 60
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
     isset($SETTINGS['enable_http_request_login']) === true
78 78
     && (int) $SETTINGS['enable_http_request_login'] === 1
79 79
     && $superGlobal('PHP_AUTH_USER', 'SERVER') !== null
80
-    && ! (isset($SETTINGS['maintenance_mode']) === true
80
+    && !(isset($SETTINGS['maintenance_mode']) === true
81 81
         && (int) $SETTINGS['maintenance_mode'] === 1)
82 82
 ) {
83 83
     if (strpos($superGlobal('PHP_AUTH_USER', 'SERVER'), '@') !== false) {
@@ -91,22 +91,22 @@  discard block
 block discarded – undo
91 91
             <input type="text" id="login" class="form-control" placeholder="', filter_var($username, FILTER_SANITIZE_STRING), '" readonly>';
92 92
 } else {
93 93
     echo '
94
-            <input type="text" id="login" class="form-control" placeholder="' . langHdl('index_login') . '">';
94
+            <input type="text" id="login" class="form-control" placeholder="' . langHdl('index_login').'">';
95 95
 }
96 96
 
97 97
 echo '
98 98
         </div>';
99
-if (! (isset($SETTINGS['enable_http_request_login']) === true
99
+if (!(isset($SETTINGS['enable_http_request_login']) === true
100 100
     && (int) $SETTINGS['enable_http_request_login'] === 1
101 101
     && $superGlobal('PHP_AUTH_USER', 'SERVER') !== null
102
-    && ! (isset($SETTINGS['maintenance_mode']) === true
102
+    && !(isset($SETTINGS['maintenance_mode']) === true
103 103
         && (int) $SETTINGS['maintenance_mode'] === 1))) {
104 104
     echo '
105 105
         <div class="input-group has-feedback mb-2">
106 106
             <div class="input-group-prepend">
107 107
                 <span class="input-group-text"><i class="fas fa-lock fa-fw"></i></span>
108 108
             </div>
109
-            <input type="password" id="pw" class="form-control submit-button" placeholder="' . langHdl('index_password') . '">
109
+            <input type="password" id="pw" class="form-control submit-button" placeholder="' . langHdl('index_password').'">
110 110
         </div>';
111 111
 }
112 112
 
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
                 <span class="input-group-text"><i class="fas fa-clock fa-fw"></i></span>
117 117
             </div>
118 118
             <input type="text" id="session_duration" class="form-control submit-button" 
119
-            placeholder="' . langHdl('index_session_duration') .'&nbsp;(' . langHdl('minutes') . ')" 
119
+            placeholder="' . langHdl('index_session_duration').'&nbsp;('.langHdl('minutes').')" 
120 120
             value="', isset($SETTINGS['default_session_expiration_time']) === true ? $SETTINGS['default_session_expiration_time'] : '', '">
121 121
         </div>';
122 122
 // 2FA auth selector
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
     '" />
130 130
         <div class="row mb-3 hidden" id="2fa_methods_selector">
131 131
             <div class="col-12">
132
-                <h8 class="login-box-msg">' . langHdl('2fa_authentication_selector') . '</h8>
132
+                <h8 class="login-box-msg">' . langHdl('2fa_authentication_selector').'</h8>
133 133
                 <div class="2fa-methods text-center mt-2">',
134 134
     isset($SETTINGS['google_authentication']) === true && (int) $SETTINGS['google_authentication'] === 1 ?
135 135
         '
@@ -177,11 +177,11 @@  discard block
 block discarded – undo
177 177
                 <div class="col-1">
178 178
                 </div>
179 179
                 <div class="col-8">
180
-                    <input type="text" id="ga_code" class="form-control submit-button" placeholder="' . langHdl('ga_identification_code') . '" />
180
+                    <input type="text" id="ga_code" class="form-control submit-button" placeholder="' . langHdl('ga_identification_code').'" />
181 181
                 </div>
182 182
                 <div class="col-1">
183 183
                     <i class="fas fa-envelope form-control-feedback pointer infotip text-info" 
184
-                    title="' . langHdl('i_need_to_generate_new_ga_code') . '" onclick="send_user_new_temporary_ga_code()"></i>
184
+                    title="' . langHdl('i_need_to_generate_new_ga_code').'" onclick="send_user_new_temporary_ga_code()"></i>
185 185
                 </div>
186 186
             </div>
187 187
             <div id="div-2fa-google-qr" class="row mt-2 "></div>
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 <script>
199 199
 var seconds = 1;
200 200
 function updateLogonButton(timeToGo){
201
-    document.getElementById("but_identify_user").value = "' . langHdl('duration_login_attempt') . ' " + timeToGo;
201
+    document.getElementById("but_identify_user").value = "' . langHdl('duration_login_attempt').' " + timeToGo;
202 202
 }
203 203
 $( window ).on( "load", function() {
204 204
     updateLogonButton(seconds);
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
         if (seconds >= 0) {
208 208
             updateLogonButton(seconds);
209 209
         } else if(seconds === 0) {
210
-            launchIdentify("", "' . $nextUrl . '");
210
+            launchIdentify("", "' . $nextUrl.'");
211 211
         }
212 212
         updateLogonButton(seconds);
213 213
     },
@@ -228,15 +228,15 @@  discard block
 block discarded – undo
228 228
             <div class="col-8">
229 229
                 <div id="yubiko-new-key" class="alert alert-info hidden">
230 230
                     <p>
231
-                        <input type="text" size="10" id="yubico_user_id" class="form-control" placeholder="' . langHdl('yubico_user_id') . '">
231
+                        <input type="text" size="10" id="yubico_user_id" class="form-control" placeholder="' . langHdl('yubico_user_id').'">
232 232
                     </p>
233 233
                     <p>
234
-                    <input type="text" size="10" id="yubico_user_key" class="form-control" placeholder="' . langHdl('yubico_user_key') . '">
234
+                    <input type="text" size="10" id="yubico_user_key" class="form-control" placeholder="' . langHdl('yubico_user_key').'">
235 235
                     </p>
236 236
                 </div>
237
-                <input autocomplete="off" type="text" id="yubico_key" class="form-control submit-button" placeholder="' . langHdl('press_your_yubico_key') . '">
237
+                <input autocomplete="off" type="text" id="yubico_key" class="form-control submit-button" placeholder="' . langHdl('press_your_yubico_key').'">
238 238
                 <div class="row">
239
-                    <span class="ml-2 mt-1 font-weight-light small pointer" id="register-yubiko-key">' . langHdl('register_new_yubiko_key') . '</span>
239
+                    <span class="ml-2 mt-1 font-weight-light small pointer" id="register-yubiko-key">' . langHdl('register_new_yubiko_key').'</span>
240 240
                 </div>
241 241
             </div>
242 242
         </div>';
@@ -245,22 +245,22 @@  discard block
 block discarded – undo
245 245
 echo '
246 246
         <div class="row mb-3 mt-5">
247 247
             <div class="col-12">
248
-                <button id="but_identify_user" class="btn btn-primary btn-block">' . langHdl('log_in') . '</button>
248
+                <button id="but_identify_user" class="btn btn-primary btn-block">' . langHdl('log_in').'</button>
249 249
                 
250 250
                 <!-- In case of upgrade, the user has to provide his One Time Code -->
251 251
                 <div class="card-body user-one-time-code-card-body hidden">
252
-                    <h5 class="login-box-msg">' . langHdl('provide_personal_one_time_code') . '</h5>
252
+                    <h5 class="login-box-msg">' . langHdl('provide_personal_one_time_code').'</h5>
253 253
 
254 254
                     <div class="input-group has-feedback mb-2 mt-4">
255 255
                         <div class="input-group-prepend">
256 256
                             <span class="input-group-text"><i class="fas fa-unlock-alt"></i></span>
257 257
                         </div>
258
-                        <input type="password" id="user-one-time-code" class="form-control" placeholder="' . langHdl('one_time_code') . '">
258
+                        <input type="password" id="user-one-time-code" class="form-control" placeholder="' . langHdl('one_time_code').'">
259 259
                     </div>
260 260
 
261 261
                     <div class="row mb-3">
262 262
                         <div class="col-12">
263
-                            <button id="but_confirm_otc" class="btn btn-primary btn-block">' . langHdl('confirm') . '</button>
263
+                            <button id="but_confirm_otc" class="btn btn-primary btn-block">' . langHdl('confirm').'</button>
264 264
                         </div>
265 265
                     </div>
266 266
                 </div>
@@ -275,10 +275,10 @@  discard block
 block discarded – undo
275 275
 // In case of password change
276 276
 echo '
277 277
     <div class="card-body confirm-password-card-body hidden">
278
-        <h5 class="login-box-msg">' . langHdl('new_password_required') . '</h5>
278
+        <h5 class="login-box-msg">' . langHdl('new_password_required').'</h5>
279 279
 
280 280
         <div class="alert alert-info">
281
-            <div class="text-center"><i class="icon fa fa-info"></i>' . langHdl('password_strength') . '
281
+            <div class="text-center"><i class="icon fa fa-info"></i>' . langHdl('password_strength').'
282 282
             <span id="confirm-password-level" class="ml-2 font-weight-bold"></span></div>
283 283
         </div>
284 284
 
@@ -288,20 +288,20 @@  discard block
 block discarded – undo
288 288
                     <div class="input-group-prepend">
289 289
                         <span class="input-group-text"><i class="fa fa-key"></i></span>
290 290
                     </div>
291
-                    <input type="password" id="current-user-password" class="form-control" placeholder="' . langHdl('current_password') . '">
291
+                    <input type="password" id="current-user-password" class="form-control" placeholder="' . langHdl('current_password').'">
292 292
                 </div>
293 293
             </div>
294 294
             <div class="input-group has-feedback mb-2 mt-4">
295 295
                 <div class="input-group-prepend">
296 296
                     <span class="input-group-text"><i class="fa fa-key"></i></span>
297 297
                 </div>
298
-                <input type="password" id="new-user-password" class="form-control" placeholder="' . langHdl('index_new_pw') . '">
298
+                <input type="password" id="new-user-password" class="form-control" placeholder="' . langHdl('index_new_pw').'">
299 299
             </div>
300 300
             <div class="input-group has-feedback mb-2">
301 301
                 <div class="input-group-prepend">
302 302
                     <span class="input-group-text"><i class="fa fa-key"></i></span>
303 303
                 </div>
304
-                <input type="password" id="new-user-password-confirm" class="form-control" placeholder="' . langHdl('index_change_pw_confirmation') . '">
304
+                <input type="password" id="new-user-password-confirm" class="form-control" placeholder="' . langHdl('index_change_pw_confirmation').'">
305 305
             </div>
306 306
             <div class="row mb-3">
307 307
                 <div class="col-md-12 offset-sm-4 text-center">
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
             </div>
313 313
             <div class="row mb-3">
314 314
                 <div class="col-12">
315
-                    <button id="but_confirm_new_password" class="btn btn-primary btn-block">' . langHdl('confirm') . '</button>
315
+                    <button id="but_confirm_new_password" class="btn btn-primary btn-block">' . langHdl('confirm').'</button>
316 316
                 </div>
317 317
             </div>
318 318
         </div>
@@ -320,20 +320,20 @@  discard block
 block discarded – undo
320 320
 
321 321
     <div class="card-body hidden" id="card-user-treat-psk">
322 322
         <div class="alert alert-info">
323
-            <div class="text-center"><i class="icon fa fa-info"></i>' . langHdl('user_has_psk_info') . '</div>
323
+            <div class="text-center"><i class="icon fa fa-info"></i>' . langHdl('user_has_psk_info').'</div>
324 324
         </div>
325 325
         <div class="input-group has-feedback mb-2">
326 326
             <div class="input-group-prepend">
327 327
                 <span class="input-group-text"><i class="fa fa-key"></i></span>
328 328
             </div>
329
-            <input type="password" id="user-old-defuse-psk" class="form-control" placeholder="' . langHdl('home_personal_saltkey') . '">
329
+            <input type="password" id="user-old-defuse-psk" class="form-control" placeholder="' . langHdl('home_personal_saltkey').'">
330 330
         </div>
331 331
         <div class="row mb-3 mt-4">
332 332
             <div class="col-12">
333
-                <button id="but_confirm_defuse_psk" class="btn btn-primary btn-block">' . langHdl('launch') . '</button>
333
+                <button id="but_confirm_defuse_psk" class="btn btn-primary btn-block">' . langHdl('launch').'</button>
334 334
             </div>
335 335
             <div class="col-12 mt-3">
336
-                <button id="but_confirm_forgot_defuse_psk" class="btn btn-danger btn-block text-bold">' . langHdl('i_cannot_remember') . '</button>
336
+                <button id="but_confirm_forgot_defuse_psk" class="btn btn-danger btn-block text-bold">' . langHdl('i_cannot_remember').'</button>
337 337
             </div>
338 338
         </div>
339 339
     </div>
Please login to merge, or discard this patch.
sources/identify.php 1 patch
Spacing   +95 added lines, -95 removed lines patch added patch discarded remove patch
@@ -44,28 +44,28 @@  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['cpassman_dir'] = '..';
49 49
 }
50 50
 
51 51
 // Load AntiXSS
52
-require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/AntiXSS.php';
52
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/AntiXSS.php';
53 53
 $antiXss = new voku\helper\AntiXSS();
54
-require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
55
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
56
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
54
+require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
55
+require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php';
56
+require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
57 57
 // init
58 58
 $ldap_suffix = '';
59 59
 $result = '';
60 60
 $adldap = '';
61 61
 // If Debug then clean the files
62 62
 if (DEBUGLDAP === true) {
63
-    define('DEBUGLDAPFILE', $SETTINGS['path_to_files_folder'] . '/ldap.debug.txt');
63
+    define('DEBUGLDAPFILE', $SETTINGS['path_to_files_folder'].'/ldap.debug.txt');
64 64
     $fp = fopen(DEBUGLDAPFILE, 'w');
65 65
     fclose($fp);
66 66
 }
67 67
 if (DEBUGDUO === true) {
68
-    define('DEBUGDUOFILE', $SETTINGS['path_to_files_folder'] . '/duo.debug.txt');
68
+    define('DEBUGDUOFILE', $SETTINGS['path_to_files_folder'].'/duo.debug.txt');
69 69
     $fp = fopen(DEBUGDUOFILE, 'w');
70 70
     fclose($fp);
71 71
 }
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 if (defined('DB_PASSWD_CLEAR') === false) {
82 82
     define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
83 83
 }
84
-require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
84
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
85 85
 if (defined('DB_PASSWD_CLEAR') === false) {
86 86
     define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
87 87
 }
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
     // Get DUO keys
101 101
     $duoData = DB::query(
102 102
         'SELECT intitule, valeur
103
-        FROM ' . prefixTable('misc') . '
103
+        FROM ' . prefixTable('misc').'
104 104
         WHERE type = %s',
105 105
         'duoSecurity'
106 106
     );
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
     }
110 110
 
111 111
     // load library
112
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/DuoSecurity/Duo.php';
112
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/DuoSecurity/Duo.php';
113 113
     $sig_request = Duo::signRequest(
114 114
         $_GLOBALS['IKEY'],
115 115
         $_GLOBALS['SKEY'],
@@ -120,16 +120,16 @@  discard block
 block discarded – undo
120 120
         debugIdentify(
121 121
             DEBUGDUO,
122 122
             DEBUGDUOFILE,
123
-            "\n\n-----\n\n" .
124
-                'sig request : ' . $post_login . "\n" .
125
-                'resp : ' . $sig_request . "\n"
123
+            "\n\n-----\n\n".
124
+                'sig request : '.$post_login."\n".
125
+                'resp : '.$sig_request."\n"
126 126
         );
127 127
     }
128 128
 
129 129
     // load csrfprotector
130
-    $csrfp_config = include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/csrfp/libs/csrfp.config.php';
130
+    $csrfp_config = include_once $SETTINGS['cpassman_dir'].'/includes/libraries/csrfp/libs/csrfp.config.php';
131 131
     // return result
132
-    echo '[{"sig_request" : "' . $sig_request . '" , "csrfp_token" : "' . $csrfp_config['CSRFP_TOKEN'] . '" , "csrfp_key" : "' . filter_var($_COOKIE[$csrfp_config['CSRFP_TOKEN']], FILTER_SANITIZE_STRING) . '"}]';
132
+    echo '[{"sig_request" : "'.$sig_request.'" , "csrfp_token" : "'.$csrfp_config['CSRFP_TOKEN'].'" , "csrfp_key" : "'.filter_var($_COOKIE[$csrfp_config['CSRFP_TOKEN']], FILTER_SANITIZE_STRING).'"}]';
133 133
 // ---
134 134
     // ---
135 135
 } elseif ($post_type === 'identify_duo_user_check') {
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
     //--------
140 140
 
141 141
     // load library
142
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/DuoSecurity/Duo.php';
142
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/DuoSecurity/Duo.php';
143 143
     $authenticated_username = Duo::verifyResponse(
144 144
         $SETTINGS['duo_ikey'],
145 145
         $SETTINGS['duo_skey'],
@@ -150,9 +150,9 @@  discard block
 block discarded – undo
150 150
         debugIdentify(
151 151
             DEBUGDUO,
152 152
             DEBUGDUOFILE,
153
-            "\n\n-----\n\n" .
154
-                'sig response : ' . $post_sig_response . "\n" .
155
-                'resp : ' . $authenticated_username . "\n"
153
+            "\n\n-----\n\n".
154
+                'sig response : '.$post_sig_response."\n".
155
+                'resp : '.$authenticated_username."\n"
156 156
         );
157 157
     }
158 158
 
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
             // is user in Teampass?
164 164
             $userInfo = DB::queryfirstrow(
165 165
                 'SELECT id
166
-                FROM ' . prefixTable('users') . '
166
+                FROM ' . prefixTable('users').'
167 167
                 WHERE login = %s',
168 168
                 $post_login
169 169
             );
@@ -173,9 +173,9 @@  discard block
 block discarded – undo
173 173
             }
174 174
         }
175 175
 
176
-        echo '[{"authenticated_username" : "' . $authenticated_username . '"}]';
176
+        echo '[{"authenticated_username" : "'.$authenticated_username.'"}]';
177 177
     } else {
178
-        echo '[{"authenticated_username" : "' . $authenticated_username . '"}]';
178
+        echo '[{"authenticated_username" : "'.$authenticated_username.'"}]';
179 179
     }
180 180
     // ---
181 181
     // ---
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
     //--------
186 186
 
187 187
     // Load superGlobals
188
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
188
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
189 189
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
190 190
     // Prepare GET variables
191 191
     $sessionPwdAttempts = $superGlobal->get('pwd_attempts', 'SESSION');
@@ -270,16 +270,16 @@  discard block
 block discarded – undo
270 270
     } else {
271 271
         throw new Exception("Error file '/includes/config/tp.config.php' not exists", 1);
272 272
     }
273
-    include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
273
+    include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
274 274
     header('Content-type: text/html; charset=utf-8');
275 275
     error_reporting(E_ERROR);
276
-    include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
277
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
276
+    include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
277
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
278 278
     // Load AntiXSS
279
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/AntiXSS.php';
279
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/AntiXSS.php';
280 280
     $antiXss = new voku\helper\AntiXSS();
281 281
     // Load superGlobals
282
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
282
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
283 283
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
284 284
     // Prepare GET variables
285 285
     $sessionUserLanguage = $superGlobal->get('user_language', 'SESSION');
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
     $sessionPwdAttempts = $superGlobal->get('pwd_attempts', 'SESSION');
289 289
     $sessionUrl = $superGlobal->get('initial_url', 'SESSION');
290 290
     // connect to the server
291
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
291
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
292 292
     if (defined('DB_PASSWD_CLEAR') === false) {
293 293
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
294 294
     }
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
     DB::$port = DB_PORT;
300 300
     DB::$encoding = DB_ENCODING;
301 301
     // User's language loading
302
-    include_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $sessionUserLanguage . '.php';
302
+    include_once $SETTINGS['cpassman_dir'].'/includes/language/'.$sessionUserLanguage.'.php';
303 303
     //echo $dataReceived." -->".empty($sessionKey)."<-- ".$sessionKey." ** " ;
304 304
     // decrypt and retreive data in JSON format
305 305
     if (empty($sessionKey) === true) {
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
     // Check if user exists
375 375
     $userInfo = DB::queryFirstRow(
376 376
         'SELECT *
377
-        FROM ' . prefixTable('users') . '
377
+        FROM ' . prefixTable('users').'
378 378
         WHERE login=%s',
379 379
         $username
380 380
     );
@@ -570,7 +570,7 @@  discard block
 block discarded – undo
570 570
         //$arrAttempts = array();
571 571
         $rows = DB::query(
572 572
             'SELECT date
573
-            FROM ' . prefixTable('log_system') . "
573
+            FROM ' . prefixTable('log_system')."
574 574
             WHERE field_1 = %s
575 575
             AND type = 'failed_auth'
576 576
             AND label = 'user_password_not_correct'
@@ -586,7 +586,7 @@  discard block
 block discarded – undo
586 586
             foreach ($rows as $record) {
587 587
                 array_push(
588 588
                     $arrAttempts,
589
-                    date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], $record['date'])
589
+                    date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], $record['date'])
590 590
                 );
591 591
             }
592 592
         }
@@ -622,7 +622,7 @@  discard block
 block discarded – undo
622 622
         $superGlobal->put('user_upgrade_needed', $userInfo['upgrade_needed'], 'SESSION');
623 623
         $superGlobal->put('user_force_relog', $userInfo['force-relog'], 'SESSION');
624 624
         // get personal settings
625
-        if (! isset($userInfo['treeloadstrategy']) || empty($userInfo['treeloadstrategy'])) {
625
+        if (!isset($userInfo['treeloadstrategy']) || empty($userInfo['treeloadstrategy'])) {
626 626
             $userInfo['treeloadstrategy'] = 'full';
627 627
         }
628 628
         $superGlobal->put('treeloadstrategy', $userInfo['treeloadstrategy'], 'SESSION', 'user');
@@ -722,7 +722,7 @@  discard block
 block discarded – undo
722 722
         foreach ($superGlobal->get('user_roles', 'SESSION') as $role) {
723 723
             $resRoles = DB::queryFirstRow(
724 724
                 'SELECT title, complexity
725
-                FROM ' . prefixTable('roles_title') . '
725
+                FROM ' . prefixTable('roles_title').'
726 726
                 WHERE id=%i',
727 727
                 $role
728 728
             );
@@ -743,7 +743,7 @@  discard block
 block discarded – undo
743 743
 
744 744
         // build complete array of roles
745 745
         $superGlobal->put('arr_roles_full', [], 'SESSION');
746
-        $rows = DB::query('SELECT id, title FROM ' . prefixTable('roles_title') . ' ORDER BY title ASC');
746
+        $rows = DB::query('SELECT id, title FROM '.prefixTable('roles_title').' ORDER BY title ASC');
747 747
         foreach ($rows as $record) {
748 748
             $superGlobal->put(
749 749
                 $record['id'],
@@ -832,10 +832,10 @@  discard block
 block discarded – undo
832 832
         $superGlobal->put('latest_items_tab', [], 'SESSION');
833 833
         $superGlobal->put('nb_roles', 0, 'SESSION');
834 834
         foreach ($superGlobal->get('latest_items', 'SESSION') as $item) {
835
-            if (! empty($item)) {
835
+            if (!empty($item)) {
836 836
                 $dataLastItems = DB::queryFirstRow(
837 837
                     'SELECT id,label,id_tree
838
-                    FROM ' . prefixTable('items') . '
838
+                    FROM ' . prefixTable('items').'
839 839
                     WHERE id=%i',
840 840
                     $item
841 841
                 );
@@ -844,7 +844,7 @@  discard block
 block discarded – undo
844 844
                     [
845 845
                         'id' => $item,
846 846
                         'label' => $dataLastItems['label'],
847
-                        'url' => 'index.php?page=items&amp;group=' . $dataLastItems['id_tree'] . '&amp;id=' . $item,
847
+                        'url' => 'index.php?page=items&amp;group='.$dataLastItems['id_tree'].'&amp;id='.$item,
848 848
                     ],
849 849
                     'SESSION',
850 850
                     'latest_items_tab'
@@ -861,12 +861,12 @@  discard block
 block discarded – undo
861 861
         ) {
862 862
             // get all Admin users
863 863
             $receivers = '';
864
-            $rows = DB::query('SELECT email FROM ' . prefixTable('users') . " WHERE admin = %i and email != ''", 1);
864
+            $rows = DB::query('SELECT email FROM '.prefixTable('users')." WHERE admin = %i and email != ''", 1);
865 865
             foreach ($rows as $record) {
866 866
                 if (empty($receivers)) {
867 867
                     $receivers = $record['email'];
868 868
                 } else {
869
-                    $receivers = ',' . $record['email'];
869
+                    $receivers = ','.$record['email'];
870 870
                 }
871 871
             }
872 872
             // Add email to table
@@ -882,7 +882,7 @@  discard block
 block discarded – undo
882 882
                             '#tp_time#',
883 883
                         ],
884 884
                         [
885
-                            ' ' . $superGlobal->get('login', 'SESSION') . ' (IP: ' . getClientIpServer() . ')',
885
+                            ' '.$superGlobal->get('login', 'SESSION').' (IP: '.getClientIpServer().')',
886 886
                             date($SETTINGS['date_format'], $superGlobal->get('last_connection', 'SESSION')),
887 887
                             date($SETTINGS['time_format'], $superGlobal->get('last_connection', 'SESSION')),
888 888
                         ],
@@ -1027,8 +1027,8 @@  discard block
 block discarded – undo
1027 1027
     debugIdentify(
1028 1028
         DEBUGDUO,
1029 1029
         DEBUGDUOFILE,
1030
-        "\n\n----\n" .
1031
-            'Identified : ' . filter_var($return, FILTER_SANITIZE_STRING) . "\n\n"
1030
+        "\n\n----\n".
1031
+            'Identified : '.filter_var($return, FILTER_SANITIZE_STRING)."\n\n"
1032 1032
     );
1033 1033
     echo prepareExchangedData(
1034 1034
         [
@@ -1092,44 +1092,44 @@  discard block
 block discarded – undo
1092 1092
         ],
1093 1093
     ];
1094 1094
     // Load expected libraries
1095
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Illuminate/Contracts/Auth/Authenticatable.php';
1096
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Traits/EnumeratesValues.php';
1097
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Traits/Macroable.php';
1098
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/helpers.php';
1099
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Arr.php';
1100
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Contracts/Support/Jsonable.php';
1101
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Contracts/Support/Arrayable.php';
1102
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Enumerable.php';
1103
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Collection.php';
1104
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/CarbonTimeZone.php';
1105
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Units.php';
1106
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Week.php';
1107
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Timestamp.php';
1108
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Test.php';
1109
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/ObjectInitialisation.php';
1110
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Serialization.php';
1111
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/IntervalRounding.php';
1112
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Rounding.php';
1113
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Localization.php';
1114
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Options.php';
1115
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Cast.php';
1116
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Mutability.php';
1117
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Modifiers.php';
1118
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Mixin.php';
1119
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Macro.php';
1120
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Difference.php';
1121
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Creator.php';
1122
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Converter.php';
1123
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Comparison.php';
1124
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Boundaries.php';
1125
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Date.php';
1126
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/CarbonInterface.php';
1127
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Carbon.php';
1128
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/DetectsErrors.php';
1129
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/Connection.php';
1130
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/LdapInterface.php';
1131
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/LdapBase.php';
1132
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/Ldap.php';
1095
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Illuminate/Contracts/Auth/Authenticatable.php';
1096
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Traits/EnumeratesValues.php';
1097
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Traits/Macroable.php';
1098
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/helpers.php';
1099
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Arr.php';
1100
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Contracts/Support/Jsonable.php';
1101
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Contracts/Support/Arrayable.php';
1102
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Enumerable.php';
1103
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Collection.php';
1104
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/CarbonTimeZone.php';
1105
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Units.php';
1106
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Week.php';
1107
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Timestamp.php';
1108
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Test.php';
1109
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/ObjectInitialisation.php';
1110
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Serialization.php';
1111
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/IntervalRounding.php';
1112
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Rounding.php';
1113
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Localization.php';
1114
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Options.php';
1115
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Cast.php';
1116
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Mutability.php';
1117
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Modifiers.php';
1118
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Mixin.php';
1119
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Macro.php';
1120
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Difference.php';
1121
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Creator.php';
1122
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Converter.php';
1123
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Comparison.php';
1124
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Boundaries.php';
1125
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Date.php';
1126
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/CarbonInterface.php';
1127
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Carbon.php';
1128
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/DetectsErrors.php';
1129
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/Connection.php';
1130
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/LdapInterface.php';
1131
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/LdapBase.php';
1132
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/Ldap.php';
1133 1133
     $ad = new SplClassLoader('LdapRecord', '../includes/libraries');
1134 1134
     $ad->register();
1135 1135
     $connection = new Connection($config);
@@ -1141,7 +1141,7 @@  discard block
 block discarded – undo
1141 1141
         $error = $e->getDetailedError();
1142 1142
         return [
1143 1143
             'error' => true,
1144
-            'message' => langHdl('error').' : '.$error->getErrorCode().' - '.$error->getErrorMessage(). '<br>'.$error->getDiagnosticMessage().' '.$config['username'],
1144
+            'message' => langHdl('error').' : '.$error->getErrorCode().' - '.$error->getErrorMessage().'<br>'.$error->getDiagnosticMessage().' '.$config['username'],
1145 1145
 
1146 1146
         ];
1147 1147
     }
@@ -1169,7 +1169,7 @@  discard block
 block discarded – undo
1169 1169
     }
1170 1170
 
1171 1171
     // load passwordLib library
1172
-    $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'] . '/includes/libraries');
1172
+    $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'].'/includes/libraries');
1173 1173
     $pwdlib->register();
1174 1174
     $pwdlib = new PasswordLib\PasswordLib();
1175 1175
     $hashedPassword = $pwdlib->createPasswordHash($passwordClear);
@@ -1234,7 +1234,7 @@  discard block
 block discarded – undo
1234 1234
 function yubicoMFACheck($dataReceived, string $userInfo, array $SETTINGS): array
1235 1235
 {
1236 1236
     // Load superGlobals
1237
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1237
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1238 1238
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
1239 1239
     $sessionAdmin = $superGlobal->get('user_admin', 'SESSION');
1240 1240
     $sessionUrl = $superGlobal->get('initial_url', 'SESSION');
@@ -1273,7 +1273,7 @@  discard block
 block discarded – undo
1273 1273
     }
1274 1274
 
1275 1275
     // Now check yubico validity
1276
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/Yubico/Yubico.php';
1276
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/Yubico/Yubico.php';
1277 1277
     $yubi = new Auth_Yubico($yubico_user_id, $yubico_user_key);
1278 1278
     $auth = $yubi->verify($yubico_key);
1279 1279
     //, null, null, null, 60
@@ -1325,7 +1325,7 @@  discard block
 block discarded – undo
1325 1325
             'gestionnaire' => '0',
1326 1326
             'can_manage_all_users' => '0',
1327 1327
             'personal_folder' => $SETTINGS['enable_pf_feature'] === '1' ? '1' : '0',
1328
-            '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'),
1328
+            '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'),
1329 1329
             'groupes_interdits' => '',
1330 1330
             'groupes_visibles' => '',
1331 1331
             'last_pw_change' => time(),
@@ -1350,7 +1350,7 @@  discard block
 block discarded – undo
1350 1350
             ]
1351 1351
         );
1352 1352
         // Rebuild tree
1353
-        $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries');
1353
+        $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries');
1354 1354
         $tree->register();
1355 1355
         $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title');
1356 1356
         $tree->rebuild();
@@ -1381,13 +1381,13 @@  discard block
 block discarded – undo
1381 1381
         && empty($dataReceived['GACode']) === false
1382 1382
     ) {
1383 1383
         // Load superGlobals
1384
-        include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1384
+        include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1385 1385
         $superGlobal = new protect\SuperGlobal\SuperGlobal();
1386 1386
         $sessionAdmin = $superGlobal->get('user_admin', 'SESSION');
1387 1387
         $sessionUrl = $superGlobal->get('initial_url', 'SESSION');
1388 1388
         $sessionPwdAttempts = $superGlobal->get('pwd_attempts', 'SESSION');
1389 1389
         // load library
1390
-        include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/TwoFactorAuth/TwoFactorAuth.php';
1390
+        include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/TwoFactorAuth/TwoFactorAuth.php';
1391 1391
         // create new instance
1392 1392
         $tfa = new Authentication\TwoFactorAuth\TwoFactorAuth($SETTINGS['ga_website_name']);
1393 1393
         // Init
@@ -1409,7 +1409,7 @@  discard block
 block discarded – undo
1409 1409
             $mfaMessage = langHdl('ga_flash_qr_and_login');
1410 1410
             // generate new QR
1411 1411
             $new_2fa_qr = $tfa->getQRCodeImageAsDataUri(
1412
-                'Teampass - ' . $username,
1412
+                'Teampass - '.$username,
1413 1413
                 $userInfo['ga']
1414 1414
             );
1415 1415
             // clear temporary code from DB
@@ -1422,7 +1422,7 @@  discard block
 block discarded – undo
1422 1422
                 $userInfo['id']
1423 1423
             );
1424 1424
             $firstTime = [
1425
-                'value' => '<img src="' . $new_2fa_qr . '">',
1425
+                'value' => '<img src="'.$new_2fa_qr.'">',
1426 1426
                 'user_admin' => isset($sessionAdmin) ? (int) $sessionAdmin : '',
1427 1427
                 'initial_url' => isset($sessionUrl) === true ? $sessionUrl : '',
1428 1428
                 'pwd_attempts' => (int) $sessionPwdAttempts,
@@ -1467,13 +1467,13 @@  discard block
 block discarded – undo
1467 1467
  * @param string                $username      User name
1468 1468
  * @param array                 $SETTINGS      Teampass settings
1469 1469
  */
1470
-function checkCredentials(string $passwordClear, array|string $userInfo, $dataReceived, string $username, array $SETTINGS): bool
1470
+function checkCredentials(string $passwordClear, array | string $userInfo, $dataReceived, string $username, array $SETTINGS): bool
1471 1471
 {
1472 1472
     // Set to false
1473 1473
     $userPasswordVerified = false;
1474 1474
     // load passwordLib library
1475
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
1476
-    $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'] . '/includes/libraries');
1475
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
1476
+    $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'].'/includes/libraries');
1477 1477
     $pwdlib->register();
1478 1478
     $pwdlib = new PasswordLib\PasswordLib();
1479 1479
     // Check if old encryption used
Please login to merge, or discard this patch.
sources/export.queries.php 1 patch
Spacing   +81 added lines, -81 removed lines patch added patch discarded remove patch
@@ -54,24 +54,24 @@  discard block
 block discarded – undo
54 54
 }
55 55
 
56 56
 // Do checks
57
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
58
-require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php';
57
+require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php';
58
+require_once $SETTINGS['cpassman_dir'].'/sources/checks.php';
59 59
 if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'items', $SETTINGS) === false) {
60 60
     // Not allowed page
61 61
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
62
-    include $SETTINGS['cpassman_dir'] . '/error.php';
62
+    include $SETTINGS['cpassman_dir'].'/error.php';
63 63
     exit;
64 64
 }
65 65
 
66 66
 // No time limit
67 67
 set_time_limit(0);
68
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
68
+require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
69 69
 header('Content-type: text/html; charset=utf-8');
70 70
 error_reporting(E_ERROR);
71
-require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
72
-require_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
71
+require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
72
+require_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
73 73
 // Connect to mysql server
74
-require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
74
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
75 75
 if (defined('DB_PASSWD_CLEAR') === false) {
76 76
     define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
77 77
 }
@@ -82,11 +82,11 @@  discard block
 block discarded – undo
82 82
 DB::$port = DB_PORT;
83 83
 DB::$encoding = DB_ENCODING;
84 84
 // Build tree
85
-$tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries');
85
+$tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries');
86 86
 $tree->register();
87
-$tree = new Tree\NestedTree\NestedTree($pre . 'nested_tree', 'id', 'parent_id', 'title');
87
+$tree = new Tree\NestedTree\NestedTree($pre.'nested_tree', 'id', 'parent_id', 'title');
88 88
 // User's language loading
89
-require_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php';
89
+require_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php';
90 90
 // Prepare POST variables
91 91
 $id = filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT);
92 92
 $post_type = filter_input(INPUT_POST, 'type', FILTER_SANITIZE_STRING);
@@ -133,9 +133,9 @@  discard block
 block discarded – undo
133 133
             'SELECT i.id as id, i.id_tree as id_tree, i.restricted_to as restricted_to, i.perso as perso,
134 134
                             i.label as label, i.description as description, i.pw as pw, i.login as login, i.url as url,
135 135
                             i.email as email,l.date as date, i.pw_iv as pw_iv,n.renewal_period as renewal_period
136
-                        FROM ' . prefixTable('items') . ' as i
137
-                        INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree = n.id)
138
-                        INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id = l.id_item)
136
+                        FROM ' . prefixTable('items').' as i
137
+                        INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree = n.id)
138
+                        INNER JOIN ' . prefixTable('log_items').' as l ON (i.id = l.id_item)
139 139
                         WHERE i.inactif = %i
140 140
                         AND i.id_tree= %i
141 141
                         AND (l.action = %s OR (l.action = %s AND l.raison LIKE %s))
@@ -158,8 +158,8 @@  discard block
 block discarded – undo
158 158
                     // Run query
159 159
                     $dataItem = DB::queryfirstrow(
160 160
                         'SELECT i.pw AS pw, s.share_key AS share_key
161
-                                    FROM ' . prefixTable('items') . ' AS i
162
-                                    INNER JOIN ' . prefixTable('sharekeys_items') . ' AS s ON (s.object_id = i.id)
161
+                                    FROM ' . prefixTable('items').' AS i
162
+                                    INNER JOIN ' . prefixTable('sharekeys_items').' AS s ON (s.object_id = i.id)
163 163
                                     WHERE user_id = %i AND i.id = %i',
164 164
                         $_SESSION['user_id'],
165 165
                         $record['id']
@@ -182,8 +182,8 @@  discard block
 block discarded – undo
182 182
                     $arr_kbs = [];
183 183
                     $rows_kb = DB::query(
184 184
                         'SELECT b.label, b.id
185
-                                    FROM ' . prefixTable('kb_items') . ' AS a
186
-                                    INNER JOIN ' . prefixTable('kb') . ' AS b ON (a.kb_id = b.id)
185
+                                    FROM ' . prefixTable('kb_items').' AS a
186
+                                    INNER JOIN ' . prefixTable('kb').' AS b ON (a.kb_id = b.id)
187 187
                                     WHERE a.item_id = %i',
188 188
                         $record['id']
189 189
                     );
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
                     $arr_tags = [];
196 196
                     $rows_tag = DB::query(
197 197
                         'SELECT tag
198
-                                    FROM ' . prefixTable('tags') . '
198
+                                    FROM ' . prefixTable('tags').'
199 199
                                     WHERE item_id = %i',
200 200
                         $record['id']
201 201
                     );
@@ -241,14 +241,14 @@  discard block
 block discarded – undo
241 241
     $tmp .= array2csv($value);
242 242
 }
243 243
 
244
-            echo '[{"content":"' . base64_encode($tmp) . '"}]';
244
+            echo '[{"content":"'.base64_encode($tmp).'"}]';
245 245
 
246 246
             break;
247 247
 /*
248 248
          * PDF - step 1 - Prepare database
249 249
          */
250 250
         case 'initialize_export_table':
251
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    DB::query('TRUNCATE TABLE ' . prefixTable('export'));
251
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    DB::query('TRUNCATE TABLE '.prefixTable('export'));
252 252
 
253 253
             break;
254 254
 /*
@@ -290,9 +290,9 @@  discard block
 block discarded – undo
290 290
         'SELECT i.id as id, i.restricted_to as restricted_to, i.perso as perso, i.label as label, i.description as description, i.pw as pw, i.login as login, i.url as url, i.email as email,
291 291
                         l.date as date, i.pw_iv as pw_iv,
292 292
                         n.renewal_period as renewal_period
293
-                        FROM ' . prefixTable('items') . ' as i
294
-                        INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree = n.id)
295
-                        INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id = l.id_item)
293
+                        FROM ' . prefixTable('items').' as i
294
+                        INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree = n.id)
295
+                        INNER JOIN ' . prefixTable('log_items').' as l ON (i.id = l.id_item)
296 296
                         WHERE i.inactif = %i
297 297
                         AND i.id_tree= %i
298 298
                         AND (l.action = %s OR (l.action = %s AND l.raison LIKE %s))
@@ -310,16 +310,16 @@  discard block
 block discarded – undo
310 310
         $restricted_users_array = explode(';', $record['restricted_to']);
311 311
         //exclude all results except the first one returned by query
312 312
         if (empty($id_managed) || $id_managed !== $record['id']) {
313
-            if ((in_array($post_id, $_SESSION['personal_visible_groups']) && ! ($record['perso'] === 1 && $_SESSION['user_id'] === $record['restricted_to']) && ! empty($record['restricted_to']))
314
-                            || (! empty($record['restricted_to']) && ! in_array($_SESSION['user_id'], $restricted_users_array))
313
+            if ((in_array($post_id, $_SESSION['personal_visible_groups']) && !($record['perso'] === 1 && $_SESSION['user_id'] === $record['restricted_to']) && !empty($record['restricted_to']))
314
+                            || (!empty($record['restricted_to']) && !in_array($_SESSION['user_id'], $restricted_users_array))
315 315
                         ) {
316 316
                 //exclude this case
317 317
             } else {
318 318
                 // Run query
319 319
                 $dataItem = DB::queryfirstrow(
320 320
                     'SELECT i.pw AS pw, s.share_key AS share_key
321
-                                FROM ' . prefixTable('items') . ' AS i
322
-                                INNER JOIN ' . prefixTable('sharekeys_items') . ' AS s ON (s.object_id = i.id)
321
+                                FROM ' . prefixTable('items').' AS i
322
+                                INNER JOIN ' . prefixTable('sharekeys_items').' AS s ON (s.object_id = i.id)
323 323
                                 WHERE user_id = %i AND i.id = %i',
324 324
                     $_SESSION['user_id'],
325 325
                     $record['id']
@@ -342,8 +342,8 @@  discard block
 block discarded – undo
342 342
                 $arr_kbs = '';
343 343
                 $rows_kb = DB::query(
344 344
                     'SELECT b.label, b.id
345
-                                FROM ' . prefixTable('kb_items') . ' AS a
346
-                                INNER JOIN ' . prefixTable('kb') . ' AS b ON (a.kb_id = b.id)
345
+                                FROM ' . prefixTable('kb_items').' AS a
346
+                                INNER JOIN ' . prefixTable('kb').' AS b ON (a.kb_id = b.id)
347 347
                                 WHERE a.item_id = %i',
348 348
                     $record['id']
349 349
                 );
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
                     if (empty($arr_kbs)) {
352 352
                         $arr_kbs = $rec_kb['label'];
353 353
                     } else {
354
-                        $arr_kbs .= ' | ' . $rec_kb['label'];
354
+                        $arr_kbs .= ' | '.$rec_kb['label'];
355 355
                     }
356 356
                 }
357 357
 
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
                 $arr_tags = '';
360 360
                 $rows_tag = DB::query(
361 361
                     'SELECT tag
362
-                                FROM ' . prefixTable('tags') . '
362
+                                FROM ' . prefixTable('tags').'
363 363
                                 WHERE item_id = %i',
364 364
                     $record['id']
365 365
                 );
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
                     if (empty($arr_tags)) {
368 368
                         $arr_tags = $rec_tag['tag'];
369 369
                     } else {
370
-                        $arr_tags .= ' ' . $rec_tag['tag'];
370
+                        $arr_tags .= ' '.$rec_tag['tag'];
371 371
                     }
372 372
                 }
373 373
 
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
 // Adapt header to pdf
433 433
             header('Content-type: application/pdf');
434 434
 // query
435
-            $rows = DB::query('SELECT * FROM ' . prefixTable('export'));
435
+            $rows = DB::query('SELECT * FROM '.prefixTable('export'));
436 436
 $counter = DB::count();
437 437
 if ($counter > 0) {
438 438
     // print
@@ -441,8 +441,8 @@  discard block
 block discarded – undo
441 441
     $table_col_width = [40, 30, 30, 60, 27, 40, 25, 25];
442 442
     $prev_path = '';
443 443
     //Prepare the PDF file
444
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Pdf/tcpdf/config/tcpdf_config.php';
445
-    include $SETTINGS['cpassman_dir'] . '/includes/libraries/Pdf/tcpdf/tcpdf.php';
444
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Pdf/tcpdf/config/tcpdf_config.php';
445
+    include $SETTINGS['cpassman_dir'].'/includes/libraries/Pdf/tcpdf/tcpdf.php';
446 446
     $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
447 447
     $pdf->SetProtection(['print'], $dataReceived['pdf_password'], null);
448 448
     // set document information
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
     $pdf->SetTitle('Teampass export');
452 452
     // set default header data
453 453
     $pdf->SetHeaderData(
454
-        $SETTINGS['cpassman_dir'] . '/includes/images/teampass-logo2-home.png',
454
+        $SETTINGS['cpassman_dir'].'/includes/images/teampass-logo2-home.png',
455 455
         PDF_HEADER_LOGO_WIDTH,
456 456
         'Teampass export',
457 457
         $_SESSION['lastname'].' '.$_SESSION['name'].' @ '.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], time())
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
     //log
544 544
     logEvents($SETTINGS, 'pdf_export', '', $_SESSION['user_id'], $_SESSION['login']);
545 545
     //clean table
546
-    DB::query('TRUNCATE TABLE ' . prefixTable('export'));
546
+    DB::query('TRUNCATE TABLE '.prefixTable('export'));
547 547
     // Send back the file in Blob
548 548
     echo $pdf->Output(null, 'I');
549 549
 }
@@ -555,8 +555,8 @@  discard block
 block discarded – undo
555 555
 
556 556
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     // - prepare export file
557 557
             // - get full list of objects id to export
558
-            include $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
559
-include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/GibberishAES/GibberishAES.php';
558
+            include $SETTINGS['cpassman_dir'].'/includes/config/include.php';
559
+include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/GibberishAES/GibberishAES.php';
560 560
 $idsList = [];
561 561
 $objNumber = 0;
562 562
 foreach (explode(';', $post_ids) as $id) {
@@ -568,9 +568,9 @@  discard block
 block discarded – undo
568 568
         // count elements to display
569 569
         $result = DB::query(
570 570
             'SELECT i.id AS id, i.label AS label, i.restricted_to AS restricted_to, i.perso AS perso
571
-                    FROM ' . prefixTable('items') . ' as i
572
-                    INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree = n.id)
573
-                    INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id = l.id_item)
571
+                    FROM ' . prefixTable('items').' as i
572
+                    INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree = n.id)
573
+                    INNER JOIN ' . prefixTable('log_items').' as l ON (i.id = l.id_item)
574 574
                     WHERE i.inactif = %i
575 575
                     AND i.id_tree= %i
576 576
                     AND (l.action = %s OR (l.action = %s AND l.raison LIKE %s))
@@ -584,7 +584,7 @@  discard block
 block discarded – undo
584 584
         foreach ($result as $record) {
585 585
             $restricted_users_array = explode(';', $record['restricted_to']);
586 586
             if (((in_array($id, $_SESSION['personal_visible_groups']) === true
587
-                                && ! ($record['perso'] === 1 && $_SESSION['user_id'] === $record['restricted_to'])
587
+                                && !($record['perso'] === 1 && $_SESSION['user_id'] === $record['restricted_to'])
588 588
                                 && empty($record['restricted_to']) === false)
589 589
                                 || (empty($record['restricted_to']) === false
590 590
                                     && in_array($_SESSION['user_id'], $restricted_users_array) === false)
@@ -599,9 +599,9 @@  discard block
 block discarded – undo
599 599
 
600 600
             // prepare export file
601 601
             //save the file
602
-            $html_file = '/teampass_export_' . time() . '_' . generateKey() . '.html';
602
+            $html_file = '/teampass_export_'.time().'_'.generateKey().'.html';
603 603
 //print_r($full_listing);
604
-            $outstream = fopen($SETTINGS['path_to_files_folder'] . $html_file, 'w');
604
+            $outstream = fopen($SETTINGS['path_to_files_folder'].$html_file, 'w');
605 605
 if ($outstream === false) {
606 606
     echo '[{"error":"true"}]';
607 607
     break;
@@ -625,12 +625,12 @@  discard block
 block discarded – undo
625 625
     </style>
626 626
     </head>
627 627
     <body>
628
-    <input type="hidden" id="generation_date" value="' . GibberishAES::enc(/** @scrutinizer ignore-type */ (string) time(), $post_pdf_password) . '" />
628
+    <input type="hidden" id="generation_date" value="' . GibberishAES::enc(/** @scrutinizer ignore-type */ (string) time(), $post_pdf_password).'" />
629 629
     <div id="header">
630
-    ' . TP_TOOL_NAME . ' - Off Line mode
630
+    ' . TP_TOOL_NAME.' - Off Line mode
631 631
     </div>
632 632
     <div style="margin:10px; font-size:9px;">
633
-    <i>This page was generated by <b>' . $_SESSION['name'] . ' ' . $_SESSION['lastname'] . '</b>, the ' . date('Y/m/d H:i:s') . '.</i>
633
+    <i>This page was generated by <b>' . $_SESSION['name'].' '.$_SESSION['lastname'].'</b>, the '.date('Y/m/d H:i:s').'.</i>
634 634
     <span id="info_page" style="margin-left:20px; font-weight:bold; font-size: 14px; color:red;"></span>
635 635
     </div>
636 636
     <div id="information"></div>
@@ -641,11 +641,11 @@  discard block
 block discarded – undo
641 641
     <div>
642 642
     <table id="itemsTable">
643 643
         <thead><tr>
644
-            <th style="width:15%;">' . $LANG['label'] . '</th>
645
-            <th style="width:10%;">' . $LANG['pw'] . '</th>
646
-            <th style="width:30%;">' . $LANG['description'] . '</th>
647
-            <th style="width:5%;">' . $LANG['user_login'] . '</th>
648
-            <th style="width:20%;">' . $LANG['url'] . '</th>
644
+            <th style="width:15%;">' . $LANG['label'].'</th>
645
+            <th style="width:10%;">' . $LANG['pw'].'</th>
646
+            <th style="width:30%;">' . $LANG['description'].'</th>
647
+            <th style="width:5%;">' . $LANG['user_login'].'</th>
648
+            <th style="width:20%;">' . $LANG['url'].'</th>
649 649
         </tr></thead>
650 650
         <tbody id="itemsTable_tbody">'
651 651
             );
@@ -669,21 +669,21 @@  discard block
 block discarded – undo
669 669
                 || in_array($post_idTree, $_SESSION['groupes_visibles']) === false
670 670
                 || (in_array($post_idTree, $_SESSION['no_access_folders']) === true)
671 671
             ) {
672
-                echo '[{"loop":"true", "number":"' . $post_number . '", "cpt":"' . $post_cpt . '", "file":"' . $post_file . '", "idsList":"' . $post_idsList . '" , "file_link":"' . $post_file_link . '"}]';
672
+                echo '[{"loop":"true", "number":"'.$post_number.'", "cpt":"'.$post_cpt.'", "file":"'.$post_file.'", "idsList":"'.$post_idsList.'" , "file_link":"'.$post_file_link.'"}]';
673 673
                 break;
674 674
             }
675 675
 
676 676
             $full_listing = [];
677 677
 $items_id_list = [];
678
-include $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
679
-include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/GibberishAES/GibberishAES.php';
678
+include $SETTINGS['cpassman_dir'].'/includes/config/include.php';
679
+include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/GibberishAES/GibberishAES.php';
680 680
 $rows = DB::query(
681 681
     'SELECT i.id as id, i.url as url, i.perso as perso, i.label as label, i.description as description, i.pw as pw, i.login as login, i.id_tree as id_tree,
682 682
                 l.date as date, i.pw_iv as pw_iv,
683 683
                 n.renewal_period as renewal_period
684
-            FROM ' . prefixTable('items') . ' as i
685
-            INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree = n.id)
686
-            INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id = l.id_item)
684
+            FROM ' . prefixTable('items').' as i
685
+            INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree = n.id)
686
+            INNER JOIN ' . prefixTable('log_items').' as l ON (i.id = l.id_item)
687 687
             WHERE i.inactif = %i
688 688
             AND i.id_tree= %i
689 689
             AND (l.action = %s OR (l.action = %s AND l.raison LIKE %s))
@@ -742,7 +742,7 @@  discard block
 block discarded – undo
742 742
 }
743 743
 
744 744
             //save in export file
745
-            $outstream = fopen($post_file . '.txt', 'a');
745
+            $outstream = fopen($post_file.'.txt', 'a');
746 746
 if ($outstream === false) {
747 747
     echo '[{"error":"true"}]';
748 748
     break;
@@ -780,13 +780,13 @@  discard block
 block discarded – undo
780 780
             if (empty($arboHtml)) {
781 781
                 $arboHtml = $arboHtml_tmp;
782 782
             } else {
783
-                $arboHtml .= ' » ' . $arboHtml_tmp;
783
+                $arboHtml .= ' » '.$arboHtml_tmp;
784 784
             }
785 785
         }
786 786
         fputs(
787 787
             $outstream,
788 788
             '
789
-        <tr class="path"><td colspan="5">' . $arboHtml . '</td></tr>'
789
+        <tr class="path"><td colspan="5">' . $arboHtml.'</td></tr>'
790 790
         );
791 791
         $idTree = $elem['id_tree'];
792 792
     }
@@ -795,41 +795,41 @@  discard block
 block discarded – undo
795 795
     fputs(
796 796
         $outstream,
797 797
         '
798
-        <tr class="' . $lineType . '">
799
-            <td>' . addslashes($elem['label']) . '</td>
800
-            <td align="center"><span class="span_pw" id="span_' . $elem['id'] . '"><a href="#" onclick="decryptme(' . $elem['id'] . ', \'' . $encPw . '\');return false;">Decrypt </a></span><input type="hidden" id="hide_' . $elem['id'] . '" value="' . $encPw . '" /></td>
801
-            <td>' . $desc . '</td>
802
-            <td align="center">' . $login . '</td>
803
-            <td align="center">' . $url . '</td>
798
+        <tr class="' . $lineType.'">
799
+            <td>' . addslashes($elem['label']).'</td>
800
+            <td align="center"><span class="span_pw" id="span_' . $elem['id'].'"><a href="#" onclick="decryptme('.$elem['id'].', \''.$encPw.'\');return false;">Decrypt </a></span><input type="hidden" id="hide_'.$elem['id'].'" value="'.$encPw.'" /></td>
801
+            <td>' . $desc.'</td>
802
+            <td align="center">' . $login.'</td>
803
+            <td align="center">' . $url.'</td>
804 804
             </tr>'
805 805
     );
806 806
 }
807 807
 
808 808
             fclose($outstream);
809 809
 // send back and continue
810
-            echo '[{"loop":"true", "number":"' . $post_number . '", "cpt":"' . $post_cpt . '", "file":"' . $post_file . '", "idsList":"' . $post_idsList . '" , "file_link":"' . $post_file_link . '"}]';
810
+            echo '[{"loop":"true", "number":"'.$post_number.'", "cpt":"'.$post_cpt.'", "file":"'.$post_file.'", "idsList":"'.$post_idsList.'" , "file_link":"'.$post_file_link.'"}]';
811 811
 
812 812
             break;
813 813
 //CASE export in HTML format - Iteration loop
814 814
         case 'export_to_html_format_finalize':
815 815
             // Load includes
816 816
 
817
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    include $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
818
-require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/GibberishAES/GibberishAES.php';
817
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    include $SETTINGS['cpassman_dir'].'/includes/config/include.php';
818
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/GibberishAES/GibberishAES.php';
819 819
 // read the content of the temporary file
820
-            $handle = fopen($post_file . '.txt', 'r');
820
+            $handle = fopen($post_file.'.txt', 'r');
821 821
 if ($handle === false) {
822 822
     echo '[{"error":"true"}]';
823 823
     break;
824 824
 }
825
-            $contents = fread($handle, filesize($post_file . '.txt'));
825
+            $contents = fread($handle, filesize($post_file.'.txt'));
826 826
 if ($contents === false) {
827 827
     echo '[{"error":"true"}]';
828 828
     break;
829 829
 }
830 830
             fclose($handle);
831
-if (is_file($post_file . '.txt')) {
832
-    unlink($post_file . '.txt');
831
+if (is_file($post_file.'.txt')) {
832
+    unlink($post_file.'.txt');
833 833
 }
834 834
 
835 835
             // Encrypt its content
@@ -840,7 +840,7 @@  discard block
 block discarded – undo
840 840
     if (empty($encrypted_text) === true) {
841 841
         $encrypted_text = GibberishAES::enc(/** @scrutinizer ignore-type */ $chunk, $post_pdf_password);
842 842
     } else {
843
-        $encrypted_text .= '|#|#|' . GibberishAES::enc(/** @scrutinizer ignore-type */ $chunk, $post_pdf_password);
843
+        $encrypted_text .= '|#|#|'.GibberishAES::enc(/** @scrutinizer ignore-type */ $chunk, $post_pdf_password);
844 844
     }
845 845
 }
846 846
 
@@ -857,9 +857,9 @@  discard block
 block discarded – undo
857 857
         </table></div>
858 858
         <input type="button" value="Hide all" onclick="hideAll()" />
859 859
         <div id="footer" style="text-align:center;">
860
-            <a href="https://teampass.net/about/" target="_blank" style="">' . TP_TOOL_NAME . '&nbsp;' . TP_VERSION_FULL . '&nbsp;' . TP_COPYRIGHT . '</a>
860
+            <a href="https://teampass.net/about/" target="_blank" style="">' . TP_TOOL_NAME.'&nbsp;'.TP_VERSION_FULL.'&nbsp;'.TP_COPYRIGHT.'</a>
861 861
         </div>
862
-        <div id="enc_html" style="display:none;">' . $encrypted_text . '</div>
862
+        <div id="enc_html" style="display:none;">' . $encrypted_text.'</div>
863 863
         </body>
864 864
     </html>
865 865
     <script type="text/javascript">
@@ -963,9 +963,9 @@  discard block
 block discarded – undo
963 963
     </script>'
964 964
             );
965 965
 fclose($outstream);
966
-echo '[{"text":"<a href=\'' .
967
-                $post_file_link .
968
-                '\' target=\'_blank\'>' . $LANG['pdf_download'] . '</a>"}]';
966
+echo '[{"text":"<a href=\''.
967
+                $post_file_link.
968
+                '\' target=\'_blank\'>'.$LANG['pdf_download'].'</a>"}]';
969 969
 
970 970
             break;
971 971
 
Please login to merge, or discard this patch.
sources/utils.queries.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 require_once 'SecureHandler.php';
29 29
 session_name('teampass_session');
30 30
 session_start();
31
-if (! isset($_SESSION['CPM']) || $_SESSION['CPM'] === false || ! isset($_SESSION['key']) || empty($_SESSION['key'])) {
31
+if (!isset($_SESSION['CPM']) || $_SESSION['CPM'] === false || !isset($_SESSION['key']) || empty($_SESSION['key'])) {
32 32
     die('Hacking attempt...');
33 33
 }
34 34
 
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
     'perso' => 'perso',
101 101
 ];
102 102
 foreach (explode(';', $post_ids) as $id) {
103
-    if (! in_array($id, $_SESSION['forbiden_pfs']) && in_array($id, $_SESSION['groupes_visibles'])) {
103
+    if (!in_array($id, $_SESSION['forbiden_pfs']) && in_array($id, $_SESSION['groupes_visibles'])) {
104 104
         $rows = DB::query(
105 105
             'SELECT i.id as id, i.restricted_to as restricted_to, i.perso as perso,
106 106
                         i.label as label, i.description as description, i.pw as pw, i.login as login, i.pw_iv as pw_iv
@@ -127,12 +127,12 @@  discard block
 block discarded – undo
127 127
             //exclude all results except the first one returned by query
128 128
             if (empty($id_managed) || $id_managed !== $record['id']) {
129 129
                 if ((in_array($id, $_SESSION['personal_visible_groups'])
130
-                                && ! ($record['perso'] === '1'
130
+                                && !($record['perso'] === '1'
131 131
                                     && $_SESSION['user_id'] === $record['restricted_to'])
132
-                                && ! empty($record['restricted_to']))
132
+                                && !empty($record['restricted_to']))
133 133
                                 ||
134
-                                (! empty($record['restricted_to'])
135
-                                    && ! in_array($_SESSION['user_id'], $restricted_users_array))
134
+                                (!empty($record['restricted_to'])
135
+                                    && !in_array($_SESSION['user_id'], $restricted_users_array))
136 136
                             ) {
137 137
                     //exclude this case
138 138
                 } else {
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
             $ret = '';
265 265
 require $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/phpseclib/Net/SSH2.php';
266 266
 $parse = parse_url($dataItem['url']);
267
-if (! isset($parse['host']) || empty($parse['host']) || ! isset($parse['port']) || empty($parse['port'])) {
267
+if (!isset($parse['host']) || empty($parse['host']) || !isset($parse['port']) || empty($parse['port'])) {
268 268
     // error in parsing the url
269 269
     echo prepareExchangedData(
270 270
         [
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
     break;
278 278
 }
279 279
                 $ssh = new phpseclib\Net\SSH2($parse['host'], $parse['port']);
280
-if (! $ssh->login($dataReceived['ssh_root'], $dataReceived['ssh_pwd'])) {
280
+if (!$ssh->login($dataReceived['ssh_root'], $dataReceived['ssh_pwd'])) {
281 281
     echo prepareExchangedData(
282 282
         [
283 283
             'error' => true,
Please login to merge, or discard this patch.
sources/user.logs.datatables.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
 require_once 'SecureHandler.php';
29 29
 session_name('teampass_session');
30 30
 session_start();
31
-if (! isset($_SESSION['CPM']) || $_SESSION['CPM'] === false || ! isset($_SESSION['key']) || empty($_SESSION['key'])) {
31
+if (!isset($_SESSION['CPM']) || $_SESSION['CPM'] === false || !isset($_SESSION['key']) || empty($_SESSION['key'])) {
32 32
     die('Hacking attempt...');
33 33
 }
34 34
 
Please login to merge, or discard this patch.
sources/items.logs.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
 /* do checks */
53 53
 require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php';
54 54
 require_once $SETTINGS['cpassman_dir'].'/sources/checks.php';
55
-if (! checkUser($_SESSION['user_id'], $_SESSION['key'], 'items', $SETTINGS)) {
55
+if (!checkUser($_SESSION['user_id'], $_SESSION['key'], 'items', $SETTINGS)) {
56 56
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
57 57
     //not allowed page
58 58
     include $SETTINGS['cpassman_dir'].'/error.php';
Please login to merge, or discard this patch.
sources/checks.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     throw new Exception('Error file "/includes/config/tp.config.php" not exists', 1);
38 38
 }
39 39
 
40
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
40
+require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php';
41 41
 /*
42 42
 Handle CASES
43 43
  */
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
     // Load CSRFP
56 56
     $csrfp_array = include '../includes/libraries/csrfp/libs/csrfp.config.php';
57 57
     // Send back CSRFP info
58
-    echo $csrfp_array['CSRFP_TOKEN'] . ';' . filter_input(INPUT_POST, $csrfp_array['CSRFP_TOKEN'], FILTER_SANITIZE_STRING);
58
+    echo $csrfp_array['CSRFP_TOKEN'].';'.filter_input(INPUT_POST, $csrfp_array['CSRFP_TOKEN'], FILTER_SANITIZE_STRING);
59 59
 }
60 60
 
61 61
         break;
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 function curPage($SETTINGS): string
71 71
 {
72 72
     // Load libraries
73
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
73
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
74 74
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
75 75
     // Parse the url
76 76
     parse_str(
@@ -125,10 +125,10 @@  discard block
 block discarded – undo
125 125
     // Convert to array
126 126
     $pageVisited = [$pageVisited];
127 127
     // Load
128
-    include_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
129
-    include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
128
+    include_once $SETTINGS['cpassman_dir'].'/includes/config/include.php';
129
+    include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
130 130
     // Load libraries
131
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
131
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
132 132
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
133 133
     // Securize language
134 134
     if (
@@ -138,11 +138,11 @@  discard block
 block discarded – undo
138 138
         $superGlobal->put('user_language', 'english', 'SESSION');
139 139
     }
140 140
 
141
-    include_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $superGlobal->get('user_language', 'SESSION') . '.php';
141
+    include_once $SETTINGS['cpassman_dir'].'/includes/language/'.$superGlobal->get('user_language', 'SESSION').'.php';
142 142
     include_once 'SplClassLoader.php';
143 143
     include_once 'main.functions.php';
144 144
     // Connect to mysql server
145
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
145
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
146 146
     if (defined('DB_PASSWD_CLEAR') === false) {
147 147
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
148 148
     }
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 
156 156
     // load user's data
157 157
     $data = DB::queryfirstrow(
158
-        'SELECT login, key_tempo, admin, gestionnaire, can_manage_all_users FROM ' . prefixTable('users') . ' WHERE id = %i',
158
+        'SELECT login, key_tempo, admin, gestionnaire, can_manage_all_users FROM '.prefixTable('users').' WHERE id = %i',
159 159
         $userId
160 160
     );
161 161
 
Please login to merge, or discard this patch.
sources/core.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -50,22 +50,22 @@  discard block
 block discarded – undo
50 50
     // Load AntiXSS
51 51
     include_once '../includes/libraries/voku/helper/AntiXSS.php';
52 52
     $antiXss = new voku\helper\AntiXSS();
53
-    if (! headers_sent()) {    //If headers not sent yet... then do php redirect
54
-        header('Location: ' . $antiXss->xss_clean($url));
53
+    if (!headers_sent()) {    //If headers not sent yet... then do php redirect
54
+        header('Location: '.$antiXss->xss_clean($url));
55 55
         return;
56 56
     }
57 57
 
58 58
     //If headers are sent... do java redirect... if java disabled, do html redirect.
59 59
     echo '<script type="text/javascript">';
60
-    echo 'window.location.href="' . $antiXss->xss_clean($url) . '";';
60
+    echo 'window.location.href="'.$antiXss->xss_clean($url).'";';
61 61
     echo '</script>';
62 62
     echo '<noscript>';
63
-    echo '<meta http-equiv="refresh" content="0;url=' . $antiXss->xss_clean($url) . '" />';
63
+    echo '<meta http-equiv="refresh" content="0;url='.$antiXss->xss_clean($url).'" />';
64 64
     echo '</noscript>';
65 65
 }
66 66
 
67 67
 // Include files
68
-require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
68
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
69 69
 $superGlobal = new protect\SuperGlobal\SuperGlobal();
70 70
 // Prepare GET variables
71 71
 $get_group = $superGlobal->get('group', 'GET');
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
     && isset($SETTINGS['enable_sts']) === true
76 76
     && (int) $SETTINGS['enable_sts'] === 1
77 77
 ) {
78
-    redirect('https://' . $superGlobal->get('HTTP_HOST', 'SERVER') . $superGlobal->get('REQUEST_URI', 'SERVER'));
78
+    redirect('https://'.$superGlobal->get('HTTP_HOST', 'SERVER').$superGlobal->get('REQUEST_URI', 'SERVER'));
79 79
 }
80 80
 
81 81
 // Load pwComplexity
@@ -100,11 +100,11 @@  discard block
 block discarded – undo
100 100
 // LOAD CPASSMAN SETTINGS
101 101
 if (
102 102
     isset($SETTINGS['cpassman_dir']) === true
103
-    && is_dir($SETTINGS['cpassman_dir'] . '/install') === true
103
+    && is_dir($SETTINGS['cpassman_dir'].'/install') === true
104 104
 ) {
105 105
     // Should we delete folder INSTALL?
106 106
     $row = DB::queryFirstRow(
107
-        'SELECT valeur FROM ' . prefixTable('misc') . ' WHERE type=%s AND intitule=%s',
107
+        'SELECT valeur FROM '.prefixTable('misc').' WHERE type=%s AND intitule=%s',
108 108
         'install',
109 109
         'clear_install_folder'
110 110
     );
@@ -118,11 +118,11 @@  discard block
 block discarded – undo
118 118
             if ($directories !== false) {
119 119
                 $files = array_diff($directories, ['.', '..']);
120 120
                 foreach ($files as $file) {
121
-                    if (is_dir($dir . '/' . $file)) {
122
-                        delTree($dir . '/' . $file);
121
+                    if (is_dir($dir.'/'.$file)) {
122
+                        delTree($dir.'/'.$file);
123 123
                     } else {
124 124
                         try {
125
-                            unlink($dir . '/' . $file);
125
+                            unlink($dir.'/'.$file);
126 126
                         } catch (Exception $e) {
127 127
                             // do nothing... php will ignore and continue
128 128
                         }
@@ -135,13 +135,13 @@  discard block
 block discarded – undo
135 135
             }
136 136
         }
137 137
 
138
-        if (is_dir($SETTINGS['cpassman_dir'] . '/install')) {
138
+        if (is_dir($SETTINGS['cpassman_dir'].'/install')) {
139 139
             // Set the permissions on the install directory and delete
140 140
             // is server Windows or Linux?
141 141
             if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
142
-                recursiveChmod($SETTINGS['cpassman_dir'] . '/install', 0755, 0440);
142
+                recursiveChmod($SETTINGS['cpassman_dir'].'/install', 0755, 0440);
143 143
             }
144
-            delTree($SETTINGS['cpassman_dir'] . '/install');
144
+            delTree($SETTINGS['cpassman_dir'].'/install');
145 145
         }
146 146
 
147 147
         // Delete temporary install table
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 // Load Languages stuff
160 160
 if (isset($languagesList) === false) {
161 161
     $languagesList = [];
162
-    $rows = DB::query('SELECT * FROM ' . prefixTable('languages') . ' GROUP BY name, label, code, flag, id ORDER BY name ASC');
162
+    $rows = DB::query('SELECT * FROM '.prefixTable('languages').' GROUP BY name, label, code, flag, id ORDER BY name ASC');
163 163
     foreach ($rows as $record) {
164 164
         array_push($languagesList, $record['name']);
165 165
         if (isset($_SESSION['user_language']) && $record['name'] === $_SESSION['user_language']) {
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 // CHECK IF SESSION EXISTS AND IF SESSION IS VALID
218 218
 if (empty($_SESSION['sessionDuration']) === false) {
219 219
     $dataSession = DB::queryFirstRow(
220
-        'SELECT key_tempo FROM ' . prefixTable('users') . ' WHERE id=%i',
220
+        'SELECT key_tempo FROM '.prefixTable('users').' WHERE id=%i',
221 221
         $_SESSION['user_id']
222 222
     );
223 223
 } else {
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
     && (isset($_SESSION['user_admin']) === true && $_SESSION['user_admin'] === 1)
282 282
 ) {
283 283
     $row = DB::queryFirstRow(
284
-        'SELECT valeur FROM ' . prefixTable('misc') . ' WHERE type=%s_type AND intitule=%s_intitule',
284
+        'SELECT valeur FROM '.prefixTable('misc').' WHERE type=%s_type AND intitule=%s_intitule',
285 285
         [
286 286
             'type' => 'admin',
287 287
             'intitule' => 'cpassman_version',
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
 
342 342
         syslog(
343 343
             LOG_WARNING,
344
-            'Unlog user: ' . date('Y/m/d H:i:s') . " {$_SERVER['REMOTE_ADDR']} ({$_SERVER['HTTP_USER_AGENT']})"
344
+            'Unlog user: '.date('Y/m/d H:i:s')." {$_SERVER['REMOTE_ADDR']} ({$_SERVER['HTTP_USER_AGENT']})"
345 345
         );
346 346
         // erase session table
347 347
         $_SESSION = [];
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
 if (isset($_SESSION['user_id']) === true && empty($_SESSION['user_id']) === false) {
393 393
     // query on user
394 394
     $data = DB::queryfirstrow(
395
-        'SELECT login, admin, gestionnaire, can_manage_all_users, groupes_visibles, groupes_interdits, fonction_id, last_connexion FROM ' . prefixTable('users') . ' WHERE id=%i',
395
+        'SELECT login, admin, gestionnaire, can_manage_all_users, groupes_visibles, groupes_interdits, fonction_id, last_connexion FROM '.prefixTable('users').' WHERE id=%i',
396 396
         $_SESSION['user_id']
397 397
     );
398 398
     //Check if user has been deleted or unlogged
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
     $_SESSION['item_fields'] = [];
474 474
     $rows = DB::query(
475 475
     'SELECT *
476
-        FROM ' . prefixTable('categories') . '
476
+        FROM ' . prefixTable('categories').'
477 477
         WHERE level=%i',
478 478
     '0'
479 479
 );
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
         // get each field
483 483
         $rows2 = DB::query(
484 484
             'SELECT *
485
-            FROM ' . prefixTable('categories') . '
485
+            FROM ' . prefixTable('categories').'
486 486
             WHERE parent_id=%i
487 487
             ORDER BY `order` ASC',
488 488
             $record['id']
@@ -559,7 +559,7 @@  discard block
 block discarded – undo
559 559
 if (
560 560
     isset($SETTINGS['roles_allowed_to_print']) === true
561 561
     && isset($_SESSION['user_roles']) === true
562
-    && (! isset($_SESSION['temporary']['user_can_printout']) || empty($_SESSION['temporary']['user_can_printout']))
562
+    && (!isset($_SESSION['temporary']['user_can_printout']) || empty($_SESSION['temporary']['user_can_printout']))
563 563
 ) {
564 564
     foreach (explode(';', $SETTINGS['roles_allowed_to_print']) as $role) {
565 565
         if (in_array($role, $_SESSION['user_roles']) === true) {
@@ -569,5 +569,5 @@  discard block
 block discarded – undo
569 569
 }
570 570
 
571 571
 /* CHECK NUMBER OF USER ONLINE */
572
-DB::query('SELECT * FROM ' . prefixTable('users') . ' WHERE timestamp>=%i', time() - 600);
572
+DB::query('SELECT * FROM '.prefixTable('users').' WHERE timestamp>=%i', time() - 600);
573 573
 $_SESSION['nb_users_online'] = DB::count();
Please login to merge, or discard this patch.
sources/folders.datatable.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
 require_once 'SecureHandler.php';
29 29
 session_name('teampass_session');
30 30
 session_start();
31
-if (! isset($_SESSION['CPM']) || $_SESSION['CPM'] === false || ! isset($_SESSION['key']) || empty($_SESSION['key'])) {
31
+if (!isset($_SESSION['CPM']) || $_SESSION['CPM'] === false || !isset($_SESSION['key']) || empty($_SESSION['key'])) {
32 32
     die('Hacking attempt...');
33 33
 }
34 34
 
Please login to merge, or discard this patch.