Completed
Push — development ( 362b6c...477849 )
by Nils
08:04
created
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.
sources/categories.queries.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
                     prefix_table("categories"),
100 100
                     array(
101 101
                         'title' => $_POST['data']
102
-                       ),
102
+                        ),
103 103
                     "id=%i",
104 104
                     $_POST['id']
105 105
                 );
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
                     array(
116 116
                         'parent_id' => $_POST['data'],
117 117
                         'order' => 99
118
-                       ),
118
+                        ),
119 119
                     "id=%i",
120 120
                     $_POST['id']
121 121
                 );
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
                         prefix_table("categories"),
133 133
                         array(
134 134
                             'order' => $elem[1]
135
-                           ),
135
+                            ),
136 136
                         "id=%i",
137 137
                         $elem[0]
138 138
                     );
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
                         array(
216 216
                             'id_category' => $_POST['id'],
217 217
                             'id_folder' => $folder
218
-                           )
218
+                            )
219 219
                     );
220 220
 
221 221
                     // prepare a list
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
                 prefix_table("categories"),
237 237
                 array(
238 238
                     'encrypted_data' => $_POST['encrypt']
239
-                   ),
239
+                    ),
240 240
                 "id = %i",
241 241
                 $_POST['id']
242 242
             );
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
                     array(
272 272
                         'data' => $encrypt['string'],
273 273
                         'data_iv' => ""
274
-                       ),
274
+                        ),
275 275
                     "id = %i",
276 276
                     $recordF['id']
277 277
                 );
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -199,7 +199,7 @@
 block discarded – undo
199 199
                     }
200 200
                 }
201 201
             }
202
-            echo json_encode($arrCategories, JSON_HEX_TAG|JSON_HEX_APOS|JSON_HEX_QUOT|JSON_HEX_AMP);
202
+            echo json_encode($arrCategories, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP);
203 203
             break;
204 204
 
205 205
         case "categoryInFolders":
Please login to merge, or discard this patch.
sources/SecureHandler.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -25,13 +25,13 @@  discard block
 block discarded – undo
25 25
      */
26 26
     public function __construct()
27 27
     {
28
-        if (! extension_loaded('openssl')) {
28
+        if (!extension_loaded('openssl')) {
29 29
             throw new \RuntimeException(sprintf(
30 30
                 "You need the OpenSSL extension to use %s",
31 31
                 __CLASS__
32 32
             ));
33 33
         }
34
-        if (! extension_loaded('mbstring')) {
34
+        if (!extension_loaded('mbstring')) {
35 35
             throw new \RuntimeException(sprintf(
36 36
                 "You need the Multibytes extension to use %s",
37 37
                 __CLASS__
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
      */
49 49
     public function open($save_path, $session_name)
50 50
     {
51
-        $this->key = $this->getKey('KEY_' . $session_name);
51
+        $this->key = $this->getKey('KEY_'.$session_name);
52 52
         return parent::open($save_path, $session_name);
53 53
     }
54 54
 
@@ -95,11 +95,11 @@  discard block
 block discarded – undo
95 95
         // Authentication
96 96
         $hmac = hash_hmac(
97 97
             'SHA256',
98
-            $iv . $ciphertext,
98
+            $iv.$ciphertext,
99 99
             mb_substr($key, 32, null, '8bit'),
100 100
             true
101 101
         );
102
-        return $hmac . $iv . $ciphertext;
102
+        return $hmac.$iv.$ciphertext;
103 103
     }
104 104
 
105 105
     /**
@@ -117,11 +117,11 @@  discard block
 block discarded – undo
117 117
         // Authentication
118 118
         $hmacNew = hash_hmac(
119 119
             'SHA256',
120
-            $iv . $ciphertext,
120
+            $iv.$ciphertext,
121 121
             mb_substr($key, 32, null, '8bit'),
122 122
             true
123 123
         );
124
-        if (! $this->hash_equals($hmac, $hmacNew)) {
124
+        if (!$this->hash_equals($hmac, $hmacNew)) {
125 125
             throw new \RuntimeException('Authentication failed');
126 126
         }
127 127
         // Decrypt
Please login to merge, or discard this patch.
sources/main.queries.php 3 patches
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
                     prefix_table("users"),
100 100
                     array(
101 101
                         'fonction_id' => $data_roles['fonction_id']
102
-                       ),
102
+                        ),
103 103
                     "id = %i",
104 104
                     $_SESSION['user_id']
105 105
                 );
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
                         'pw' => $newPw,
167 167
                         'last_pw_change' => mktime(0, 0, 0, date('m'), date('d'), date('y')),
168 168
                         'last_pw' => $oldPw
169
-                       ),
169
+                        ),
170 170
                     "id = %i",
171 171
                     $_SESSION['user_id']
172 172
                 );
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
                 array(
205 205
                     'pw' => $newPw,
206 206
                     'last_pw_change' => mktime(0, 0, 0, date('m'), date('d'), date('y'))
207
-                   ),
207
+                    ),
208 208
                 "id = %i",
209 209
                 $dataReceived['user_id']
210 210
             );
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
                 array(
241 241
                     'pw' => $newPw,
242 242
                     'last_pw_change' => mktime(0, 0, 0, date('m'), date('d'), date('y'))
243
-                   ),
243
+                    ),
244 244
                 "id = %i",
245 245
                 $_SESSION['user_id']
246 246
             );
@@ -261,8 +261,8 @@  discard block
 block discarded – undo
261 261
         }
262 262
         break;
263 263
     /**
264
-    * This will generate the QR Google Authenticator
265
-    */
264
+     * This will generate the QR Google Authenticator
265
+     */
266 266
     case "ga_generate_qr":
267 267
         // is this allowed by setting
268 268
         if (!isset($_SESSION['settings']['ga_reset_by_user']) || $_SESSION['settings']['ga_reset_by_user'] !== "1") {
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
                     array(
312 312
                         'ga' => $gaSecretKey,
313 313
                         'ga_temporary_code' => $gaTemporaryCode
314
-                       ),
314
+                        ),
315 315
                     "id = %i",
316 316
                     $data['id']
317 317
                 );
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
                 prefix_table("users"),
458 458
                 array(
459 459
                     'pw' => $newPw
460
-                   ),
460
+                    ),
461 461
                 "login = %s",
462 462
                 mysqli_escape_string($link, $login)
463 463
             );
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
                     prefix_table("users"),
552 552
                     array(
553 553
                         'encrypted_psk' => $_SESSION['user_settings']['encrypted_psk']
554
-                       ),
554
+                        ),
555 555
                     "id = %i",
556 556
                     $_SESSION['user_id']
557 557
                 );
@@ -635,7 +635,7 @@  discard block
 block discarded – undo
635 635
             prefix_table("users"),
636 636
             array(
637 637
                 'encrypted_psk' => $_SESSION['user_settings']['encrypted_psk']
638
-               ),
638
+                ),
639 639
             "id = %i",
640 640
             $_SESSION['user_id']
641 641
         );
@@ -739,7 +739,7 @@  discard block
 block discarded – undo
739 739
                 prefix_table("users"),
740 740
                 array(
741 741
                     'user_language' => $language
742
-                   ),
742
+                    ),
743 743
                 "id = %i",
744 744
                 $_SESSION['user_id']
745 745
             );
@@ -806,7 +806,7 @@  discard block
 block discarded – undo
806 806
                         prefix_table("emails"),
807 807
                         array(
808 808
                             'status' => $status
809
-                           ),
809
+                            ),
810 810
                         "timestamp = %s",
811 811
                         $record['timestamp']
812 812
                     );
@@ -820,7 +820,7 @@  discard block
 block discarded – undo
820 820
                 prefix_table("misc"),
821 821
                 array(
822 822
                     'valeur' => time()
823
-                   ),
823
+                    ),
824 824
                 "intitule = %s AND type = %s",
825 825
                 "sending_emails",
826 826
                 "cron"
@@ -1137,7 +1137,7 @@  discard block
 block discarded – undo
1137 1137
                 prefix_table("misc"),
1138 1138
                 array(
1139 1139
                     'valeur' => time()
1140
-                   ),
1140
+                    ),
1141 1141
                 "type = %s AND intitule = %s",
1142 1142
                 'admin',
1143 1143
                 'send_stats_time'
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         $pwdlib = new PasswordLib\PasswordLib();
84 84
 
85 85
         // Prepare variables
86
-        $newPw = $pwdlib->createPasswordHash(htmlspecialchars_decode($dataReceived['new_pw']));    //bCrypt(htmlspecialchars_decode($dataReceived['new_pw']), COST);
86
+        $newPw = $pwdlib->createPasswordHash(htmlspecialchars_decode($dataReceived['new_pw'])); //bCrypt(htmlspecialchars_decode($dataReceived['new_pw']), COST);
87 87
 
88 88
         // User has decided to change is PW
89 89
         if (isset($_POST['change_pw_origine']) && $_POST['change_pw_origine'] === "user_change" && $_SESSION['user_admin'] !== "1") {
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
             $data_roles = DB::queryfirstrow("SELECT fonction_id FROM ".prefix_table("users")." WHERE id = %i", $_SESSION['user_id']);
92 92
 
93 93
             // check if badly written
94
-            $data_roles['fonction_id'] = array_filter(explode(',',str_replace(';', ',', $data_roles['fonction_id'])));
94
+            $data_roles['fonction_id'] = array_filter(explode(',', str_replace(';', ',', $data_roles['fonction_id'])));
95 95
             if ($data_roles['fonction_id'][0] === "") {
96 96
                 //$data_roles['fonction_id'] = array_filter($data_roles['fonction_id']);
97 97
                 $data_roles['fonction_id'] = implode(';', $data_roles['fonction_id']);
@@ -222,9 +222,9 @@  discard block
 block discarded – undo
222 222
                 if (!empty($row['email']) && isset($_SESSION['settings']['enable_email_notification_on_user_pw_change']) && $_SESSION['settings']['enable_email_notification_on_user_pw_change'] == 1) {
223 223
                     sendEmail(
224 224
                         $LANG['forgot_pw_email_subject'],
225
-                        $LANG['forgot_pw_email_body'] . " " . htmlspecialchars_decode($dataReceived['new_pw']),
225
+                        $LANG['forgot_pw_email_body']." ".htmlspecialchars_decode($dataReceived['new_pw']),
226 226
                         $row[0],
227
-                        $LANG['forgot_pw_email_altbody_1'] . " " . htmlspecialchars_decode($dataReceived['new_pw'])
227
+                        $LANG['forgot_pw_email_altbody_1']." ".htmlspecialchars_decode($dataReceived['new_pw'])
228 228
                     );
229 229
                 }
230 230
             }
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 
319 319
                 // send mail?
320 320
                 if (isset($_POST['send_email']) && $_POST['send_email'] === "1") {
321
-                    sendEmail (
321
+                    sendEmail(
322 322
                         $LANG['email_ga_subject'],
323 323
                         str_replace(
324 324
                             "#2FACode#",
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
      */
369 369
     case "send_pw_by_email":
370 370
         // generate key
371
-        $key =  GenerateCryptKey(50);
371
+        $key = GenerateCryptKey(50);
372 372
 
373 373
         // Get account and pw associated to email
374 374
         DB::query(
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
                 }
528 528
             }
529 529
         }
530
-        echo json_encode($arrOutput, JSON_HEX_TAG|JSON_HEX_APOS|JSON_HEX_QUOT|JSON_HEX_AMP);
530
+        echo json_encode($arrOutput, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP);
531 531
         break;
532 532
     /**
533 533
      * Store the personal saltkey
@@ -863,10 +863,10 @@  discard block
 block discarded – undo
863 863
             $pwgen->setCapitalize(true);
864 864
             $pwgen->setNumerals(true);
865 865
         } else {
866
-            $pwgen->setSecure(($_POST['secure'] == "true")? true : false);
867
-            $pwgen->setNumerals(($_POST['numerals'] == "true")? true : false);
868
-            $pwgen->setCapitalize(($_POST['capitalize'] == "true")? true : false);
869
-            $pwgen->setSymbols(($_POST['symbols'] == "true")? true : false);
866
+            $pwgen->setSecure(($_POST['secure'] == "true") ? true : false);
867
+            $pwgen->setNumerals(($_POST['numerals'] == "true") ? true : false);
868
+            $pwgen->setCapitalize(($_POST['capitalize'] == "true") ? true : false);
869
+            $pwgen->setSymbols(($_POST['symbols'] == "true") ? true : false);
870 870
         }
871 871
 
872 872
         echo prepareExchangedData(
@@ -927,7 +927,7 @@  discard block
 block discarded – undo
927 927
                     prefix_table("statistics"),
928 928
                     array(
929 929
                         'scope' => 'item',
930
-                        'view' => $data['view']+1
930
+                        'view' => $data['view'] + 1
931 931
                     ),
932 932
                     "item_id = %i",
933 933
                     $_POST['id']
@@ -985,7 +985,7 @@  discard block
 block discarded – undo
985 985
                 "existing_suggestions" => $nb_suggestions_waiting,
986 986
                 "text" => handleBackslash($return)
987 987
             ),
988
-            JSON_HEX_TAG|JSON_HEX_APOS|JSON_HEX_QUOT|JSON_HEX_AMP
988
+            JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP
989 989
         );
990 990
         break;
991 991
 
@@ -1023,7 +1023,7 @@  discard block
 block discarded – undo
1023 1023
                 'token' => $token,
1024 1024
                 'reason' => $_POST['reason'],
1025 1025
                 'creation_timestamp' => time(),
1026
-                'end_timestamp' => time()+$_POST['duration']    // in secs
1026
+                'end_timestamp' => time() + $_POST['duration']    // in secs
1027 1027
             )
1028 1028
         );
1029 1029
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -964,7 +964,9 @@
 block discarded – undo
964 964
                     $return .= '<li onclick="displayItemNumber('.$record['id'].', '.$record['id_tree'].')"><i class="fa fa-hand-o-right"></i>&nbsp;'.($record['label']).'</li>';
965 965
                     $x++;
966 966
                     array_push($arrTmp, $record['id']);
967
-                    if ($x >= 10) break;
967
+                    if ($x >= 10) {
968
+                        break;
969
+                    }
968 970
                 }
969 971
             }
970 972
         }
Please login to merge, or discard this patch.