Completed
Push — development ( 477849...8fd89f )
by Nils
07:48
created
sources/upload/upload.attachments.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
             prefix_table('tokens'),
74 74
             array(
75 75
                 'end_timestamp' => time() + 10
76
-               ),
76
+                ),
77 77
             "user_id = %i AND token = %s",
78 78
             $_SESSION['user_id'],
79 79
             $_POST['user_token']
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
                 prefix_table('tokens'),
90 90
                 array(
91 91
                     'end_timestamp' => time() + 30
92
-                   ),
92
+                    ),
93 93
                 "user_id = %i AND token = %s",
94 94
                 $_SESSION['user_id'],
95 95
                 $_POST['user_token']
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 
129 129
 // HTTP headers for no cache etc
130 130
 header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
131
-header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
131
+header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
132 132
 header("Cache-Control: no-store, no-cache, must-revalidate");
133 133
 header("Cache-Control: post-check=0, pre-check=0", false);
134 134
 header("Pragma: no-cache");
@@ -137,9 +137,9 @@  discard block
 block discarded – undo
137 137
 
138 138
 $cleanupTargetDir = true; // Remove old files
139 139
 $maxFileAge = 5 * 3600; // Temp file age in seconds
140
-$valid_chars_regex = 'A-Za-z0-9';   //accept only those characters
140
+$valid_chars_regex = 'A-Za-z0-9'; //accept only those characters
141 141
 $MAX_FILENAME_LENGTH = 260;
142
-$max_file_size_in_bytes = 2147483647;   //2Go
142
+$max_file_size_in_bytes = 2147483647; //2Go
143 143
 
144 144
 @date_default_timezone_set($_POST['timezone']);
145 145
 
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 $POST_MAX_SIZE = ini_get('post_max_size');
148 148
 $unit = strtoupper(substr($POST_MAX_SIZE, -1));
149 149
 $multiplier = ($unit == 'M' ? 1048576 : ($unit == 'K' ? 1024 : ($unit == 'G' ? 1073741824 : 1)));
150
-if ((int) $_SERVER['CONTENT_LENGTH'] > $multiplier*(int) $POST_MAX_SIZE && $POST_MAX_SIZE) {
150
+if ((int) $_SERVER['CONTENT_LENGTH'] > $multiplier * (int) $POST_MAX_SIZE && $POST_MAX_SIZE) {
151 151
     handleError('POST exceeded maximum allowed size.', 111);
152 152
 }
153 153
 
@@ -201,20 +201,20 @@  discard block
 block discarded – undo
201 201
 $fileName = preg_replace('[^'.$valid_chars_regex.']', '', strtolower(basename($fileName)));
202 202
 
203 203
 // Make sure the fileName is unique but only if chunking is disabled
204
-if ($chunks < 2 && file_exists($targetDir . DIRECTORY_SEPARATOR . $fileName)) {
204
+if ($chunks < 2 && file_exists($targetDir.DIRECTORY_SEPARATOR.$fileName)) {
205 205
     $ext = strrpos($fileName, '.');
206 206
     $fileNameA = substr($fileName, 0, $ext);
207 207
     $fileNameB = substr($fileName, $ext);
208 208
 
209 209
     $count = 1;
210
-    while (file_exists($targetDir . DIRECTORY_SEPARATOR . $fileNameA . '_' . $count . $fileNameB)) {
210
+    while (file_exists($targetDir.DIRECTORY_SEPARATOR.$fileNameA.'_'.$count.$fileNameB)) {
211 211
         $count++;
212 212
     }
213 213
 
214
-    $fileName = $fileNameA . '_' . $count . $fileNameB;
214
+    $fileName = $fileNameA.'_'.$count.$fileNameB;
215 215
 }
216 216
 
217
-$filePath = $targetDir . DIRECTORY_SEPARATOR . $fileName;
217
+$filePath = $targetDir.DIRECTORY_SEPARATOR.$fileName;
218 218
 
219 219
 // Create target dir
220 220
 if (!file_exists($targetDir)) {
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 // Remove old temp files
225 225
 if ($cleanupTargetDir && is_dir($targetDir) && ($dir = opendir($targetDir))) {
226 226
     while (($file = readdir($dir)) !== false) {
227
-        $tmpfilePath = $targetDir . DIRECTORY_SEPARATOR . $file;
227
+        $tmpfilePath = $targetDir.DIRECTORY_SEPARATOR.$file;
228 228
 
229 229
         // Remove temp file if it is older than the max age and is not the current file
230 230
         if (preg_match('/\.part$/', $file)
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
 
340 340
 // Get some variables
341 341
 $fileRandomId = md5($fileName.time());
342
-rename($filePath, $targetDir . DIRECTORY_SEPARATOR . $fileRandomId);
342
+rename($filePath, $targetDir.DIRECTORY_SEPARATOR.$fileRandomId);
343 343
 
344 344
 //Get data from DB
345 345
 /*$data = DB::queryfirstrow(
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
         return $f;
389 389
     }
390 390
 
391
-    return substr($f, strrpos($f, '.')+1);
391
+    return substr($f, strrpos($f, '.') + 1);
392 392
 }
393 393
 
394 394
 /* Handles the error output. */
Please login to merge, or discard this patch.
sources/upload/upload.files.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 
68 68
 // HTTP headers for no cache etc
69 69
 header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
70
-header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
70
+header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
71 71
 header("Cache-Control: no-store, no-cache, must-revalidate");
72 72
 header("Cache-Control: post-check=0, pre-check=0", false);
73 73
 header("Pragma: no-cache");
@@ -80,9 +80,9 @@  discard block
 block discarded – undo
80 80
 
81 81
 $cleanupTargetDir = true; // Remove old files
82 82
 $maxFileAge = 5 * 3600; // Temp file age in seconds
83
-$valid_chars_regex = 'A-Za-z0-9';	//accept only those characters
83
+$valid_chars_regex = 'A-Za-z0-9'; //accept only those characters
84 84
 $MAX_FILENAME_LENGTH = 260;
85
-$max_file_size_in_bytes = 2147483647;   //2Go
85
+$max_file_size_in_bytes = 2147483647; //2Go
86 86
 
87 87
 @date_default_timezone_set($_POST['timezone']);
88 88
 
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 $POST_MAX_SIZE = ini_get('post_max_size');
91 91
 $unit = strtoupper(substr($POST_MAX_SIZE, -1));
92 92
 $multiplier = ($unit == 'M' ? 1048576 : ($unit == 'K' ? 1024 : ($unit == 'G' ? 1073741824 : 1)));
93
-if ((int) $_SERVER['CONTENT_LENGTH'] > $multiplier*(int) $POST_MAX_SIZE && $POST_MAX_SIZE) {
93
+if ((int) $_SERVER['CONTENT_LENGTH'] > $multiplier * (int) $POST_MAX_SIZE && $POST_MAX_SIZE) {
94 94
     handleError('POST exceeded maximum allowed size.', 111);
95 95
 }
96 96
 
@@ -161,19 +161,19 @@  discard block
 block discarded – undo
161 161
 $fileName = preg_replace('/[^'.$valid_chars_regex.'\.]/', '', strtolower(basename($fileName)));
162 162
 
163 163
 // Make sure the fileName is unique but only if chunking is disabled
164
-if ($chunks < 2 && file_exists($targetDir . DIRECTORY_SEPARATOR . $fileName)) {
164
+if ($chunks < 2 && file_exists($targetDir.DIRECTORY_SEPARATOR.$fileName)) {
165 165
     $fileNameA = substr($fileName, 0, $ext);
166 166
     $fileNameB = substr($fileName, $ext);
167 167
 
168 168
     $count = 1;
169
-    while (file_exists($targetDir . DIRECTORY_SEPARATOR . $fileNameA . '_' . $count . $fileNameB)) {
169
+    while (file_exists($targetDir.DIRECTORY_SEPARATOR.$fileNameA.'_'.$count.$fileNameB)) {
170 170
         $count++;
171 171
     }
172 172
 
173
-    $fileName = $fileNameA . '_' . $count . $fileNameB;
173
+    $fileName = $fileNameA.'_'.$count.$fileNameB;
174 174
 }
175 175
 
176
-$filePath = $targetDir . DIRECTORY_SEPARATOR . $fileName;
176
+$filePath = $targetDir.DIRECTORY_SEPARATOR.$fileName;
177 177
 
178 178
 // Create target dir
179 179
 if (!file_exists($targetDir)) {
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 // Remove old temp files
184 184
 if ($cleanupTargetDir && is_dir($targetDir) && ($dir = opendir($targetDir))) {
185 185
     while (($file = readdir($dir)) !== false) {
186
-        $tmpfilePath = $targetDir . DIRECTORY_SEPARATOR . $file;
186
+        $tmpfilePath = $targetDir.DIRECTORY_SEPARATOR.$file;
187 187
 
188 188
         // Remove temp file if it is older than the max age and is not the current file
189 189
         if (preg_match('/\.part$/', $file)
@@ -270,9 +270,9 @@  discard block
 block discarded – undo
270 270
 }
271 271
 
272 272
 if (isset($_POST["type_upload"]) && $_POST["type_upload"] == "import_items_from_csv") {
273
-    rename($filePath, $targetDir . DIRECTORY_SEPARATOR . $_POST["csvFile"]);
273
+    rename($filePath, $targetDir.DIRECTORY_SEPARATOR.$_POST["csvFile"]);
274 274
 } else if (isset($_POST["type_upload"]) && $_POST["type_upload"] == "import_items_from_keypass") {
275
-    rename($filePath, $targetDir . DIRECTORY_SEPARATOR . $_POST["xmlFile"]);
275
+    rename($filePath, $targetDir.DIRECTORY_SEPARATOR.$_POST["xmlFile"]);
276 276
 } else if (isset($_POST["type_upload"]) && $_POST["type_upload"] == "upload_profile_photo") {
277 277
     // sanitize the new file name
278 278
     $newFileName = preg_replace('/[^\w\._]+/', '_', $_POST['newFileName']);
@@ -282,13 +282,13 @@  discard block
 block discarded – undo
282 282
     $ext = pathinfo($filePath, PATHINFO_EXTENSION);
283 283
 
284 284
     // rename the file
285
-    rename($filePath, $targetDir . DIRECTORY_SEPARATOR . $newFileName . '.' . $ext);
285
+    rename($filePath, $targetDir.DIRECTORY_SEPARATOR.$newFileName.'.'.$ext);
286 286
 
287 287
     // make thumbnail
288 288
     require_once $_SESSION['settings']['cpassman_dir'].'/sources/main.functions.php';
289 289
     make_thumb(
290
-        $targetDir . DIRECTORY_SEPARATOR . $newFileName . '.' . $ext,
291
-        $targetDir . DIRECTORY_SEPARATOR . $newFileName ."_thumb" . '.' . $ext,
290
+        $targetDir.DIRECTORY_SEPARATOR.$newFileName.'.'.$ext,
291
+        $targetDir.DIRECTORY_SEPARATOR.$newFileName."_thumb".'.'.$ext,
292 292
         40
293 293
     );
294 294
 
@@ -307,13 +307,13 @@  discard block
 block discarded – undo
307 307
 
308 308
     // get current avatar and delete it
309 309
     $data = DB::queryFirstRow("SELECT avatar, avatar_thumb FROM ".$pre."users WHERE id=%i", $_SESSION['user_id']);
310
-    @unlink($targetDir . DIRECTORY_SEPARATOR .$data['avatar']);
311
-    @unlink($targetDir . DIRECTORY_SEPARATOR .$data['avatar_thumb']);
310
+    @unlink($targetDir.DIRECTORY_SEPARATOR.$data['avatar']);
311
+    @unlink($targetDir.DIRECTORY_SEPARATOR.$data['avatar_thumb']);
312 312
 
313 313
     // store in DB the new avatar
314 314
     DB::query(
315 315
         "UPDATE ".$pre."users
316
-        SET avatar='".$newFileName . '.' . $ext."', avatar_thumb='".$newFileName ."_thumb" . '.' . $ext."'
316
+        SET avatar='".$newFileName.'.'.$ext."', avatar_thumb='".$newFileName."_thumb".'.'.$ext."'
317 317
         WHERE id=%i",
318 318
         $_SESSION['user_id']
319 319
     );
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
     exit();
327 327
 
328 328
 } else {
329
-    rename($filePath, $targetDir . DIRECTORY_SEPARATOR . $_POST["File"]);
329
+    rename($filePath, $targetDir.DIRECTORY_SEPARATOR.$_POST["File"]);
330 330
 }
331 331
 
332 332
 // Return JSON-RPC response
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
         return $f;
340 340
     }
341 341
 
342
-    return substr($f, strrpos($f, '.')+1);
342
+    return substr($f, strrpos($f, '.') + 1);
343 343
 }
344 344
 
345 345
 /* Handles the error output. */
Please login to merge, or discard this patch.
sources/items.logs.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
                         'date' => time(),
60 60
                         'id_user' => $_SESSION['user_id'],
61 61
                         'action' => 'at_password_shown'
62
-                   )
62
+                    )
63 63
                 );
64 64
 
65 65
                 // SysLog
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
                         'date' => time(),
83 83
                         'id_user' => $_SESSION['user_id'],
84 84
                         'action' => 'at_password_copied'
85
-                   )
85
+                    )
86 86
                 );
87 87
 
88 88
                 // SysLog
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 
65 65
                 // SysLog
66 66
                 if (isset($_SESSION['settings']['syslog_enable']) && $_SESSION['settings']['syslog_enable'] == 1) {
67
-                    send_syslog("The password of Item #".$_POST['id_item']." was shown to ".$_SESSION['login'].".","teampass","php",$_SESSION['settings']['syslog_host'],$_SESSION['settings']['syslog_port']);
67
+                    send_syslog("The password of Item #".$_POST['id_item']." was shown to ".$_SESSION['login'].".", "teampass", "php", $_SESSION['settings']['syslog_host'], $_SESSION['settings']['syslog_port']);
68 68
                 }
69 69
             }
70 70
 
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 
88 88
                 // SysLog
89 89
                 if (isset($_SESSION['settings']['syslog_enable']) && $_SESSION['settings']['syslog_enable'] == 1) {
90
-                    send_syslog("The password of Item #".$_POST['id_item']." was copied to clipboard by ".$_SESSION['login'].".","teampass","php",$_SESSION['settings']['syslog_host'],$_SESSION['settings']['syslog_port']);
90
+                    send_syslog("The password of Item #".$_POST['id_item']." was copied to clipboard by ".$_SESSION['login'].".", "teampass", "php", $_SESSION['settings']['syslog_host'], $_SESSION['settings']['syslog_port']);
91 91
                 }
92 92
             }
93 93
 
Please login to merge, or discard this patch.
sources/utils.queries.php 3 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
                         array(
253 253
                             'pw' => $encrypt['string'],
254 254
                             'pw_iv' => ""
255
-                           ),
255
+                            ),
256 256
                         "id = %i", $data['id']
257 257
                     );
258 258
                 }
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
                         'pw' => $encrypt['string'],
306 306
                         'pw_iv' => "",
307 307
                         "encryption_type" => "defuse"
308
-                       ),
308
+                        ),
309 309
                     "id = %i", $data['id']
310 310
                 );
311 311
             } elseif ($data['encryption_type'] === "not_set") {
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
                         'pw' => $encrypt['string'],
334 334
                         'pw_iv' => "",
335 335
                         "encryption_type" => "defuse"
336
-                       ),
336
+                        ),
337 337
                     "id = %i", $data['id']
338 338
                 );
339 339
             } else {
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
             prefix_table('users'),
348 348
             array(
349 349
                 'upgrade_needed' => 0
350
-               ),
350
+                ),
351 351
             "id = %i",
352 352
             $_SESSION['user_id']
353 353
         );
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
         } else {
407 407
             $ssh = new phpseclib\Net\SSH2($parse['host'], $parse['port']);
408 408
             if (!$ssh->login($dataReceived['ssh_root'], $dataReceived['ssh_pwd'])) {
409
-               echo prepareExchangedData(
409
+                echo prepareExchangedData(
410 410
                     array(
411 411
                         "error" => "Login failed.",
412 412
                         "text" => ""
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
                 array(
435 435
                     'pw' => $encrypt['string'],
436 436
                     'pw_iv' => $encrypt['iv']
437
-                   ),
437
+                    ),
438 438
                 "id = %i",
439 439
                 $dataReceived['currentId']
440 440
             );
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
             array(
468 468
                 'auto_update_pwd_frequency' => $_POST['freq'],
469 469
                 'auto_update_pwd_next_date' => time() + (2592000 * intval($_POST['freq']))
470
-               ),
470
+                ),
471 471
             "id = %i",
472 472
             $_POST['id']
473 473
         );
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 
54 54
         foreach (explode(';', $_POST['ids']) as $id) {
55 55
             if (!in_array($id, $_SESSION['forbiden_pfs']) && in_array($id, $_SESSION['groupes_visibles'])) {
56
-                $rows =DB::query(
56
+                $rows = DB::query(
57 57
                     "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.pw_iv as pw_iv
58 58
                     l.date as date,
59 59
                     n.renewal_period as renewal_period
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
                     $pw = decrypt($data['pw'], $oldPersonalSaltkey);
220 220
                     if (empty($pw)) {
221 221
                         // used protocol is #1
222
-                        $pw = decryptOld($data['pw'], $oldPersonalSaltkey);  // decrypt using protocol #1
222
+                        $pw = decryptOld($data['pw'], $oldPersonalSaltkey); // decrypt using protocol #1
223 223
                     } else {
224 224
                         // used protocol is #2
225 225
                         // get key for this pw
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
                 );
275 275
                 if (empty($pw)) {
276 276
                     // used protocol is #1
277
-                    $pw = decryptOld($data['pw'], $_SESSION['user_settings']['clear_psk']);  // decrypt using protocol #1
277
+                    $pw = decryptOld($data['pw'], $_SESSION['user_settings']['clear_psk']); // decrypt using protocol #1
278 278
                 } else {
279 279
                     // used protocol is #2
280 280
                     // get key for this pw
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
         $ret = "";
394 394
         require($_SESSION['settings']['cpassman_dir'].'/includes/libraries/Authentication/phpseclib/Net/SSH2.php');
395 395
         $parse = parse_url($dataItem['url']);
396
-        if (!isset($parse['host']) || empty($parse['host']) ||!isset($parse['port']) || empty($parse['port'])) {
396
+        if (!isset($parse['host']) || empty($parse['host']) || !isset($parse['port']) || empty($parse['port'])) {
397 397
             // error in parsing the url
398 398
             echo prepareExchangedData(
399 399
                 array(
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
                     "encode"
415 415
                 );
416 416
                 break;
417
-            }else{
417
+            } else {
418 418
                 // send ssh script for user change
419 419
                 $ret .= "<br />".$LANG['ssh_answer_from_server'].':&nbsp;<div style="margin-left:20px;font-style: italic;">';
420 420
                 $ret_server = $ssh->exec('echo -e "'.$dataReceived['ssh_pwd'].'\n'.$dataReceived['new_pwd'].'\n'.$dataReceived['new_pwd'].'" | passwd '.$dataItem['login']);
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
         // finished
449 449
         echo prepareExchangedData(
450 450
             array(
451
-                "error" => "" ,
451
+                "error" => "",
452 452
                 "text" => str_replace(array("\n"), array("<br />"), $ret)
453 453
             ),
454 454
             "encode"
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -414,7 +414,7 @@
 block discarded – undo
414 414
                     "encode"
415 415
                 );
416 416
                 break;
417
-            }else{
417
+            } else{
418 418
                 // send ssh script for user change
419 419
                 $ret .= "<br />".$LANG['ssh_answer_from_server'].':&nbsp;<div style="margin-left:20px;font-style: italic;">';
420 420
                 $ret_server = $ssh->exec('echo -e "'.$dataReceived['ssh_pwd'].'\n'.$dataReceived['new_pwd'].'\n'.$dataReceived['new_pwd'].'" | passwd '.$dataItem['login']);
Please login to merge, or discard this patch.
sources/find.queries.php 2 patches
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 
56 56
 //init SQL variables
57 57
 $sOrder = $sLimit = "";
58
-$sWhere = "id_tree IN %ls_idtree";    //limit search to the visible folders
58
+$sWhere = "id_tree IN %ls_idtree"; //limit search to the visible folders
59 59
 
60 60
 //Get current user "personal folder" ID
61 61
 $row = DB::query(
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 //Paging
94 94
 $sLimit = "";
95 95
 if (isset($_GET['iDisplayStart']) && $_GET['iDisplayLength'] != '-1') {
96
-    $sLimit = "LIMIT ". filter_var($_GET['iDisplayStart'], FILTER_SANITIZE_NUMBER_INT) .", ". filter_var($_GET['iDisplayLength'], FILTER_SANITIZE_NUMBER_INT)."";
96
+    $sLimit = "LIMIT ".filter_var($_GET['iDisplayStart'], FILTER_SANITIZE_NUMBER_INT).", ".filter_var($_GET['iDisplayLength'], FILTER_SANITIZE_NUMBER_INT)."";
97 97
 }
98 98
 
99 99
 //Ordering
@@ -106,13 +106,13 @@  discard block
 block discarded – undo
106 106
     }
107 107
     else {
108 108
         $sOrder = "ORDER BY  ";
109
-        for ($i=0; $i<intval($_GET['iSortingCols']); $i++) {
109
+        for ($i = 0; $i < intval($_GET['iSortingCols']); $i++) {
110 110
             if (
111
-                $_GET[ 'bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" &&
111
+                $_GET['bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" &&
112 112
                 preg_match("#^(asc|desc)\$#i", $_GET['sSortDir_'.$i])
113 113
             ) {
114
-                $sOrder .= "".$aColumns[ filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT) ]." "
115
-                .mysqli_escape_string($link, $_GET['sSortDir_'.$i]) .", ";
114
+                $sOrder .= "".$aColumns[filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)]." "
115
+                .mysqli_escape_string($link, $_GET['sSortDir_'.$i]).", ";
116 116
             }
117 117
         }
118 118
 
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
  */
132 132
 if (isset($_GET['sSearch']) && $_GET['sSearch'] != "") {
133 133
     $sWhere .= " AND (";
134
-    for ($i=0; $i<count($aColumns); $i++) {
134
+    for ($i = 0; $i < count($aColumns); $i++) {
135 135
         $sWhere .= $aColumns[$i]." LIKE %ss_".$i." OR ";
136 136
     }
137 137
     $sWhere = substr_replace($sWhere, "", -3).") ";
@@ -208,9 +208,9 @@  discard block
 block discarded – undo
208 208
  */
209 209
 if (!isset($_GET['type'])) {
210 210
     $sOutput = '{';
211
-    if (isset($_GET['sEcho'])) $sOutput .= '"sEcho": ' . intval($_GET['sEcho']) . ', ';
212
-    $sOutput .= '"iTotalRecords": ' . $iFilteredTotal . ', ';
213
-    $sOutput .= '"iTotalDisplayRecords": ' . $iTotal . ', ';
211
+    if (isset($_GET['sEcho'])) $sOutput .= '"sEcho": '.intval($_GET['sEcho']).', ';
212
+    $sOutput .= '"iTotalRecords": '.$iFilteredTotal.', ';
213
+    $sOutput .= '"iTotalDisplayRecords": '.$iTotal.', ';
214 214
     $sOutput .= '"aaData": [ ';
215 215
     $sOutputConst = "";
216 216
 
@@ -242,14 +242,14 @@  discard block
 block discarded – undo
242 242
         }
243 243
 
244 244
         //col1
245
-        $sOutputItem .= '"<i class=\"fa fa-external-link tip\" title=\"'.$LANG['open_url_link'].'\" onClick=\"javascript:window.location.href = &#039;index.php?page=items&amp;group=' . $record['id_tree'] . '&amp;id=' . $record['id'] . '&#039;;\" style=\"cursor:pointer;\"></i>&nbsp;'.
246
-            '<i class=\"fa fa-eye tip\" title=\"'.$LANG['see_item_title'].'\" onClick=\"javascript:see_item(' . $record['id'] . ',' . $record['perso'] . ');\" style=\"cursor:pointer;\"></i>'.$checkbox.'", ';
245
+        $sOutputItem .= '"<i class=\"fa fa-external-link tip\" title=\"'.$LANG['open_url_link'].'\" onClick=\"javascript:window.location.href = &#039;index.php?page=items&amp;group='.$record['id_tree'].'&amp;id='.$record['id'].'&#039;;\" style=\"cursor:pointer;\"></i>&nbsp;'.
246
+            '<i class=\"fa fa-eye tip\" title=\"'.$LANG['see_item_title'].'\" onClick=\"javascript:see_item('.$record['id'].','.$record['perso'].');\" style=\"cursor:pointer;\"></i>'.$checkbox.'", ';
247 247
 
248 248
         //col2
249
-        $sOutputItem .= '"<span id=\"item_label-'.$record['id'].'\">' . htmlspecialchars(stripslashes($record['label']), ENT_QUOTES) . '</span>", ';
249
+        $sOutputItem .= '"<span id=\"item_label-'.$record['id'].'\">'.htmlspecialchars(stripslashes($record['label']), ENT_QUOTES).'</span>", ';
250 250
 
251 251
         //col3
252
-        $sOutputItem .= '"' . str_replace("&amp;", "&", htmlspecialchars(stripslashes($record['login']), ENT_QUOTES)) . '", ';
252
+        $sOutputItem .= '"'.str_replace("&amp;", "&", htmlspecialchars(stripslashes($record['login']), ENT_QUOTES)).'", ';
253 253
 
254 254
         //col4
255 255
         //get restriction from ROles
@@ -281,23 +281,23 @@  discard block
 block discarded – undo
281 281
         } else {
282 282
             $txt = str_replace(array('\n', '<br />', '\\'), array(' ', ' ', '', ' '), strip_tags($record['description']));
283 283
             if (strlen($txt) > 50) {
284
-                $sOutputItem .= '"' . substr(stripslashes(preg_replace('~/<[\/]{0,1}[^>]*>\//|[ \t]/~', '', $txt)), 0, 50) . '", ';
284
+                $sOutputItem .= '"'.substr(stripslashes(preg_replace('~/<[\/]{0,1}[^>]*>\//|[ \t]/~', '', $txt)), 0, 50).'", ';
285 285
             } else {
286
-                $sOutputItem .= '"' . stripslashes(preg_replace('~/<[^>]*>|[ \t]/~', '', $txt)) . '", ';
286
+                $sOutputItem .= '"'.stripslashes(preg_replace('~/<[^>]*>|[ \t]/~', '', $txt)).'", ';
287 287
             }
288 288
         }
289 289
 
290 290
         //col5 - TAGS
291
-        $sOutputItem .= '"' . htmlspecialchars(stripslashes($record['tags']), ENT_QUOTES) . '", ';
291
+        $sOutputItem .= '"'.htmlspecialchars(stripslashes($record['tags']), ENT_QUOTES).'", ';
292 292
 
293 293
         // col6 - URL
294 294
         if ($record['url'] != "0")
295
-            $sOutputItem .= '"' . htmlspecialchars(stripslashes($record['url']), ENT_QUOTES) . '", ';
295
+            $sOutputItem .= '"'.htmlspecialchars(stripslashes($record['url']), ENT_QUOTES).'", ';
296 296
         else
297 297
             $sOutputItem .= '"", ';
298 298
 
299 299
         //col7 - Prepare the Treegrid
300
-        $sOutputItem .= '"' . htmlspecialchars(stripslashes($record['folder']), ENT_QUOTES) . '"';
300
+        $sOutputItem .= '"'.htmlspecialchars(stripslashes($record['folder']), ENT_QUOTES).'"';
301 301
 
302 302
         //Finish the line
303 303
         $sOutputItem .= '], ';
Please login to merge, or discard this patch.
Braces   +19 added lines, -12 removed lines patch added patch discarded remove patch
@@ -103,8 +103,7 @@  discard block
 block discarded – undo
103 103
         // possible attack - stop
104 104
         echo '[{}]';
105 105
         exit;
106
-    }
107
-    else {
106
+    } else {
108 107
         $sOrder = "ORDER BY  ";
109 108
         for ($i=0; $i<intval($_GET['iSortingCols']); $i++) {
110 109
             if (
@@ -208,7 +207,9 @@  discard block
 block discarded – undo
208 207
  */
209 208
 if (!isset($_GET['type'])) {
210 209
     $sOutput = '{';
211
-    if (isset($_GET['sEcho'])) $sOutput .= '"sEcho": ' . intval($_GET['sEcho']) . ', ';
210
+    if (isset($_GET['sEcho'])) {
211
+        $sOutput .= '"sEcho": ' . intval($_GET['sEcho']) . ', ';
212
+    }
212 213
     $sOutput .= '"iTotalRecords": ' . $iFilteredTotal . ', ';
213 214
     $sOutput .= '"iTotalDisplayRecords": ' . $iTotal . ', ';
214 215
     $sOutput .= '"aaData": [ ';
@@ -232,13 +233,18 @@  discard block
 block discarded – undo
232 233
                     $role,
233 234
                     $record['id_tree']
234 235
                 );
235
-                if ($access['type'] == "R") array_push($arrTmp, 1);
236
-                else if ($access['type'] == "W") array_push($arrTmp, 0);
237
-                else array_push($arrTmp, 2);
236
+                if ($access['type'] == "R") {
237
+                    array_push($arrTmp, 1);
238
+                } else if ($access['type'] == "W") {
239
+                    array_push($arrTmp, 0);
240
+                } else {
241
+                    array_push($arrTmp, 2);
242
+                }
238 243
             }
239 244
             $accessLevel = min($arrTmp);
240
-            if ($accessLevel === 0)
241
-                $checkbox = '&nbsp;<input type=\"checkbox\" value=\"0\" class=\"mass_op_cb\" id=\"mass_op_cb-'.$record['id'].'\">';
245
+            if ($accessLevel === 0) {
246
+                            $checkbox = '&nbsp;<input type=\"checkbox\" value=\"0\" class=\"mass_op_cb\" id=\"mass_op_cb-'.$record['id'].'\">';
247
+            }
242 248
         }
243 249
 
244 250
         //col1
@@ -291,10 +297,11 @@  discard block
 block discarded – undo
291 297
         $sOutputItem .= '"' . htmlspecialchars(stripslashes($record['tags']), ENT_QUOTES) . '", ';
292 298
 
293 299
         // col6 - URL
294
-        if ($record['url'] != "0")
295
-            $sOutputItem .= '"' . htmlspecialchars(stripslashes($record['url']), ENT_QUOTES) . '", ';
296
-        else
297
-            $sOutputItem .= '"", ';
300
+        if ($record['url'] != "0") {
301
+                    $sOutputItem .= '"' . htmlspecialchars(stripslashes($record['url']), ENT_QUOTES) . '", ';
302
+        } else {
303
+                    $sOutputItem .= '"", ';
304
+        }
298 305
 
299 306
         //col7 - Prepare the Treegrid
300 307
         $sOutputItem .= '"' . htmlspecialchars(stripslashes($record['folder']), ENT_QUOTES) . '"';
Please login to merge, or discard this patch.
sources/export.queries.php 3 patches
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -131,13 +131,13 @@  discard block
 block discarded – undo
131 131
                             WHERE a.item_id = %i",
132 132
                             $record['id']
133 133
                         );
134
-                         foreach ($rows_kb as $rec_kb) {
134
+                            foreach ($rows_kb as $rec_kb) {
135 135
                             if (empty($arr_kbs)) {
136 136
                                 $arr_kbs = $rec_kb['label'];
137 137
                             } else {
138 138
                                 $arr_kbs .= " | ".$rec_kb['label'];
139 139
                             }
140
-                         }
140
+                            }
141 141
 
142 142
                         // get TAGS
143 143
                         $arr_tags = "";
@@ -147,13 +147,13 @@  discard block
 block discarded – undo
147 147
                             WHERE item_id = %i",
148 148
                             $record['id']
149 149
                         );
150
-                         foreach ($rows_tag as $rec_tag) {
150
+                            foreach ($rows_tag as $rec_tag) {
151 151
                             if (empty($arr_tags)) {
152 152
                                 $arr_tags = $rec_tag['tag'];
153 153
                             } else {
154 154
                                 $arr_tags .= " ".$rec_tag['tag'];
155 155
                             }
156
-                         }
156
+                            }
157 157
 
158 158
                         // store
159 159
                         DB::insert(
@@ -369,9 +369,9 @@  discard block
 block discarded – undo
369 369
                                 WHERE a.item_id = %i",
370 370
                                 $record['id']
371 371
                             );
372
-                             foreach ($rows_kb as $rec_kb) {
372
+                                foreach ($rows_kb as $rec_kb) {
373 373
                                 array_push($arr_kbs, $rec_kb['label']);
374
-                             }
374
+                                }
375 375
 
376 376
                             // get TAGS
377 377
                             $arr_tags = [];
@@ -381,9 +381,9 @@  discard block
 block discarded – undo
381 381
                                 WHERE item_id = %i",
382 382
                                 $record['id']
383 383
                             );
384
-                             foreach ($rows_tag as $rec_tag) {
384
+                                foreach ($rows_tag as $rec_tag) {
385 385
                                 array_push($arr_tags, $rec_tag['tag']);
386
-                             }
386
+                                }
387 387
 
388 388
                             $full_listing[$i] = array(
389 389
                                 'id' => $record['id'],
@@ -487,13 +487,13 @@  discard block
 block discarded – undo
487 487
             }
488 488
         }
489 489
 
490
-          // prepare export file
491
-          //save the file
492
-          $html_file = '/teampass_export_'.time().'_'.generateKey().'.html';
493
-          //print_r($full_listing);
494
-          $outstream = fopen($_SESSION['settings']['path_to_files_folder'].$html_file, "w");
495
-          fwrite(
496
-              $outstream,
490
+            // prepare export file
491
+            //save the file
492
+            $html_file = '/teampass_export_'.time().'_'.generateKey().'.html';
493
+            //print_r($full_listing);
494
+            $outstream = fopen($_SESSION['settings']['path_to_files_folder'].$html_file, "w");
495
+            fwrite(
496
+                $outstream,
497 497
 '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
498 498
 <head>
499 499
 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
         <th style="width:5%;">'.$LANG['user_login'].'</th>
531 531
         <th style="width:20%;">'.$LANG['url'].'</th>
532 532
     </tr></thead>'
533
-          );
533
+            );
534 534
 
535 535
         fclose($outstream);
536 536
 
Please login to merge, or discard this patch.
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -160,13 +160,13 @@  discard block
 block discarded – undo
160 160
                             prefix_table("export"),
161 161
                             array(
162 162
                                 'id' => $record['id'],
163
-                                'description' => strip_tags(cleanString(html_entity_decode($record['description'], ENT_QUOTES | ENT_XHTML, UTF-8), true)),
164
-                                'label' => cleanString(html_entity_decode($record['label'], ENT_QUOTES | ENT_XHTML, UTF-8), true),
165
-                                'pw' => html_entity_decode($pw['string'], ENT_QUOTES | ENT_XHTML, UTF-8),
166
-                                'login' => strip_tags(cleanString(html_entity_decode($record['login'], ENT_QUOTES | ENT_XHTML, UTF-8), true)),
163
+                                'description' => strip_tags(cleanString(html_entity_decode($record['description'], ENT_QUOTES | ENT_XHTML, UTF - 8), true)),
164
+                                'label' => cleanString(html_entity_decode($record['label'], ENT_QUOTES | ENT_XHTML, UTF - 8), true),
165
+                                'pw' => html_entity_decode($pw['string'], ENT_QUOTES | ENT_XHTML, UTF - 8),
166
+                                'login' => strip_tags(cleanString(html_entity_decode($record['login'], ENT_QUOTES | ENT_XHTML, UTF - 8), true)),
167 167
                                 'path' => $path,
168
-                                'url' => strip_tags(cleanString(html_entity_decode($record['url'], ENT_QUOTES | ENT_XHTML, UTF-8), true)),
169
-                                'email' => strip_tags(cleanString(html_entity_decode($record['email'], ENT_QUOTES | ENT_XHTML, UTF-8), true)),
168
+                                'url' => strip_tags(cleanString(html_entity_decode($record['url'], ENT_QUOTES | ENT_XHTML, UTF - 8), true)),
169
+                                'email' => strip_tags(cleanString(html_entity_decode($record['email'], ENT_QUOTES | ENT_XHTML, UTF - 8), true)),
170 170
                                 'kbs' => $arr_kbs,
171 171
                                 'tags' => $arr_tags
172 172
                             )
@@ -257,23 +257,23 @@  discard block
 block discarded – undo
257 257
                 $nb = max($nb, nbLines($table_col_width[6], $record['kbs']));
258 258
                 $nb = max($nb, nbLines($table_col_width[7], $record['tags']));
259 259
 
260
-                $h=5*$nb;
260
+                $h = 5 * $nb;
261 261
                 //Page break needed?
262 262
                 checkPageBreak($h);
263 263
                 //Draw cells
264 264
                 $pdf->SetFont('helvetica', '', 8);
265
-                for ($i=0; $i<count($table); $i++) {
266
-                    $w=$table_col_width[$i];
267
-                    $a='L';
265
+                for ($i = 0; $i < count($table); $i++) {
266
+                    $w = $table_col_width[$i];
267
+                    $a = 'L';
268 268
                     //actual position
269
-                    $x=$pdf->GetX();
270
-                    $y=$pdf->GetY();
269
+                    $x = $pdf->GetX();
270
+                    $y = $pdf->GetY();
271 271
                     //Draw
272 272
                     $pdf->Rect($x, $y, $w, $h);
273 273
                     //Write
274 274
                     $pdf->MultiCell($w, 5, ($record[$table[$i]]), 0, $a);
275 275
                     //go to right
276
-                    $pdf->SetXY($x+$w, $y);
276
+                    $pdf->SetXY($x + $w, $y);
277 277
                 }
278 278
                 //return to line
279 279
                 $pdf->Ln($h);
@@ -387,10 +387,10 @@  discard block
 block discarded – undo
387 387
 
388 388
                             $full_listing[$i] = array(
389 389
                                 'id' => $record['id'],
390
-                                'label' => strip_tags(cleanString(html_entity_decode($record['label'], ENT_QUOTES | ENT_XHTML, UTF-8), true)),
390
+                                'label' => strip_tags(cleanString(html_entity_decode($record['label'], ENT_QUOTES | ENT_XHTML, UTF - 8), true)),
391 391
                                 'description' => htmlspecialchars_decode(addslashes(str_replace(array(";", "<br />"), array("|", "\n\r"), mysqli_escape_string($link, stripslashes(utf8_decode($record['description'])))))),
392
-                                'pw' => html_entity_decode($pw['string'], ENT_QUOTES | ENT_XHTML, UTF-8),
393
-                                'login' => strip_tags(cleanString(html_entity_decode($record['login'], ENT_QUOTES | ENT_XHTML, UTF-8), true)),
392
+                                'pw' => html_entity_decode($pw['string'], ENT_QUOTES | ENT_XHTML, UTF - 8),
393
+                                'login' => strip_tags(cleanString(html_entity_decode($record['login'], ENT_QUOTES | ENT_XHTML, UTF - 8), true)),
394 394
                                 'restricted_to' => $record['restricted_to'],
395 395
                                 'perso' => $record['perso'] === "0" ? "False" : "True",
396 396
                                 'url' => $record['url'] !== "none" ? htmlspecialchars_decode($record['url']) : "",
@@ -588,7 +588,7 @@  discard block
 block discarded – undo
588 588
                         "decrypt"
589 589
                     );
590 590
                 }
591
-                array_push($full_listing,array(
591
+                array_push($full_listing, array(
592 592
                     'id_tree' => $record['id_tree'],
593 593
                     'id' => $record['id'],
594 594
                     'label' => $record['label'],
@@ -599,7 +599,7 @@  discard block
 block discarded – undo
599 599
                     'perso' => $record['perso']
600 600
                 ));
601 601
                 $i++;
602
-                array_push($items_id_list,$record['id']);
602
+                array_push($items_id_list, $record['id']);
603 603
             }
604 604
             $id_managed = $record['id'];
605 605
         }
@@ -728,7 +728,7 @@  discard block
 block discarded – undo
728 728
 {
729 729
     global $pdf;
730 730
     //Continue on a new page if needed
731
-    if ($pdf->GetY()+$h>$pdf->PageBreakTrigger) {
731
+    if ($pdf->GetY() + $h > $pdf->PageBreakTrigger) {
732 732
         $pdf->addPage($pdf->CurOrientation);
733 733
     }
734 734
 }
@@ -737,47 +737,47 @@  discard block
 block discarded – undo
737 737
 {
738 738
     global $pdf;
739 739
     //Calculate the number of lines needed by a Multicell with a width of w
740
-    $cw=&$pdf->CurrentFont['cw'];
741
-    if ($w==0) {
742
-        $w=$pdf->w-$this->rMargin-$pdf->x;
740
+    $cw = &$pdf->CurrentFont['cw'];
741
+    if ($w == 0) {
742
+        $w = $pdf->w - $this->rMargin - $pdf->x;
743 743
     }
744
-    $wmax=($w-2*$pdf->cMargin)*1000/$pdf->FontSize;
745
-    $s=str_replace("\r", '', $txt);
746
-    $nb=strlen($s);
747
-    if ($nb>0 and $s[$nb-1]=="\n") {
744
+    $wmax = ($w - 2 * $pdf->cMargin) * 1000 / $pdf->FontSize;
745
+    $s = str_replace("\r", '', $txt);
746
+    $nb = strlen($s);
747
+    if ($nb > 0 and $s[$nb - 1] == "\n") {
748 748
         $nb--;
749 749
     }
750
-    $sep=-1;
751
-    $i=0;
752
-    $j=0;
753
-    $l=0;
754
-    $nl=1;
755
-    while ($i<$nb) {
756
-        $c=$s[$i];
757
-        if ($c=="\n") {
750
+    $sep = -1;
751
+    $i = 0;
752
+    $j = 0;
753
+    $l = 0;
754
+    $nl = 1;
755
+    while ($i < $nb) {
756
+        $c = $s[$i];
757
+        if ($c == "\n") {
758 758
             $i++;
759
-            $sep=-1;
760
-            $j=$i;
761
-            $l=0;
759
+            $sep = -1;
760
+            $j = $i;
761
+            $l = 0;
762 762
             $nl++;
763 763
             continue;
764 764
         }
765
-        if ($c==' ') {
766
-            $sep=$i;
765
+        if ($c == ' ') {
766
+            $sep = $i;
767 767
         }
768
-        $l+=550;//$cw[$c];
768
+        $l += 550; //$cw[$c];
769 769
         //echo $cw[$c].";".$wmax.";".$l."|";
770
-        if ($l>$wmax) {
771
-            if ($sep==-1) {
772
-                if ($i==$j) {
770
+        if ($l > $wmax) {
771
+            if ($sep == -1) {
772
+                if ($i == $j) {
773 773
                     $i++;
774 774
                 }
775 775
             } else {
776
-                $i=$sep+1;
776
+                $i = $sep + 1;
777 777
             }
778
-            $sep=-1;
779
-            $j=$i;
780
-            $l=0;
778
+            $sep = -1;
779
+            $j = $i;
780
+            $l = 0;
781 781
             $nl++;
782 782
         } else {
783 783
             $i++;
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -246,7 +246,9 @@
 block discarded – undo
246 246
                     $pdf->cell($table_col_width[7], 6, $LANG['tags'], 1, 1, "C", 1);
247 247
                 }
248 248
                 $prev_path = $record['path'];
249
-                if (!isutf8($record['pw'])) $record['pw'] = "";
249
+                if (!isutf8($record['pw'])) {
250
+                    $record['pw'] = "";
251
+                }
250 252
                 //row height calculation
251 253
                 $nb = 0;
252 254
                 $nb = max($nb, nbLines($table_col_width[0], $record['label']));
Please login to merge, or discard this patch.
sources/views.queries.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
                             'bloquer_modification' => $folderData[7],
202 202
                             'personal_folder' => $folderData[8],
203 203
                             'renewal_period' => $folderData[9]
204
-                       )
204
+                        )
205 205
                     );
206 206
                     //delete log
207 207
                     DB::delete(prefix_table("misc"), "type = %s AND intitule = %s", "folder_deleted", $id);
@@ -327,8 +327,8 @@  discard block
 block discarded – undo
327 327
             ORDER BY %s %s
328 328
 			LIMIT ".mysqli_real_escape_string($link, filter_var($start, FILTER_SANITIZE_NUMBER_INT)) .", ". mysqli_real_escape_string($link, filter_var($nbElements, FILTER_SANITIZE_NUMBER_INT)),
329 329
             "user_connection",
330
-			$_POST['order'],
331
-			$POST['direction']
330
+            $_POST['order'],
331
+            $POST['direction']
332 332
         );
333 333
 
334 334
         foreach ($rows as $record) {
@@ -383,8 +383,8 @@  discard block
 block discarded – undo
383 383
             ORDER BY %s %s
384 384
             LIMIT ".mysqli_real_escape_string($link, filter_var($start, FILTER_SANITIZE_NUMBER_INT)) .", ". mysqli_real_escape_string($link, filter_var($nbElements, FILTER_SANITIZE_NUMBER_INT)),
385 385
             "error",
386
-			$_POST['order'],
387
-			$_POST['direction']
386
+            $_POST['order'],
387
+            $_POST['direction']
388 388
         );
389 389
         foreach ($rows as $record) {
390 390
             $label = explode('@', addslashes(cleanString($record['label'])));
@@ -756,11 +756,11 @@  discard block
 block discarded – undo
756 756
                 );
757 757
                 $counter = DB::count();
758 758
                     // Delete
759
-                 DB::delete(prefix_table("log_items"), "action=%s AND date BETWEEN %i AND %i",
759
+                    DB::delete(prefix_table("log_items"), "action=%s AND date BETWEEN %i AND %i",
760 760
                     "at_shown",
761 761
                     intval(strtotime($_POST['purgeFrom'])),
762 762
                     intval(strtotime($_POST['purgeTo']))
763
-                 );
763
+                    );
764 764
             } elseif ($_POST['logType'] == "connections_logs") {
765 765
                 DB::query(
766 766
                     "SELECT * FROM ".prefix_table("log_system")." WHERE type=%s ".
Please login to merge, or discard this patch.
Spacing   +40 added lines, -41 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
     case "log_generate":
65 65
         //Prepare the PDF file
66 66
         include $_SESSION['settings']['cpassman_dir'].'/includes/libraries/Pdf/Tfpdf/tfpdf.class.php';
67
-        $pdf=new TFPDF();
67
+        $pdf = new TFPDF();
68 68
 
69 69
         //Add font for utf-8
70 70
         $pdf->AddFont('helvetica', '');
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
         foreach ($rows as $record) {
155 155
             if ($record['id'] !== $prev_id) {
156 156
                 if (in_array($record['id_tree'], $arrFolders)) {
157
-                    if (count($arrFolders[$record['id_tree']])>0) {
157
+                    if (count($arrFolders[$record['id_tree']]) > 0) {
158 158
                         $thisFolder = '<td>'.$arrFolders[$record['id_tree']].'</td>';
159 159
                     } else {
160 160
                         $thisFolder = "";
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
      */
177 177
     case "restore_deleted__items":
178 178
         //restore FOLDERS
179
-        if (count($_POST['list_f'])>0) {
179
+        if (count($_POST['list_f']) > 0) {
180 180
             foreach (explode(';', $_POST['list_f']) as $id) {
181 181
                 $data = DB::queryfirstrow(
182 182
                     "SELECT valeur
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
             }
210 210
         }
211 211
         //restore ITEMS
212
-        if (count($_POST['list_i'])>0) {
212
+        if (count($_POST['list_i']) > 0) {
213 213
             foreach (explode(';', $_POST['list_i']) as $id) {
214 214
                 DB::update(
215 215
                     prefix_table("items"),
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
      */
242 242
     case "really_delete_items":
243 243
         $folders = explode(';', $_POST['folders']);
244
-        if (count($folders)>0) {
244
+        if (count($folders) > 0) {
245 245
             //delete folders
246 246
             foreach ($folders as $fId) {
247 247
                 //get folder ID
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
                         DB::delete(prefix_table("cache"), "id = %i", $item['id']);
268 268
                     }
269 269
                     //Actualize the variable
270
-                    $_SESSION['nb_folders'] --;
270
+                    $_SESSION['nb_folders']--;
271 271
                 }
272 272
                 //delete folder
273 273
                 DB::delete(prefix_table("misc"), "intitule = %s AND type = %s", $fId, "folder_deleted");
@@ -301,19 +301,18 @@  discard block
 block discarded – undo
301 301
             "user_connection"
302 302
         );
303 303
         if (DB::count() != 0) {
304
-            $nbPages = ceil($data[0]/$nbElements);
305
-            for ($i=1; $i<=$nbPages; $i++) {
304
+            $nbPages = ceil($data[0] / $nbElements);
305
+            for ($i = 1; $i <= $nbPages; $i++) {
306 306
                 $pages .= '<td onclick=\'displayLogs(\"connections_logs\", '.
307 307
                 $i.', \"'.$_POST['order'].'\")\'><span style=\'cursor:pointer;'.
308
-                ($_POST['page'] == $i ? 'font-weight:bold;font-size:18px;\'>'.$i:
309
-                '\'>'.$i).'</span></td>';
308
+                ($_POST['page'] == $i ? 'font-weight:bold;font-size:18px;\'>'.$i : '\'>'.$i).'</span></td>';
310 309
             }
311 310
         }
312 311
         $pages .= '</tr></table>';
313 312
 
314 313
         //define query limits
315 314
         if (isset($_POST['page']) && $_POST['page'] > 1) {
316
-            $start = ($nbElements*($_POST['page']-1)) + 1;
315
+            $start = ($nbElements * ($_POST['page'] - 1)) + 1;
317 316
         } else {
318 317
             $start = 0;
319 318
         }
@@ -325,7 +324,7 @@  discard block
 block discarded – undo
325 324
             INNER JOIN ".prefix_table("users")." as u ON (l.qui=u.id)
326 325
             WHERE l.type = %s
327 326
             ORDER BY %s %s
328
-			LIMIT ".mysqli_real_escape_string($link, filter_var($start, FILTER_SANITIZE_NUMBER_INT)) .", ". mysqli_real_escape_string($link, filter_var($nbElements, FILTER_SANITIZE_NUMBER_INT)),
327
+			LIMIT ".mysqli_real_escape_string($link, filter_var($start, FILTER_SANITIZE_NUMBER_INT)).", ".mysqli_real_escape_string($link, filter_var($nbElements, FILTER_SANITIZE_NUMBER_INT)),
329 328
             "user_connection",
330 329
 			$_POST['order'],
331 330
 			$POST['direction']
@@ -358,18 +357,18 @@  discard block
 block discarded – undo
358 357
             "error"
359 358
         );
360 359
         if (DB::count() != 0) {
361
-            $nbPages = ceil($data[0]/$nbElements);
362
-            for ($i=1; $i<=$nbPages; $i++) {
360
+            $nbPages = ceil($data[0] / $nbElements);
361
+            for ($i = 1; $i <= $nbPages; $i++) {
363 362
                 $pages .= '<td onclick=\'displayLogs(\"errors_logs\", '.$i.', \"'.$_POST['order'].
364 363
                 '\")\'><span style=\'cursor:pointer;'.($_POST['page'] == $i ?
365
-                'font-weight:bold;font-size:18px;\'>'.$i:'\'>'.$i).'</span></td>';
364
+                'font-weight:bold;font-size:18px;\'>'.$i : '\'>'.$i).'</span></td>';
366 365
             }
367 366
         }
368 367
         $pages .= '</tr></table>';
369 368
 
370 369
         //define query limits
371 370
         if (isset($_POST['page']) && $_POST['page'] > 1) {
372
-            $start = ($nbElements*($_POST['page']-1)) + 1;
371
+            $start = ($nbElements * ($_POST['page'] - 1)) + 1;
373 372
         } else {
374 373
             $start = 0;
375 374
         }
@@ -381,7 +380,7 @@  discard block
 block discarded – undo
381 380
             INNER JOIN ".prefix_table("users")." as u ON (l.qui=u.id)
382 381
             WHERE l.type = %s
383 382
             ORDER BY %s %s
384
-            LIMIT ".mysqli_real_escape_string($link, filter_var($start, FILTER_SANITIZE_NUMBER_INT)) .", ". mysqli_real_escape_string($link, filter_var($nbElements, FILTER_SANITIZE_NUMBER_INT)),
383
+            LIMIT ".mysqli_real_escape_string($link, filter_var($start, FILTER_SANITIZE_NUMBER_INT)).", ".mysqli_real_escape_string($link, filter_var($nbElements, FILTER_SANITIZE_NUMBER_INT)),
385 384
             "error",
386 385
 			$_POST['order'],
387 386
 			$_POST['direction']
@@ -420,16 +419,16 @@  discard block
 block discarded – undo
420 419
             $where
421 420
         );
422 421
         if ($data[0] != 0) {
423
-            $nbPages = ceil($data[0]/$nbElements);
424
-            for ($i=1; $i<=$nbPages; $i++) {
425
-                $pages .= '<td onclick=\'displayLogs(\"access_logs\", '.$i.', \"'.$_POST['order'].'\")\'><span style=\'cursor:pointer;'.($_POST['page'] == $i ? 'font-weight:bold;font-size:18px;\'>'.$i:'\'>'.$i).'</span></td>';
422
+            $nbPages = ceil($data[0] / $nbElements);
423
+            for ($i = 1; $i <= $nbPages; $i++) {
424
+                $pages .= '<td onclick=\'displayLogs(\"access_logs\", '.$i.', \"'.$_POST['order'].'\")\'><span style=\'cursor:pointer;'.($_POST['page'] == $i ? 'font-weight:bold;font-size:18px;\'>'.$i : '\'>'.$i).'</span></td>';
426 425
             }
427 426
         }
428 427
         $pages .= '</tr></table>';
429 428
 
430 429
         //define query limits
431 430
         if (isset($_POST['page']) && $_POST['page'] > 1) {
432
-            $start = ($nbElements*($_POST['page']-1)) + 1;
431
+            $start = ($nbElements * ($_POST['page'] - 1)) + 1;
433 432
         } else {
434 433
             $start = 0;
435 434
         }
@@ -442,7 +441,7 @@  discard block
 block discarded – undo
442 441
             INNER JOIN ".prefix_table("users")." as u ON (l.id_user=u.id)
443 442
             WHERE %l
444 443
             ORDER BY ".$_POST['order']." ".$_POST['direction']."
445
-            LIMIT ".mysqli_real_escape_string($link, filter_var($start, FILTER_SANITIZE_NUMBER_INT)) .", ". mysqli_real_escape_string($link, filter_var($nbElements, FILTER_SANITIZE_NUMBER_INT)),
444
+            LIMIT ".mysqli_real_escape_string($link, filter_var($start, FILTER_SANITIZE_NUMBER_INT)).", ".mysqli_real_escape_string($link, filter_var($nbElements, FILTER_SANITIZE_NUMBER_INT)),
446 445
             $where
447 446
         );
448 447
         foreach ($rows as $record) {
@@ -479,16 +478,16 @@  discard block
 block discarded – undo
479 478
             $where
480 479
         );
481 480
         if ($data[0] != 0) {
482
-            $nbPages = ceil($data[0]/$nbElements);
483
-            for ($i=1; $i<=$nbPages; $i++) {
484
-                $pages .= '<td onclick=\'displayLogs(\"copy_logs\", '.$i.', \'\')\'><span style=\'cursor:pointer;'.($_POST['page'] == $i ? 'font-weight:bold;font-size:18px;\'>'.$i:'\'>'.$i).'</span></td>';
481
+            $nbPages = ceil($data[0] / $nbElements);
482
+            for ($i = 1; $i <= $nbPages; $i++) {
483
+                $pages .= '<td onclick=\'displayLogs(\"copy_logs\", '.$i.', \'\')\'><span style=\'cursor:pointer;'.($_POST['page'] == $i ? 'font-weight:bold;font-size:18px;\'>'.$i : '\'>'.$i).'</span></td>';
485 484
             }
486 485
         }
487 486
         $pages .= '</tr></table>';
488 487
 
489 488
         //define query limits
490 489
         if (isset($_POST['page']) && $_POST['page'] > 1) {
491
-            $start = ($nbElements*($_POST['page']-1)) + 1;
490
+            $start = ($nbElements * ($_POST['page'] - 1)) + 1;
492 491
         } else {
493 492
             $start = 0;
494 493
         }
@@ -501,7 +500,7 @@  discard block
 block discarded – undo
501 500
             INNER JOIN ".prefix_table("users")." as u ON (l.id_user=u.id)
502 501
             WHERE %l
503 502
             ORDER BY date DESC
504
-            LIMIT ".mysqli_real_escape_string($link, filter_var($start, FILTER_SANITIZE_NUMBER_INT)) .", ". mysqli_real_escape_string($link, filter_var($nbElements, FILTER_SANITIZE_NUMBER_INT)),
503
+            LIMIT ".mysqli_real_escape_string($link, filter_var($start, FILTER_SANITIZE_NUMBER_INT)).", ".mysqli_real_escape_string($link, filter_var($nbElements, FILTER_SANITIZE_NUMBER_INT)),
505 504
             $where
506 505
         );
507 506
         foreach ($rows as $record) {
@@ -539,16 +538,16 @@  discard block
 block discarded – undo
539 538
             $where
540 539
         );
541 540
         if (DB::count() != 0) {
542
-            $nbPages = ceil($data[0]/$nbElements);
543
-            for ($i=1; $i<=$nbPages; $i++) {
544
-                $pages .= '<td onclick=\'displayLogs(\"items_logs\", '.$i.', \"\")\'><span style=\'cursor:pointer;'.($_POST['page'] == $i ? 'font-weight:bold;font-size:18px;\'>'.$i:'\'>'.$i).'</span></td>';
541
+            $nbPages = ceil($data[0] / $nbElements);
542
+            for ($i = 1; $i <= $nbPages; $i++) {
543
+                $pages .= '<td onclick=\'displayLogs(\"items_logs\", '.$i.', \"\")\'><span style=\'cursor:pointer;'.($_POST['page'] == $i ? 'font-weight:bold;font-size:18px;\'>'.$i : '\'>'.$i).'</span></td>';
545 544
             }
546 545
         }
547 546
         $pages .= '</tr></table>';
548 547
 
549 548
         //define query limits
550 549
         if (isset($_POST['page']) && $_POST['page'] > 1) {
551
-            $start = ($nbElements*($_POST['page']-1)) + 1;
550
+            $start = ($nbElements * ($_POST['page'] - 1)) + 1;
552 551
         } else {
553 552
             $start = 0;
554 553
         }
@@ -562,7 +561,7 @@  discard block
 block discarded – undo
562 561
             INNER JOIN ".prefix_table("users")." as u ON (l.id_user=u.id)
563 562
             WHERE %l
564 563
             ORDER BY date DESC
565
-            LIMIT ".mysqli_real_escape_string($link, filter_var($start, FILTER_SANITIZE_NUMBER_INT)) .", ". mysqli_real_escape_string($link, filter_var($nbElements, FILTER_SANITIZE_NUMBER_INT)),
564
+            LIMIT ".mysqli_real_escape_string($link, filter_var($start, FILTER_SANITIZE_NUMBER_INT)).", ".mysqli_real_escape_string($link, filter_var($nbElements, FILTER_SANITIZE_NUMBER_INT)),
566 565
             $where
567 566
         );
568 567
 
@@ -604,16 +603,16 @@  discard block
 block discarded – undo
604 603
             $where
605 604
         );
606 605
         if ($data[0] != 0) {
607
-            $nbPages = ceil($data[0]/$nbElements);
608
-            for ($i=1; $i<=$nbPages; $i++) {
609
-                $pages .= '<td onclick=\'displayLogs(\"copy_logs\", '.$i.', \'\')\'><span style=\'cursor:pointer;'.($_POST['page'] == $i ? 'font-weight:bold;font-size:18px;\'>'.$i:'\'>'.$i).'</span></td>';
606
+            $nbPages = ceil($data[0] / $nbElements);
607
+            for ($i = 1; $i <= $nbPages; $i++) {
608
+                $pages .= '<td onclick=\'displayLogs(\"copy_logs\", '.$i.', \'\')\'><span style=\'cursor:pointer;'.($_POST['page'] == $i ? 'font-weight:bold;font-size:18px;\'>'.$i : '\'>'.$i).'</span></td>';
610 609
             }
611 610
         }
612 611
         $pages .= '</tr></table>';
613 612
 
614 613
         //define query limits
615 614
         if (isset($_POST['page']) && $_POST['page'] > 1) {
616
-            $start = ($nbElements*($_POST['page']-1)) + 1;
615
+            $start = ($nbElements * ($_POST['page'] - 1)) + 1;
617 616
         } else {
618 617
             $start = 0;
619 618
         }
@@ -625,7 +624,7 @@  discard block
 block discarded – undo
625 624
             INNER JOIN ".prefix_table("users")." as u ON (l.qui=u.id)
626 625
             WHERE %l
627 626
             ORDER BY date DESC
628
-            LIMIT ".mysqli_real_escape_string($link, filter_var($start, FILTER_SANITIZE_NUMBER_INT)) .", ". mysqli_real_escape_string($link, filter_var($nbElements, FILTER_SANITIZE_NUMBER_INT)),
627
+            LIMIT ".mysqli_real_escape_string($link, filter_var($start, FILTER_SANITIZE_NUMBER_INT)).", ".mysqli_real_escape_string($link, filter_var($nbElements, FILTER_SANITIZE_NUMBER_INT)),
629 628
             $where
630 629
         );
631 630
 
@@ -644,11 +643,11 @@  discard block
 block discarded – undo
644 643
         if ($_POST['period'] == "0") {
645 644
             $date = (time());
646 645
         } elseif ($_POST['period'] == "1month") {
647
-            $date = (mktime(date('h'), date('i'), date('s'), date('m')+1, date('d'), date('y')));
646
+            $date = (mktime(date('h'), date('i'), date('s'), date('m') + 1, date('d'), date('y')));
648 647
         } elseif ($_POST['period'] == "6months") {
649
-            $date = (mktime(date('h'), date('i'), date('s'), date('m')+6, date('d'), date('y')));
648
+            $date = (mktime(date('h'), date('i'), date('s'), date('m') + 6, date('d'), date('y')));
650 649
         } elseif ($_POST['period'] == "1year") {
651
-            $date = (mktime(date('h'), date('i'), date('s'), date('m'), date('d'), date('y')+1));
650
+            $date = (mktime(date('h'), date('i'), date('s'), date('m'), date('d'), date('y') + 1));
652 651
         }
653 652
         $idItem = "";
654 653
         $texte = "<table cellpadding=3><thead><tr><th>".$LANG['label']."</th><th>".$LANG['creation_date']."</th><th>".$LANG['expiration_date']."</th><th>".$LANG['group']."</th><th>".$LANG['auteur']."</th></tr></thead>";
@@ -702,7 +701,7 @@  discard block
 block discarded – undo
702 701
     case "generate_renewal_pdf":
703 702
         //Prepare the PDF file
704 703
         include $_SESSION['settings']['cpassman_dir'].'/includes/libraries/Pdf/Tfpdf/tfpdf.class.php';
705
-        $pdf=new tFPDF();
704
+        $pdf = new tFPDF();
706 705
 
707 706
         //Add font for utf-8
708 707
         $pdf->AddFont('helvetica', '');
Please login to merge, or discard this patch.
sources/kb.queries.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
                         prefix_table("kb_categories"),
105 105
                         array(
106 106
                             'category' => $category
107
-                       )
107
+                        )
108 108
                     );
109 109
                     $cat_id = DB::insertId();
110 110
                 } else {
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
                             'author_id' => $_SESSION['user_id'],
124 124
                             'category_id' => $cat_id,
125 125
                             'anyone_can_modify' => $anyone_can_modify
126
-                       ),
126
+                        ),
127 127
                         "id=%i", $id
128 128
                     );
129 129
                 } else {
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
                             'author_id' => $_SESSION['user_id'],
137 137
                             'category_id' => $cat_id,
138 138
                             'anyone_can_modify' => $anyone_can_modify
139
-                       )
139
+                        )
140 140
                     );
141 141
                     $id = DB::insertId();
142 142
                 }
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
                         array(
152 152
                             'kb_id' => $id,
153 153
                             'item_id' => $item_id
154
-                       )
154
+                        )
155 155
                     );
156 156
                 }
157 157
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -194,7 +194,7 @@
 block discarded – undo
194 194
                 "options"     => $arrOptions
195 195
             );
196 196
 
197
-            echo json_encode($arrOutput, JSON_HEX_TAG|JSON_HEX_APOS|JSON_HEX_QUOT|JSON_HEX_AMP);
197
+            echo json_encode($arrOutput, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP);
198 198
             break;
199 199
         /**
200 200
          * Delete the KB
Please login to merge, or discard this patch.
sources/core.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 13
  */
14 14
 
15
-if (!isset($_SESSION['CPM']) || $_SESSION['CPM'] != 1 ) {
15
+if (!isset($_SESSION['CPM']) || $_SESSION['CPM'] != 1) {
16 16
     die('Please login...');
17 17
 }
18 18
 
@@ -44,8 +44,8 @@  discard block
 block discarded – undo
44 44
 
45 45
 /* LOAD CPASSMAN SETTINGS */
46 46
 if (!isset($_SESSION['settings']['loaded']) || $_SESSION['settings']['loaded'] != 1) {
47
-    $_SESSION['settings']['duplicate_folder'] = 0;  //by default, this is false;
48
-    $_SESSION['settings']['duplicate_item'] = 0;  //by default, this is false;
47
+    $_SESSION['settings']['duplicate_folder'] = 0; //by default, this is false;
48
+    $_SESSION['settings']['duplicate_item'] = 0; //by default, this is false;
49 49
     $_SESSION['settings']['number_of_used_pw'] = 5; //by default, this value is 5;
50 50
 
51 51
     $rows = DB::query("SELECT * FROM ".prefix_table("misc")." WHERE type=%s_type OR type=%s_type2",
@@ -78,13 +78,13 @@  discard block
 block discarded – undo
78 78
 if (isset($_SESSION['user_language']) && $_SESSION['user_language'] !== "0") {
79 79
     require_once $_SESSION['settings']['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php';
80 80
     $_SESSION['settings']['pwComplexity'] = array(
81
-        0=>array(0,$LANG['complex_level0']),
82
-        25=>array(25,$LANG['complex_level1']),
83
-        50=>array(50,$LANG['complex_level2']),
84
-        60=>array(60,$LANG['complex_level3']),
85
-        70=>array(70,$LANG['complex_level4']),
86
-        80=>array(80,$LANG['complex_level5']),
87
-        90=>array(90,$LANG['complex_level6'])
81
+        0=>array(0, $LANG['complex_level0']),
82
+        25=>array(25, $LANG['complex_level1']),
83
+        50=>array(50, $LANG['complex_level2']),
84
+        60=>array(60, $LANG['complex_level3']),
85
+        70=>array(70, $LANG['complex_level4']),
86
+        80=>array(80, $LANG['complex_level5']),
87
+        90=>array(90, $LANG['complex_level6'])
88 88
     );
89 89
 }
90 90
 
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
 * CHECK PASSWORD VALIDITY
372 372
 * Don't take into consideration if LDAP in use
373 373
 */
374
-$_SESSION['numDaysBeforePwExpiration'] = "";    //initiliaze variable
374
+$_SESSION['numDaysBeforePwExpiration'] = ""; //initiliaze variable
375 375
 if (isset($_SESSION['settings']['ldap_mode']) && $_SESSION['settings']['ldap_mode'] == 1) {
376 376
     $_SESSION['validite_pw'] = true;
377 377
     $_SESSION['last_pw_change'] = true;
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
             $_SESSION['validite_pw'] = true;
383 383
         } else {
384 384
             $_SESSION['numDaysBeforePwExpiration'] = $_SESSION['settings']['pw_life_duration'] - round(
385
-                (mktime(0, 0, 0, date('m'), date('d'), date('y'))-$_SESSION['last_pw_change'])/(24*60*60)
385
+                (mktime(0, 0, 0, date('m'), date('d'), date('y')) - $_SESSION['last_pw_change']) / (24 * 60 * 60)
386 386
             );
387 387
             if ($_SESSION['numDaysBeforePwExpiration'] <= 0) {
388 388
                 $_SESSION['validite_pw'] = false;
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
 /*
399 399
 * LOAD CATEGORIES
400 400
 */
401
-if (isset($_SESSION['settings']['item_extra_fields']) && $_SESSION['settings']['item_extra_fields'] == 1 && empty( $_SESSION['item_fields'])) {
401
+if (isset($_SESSION['settings']['item_extra_fields']) && $_SESSION['settings']['item_extra_fields'] == 1 && empty($_SESSION['item_fields'])) {
402 402
     $_SESSION['item_fields'] = array();
403 403
     $rows = DB::query("SELECT * FROM ".prefix_table("categories")." WHERE level=%s_level",
404 404
         array(
Please login to merge, or discard this patch.