Passed
Push — master ( 2d150a...a3cfc6 )
by Nils
06:39
created
includes/core/login.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,9 @@
 block discarded – undo
58 58
     $get['state'] = filter_var($_GET['state'], FILTER_SANITIZE_SPECIAL_CHARS);
59 59
     $get['session_state'] = filter_var($_GET['session_state'], FILTER_SANITIZE_SPECIAL_CHARS);
60 60
 
61
-    if (WIP === true) error_log('---- OAUTH2 START ----');
61
+    if (WIP === true) {
62
+        error_log('---- OAUTH2 START ----');
63
+    }
62 64
 
63 65
     // Création d'une instance du contrôleur
64 66
     $OAuth2 = new OAuth2Controller($SETTINGS);
Please login to merge, or discard this patch.
Spacing   +40 added lines, -41 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 $postType = $request->query->get('post_type', '');
48 48
 $postType = filter_var($postType, FILTER_SANITIZE_SPECIAL_CHARS);
49 49
 $get['post_type'] = $postType;
50
-if (isset($SETTINGS['duo']) === true && (int) $SETTINGS['duo'] === 1 && $get['post_type'] === 'duo' ) {
50
+if (isset($SETTINGS['duo']) === true && (int) $SETTINGS['duo'] === 1 && $get['post_type'] === 'duo') {
51 51
     $get['duo_state'] = $request->query->get('state');
52 52
     $get['duo_code'] = $request->query->get('duo_code');
53 53
 }
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
         exit;
78 78
     } else {
79 79
         // Gérer les erreurs
80
-        echo 'Erreur lors de la récupération des informations utilisateur : ' . htmlspecialchars($userInfo['message'], ENT_QUOTES, 'UTF-8');
80
+        echo 'Erreur lors de la récupération des informations utilisateur : '.htmlspecialchars($userInfo['message'], ENT_QUOTES, 'UTF-8');
81 81
     };
82 82
 }
83 83
 
@@ -100,8 +100,7 @@  discard block
 block discarded – undo
100 100
 <div class="login-box">
101 101
     <div class="login-logo"><div style="margin:30px;">',
102 102
     isset($SETTINGS['custom_logo']) === true && empty($SETTINGS['custom_logo']) === false ?
103
-        '<img src="' . (string) $SETTINGS['custom_logo'] . '" alt="" style="text-align:center; max-width:100px;" />' :
104
-        '<img src="includes/images/teampass-logo2-login.png" alt="Teampass Logo">',
103
+        '<img src="'.(string) $SETTINGS['custom_logo'].'" alt="" style="text-align:center; max-width:100px;" />' : '<img src="includes/images/teampass-logo2-login.png" alt="Teampass Logo">',
105 104
         '
106 105
         </div>
107 106
         <div style="font-weight:bold;">
@@ -121,14 +120,14 @@  discard block
 block discarded – undo
121 120
 
122 121
         <div class="card-body login-card-body1">
123 122
             <div class="input-group has-feedback mb-2">
124
-                <div class="input-group-prepend infotip" title="' . $lang->get('login') . '">
123
+                <div class="input-group-prepend infotip" title="' . $lang->get('login').'">
125 124
                     <span class="input-group-text"><i class="fa-solid fa-user fa-fw"></i></span>
126 125
                 </div>';
127 126
 if (
128 127
     isset($SETTINGS['enable_http_request_login']) === true
129 128
     && (int) $SETTINGS['enable_http_request_login'] === 1
130 129
     && $request->getUser() !== null
131
-    && ! (isset($SETTINGS['maintenance_mode']) === true
130
+    && !(isset($SETTINGS['maintenance_mode']) === true
132 131
         && (int) $SETTINGS['maintenance_mode'] === 1)
133 132
 ) {
134 133
     if (strpos($request->getUser(), '@') !== false) {
@@ -142,42 +141,42 @@  discard block
 block discarded – undo
142 141
             <input type="text" id="login" class="form-control" placeholder="', filter_var($username, FILTER_SANITIZE_FULL_SPECIAL_CHARS), '" readonly>';
143 142
 } else {
144 143
     echo '
145
-            <input type="text" id="login" class="form-control" placeholder="' . $lang->get('index_login') . '" value="'.(null !== $session->get('user-login') && empty($session->get('user-login')) === false ? filter_var($session->get('user-login'), FILTER_SANITIZE_FULL_SPECIAL_CHARS) : '').'">';
144
+            <input type="text" id="login" class="form-control" placeholder="' . $lang->get('index_login').'" value="'.(null !== $session->get('user-login') && empty($session->get('user-login')) === false ? filter_var($session->get('user-login'), FILTER_SANITIZE_FULL_SPECIAL_CHARS) : '').'">';
146 145
 }
147 146
 
148 147
 echo '
149 148
         </div>';
150
-if (! (isset($SETTINGS['enable_http_request_login']) === true
149
+if (!(isset($SETTINGS['enable_http_request_login']) === true
151 150
     && (int) $SETTINGS['enable_http_request_login'] === 1
152 151
     && $request->getUser() !== null
153
-    && ! (isset($SETTINGS['maintenance_mode']) === true
152
+    && !(isset($SETTINGS['maintenance_mode']) === true
154 153
         && (int) $SETTINGS['maintenance_mode'] === 1))) {
155 154
     echo '
156 155
         <div class="input-group has-feedback mb-2">
157
-            <div class="input-group-prepend infotip" title="' . $lang->get('password') . '">
156
+            <div class="input-group-prepend infotip" title="' . $lang->get('password').'">
158 157
                 <span class="input-group-text"><i class="fa-solid fa-lock fa-fw"></i></span>
159 158
             </div>
160
-            <input type="password" id="pw" class="form-control submit-button" placeholder="' . $lang->get('index_password') . '">
159
+            <input type="password" id="pw" class="form-control submit-button" placeholder="' . $lang->get('index_password').'">
161 160
         </div>';
162 161
 }
163 162
 
164 163
 echo '
165 164
         <div class="input-group has-feedback mb-2">
166
-            <div class="input-group-prepend infotip" title="' . $lang->get('session_expiration_in_minutes') . '">
165
+            <div class="input-group-prepend infotip" title="' . $lang->get('session_expiration_in_minutes').'">
167 166
                 <span class="input-group-text"><i class="fa-solid fa-clock fa-fw"></i></span>
168 167
             </div>
169 168
             <input type="text" id="session_duration" class="form-control submit-button" 
170
-            placeholder="' . $lang->get('index_session_duration') .'&nbsp;(' . $lang->get('minutes') . ')" 
169
+            placeholder="' . $lang->get('index_session_duration').'&nbsp;('.$lang->get('minutes').')" 
171 170
             value="', isset($SETTINGS['default_session_expiration_time']) === true ? $SETTINGS['default_session_expiration_time'] : '', '">
172 171
         </div>';
173 172
 // 2FA auth selector
174 173
 $mfaHtmlPart = '
175
-        <input type="hidden" id="2fa_user_selection" value="'.htmlspecialchars((isset($get['post_type']) === true && $get['post_type'] === 'duo') ? 'duo' : ''). '">
176
-        <input type="hidden" id="duo_code" value="'.htmlspecialchars(isset($get['duo_code']) === true && is_null($get['duo_code']) === false ? $get['duo_code'] : ''). '">
177
-        <input type="hidden" id="duo_state" value="'.htmlspecialchars(isset($get['duo_state']) === true && is_null($get['duo_state']) === false ? $get['duo_state'] : ''). '">
174
+        <input type="hidden" id="2fa_user_selection" value="'.htmlspecialchars((isset($get['post_type']) === true && $get['post_type'] === 'duo') ? 'duo' : '').'">
175
+        <input type="hidden" id="duo_code" value="'.htmlspecialchars(isset($get['duo_code']) === true && is_null($get['duo_code']) === false ? $get['duo_code'] : '').'">
176
+        <input type="hidden" id="duo_state" value="'.htmlspecialchars(isset($get['duo_state']) === true && is_null($get['duo_state']) === false ? $get['duo_state'] : '').'">
178 177
         <div class="row mb-3 hidden" id="2fa_methods_selector">
179 178
             <div class="col-12">
180
-                <h8 class="login-box-msg">' . $lang->get('2fa_authentication_selector') . '</h8>
179
+                <h8 class="login-box-msg">' . $lang->get('2fa_authentication_selector').'</h8>
181 180
                 <div class="2fa-methods text-center mt-2">'.
182 181
                 (isset($SETTINGS['google_authentication']) === true && (int) $SETTINGS['google_authentication'] === 1 ?
183 182
         '
@@ -210,14 +209,14 @@  discard block
 block discarded – undo
210 209
     echo '
211 210
         <div id="div-2fa-google" class="mb-3 div-2fa-method hidden">
212 211
             <div class="input-group has-feedback mb-2">
213
-                <div class="input-group-prepend infotip" title="' . $lang->get('mfa_unique_code') . '">
212
+                <div class="input-group-prepend infotip" title="' . $lang->get('mfa_unique_code').'">
214 213
                     <span class="input-group-text"><i class="fa-solid fa-key fa-fw"></i></span>
215 214
                 </div>
216
-                <input type="text" id="ga_code" class="form-control submit-button" placeholder="' . $lang->get('ga_identification_code') . '" />
215
+                <input type="text" id="ga_code" class="form-control submit-button" placeholder="' . $lang->get('ga_identification_code').'" />
217 216
                 <span class="input-group-append">
218 217
                     <button type="button" class="btn btn-info btn-flat" onclick="send_user_new_temporary_ga_code()">
219 218
                         <i class="fa-solid fa-envelope form-control-feedback pointer infotip" 
220
-                    title="' . $lang->get('i_need_to_generate_new_ga_code') . '"></i>
219
+                    title="' . $lang->get('i_need_to_generate_new_ga_code').'"></i>
221 220
                     </button>
222 221
                 </span>
223 222
             </div>
@@ -235,7 +234,7 @@  discard block
 block discarded – undo
235 234
 <script>
236 235
 var seconds = 1;
237 236
 function updateLogonButton(timeToGo){
238
-    document.getElementById("but_identify_user").value = "' . $lang->get('duration_login_attempt') . ' " + timeToGo;
237
+    document.getElementById("but_identify_user").value = "' . $lang->get('duration_login_attempt').' " + timeToGo;
239 238
 }
240 239
 $( window ).on( "load", function() {
241 240
     updateLogonButton(seconds);
@@ -244,7 +243,7 @@  discard block
 block discarded – undo
244 243
         if (seconds >= 0) {
245 244
             updateLogonButton(seconds);
246 245
         } else if(seconds === 0) {
247
-            launchIdentify("", "' . $nextUrl . '");
246
+            launchIdentify("", "' . $nextUrl.'");
248 247
         }
249 248
         updateLogonButton(seconds);
250 249
     },
@@ -265,15 +264,15 @@  discard block
 block discarded – undo
265 264
             <div class="col-8">
266 265
                 <div id="yubiko-new-key" class="alert alert-info hidden">
267 266
                     <p>
268
-                        <input type="text" size="10" id="yubico_user_id" class="form-control" placeholder="' . $lang->get('yubico_user_id') . '">
267
+                        <input type="text" size="10" id="yubico_user_id" class="form-control" placeholder="' . $lang->get('yubico_user_id').'">
269 268
                     </p>
270 269
                     <p>
271
-                    <input type="text" size="10" id="yubico_user_key" class="form-control" placeholder="' . $lang->get('yubico_user_key') . '">
270
+                    <input type="text" size="10" id="yubico_user_key" class="form-control" placeholder="' . $lang->get('yubico_user_key').'">
272 271
                     </p>
273 272
                 </div>
274
-                <input autocomplete="off" type="text" id="yubico_key" class="form-control submit-button" placeholder="' . $lang->get('press_your_yubico_key') . '">
273
+                <input autocomplete="off" type="text" id="yubico_key" class="form-control submit-button" placeholder="' . $lang->get('press_your_yubico_key').'">
275 274
                 <div class="row">
276
-                    <span class="ml-2 mt-1 font-weight-light small pointer" id="register-yubiko-key">' . $lang->get('register_new_yubiko_key') . '</span>
275
+                    <span class="ml-2 mt-1 font-weight-light small pointer" id="register-yubiko-key">' . $lang->get('register_new_yubiko_key').'</span>
277 276
                 </div>
278 277
             </div>
279 278
         </div>';
@@ -282,22 +281,22 @@  discard block
 block discarded – undo
282 281
 echo '
283 282
         <div class="row mt-5">
284 283
             <div class="col-12">
285
-                <button id="but_identify_user" class="btn btn-primary btn-block">' . $lang->get('log_in') . '</button>
284
+                <button id="but_identify_user" class="btn btn-primary btn-block">' . $lang->get('log_in').'</button>
286 285
                 
287 286
                 <!-- In case of upgrade, the user has to provide his One Time Code -->
288 287
                 <div class="card-body user-one-time-code-card-body hidden">
289
-                    <h5 class="login-box-msg">' . $lang->get('provide_personal_one_time_code') . '</h5>
288
+                    <h5 class="login-box-msg">' . $lang->get('provide_personal_one_time_code').'</h5>
290 289
 
291 290
                     <div class="input-group has-feedback mb-2 mt-4">
292 291
                         <div class="input-group-prepend">
293 292
                             <span class="input-group-text"><i class="fa-solid fa-unlock-alt"></i></span>
294 293
                         </div>
295
-                        <input type="password" id="user-one-time-code" class="form-control" placeholder="' . $lang->get('one_time_code') . '">
294
+                        <input type="password" id="user-one-time-code" class="form-control" placeholder="' . $lang->get('one_time_code').'">
296 295
                     </div>
297 296
 
298 297
                     <div class="row mb-3">
299 298
                         <div class="col-12">
300
-                            <button id="but_confirm_otc" class="btn btn-primary btn-block">' . $lang->get('confirm') . '</button>
299
+                            <button id="but_confirm_otc" class="btn btn-primary btn-block">' . $lang->get('confirm').'</button>
301 300
                         </div>
302 301
                     </div>
303 302
                 </div>
@@ -312,7 +311,7 @@  discard block
 block discarded – undo
312 311
         <hr class="mt-3 mb-3"/>
313 312
         <div class="row mb-2">
314 313
             <div class="col-12">
315
-                <button id="but_login_with_oauth2" class="btn btn-primary btn-block">' . $SETTINGS['oauth2_client_appname'] . '</button>
314
+                <button id="but_login_with_oauth2" class="btn btn-primary btn-block">' . $SETTINGS['oauth2_client_appname'].'</button>
316 315
             </div>
317 316
         </div>';
318 317
 }
@@ -325,10 +324,10 @@  discard block
 block discarded – undo
325 324
 // In case of password change
326 325
 echo '
327 326
     <div class="card-body confirm-password-card-body hidden">
328
-        <h5 class="login-box-msg">' . $lang->get('new_password_required') . '</h5>
327
+        <h5 class="login-box-msg">' . $lang->get('new_password_required').'</h5>
329 328
 
330 329
         <div class="alert alert-info">
331
-            <div class="text-center"><i class="icon fa fa-info"></i>' . $lang->get('password_strength') . '
330
+            <div class="text-center"><i class="icon fa fa-info"></i>' . $lang->get('password_strength').'
332 331
             <span id="confirm-password-level" class="ml-2 font-weight-bold"></span></div>
333 332
         </div>
334 333
 
@@ -338,20 +337,20 @@  discard block
 block discarded – undo
338 337
                     <div class="input-group-prepend">
339 338
                         <span class="input-group-text"><i class="fas fa-key"></i></span>
340 339
                     </div>
341
-                    <input type="password" id="current-user-password" class="form-control" placeholder="' . $lang->get('current_password') . '">
340
+                    <input type="password" id="current-user-password" class="form-control" placeholder="' . $lang->get('current_password').'">
342 341
                 </div>
343 342
             </div>
344 343
             <div class="input-group has-feedback mb-2 mt-4">
345 344
                 <div class="input-group-prepend">
346 345
                     <span class="input-group-text"><i class="fas fa-key"></i></span>
347 346
                 </div>
348
-                <input type="password" id="new-user-password" class="form-control" placeholder="' . $lang->get('index_new_pw') . '">
347
+                <input type="password" id="new-user-password" class="form-control" placeholder="' . $lang->get('index_new_pw').'">
349 348
             </div>
350 349
             <div class="input-group has-feedback mb-2">
351 350
                 <div class="input-group-prepend">
352 351
                     <span class="input-group-text"><i class="fas fa-key"></i></span>
353 352
                 </div>
354
-                <input type="password" id="new-user-password-confirm" class="form-control" placeholder="' . $lang->get('index_change_pw_confirmation') . '">
353
+                <input type="password" id="new-user-password-confirm" class="form-control" placeholder="' . $lang->get('index_change_pw_confirmation').'">
355 354
             </div>
356 355
             <div class="row mb-3">
357 356
                 <div class="col-md-12 offset-sm-4 text-center">
@@ -362,7 +361,7 @@  discard block
 block discarded – undo
362 361
             </div>
363 362
             <div class="row mb-3">
364 363
                 <div class="col-12">
365
-                    <button id="but_confirm_new_password" class="btn btn-primary btn-block">' . $lang->get('confirm') . '</button>
364
+                    <button id="but_confirm_new_password" class="btn btn-primary btn-block">' . $lang->get('confirm').'</button>
366 365
                 </div>
367 366
             </div>
368 367
         </div>
@@ -370,20 +369,20 @@  discard block
 block discarded – undo
370 369
 
371 370
     <div class="card-body hidden" id="card-user-treat-psk">
372 371
         <div class="alert alert-info">
373
-            <div class="text-center"><i class="icon fa fa-info"></i>' . $lang->get('user_has_psk_info') . '</div>
372
+            <div class="text-center"><i class="icon fa fa-info"></i>' . $lang->get('user_has_psk_info').'</div>
374 373
         </div>
375 374
         <div class="input-group has-feedback mb-2">
376 375
             <div class="input-group-prepend">
377 376
                 <span class="input-group-text"><i class="fas fa-key"></i></span>
378 377
             </div>
379
-            <input type="password" id="user-old-defuse-psk" class="form-control" placeholder="' . $lang->get('home_personal_saltkey') . '">
378
+            <input type="password" id="user-old-defuse-psk" class="form-control" placeholder="' . $lang->get('home_personal_saltkey').'">
380 379
         </div>
381 380
         <div class="row mb-3 mt-4">
382 381
             <div class="col-12">
383
-                <button id="but_confirm_defuse_psk" class="btn btn-primary btn-block">' . $lang->get('launch') . '</button>
382
+                <button id="but_confirm_defuse_psk" class="btn btn-primary btn-block">' . $lang->get('launch').'</button>
384 383
             </div>
385 384
             <div class="col-12 mt-3">
386
-                <button id="but_confirm_forgot_defuse_psk" class="btn btn-danger btn-block text-bold">' . $lang->get('i_cannot_remember') . '</button>
385
+                <button id="but_confirm_forgot_defuse_psk" class="btn btn-danger btn-block text-bold">' . $lang->get('i_cannot_remember').'</button>
387 386
             </div>
388 387
         </div>
389 388
     </div>
Please login to merge, or discard this patch.
scripts/task_maintenance_reload_cache_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@
 block discarded – undo
71 71
 function reloadCacheTable(): void
72 72
 {
73 73
     // Load expected files
74
-    require_once __DIR__. '/../sources/main.functions.php';
74
+    require_once __DIR__.'/../sources/main.functions.php';
75 75
 
76 76
     updateCacheTable('reload', NULL);
77 77
 }
78 78
\ No newline at end of file
Please login to merge, or discard this patch.
sources/items.logs.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 ) {
75 75
     // Not allowed page
76 76
     $session->set('system-error_code', ERR_NOT_ALLOWED);
77
-    include $SETTINGS['cpassman_dir'] . '/error.php';
77
+    include $SETTINGS['cpassman_dir'].'/error.php';
78 78
     exit;
79 79
 }
80 80
 
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
             
131 131
             if (
132 132
                 is_array($dataReceived) && // check if the data is an array
133
-                array_diff_key(array_flip($requiredKeys), $dataReceived) === [] &&  // check if all required keys have a valuekeys are present
133
+                array_diff_key(array_flip($requiredKeys), $dataReceived) === [] && // check if all required keys have a valuekeys are present
134 134
                 count(array_filter($dataReceived)) === count($requiredKeys) && // check if all required 
135 135
                 in_array($dataReceived['action'], ['at_password_shown', 'at_password_copied'], true) && // only log these actions
136 136
                 $session->get('user-id') === (int) filter_var($dataReceived['user_id'], FILTER_SANITIZE_NUMBER_INT) // only log actions of the current user
Please login to merge, or discard this patch.
includes/core/load.js.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 
176 176
                             // Show passwords inputs and form
177 177
                             $('#dialog-user-change-password-info')
178
-                                .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('user_has_to_change_password_info');?>')
178
+                                .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('user_has_to_change_password_info'); ?>')
179 179
                                 .removeClass('hidden');
180 180
                             $('#dialog-user-change-password').removeClass('hidden');
181 181
 
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 
189 189
                             // Show passwords inputs and form
190 190
                             $('#dialog-ldap-user-change-password-info')
191
-                                .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('ldap_user_has_changed_his_password');?>')
191
+                                .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('ldap_user_has_changed_his_password'); ?>')
192 192
                                 .removeClass('hidden');
193 193
                             $('#dialog-ldap-user-change-password').removeClass('hidden');
194 194
                             
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 
217 217
                             if (data.queryResults.auth_type === 'oauth2') {
218 218
                                 // LDAP or local account to OAuth2 account
219
-                                var info_message = '<?php echo $lang->get('oauth2_need_user_old_password');?>';
219
+                                var info_message = '<?php echo $lang->get('oauth2_need_user_old_password'); ?>';
220 220
 
221 221
                                 // Hide the "new password" field that users can't fill in manually
222 222
                                 $('#new-password-field').hide();
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
                                 $('#dialog-ldap-user-change-password-current').val(oauth2_encryption_hash);
229 229
                             } else {
230 230
                                 // LDAP password updated
231
-                                var info_message = '<?php echo $lang->get('ldap_user_has_changed_his_password');?>';
231
+                                var info_message = '<?php echo $lang->get('ldap_user_has_changed_his_password'); ?>';
232 232
                             }
233 233
 
234 234
                             // Display info tip
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
         /*console.log('User has to regenerate keys')
340 340
         // HIde
341 341
         $('.content-header, .content').addClass('hidden');
342
-        $('#dialog-user-temporary-code-info').html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('renecyption_expected');?>');
342
+        $('#dialog-user-temporary-code-info').html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('renecyption_expected'); ?>');
343 343
 
344 344
         // Show passwords inputs and form
345 345
         $('#dialog-user-temporary-code').removeClass('hidden');
@@ -421,13 +421,13 @@  discard block
 block discarded – undo
421 421
             {
422 422
                 if (step === 'psk') {
423 423
                     // Inform user
424
-                    $("#user-current-defuse-psk-progress").html('<b><?php echo $lang->get('encryption_keys'); ?> </b> [' + start + ' - ' + (parseInt(start) + <?php echo NUMBER_ITEMS_IN_BATCH;?>) + '] ' +
424
+                    $("#user-current-defuse-psk-progress").html('<b><?php echo $lang->get('encryption_keys'); ?> </b> [' + start + ' - ' + (parseInt(start) + <?php echo NUMBER_ITEMS_IN_BATCH; ?>) + '] ' +
425 425
                         '... <?php echo $lang->get('please_wait'); ?><i class="fa-solid fa-spinner fa-pulse ml-3 text-primary"></i>');
426 426
 
427 427
                     var data = {
428 428
                         'userPsk' : $('#user-current-defuse-psk').val(),
429 429
                         'start': start,
430
-                        'length': <?php echo NUMBER_ITEMS_IN_BATCH;?>,
430
+                        'length': <?php echo NUMBER_ITEMS_IN_BATCH; ?>,
431 431
                         'user_id': userId,
432 432
                         'counterItemsToTreat': counterItemsToTreat
433 433
                     };
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
 
504 504
                 // Show passwords inputs and form
505 505
                 $('#dialog-ldap-user-change-password-info')
506
-                    .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('ldap_user_has_changed_his_password');?>')
506
+                    .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('ldap_user_has_changed_his_password'); ?>')
507 507
                     .removeClass('hidden');
508 508
                 $('#dialog-ldap-user-change-password').removeClass('hidden');
509 509
 
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
                                 '</div>' +
594 594
                             '</div>' +
595 595
                         '</div>' +
596
-                        '<div class="row mt-2<?php echo isset($SETTINGS['enable_pf_feature']) === true && (int) $SETTINGS['enable_pf_feature'] === 1  ? '' : ' hidden'; ?>">' +
596
+                        '<div class="row mt-2<?php echo isset($SETTINGS['enable_pf_feature']) === true && (int) $SETTINGS['enable_pf_feature'] === 1 ? '' : ' hidden'; ?>">' +
597 597
                             '<h6><?php echo $lang->get('provide_recovery_keys'); ?></h6>' +
598 598
                             '<div class="input-group mb-2">' +
599 599
                                 '<div class="input-group-prepend">' +
@@ -608,7 +608,7 @@  discard block
 block discarded – undo
608 608
                                 '<textarea rows="2" id="recovery-private-key" class="form-control form-item-control"></textarea>' +
609 609
                             '</div>' +
610 610
                         '</div>' +
611
-                        '<div class="row mt-2<?php echo isset($SETTINGS['enable_pf_feature']) === true && (int) $SETTINGS['enable_pf_feature'] === 1  ? '' : ' hidden'; ?>">' +
611
+                        '<div class="row mt-2<?php echo isset($SETTINGS['enable_pf_feature']) === true && (int) $SETTINGS['enable_pf_feature'] === 1 ? '' : ' hidden'; ?>">' +
612 612
                             '<div class="alert" id="confirm-no-recovery-keys-div">' +
613 613
                                 '<div class="form-check">' +
614 614
                                     '<input type="checkbox" class="form-check-input" id="confirm-no-recovery-keys">' +
@@ -1172,15 +1172,15 @@  discard block
 block discarded – undo
1172 1172
             // Prepare data
1173 1173
             var data = {
1174 1174
                 'receipt': $('#temp-user-email').val(),
1175
-                'subject': '[Teampass] <?php echo $lang->get('your_new_password');?>',
1176
-                'body': '<?php echo $lang->get('email_body_temporary_login_password');?>',
1175
+                'subject': '[Teampass] <?php echo $lang->get('your_new_password'); ?>',
1176
+                'body': '<?php echo $lang->get('email_body_temporary_login_password'); ?>',
1177 1177
                 'pre_replace' : {
1178 1178
                     '#enc_code#' : $('#temp-user-pwd').val(),
1179 1179
                 }
1180 1180
             }
1181 1181
             if (debugJavascript === true) console.log(data);
1182 1182
             // Prepare form
1183
-            $('#dialog-admin-change-user-password-info').html('<?php echo $lang->get('sending_email_message');?>');
1183
+            $('#dialog-admin-change-user-password-info').html('<?php echo $lang->get('sending_email_message'); ?>');
1184 1184
             toastr.remove();
1185 1185
             toastr.info(
1186 1186
                 '<?php echo $lang->get('in_progress'); ?><i class="fa-solid fa-circle-notch fa-spin fa-2x ml-3"></i>'
@@ -1702,7 +1702,7 @@  discard block
 block discarded – undo
1702 1702
                         '#warningModal',
1703 1703
                         '<i class="fa-solid fa-clock fa-lg warning mr-2"></i><?php echo $lang->get('index_add_one_hour'); ?>',
1704 1704
                         '<div class="form-group">' +
1705
-                        '<label for="warningModal-input" class="col-form-label"><?php echo $lang->get('extend_session_duration_by') . ' (' . $lang->get('minutes') . ')'; ?>:</label>' +
1705
+                        '<label for="warningModal-input" class="col-form-label"><?php echo $lang->get('extend_session_duration_by').' ('.$lang->get('minutes').')'; ?>:</label>' +
1706 1706
                         '<input type="number" max="'+(60*60*24)+'" class="form-control" id="warningModal-input" value="60">' +
1707 1707
                         '</div>' +
1708 1708
                         '<div class="form-text text-muted"><i class=\"fa-solid fa-info-circle mr-2\"></i><?php echo $lang->get('maximum_session_expiration_time'); ?>: '+data.max_session_duration+'</div>',
Please login to merge, or discard this patch.
api/Model/AuthModel.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -239,7 +239,7 @@
 block discarded – undo
239 239
         $configManager = new ConfigManager();
240 240
         $SETTINGS = $configManager->getAllSettings();
241 241
         
242
-		$payload = [
242
+        $payload = [
243 243
             'username' => $login,
244 244
             'id' => $id, 
245 245
             'exp' => (time() + $SETTINGS['api_token_duration'] + 600),
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
     public function getUserAuth(string $login, string $password, string $apikey): array
50 50
     {
51 51
         // Sanitize
52
-        include_once API_ROOT_PATH . '/../sources/main.functions.php';
52
+        include_once API_ROOT_PATH.'/../sources/main.functions.php';
53 53
         $inputData = dataSanitizer(
54 54
             [
55 55
                 'login' => isset($login) === true ? $login : '',
@@ -74,8 +74,8 @@  discard block
 block discarded – undo
74 74
             // Check if user exists
75 75
             $userInfo = DB::queryfirstrow(
76 76
                 "SELECT u.id, u.pw, u.login, u.admin, u.gestionnaire, u.can_manage_all_users, u.fonction_id, u.can_create_root_folder, u.public_key, u.private_key, u.personal_folder, u.fonction_id, u.groupes_visibles, u.groupes_interdits, a.value AS user_api_key, a.allowed_folders as user_api_allowed_folders, a.enabled, a.allowed_to_create, a.allowed_to_read, a.allowed_to_update, a.allowed_to_delete
77
-                FROM " . prefixTable('users') . " AS u
78
-                INNER JOIN " . prefixTable('api') . " AS a ON (a.user_id=u.id)
77
+                FROM " . prefixTable('users')." AS u
78
+                INNER JOIN " . prefixTable('api')." AS a ON (a.user_id=u.id)
79 79
                 WHERE login = %s",
80 80
                 $inputData['login']
81 81
             );
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
         if (count($userFunctionId) > 0) {
252 252
             $rows = DB::query(
253 253
                 'SELECT * 
254
-                FROM ' . prefixTable('roles_values') . '
254
+                FROM ' . prefixTable('roles_values').'
255 255
                 WHERE role_id IN %li  AND type IN ("W", "ND", "NE", "NDNE", "R")',
256 256
                 $userFunctionId
257 257
             );
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
         $inc = 0;
278 278
         $rows = DB::query(
279 279
             'SELECT id, id_tree 
280
-            FROM ' . prefixTable('items') . '
280
+            FROM ' . prefixTable('items').'
281 281
             WHERE restricted_to LIKE %s'.
282 282
             (count($userFunctionId) > 0 ? ' AND id_tree NOT IN %li' : ''),
283 283
             $userInfo['id'],
@@ -292,8 +292,8 @@  discard block
 block discarded – undo
292 292
         // Check for the users roles if some specific rights exist on items
293 293
         $rows = DB::query(
294 294
             'SELECT i.id_tree, r.item_id
295
-            FROM ' . prefixTable('items') . ' AS i
296
-            INNER JOIN ' . prefixTable('restriction_to_roles') . ' AS r ON (r.item_id=i.id)
295
+            FROM ' . prefixTable('items').' AS i
296
+            INNER JOIN ' . prefixTable('restriction_to_roles').' AS r ON (r.item_id=i.id)
297 297
             WHERE '.(count($userFunctionId) > 0 ? ' id_tree NOT IN %li AND ' : '').' i.id_tree != ""
298 298
             ORDER BY i.id_tree ASC',
299 299
             count($userFunctionId) > 0 ? $userFunctionId : DB::sqleval('0')
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
         // Add all personal folders
310 310
         $rows = DB::queryFirstRow(
311 311
             'SELECT id 
312
-            FROM ' . prefixTable('nested_tree') . '
312
+            FROM ' . prefixTable('nested_tree').'
313 313
             WHERE title = %i AND personal_folder = 1'.
314 314
             (count($userFunctionId) > 0 ? ' AND id NOT IN %li' : ''),
315 315
             $userInfo['id'],
Please login to merge, or discard this patch.
api/inc/bootstrap.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -25,18 +25,18 @@  discard block
 block discarded – undo
25 25
 
26 26
 use TeampassClasses\ConfigManager\ConfigManager;
27 27
 
28
-define("API_ROOT_PATH", __DIR__ . "/..");
28
+define("API_ROOT_PATH", __DIR__."/..");
29 29
 
30 30
 // include main configuration file
31
-require API_ROOT_PATH . '/../sources/main.functions.php';
31
+require API_ROOT_PATH.'/../sources/main.functions.php';
32 32
 
33 33
 // include the base controller file
34
-require API_ROOT_PATH . "/Controller/Api/BaseController.php";
34
+require API_ROOT_PATH."/Controller/Api/BaseController.php";
35 35
 
36 36
 // include the use model file
37
-require API_ROOT_PATH . "/Model/UserModel.php";
38
-require API_ROOT_PATH . "/Model/ItemModel.php";
39
-require API_ROOT_PATH . "/Model/FolderModel.php";
37
+require API_ROOT_PATH."/Model/UserModel.php";
38
+require API_ROOT_PATH."/Model/ItemModel.php";
39
+require API_ROOT_PATH."/Model/FolderModel.php";
40 40
 
41 41
 /**
42 42
  * Launch expected action for ITEM
@@ -55,9 +55,9 @@  discard block
 block discarded – undo
55 55
         );
56 56
     }
57 57
     // Perform the action
58
-    require API_ROOT_PATH . "/Controller/Api/ItemController.php";    
58
+    require API_ROOT_PATH."/Controller/Api/ItemController.php";    
59 59
     $objFeedController = new ItemController();
60
-    $strMethodName = $actions[0] . 'Action';
60
+    $strMethodName = $actions[0].'Action';
61 61
     $objFeedController->{$strMethodName}($userData);
62 62
 }
63 63
 
@@ -78,9 +78,9 @@  discard block
 block discarded – undo
78 78
         );
79 79
     }
80 80
     // Perform the action
81
-    require API_ROOT_PATH . "/Controller/Api/FolderController.php";
81
+    require API_ROOT_PATH."/Controller/Api/FolderController.php";
82 82
     $objFeedController = new FolderController();
83
-    $strMethodName = $actions[0] . 'Action';
83
+    $strMethodName = $actions[0].'Action';
84 84
     $objFeedController->{$strMethodName}($userData);
85 85
 }
86 86
 
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
  */
138 138
 function verifyAuth(): string
139 139
 {
140
-    include_once API_ROOT_PATH . '/inc/jwt_utils.php';
140
+    include_once API_ROOT_PATH.'/inc/jwt_utils.php';
141 141
     $bearer_token = get_bearer_token();
142 142
 
143 143
     if (empty($bearer_token) === false && is_jwt_valid($bearer_token) === true) {
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
  */
168 168
 function getDataFromToken(): string
169 169
 {
170
-    include_once API_ROOT_PATH . '/inc/jwt_utils.php';
170
+    include_once API_ROOT_PATH.'/inc/jwt_utils.php';
171 171
     $bearer_token = get_bearer_token();
172 172
 
173 173
     if (empty($bearer_token) === false) {
Please login to merge, or discard this patch.
api/Model/UserModel.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
     {
30 30
         return DB::query(
31 31
             'SELECT * 
32
-            FROM ' . prefixTable('users') . '
32
+            FROM ' . prefixTable('users').'
33 33
             ORDER BY id ASC LIMIT %i',
34 34
             $limit
35 35
         );
Please login to merge, or discard this patch.
api/Model/ItemModel.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -50,18 +50,18 @@  discard block
 block discarded – undo
50 50
         // Get items
51 51
         $rows = DB::query(
52 52
             'SELECT i.id, label, description, i.pw, i.url, i.id_tree, i.login, i.email, i.viewed_no, i.fa_icon, i.inactif, i.perso, t.title as folder_label
53
-            FROM ' . prefixTable('items') . ' AS i
53
+            FROM ' . prefixTable('items').' AS i
54 54
             LEFT JOIN '.prefixTable('nested_tree').' as t ON (t.id = i.id_tree) '.
55
-            $sqlExtra . 
56
-            " ORDER BY i.id ASC" .
57
-            ($limit > 0 ? " LIMIT ". $limit : '')
55
+            $sqlExtra. 
56
+            " ORDER BY i.id ASC".
57
+            ($limit > 0 ? " LIMIT ".$limit : '')
58 58
         );
59 59
 
60 60
         $ret = [];
61 61
         foreach ($rows as $row) {
62 62
             $userKey = DB::queryfirstrow(
63 63
                 'SELECT share_key
64
-                FROM ' . prefixTable('sharekeys_items') . '
64
+                FROM ' . prefixTable('sharekeys_items').'
65 65
                 WHERE user_id = %i AND object_id = %i',
66 66
                 $userId,
67 67
                 $row['id']
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
                 if (empty($path) === true) {
99 99
                     $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
100 100
                 } else {
101
-                    $path .= '/' . htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
101
+                    $path .= '/'.htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
102 102
                 }
103 103
             }
104 104
 
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
     ) : array
149 149
     {
150 150
         try {
151
-            include_once API_ROOT_PATH . '/../sources/main.functions.php';
151
+            include_once API_ROOT_PATH.'/../sources/main.functions.php';
152 152
 
153 153
             // Load config
154 154
             $configManager = new ConfigManager();
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
         }
272 272
 
273 273
         if (strlen($password) > $SETTINGS['pwd_maximum_length']) {
274
-            throw new Exception('Password is too long (max allowed is ' . $SETTINGS['pwd_maximum_length'] . ' characters)');
274
+            throw new Exception('Password is too long (max allowed is '.$SETTINGS['pwd_maximum_length'].' characters)');
275 275
         }
276 276
     }
277 277
 
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
     {
285 285
         $dataFolderSettings = DB::queryFirstRow(
286 286
             'SELECT bloquer_creation, bloquer_modification, personal_folder
287
-            FROM ' . prefixTable('nested_tree') . ' 
287
+            FROM ' . prefixTable('nested_tree').' 
288 288
             WHERE id = %i',
289 289
             $folderId
290 290
         );
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
     {
308 308
         $folderComplexity = DB::queryFirstRow(
309 309
             'SELECT valeur
310
-            FROM ' . prefixTable('misc') . '
310
+            FROM ' . prefixTable('misc').'
311 311
             WHERE type = %s AND intitule = %i',
312 312
             'complex',
313 313
             $itemInfos['folderId']
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
     private function checkForDuplicates(string $label, array $SETTINGS, array $itemInfos) : void
336 336
     {
337 337
         DB::queryFirstRow(
338
-            'SELECT * FROM ' . prefixTable('items') . '
338
+            'SELECT * FROM '.prefixTable('items').'
339 339
             WHERE label = %s AND inactif = %i',
340 340
             $label,
341 341
             0
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -342,8 +342,8 @@
 block discarded – undo
342 342
         );
343 343
 
344 344
         if (DB::count() > 0 && (
345
-	     (isset($SETTINGS['duplicate_item']) && (int) $SETTINGS['duplicate_item'] === 0)
346
-	     && (int) $itemInfos['personal_folder'] === 0)
345
+            (isset($SETTINGS['duplicate_item']) && (int) $SETTINGS['duplicate_item'] === 0)
346
+         && (int) $itemInfos['personal_folder'] === 0)
347 347
         ) {
348 348
             throw new Exception('Similar item already exists. Duplicates are not allowed.');
349 349
         }
Please login to merge, or discard this patch.
pages/profile.php 2 patches
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -401,12 +401,13 @@
 block discarded – undo
401 401
                                             <select class="form-control" id="profile-user-timezone">
402 402
                                                 <?php foreach ($zones as $key => $zone): ?>
403 403
                                                     <option value="<?php echo $key; ?>"<?php 
404
-                                                        if ($session->has('user-timezone'))
405
-                                                            if($session->get('user-timezone') === $key)
404
+                                                        if ($session->has('user-timezone')) {
405
+                                                                                                                    if($session->get('user-timezone') === $key)
406 406
                                                                 echo ' selected';
407
-                                                            elseif ($session->get('user-timezone') === 'not_defined')
408
-                                                                if (isset($SETTINGS['timezone']) && $SETTINGS['timezone'] === $key)
407
+                                                        } elseif ($session->get('user-timezone') === 'not_defined') {
408
+                                                                                                                            if (isset($SETTINGS['timezone']) && $SETTINGS['timezone'] === $key)
409 409
                                                                     echo ' selected';
410
+                                                            }
410 411
                                                     ?>><?php echo $zone; ?></option>
411 412
                                                 <?php endforeach; ?>
412 413
                                             </select>
Please login to merge, or discard this patch.
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('profile') === false) {
69 69
     // Not allowed page
70 70
     $session->set('system-error_code', ERR_NOT_ALLOWED);
71
-    include $SETTINGS['cpassman_dir'] . '/error.php';
71
+    include $SETTINGS['cpassman_dir'].'/error.php';
72 72
     exit;
73 73
 }
74 74
 
@@ -101,49 +101,49 @@  discard block
 block discarded – undo
101 101
 $zones = timezone_list();
102 102
 // prepare list of languages
103 103
 $languages = DB::query(
104
-    'SELECT label, name FROM ' . prefixTable('languages') . ' ORDER BY label ASC'
104
+    'SELECT label, name FROM '.prefixTable('languages').' ORDER BY label ASC'
105 105
 );
106 106
 
107 107
 // Do some stats
108 108
 $userItemsNumber = DB::queryFirstField(
109 109
     'SELECT COUNT(id_item) as count
110
-    FROM ' . prefixTable('log_items') . '
110
+    FROM ' . prefixTable('log_items').'
111 111
     WHERE action = "at_creation" AND  id_user = %i',
112 112
     $session->get('user-id')
113 113
 );
114 114
 
115 115
 $userModificationNumber = DB::queryFirstField(
116 116
     'SELECT COUNT(id_item) as count
117
-    FROM ' . prefixTable('log_items') . '
117
+    FROM ' . prefixTable('log_items').'
118 118
     WHERE action = "at_modification" AND  id_user = %i',
119 119
     $session->get('user-id')
120 120
 );
121 121
 
122 122
 $userSeenItemsNumber = DB::queryFirstField(
123 123
     'SELECT COUNT(id_item) as count
124
-    FROM ' . prefixTable('log_items') . '
124
+    FROM ' . prefixTable('log_items').'
125 125
     WHERE action = "at_shown" AND  id_user = %i',
126 126
     $session->get('user-id')
127 127
 );
128 128
 
129 129
 $userSeenPasswordsNumber = DB::queryFirstField(
130 130
     'SELECT COUNT(id_item)
131
-    FROM ' . prefixTable('log_items') . '
131
+    FROM ' . prefixTable('log_items').'
132 132
     WHERE action = "at_password_shown" AND  id_user = %i',
133 133
     $session->get('user-id')
134 134
 );
135 135
 
136 136
 $userInfo = DB::queryFirstRow(
137 137
     'SELECT avatar, last_pw_change
138
-    FROM ' . prefixTable('users') . ' 
138
+    FROM ' . prefixTable('users').' 
139 139
     WHERE id = %i',
140 140
     $session->get('user-id')
141 141
 );
142 142
 
143 143
 if (empty($userInfo['avatar']) === true) {
144
-    $avatar = $SETTINGS['cpassman_url'] . '/includes/images/photo.jpg';
144
+    $avatar = $SETTINGS['cpassman_url'].'/includes/images/photo.jpg';
145 145
 } else {
146
-    $avatar = $SETTINGS['cpassman_url'] . '/includes/avatars/' . $userInfo['avatar'];
146
+    $avatar = $SETTINGS['cpassman_url'].'/includes/avatars/'.$userInfo['avatar'];
147 147
 }
148 148
 
149 149
 // Get Groups name
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 foreach ($session->get('user-roles_array') as $role) {
152 152
     $tmp = DB::queryFirstRow(
153 153
         'SELECT title 
154
-        FROM ' . prefixTable('roles_title') . ' 
154
+        FROM ' . prefixTable('roles_title').' 
155 155
         WHERE id = %i',
156 156
         $role
157 157
     );
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
                         <h3 id="profile-username" class="text-center">
198 198
                             <?php
199 199
                             if (null !== $session->get('user-name') && empty($session->get('user-name')) === false) {
200
-                                echo $session->get('user-name') . ' ' . $session->get('user-lastname');
200
+                                echo $session->get('user-name').' '.$session->get('user-lastname');
201 201
                             } else {
202 202
                                 echo $session->get('user-login');
203 203
                             }
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
                                             } else {
266 266
                                                 echo date('d/m/Y', (int) $session->get('user-last_connection'));
267 267
                                             }
268
-                                            echo ' ' . $lang->get('at') . ' ';
268
+                                            echo ' '.$lang->get('at').' ';
269 269
                                             if (isset($SETTINGS['time_format']) === true) {
270 270
                                                 echo date($SETTINGS['time_format'], (int) $session->get('user-last_connection'));
271 271
                                             } else {
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
                                         </a>
276 276
                                     </li>
277 277
                                     <?php
278
-                                    if (null !== $session->get('user-last_pw_change') && ! empty($session->get('user-last_pw_change') === true)) {
278
+                                    if (null !== $session->get('user-last_pw_change') && !empty($session->get('user-last_pw_change') === true)) {
279 279
                                         // Handle last password change string
280 280
                                         if ($session->has('user-last_pw_change') && null !== $session->get('user-last_pw_change')) {
281 281
                                             if (isset($SETTINGS['date_format']) === true) {
@@ -295,12 +295,12 @@  discard block
 block discarded – undo
295 295
                                         ) {
296 296
                                             $numDaysBeforePwExpiration = '';
297 297
                                         } else {
298
-                                            $numDaysBeforePwExpiration = $lang['index_pw_expiration'] . ' ' . $session->get('user-num_days_before_exp') . ' ' . $lang['days'] . '.';
298
+                                            $numDaysBeforePwExpiration = $lang['index_pw_expiration'].' '.$session->get('user-num_days_before_exp').' '.$lang['days'].'.';
299 299
                                         }
300 300
                                         echo '
301 301
                                     <li class="list-group-item">
302
-                                        <b><i class="fas fa-calendar-alt fa-fw fa-lg mr-2"></i>' . $lang->get('index_last_pw_change') . '</b>
303
-                                        <a class="float-right">' . $last_pw_change . ' ' . $numDaysBeforePwExpiration . '</a>
302
+                                        <b><i class="fas fa-calendar-alt fa-fw fa-lg mr-2"></i>' . $lang->get('index_last_pw_change').'</b>
303
+                                        <a class="float-right">' . $last_pw_change.' '.$numDaysBeforePwExpiration.'</a>
304 304
                                     </li>';
305 305
                                     }
306 306
                                     ?>
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
                                     if (isset($SETTINGS['api']) === true && (int) $SETTINGS['api'] === 1) {
321 321
                                         echo '
322 322
                                     <li class="list-group-item">
323
-                                        <b><i class="fas fa-paper-plane fa-fw fa-lg mr-2"></i>' . $lang->get('user_profile_api_key') . '</b>
323
+                                        <b><i class="fas fa-paper-plane fa-fw fa-lg mr-2"></i>' . $lang->get('user_profile_api_key').'</b>
324 324
                                         <button class="btn btn-sm btn-primary float-right" id="copy-api-key"><i class="fa-regular fa-copy  pointer"></i></button>
325 325
                                         <a class="float-right mr-2" id="profile-user-api-token">',
326 326
                                             null !== $session->get('user-api_key') ? $session->get('user-api_key') : '',
@@ -338,12 +338,12 @@  discard block
 block discarded – undo
338 338
                                         <?php
339 339
                                         $rows = DB::query(
340 340
                                             'SELECT label AS labelAction, date, null
341
-                                                    FROM ' . prefixTable('log_system') . '
341
+                                                    FROM ' . prefixTable('log_system').'
342 342
                                                     WHERE qui = %i
343 343
                                                     UNION
344 344
                                                     SELECT l.action, l.date, i.label AS itemLabel
345
-                                                    FROM ' . prefixTable('log_items') . ' AS l
346
-                                                    INNER JOIN ' . prefixTable('items') . ' AS i ON (l.id_item = i.id)
345
+                                                    FROM ' . prefixTable('log_items').' AS l
346
+                                                    INNER JOIN ' . prefixTable('items').' AS i ON (l.id_item = i.id)
347 347
                                                     WHERE l.id_user = %i AND l.action IN ("at_access")
348 348
                                                     ORDER BY date DESC
349 349
                                                     LIMIT 0, 40',
@@ -357,9 +357,9 @@  discard block
 block discarded – undo
357 357
                                                 $text = $lang->get($record['labelAction']);
358 358
                                             }
359 359
                                             if (empty($record['NULL']) === false) {
360
-                                                $text .= ' ' . $lang->get('for') . ' <span class="font-weight-light">' . addslashes($record['NULL']) . '</span>';
360
+                                                $text .= ' '.$lang->get('for').' <span class="font-weight-light">'.addslashes($record['NULL']).'</span>';
361 361
                                             }
362
-                                            echo '<li class="list-group-item">' . date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['date']) . ' - ' . $text . '</li>';
362
+                                            echo '<li class="list-group-item">'.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['date']).' - '.$text.'</li>';
363 363
                                         }
364 364
                                         ?>
365 365
                                     </ul>
@@ -393,13 +393,13 @@  discard block
 block discarded – undo
393 393
                                 <?php endif; /* disable_user_edit_profile */
394 394
                                 if (($SETTINGS['disable_user_edit_timezone'] ?? '0') === '0') : ?>
395 395
                                     <div class="form-group">
396
-                                        <label class="col-sm-10 control-label"><?php echo $lang->get('timezone_selection');?></label>
396
+                                        <label class="col-sm-10 control-label"><?php echo $lang->get('timezone_selection'); ?></label>
397 397
                                         <div class="col-sm-10">
398 398
                                             <select class="form-control" id="profile-user-timezone">
399 399
                                                 <?php foreach ($zones as $key => $zone): ?>
400 400
                                                     <option value="<?php echo $key; ?>"<?php 
401 401
                                                         if ($session->has('user-timezone'))
402
-                                                            if($session->get('user-timezone') === $key)
402
+                                                            if ($session->get('user-timezone') === $key)
403 403
                                                                 echo ' selected';
404 404
                                                             elseif ($session->get('user-timezone') === 'not_defined')
405 405
                                                                 if (isset($SETTINGS['timezone']) && $SETTINGS['timezone'] === $key)
@@ -417,10 +417,10 @@  discard block
 block discarded – undo
417 417
                                             <select class="form-control" id="profile-user-language">
418 418
                                                 <?php
419 419
                                                     foreach ($languages as $language) {
420
-                                                        echo '<option value="' . $language['name'] . '"',
420
+                                                        echo '<option value="'.$language['name'].'"',
421 421
                                                         strtolower($session->get('user-language')) === strtolower($language['name']) ?
422 422
                                                         ' selected="selected"' : '',
423
-                                                    '>' . $language['label'] . '</option>';
423
+                                                    '>'.$language['label'].'</option>';
424 424
                                                     }
425 425
                                                 ?>
426 426
                                             </select>
@@ -433,11 +433,11 @@  discard block
 block discarded – undo
433 433
                                         <div class="col-sm-10">
434 434
                                             <select class="form-control" id="profile-user-treeloadstrategy">
435 435
                                                 
436
-                                                <option value="sequential" <?php echo $session->has('user-tree_load_strategy') && $session->get('user-tree_load_strategy') && null !== $session->get('user-tree_load_strategy') && $session->get('user-tree_load_strategy') === 'sequential' ? ' selected' : '';?>>
436
+                                                <option value="sequential" <?php echo $session->has('user-tree_load_strategy') && $session->get('user-tree_load_strategy') && null !== $session->get('user-tree_load_strategy') && $session->get('user-tree_load_strategy') === 'sequential' ? ' selected' : ''; ?>>
437 437
                                                     <?php echo $lang->get('sequential'); ?>
438 438
                                                 </option>
439 439
                                                 
440
-                                                <option value="full" <?php echo $session->has('user-tree_load_strategy') && $session->get('user-tree_load_strategy') && null !== $session->get('user-tree_load_strategy') && $session->get('user-tree_load_strategy') === 'full' ? ' selected' : '';?>>
440
+                                                <option value="full" <?php echo $session->has('user-tree_load_strategy') && $session->get('user-tree_load_strategy') && null !== $session->get('user-tree_load_strategy') && $session->get('user-tree_load_strategy') === 'full' ? ' selected' : ''; ?>>
441 441
                                                     <?php echo $lang->get('full'); ?>
442 442
                                                 </option>
443 443
                                             </select>
@@ -450,11 +450,11 @@  discard block
 block discarded – undo
450 450
                                         <div class="col-sm-10">
451 451
                                             <select class="form-control" id="profile-user-split_view_mode">
452 452
                                                 
453
-                                                <option value="0" <?php echo $session->has('user-split_view_mode') && $session->get('user-split_view_mode') && null !== $session->get('user-split_view_mode') && $session->get('user-split_view_mode') === 0 ? 'selected' : '';?>>
453
+                                                <option value="0" <?php echo $session->has('user-split_view_mode') && $session->get('user-split_view_mode') && null !== $session->get('user-split_view_mode') && $session->get('user-split_view_mode') === 0 ? 'selected' : ''; ?>>
454 454
                                                     <?php echo $lang->get('no'); ?>
455 455
                                                 </option>
456 456
                                                 
457
-                                                <option value="1" <?php echo $session->has('user-split_view_mode') && $session->get('user-split_view_mode') && null !== $session->get('user-split_view_mode') && (int) $session->get('user-split_view_mode') === 1 ? 'selected' : '';?>>
457
+                                                <option value="1" <?php echo $session->has('user-split_view_mode') && $session->get('user-split_view_mode') && null !== $session->get('user-split_view_mode') && (int) $session->get('user-split_view_mode') === 1 ? 'selected' : ''; ?>>
458 458
                                                     <?php echo $lang->get('yes'); ?>
459 459
                                                 </option>
460 460
                                             </select>
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
                                                 <?php 
473 473
                                                 }
474 474
                                                 if (isset($SETTINGS['api']) === true && (int) $SETTINGS['api'] === 1) {
475
-                                                    echo '<button type="button" class="btn btn-warning float-right" id="profile-button-api_token">' . $lang->get('generate_api_token') . '</button>';
475
+                                                    echo '<button type="button" class="btn btn-warning float-right" id="profile-button-api_token">'.$lang->get('generate_api_token').'</button>';
476 476
                                                 }
477 477
                                                 ?>
478 478
                                                 <div id="profile-avatar-file-container" class="hidden"></div>
Please login to merge, or discard this patch.