Completed
Push — development ( 362b6c...477849 )
by Nils
08:04
created
sources/downloadFile.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
 
15 15
 require_once 'SecureHandler.php';
16 16
 session_start();
17
-if (!isset($_SESSION['CPM']) || !isset($_SESSION['key_tmp']) || !isset($_SESSION['key']) || $_SESSION['CPM'] != 1 || $_GET['key'] != $_SESSION['key'] || $_GET['key_tmp'] != $_SESSION['key_tmp'] || empty($_SESSION['key']) || empty($_SESSION['key_tmp']) ) {
17
+if (!isset($_SESSION['CPM']) || !isset($_SESSION['key_tmp']) || !isset($_SESSION['key']) || $_SESSION['CPM'] != 1 || $_GET['key'] != $_SESSION['key'] || $_GET['key_tmp'] != $_SESSION['key_tmp'] || empty($_SESSION['key']) || empty($_SESSION['key_tmp'])) {
18 18
     die('Hacking attempt...');
19 19
 }
20 20
 
Please login to merge, or discard this patch.
sources/users.queries.php 2 patches
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
             DB::update(
95 95
                 prefix_table("users"),
96 96
                 array($_POST['type'] => $new_groupes
97
-                   ),
97
+                    ),
98 98
                 "id = %i",
99 99
                 $val[0]
100 100
             );
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
                 prefix_table("users"),
128 128
                 array(
129 129
                     'fonction_id' => $new_fonctions
130
-                   ),
130
+                    ),
131 131
                 "id = %i",
132 132
                 $val[0]
133 133
             );
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
                         'groupes_visibles' => $dataReceived['allowed_flds'],
189 189
                         'isAdministratedByRole' => $dataReceived['isAdministratedByRole'] === "null" ? "0" : $dataReceived['isAdministratedByRole'],
190 190
                         'encrypted_psk' => ''
191
-                       )
191
+                        )
192 192
                 );
193 193
                 $new_user_id = DB::insertId();
194 194
                 // Create personnal folder
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
                             'bloquer_creation' => '0',
202 202
                             'bloquer_modification' => '0',
203 203
                             'personal_folder' => '1'
204
-                           )
204
+                            )
205 205
                     );
206 206
                     $tree->rebuild();
207 207
                 }
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
                             'renewal_period' => 0,
218 218
                             'bloquer_creation' => '0',
219 219
                             'bloquer_modification' => '0'
220
-                           )
220
+                            )
221 221
                     );
222 222
                     $new_folder_id = DB::insertId();
223 223
                     // Add complexity
@@ -227,14 +227,14 @@  discard block
 block discarded – undo
227 227
                             'type' => 'complex',
228 228
                             'intitule' => $new_folder_id,
229 229
                             'valeur' => 50
230
-                           )
230
+                            )
231 231
                     );
232 232
                     // Create role
233 233
                     DB::insert(
234 234
                         prefix_table("roles_title"),
235 235
                         array(
236 236
                             'title' => mysqli_escape_string($link, stripslashes(($dataReceived['domain'])))
237
-                           )
237
+                            )
238 238
                     );
239 239
                     $new_role_id = DB::insertId();
240 240
                     // Associate new role to new folder
@@ -243,14 +243,14 @@  discard block
 block discarded – undo
243 243
                         array(
244 244
                             'folder_id' => $new_folder_id,
245 245
                             'role_id' => $new_role_id
246
-                           )
246
+                            )
247 247
                     );
248 248
                     // Add the new user to this role
249 249
                     DB::update(
250 250
                         prefix_table("users"),
251 251
                         array(
252 252
                             'fonction_id' => is_int($new_role_id)
253
-                           ),
253
+                            ),
254 254
                         "id=%i",
255 255
                         $new_user_id
256 256
                     );
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
                     array(
332 332
                         'disabled' => 1,
333 333
                         'key_tempo' => ""
334
-                       ),
334
+                        ),
335 335
                     "id=%i",
336 336
                     $_POST['id']
337 337
                 );
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
                 prefix_table("users"),
361 361
                 array(
362 362
                     'email' => $_POST['newemail']
363
-                   ),
363
+                    ),
364 364
                 "id = %i",
365 365
                 $_POST['id']
366 366
             );
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
                 prefix_table("users"),
383 383
                 array(
384 384
                     'can_create_root_folder' => $_POST['value']
385
-                   ),
385
+                    ),
386 386
                 "id = %i",
387 387
                 $_POST['id']
388 388
             );
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
                     'admin' => filter_var($_POST['value'], FILTER_SANITIZE_NUMBER_INT),
405 405
                     'gestionnaire' => $_POST['value'] === "1" ? "0" : "0",
406 406
                     'read_only' => $_POST['value'] === "1" ? "0" : "0"
407
-                   ),
407
+                    ),
408 408
                 "id = %i",
409 409
                 filter_var($_POST['id'], FILTER_SANITIZE_NUMBER_INT)
410 410
             );
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
                     ),
440 440
                     'admin' => $_POST['value'] === "1" ? "0" : "0",
441 441
                     'read_only' => $_POST['value'] === "1" ? "0" : "0"
442
-                   ),
442
+                    ),
443 443
                 "id = %i",
444 444
                 filter_var($_POST['id'], FILTER_SANITIZE_NUMBER_INT)
445 445
             );
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
                     'read_only' => $_POST['value'],
462 462
                     'gestionnaire' => $_POST['value'] == 1 ? "0" : "0",
463 463
                     'admin' => $_POST['value'] == 1 ? "0" : "0"
464
-                   ),
464
+                    ),
465 465
                 "id = %i",
466 466
                 filter_var($_POST['id'], FILTER_SANITIZE_NUMBER_INT)
467 467
             );
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
                     'gestionnaire' => ($data['gestionnaire'] == 0 && $_POST['value'] == 1) ? "1" : (($data['gestionnaire'] == 1 && $_POST['value'] == 1) ? "1" : (($data['gestionnaire'] == 1 && $_POST['value'] == 0) ? "1" : "0")),
493 493
                     'admin' => $_POST['value'] == 1 ? "0" : "0",
494 494
                     'read_only' => $_POST['value'] == 1 ? "0" : "0"
495
-                   ),
495
+                    ),
496 496
                 "id = %i",
497 497
                 $_POST['id']
498 498
             );
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
                 prefix_table("users"),
513 513
                 array(
514 514
                     'personal_folder' => $_POST['value']
515
-                   ),
515
+                    ),
516 516
                 "id = %i",
517 517
                 $_POST['id']
518 518
             );
@@ -566,7 +566,7 @@  discard block
 block discarded – undo
566 566
                 prefix_table("users"),
567 567
                 array(
568 568
                     'fonction_id' => $_POST['list']
569
-                   ),
569
+                    ),
570 570
                 "id = %i",
571 571
                 $_POST['id']
572 572
             );
@@ -636,7 +636,7 @@  discard block
 block discarded – undo
636 636
                 prefix_table("users"),
637 637
                 array(
638 638
                     'isAdministratedByRole' => $_POST['isAdministratedByRole']
639
-                   ),
639
+                    ),
640 640
                 "id = %i",
641 641
                 $_POST['userId']
642 642
             );
@@ -657,7 +657,7 @@  discard block
 block discarded – undo
657 657
                 prefix_table("users"),
658 658
                 array(
659 659
                     'groupes_visibles' => $_POST['list']
660
-                   ),
660
+                    ),
661 661
                 "id = %i",
662 662
                 $_POST['id']
663 663
             );
@@ -727,7 +727,7 @@  discard block
 block discarded – undo
727 727
                 prefix_table("users"),
728 728
                 array(
729 729
                     'groupes_interdits' => $_POST['list']
730
-                   ),
730
+                    ),
731 731
                 "id = %i",
732 732
                 $_POST['id']
733 733
             );
@@ -762,7 +762,7 @@  discard block
 block discarded – undo
762 762
                 array(
763 763
                     'disabled' => 0,
764 764
                     'no_bad_attempts' => 0
765
-                   ),
765
+                    ),
766 766
                 "id = %i",
767 767
                 $_POST['id']
768 768
             );
@@ -970,7 +970,7 @@  discard block
 block discarded – undo
970 970
                             prefix_table("log_items"),
971 971
                             array(
972 972
                                 'id_user' => $user_id
973
-                               ),
973
+                                ),
974 974
                             "id_item = %i AND id_user $ %i AND action = %s",
975 975
                             $record['id'],
976 976
                             $user_id,
@@ -985,8 +985,8 @@  discard block
 block discarded – undo
985 985
             break;
986 986
 
987 987
         /**
988
-        * delete the timestamp value for specified user => disconnect
989
-        */
988
+         * delete the timestamp value for specified user => disconnect
989
+         */
990 990
         case "disconnect_user":
991 991
             // Check KEY
992 992
             if ($_POST['key'] != $_SESSION['key']) {
@@ -1000,15 +1000,15 @@  discard block
 block discarded – undo
1000 1000
                     'timestamp' => "",
1001 1001
                     'key_tempo' => "",
1002 1002
                     'session_end' => ""
1003
-                   ),
1003
+                    ),
1004 1004
                 "id = %i",
1005 1005
                 intval($_POST['user_id'])
1006 1006
             );
1007 1007
             break;
1008 1008
 
1009 1009
         /**
1010
-        * delete the timestamp value for all users
1011
-        */
1010
+         * delete the timestamp value for all users
1011
+         */
1012 1012
         case "disconnect_all_users":
1013 1013
             // Check KEY
1014 1014
             if ($_POST['key'] != $_SESSION['key']) {
@@ -1029,7 +1029,7 @@  discard block
 block discarded – undo
1029 1029
                         'timestamp' => "",
1030 1030
                         'key_tempo' => "",
1031 1031
                         'session_end' => ""
1032
-                       ),
1032
+                        ),
1033 1033
                     "id = %i",
1034 1034
                     intval($record['id'])
1035 1035
                 );
@@ -1313,7 +1313,7 @@  discard block
 block discarded – undo
1313 1313
                         'groupes_interdits' => empty($dataReceived['forbidFld']) ? '0' : rtrim($dataReceived['forbidFld'], ";"),
1314 1314
                         'groupes_visibles' => empty($dataReceived['allowFld']) ? '0' : rtrim($dataReceived['allowFld'], ";"),
1315 1315
                         'fonction_id' => empty($dataReceived['functions']) ? '0' : rtrim($dataReceived['functions'], ";"),
1316
-                       ),
1316
+                        ),
1317 1317
                     "id = %i",
1318 1318
                     $_POST['id']
1319 1319
                 );
@@ -1639,7 +1639,7 @@  discard block
 block discarded – undo
1639 1639
                         'personal_folder' => $user_other_rights[3],
1640 1640
                         'can_manage_all_users' => $user_other_rights[4],
1641 1641
                         'admin' => $user_other_rights[5],
1642
-                       ),
1642
+                        ),
1643 1643
                     "id = %i",
1644 1644
                     $dest_user_id
1645 1645
                 );
@@ -1683,7 +1683,7 @@  discard block
 block discarded – undo
1683 1683
         prefix_table("users"),
1684 1684
         array(
1685 1685
             $value[0] => $_POST['newValue']
1686
-           ),
1686
+            ),
1687 1687
         "id = %i",
1688 1688
         $value[1]
1689 1689
     );
@@ -1720,7 +1720,7 @@  discard block
 block discarded – undo
1720 1720
         prefix_table("users"),
1721 1721
         array(
1722 1722
             'admin' => $_POST['newadmin']
1723
-           ),
1723
+            ),
1724 1724
         "id = %i",
1725 1725
         $id[1]
1726 1726
     );
Please login to merge, or discard this patch.
Spacing   +20 added lines, -21 removed lines patch added patch discarded remove patch
@@ -434,8 +434,7 @@  discard block
 block discarded – undo
434 434
                     'gestionnaire' => filter_var($_POST['value'], FILTER_SANITIZE_NUMBER_INT),
435 435
                     'can_manage_all_users' => ($data['can_manage_all_users'] === "0" && $_POST['value'] === "1") ? "0" : (
436 436
                         ($data['can_manage_all_users'] === "0" && $_POST['value'] === "0") ? "0" : (
437
-                        ($data['can_manage_all_users'] === "1" && $_POST['value'] === "0") ? "0" :
438
-                        "1")
437
+                        ($data['can_manage_all_users'] === "1" && $_POST['value'] === "0") ? "0" : "1")
439 438
                     ),
440 439
                     'admin' => $_POST['value'] === "1" ? "0" : "0",
441 440
                     'read_only' => $_POST['value'] === "1" ? "0" : "0"
@@ -537,7 +536,7 @@  discard block
 block discarded – undo
537 536
 
538 537
             $rows = DB::query("SELECT id,title,creator_id FROM ".prefix_table("roles_title"));
539 538
             foreach ($rows as $record) {
540
-                if ($_SESSION['is_admin'] == 1  || ($_SESSION['user_manager'] == 1 && (in_array($record['id'], $my_functions) || $record['creator_id'] == $_SESSION['user_id']))) {
539
+                if ($_SESSION['is_admin'] == 1 || ($_SESSION['user_manager'] == 1 && (in_array($record['id'], $my_functions) || $record['creator_id'] == $_SESSION['user_id']))) {
541 540
                     $text .= '<input type="checkbox" id="cb_change_function-'.$record['id'].'"';
542 541
                     if (in_array($record['id'], $users_functions)) {
543 542
                         $text .= ' checked';
@@ -549,7 +548,7 @@  discard block
 block discarded – undo
549 548
                 }
550 549
             }
551 550
             // return data
552
-            $return_values = json_encode(array("text" => $text), JSON_HEX_TAG|JSON_HEX_APOS|JSON_HEX_QUOT|JSON_HEX_AMP);
551
+            $return_values = json_encode(array("text" => $text), JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP);
553 552
             echo $return_values;
554 553
             break;
555 554
         /**
@@ -618,7 +617,7 @@  discard block
 block discarded – undo
618 617
                 }
619 618
             }
620 619
             // return data
621
-            $return_values = json_encode(array("text" => $text), JSON_HEX_TAG|JSON_HEX_APOS|JSON_HEX_QUOT|JSON_HEX_AMP);
620
+            $return_values = json_encode(array("text" => $text), JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP);
622 621
             echo $return_values;
623 622
             break;
624 623
 
@@ -703,7 +702,7 @@  discard block
 block discarded – undo
703 702
                 if (in_array($t->id, $_SESSION['groupes_visibles']) && !in_array($t->id, $_SESSION['personal_visible_groups'])) {
704 703
                     $text .= '<input type="checkbox" id="cb_change_forgroup-'.$t->id.'"';
705 704
                     $ident = "";
706
-                    for ($y = 1;$y < $t->nlevel;$y++) {
705
+                    for ($y = 1; $y < $t->nlevel; $y++) {
707 706
                         $ident .= "&nbsp;&nbsp;";
708 707
                     }
709 708
                     if (in_array($t->id, $user)) {
@@ -714,7 +713,7 @@  discard block
 block discarded – undo
714 713
                 }
715 714
             }
716 715
             // return data
717
-            $return_values = json_encode(array("text" => $text), JSON_HEX_TAG|JSON_HEX_APOS|JSON_HEX_QUOT|JSON_HEX_AMP);
716
+            $return_values = json_encode(array("text" => $text), JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP);
718 717
             echo $return_values;
719 718
             break;
720 719
 
@@ -864,7 +863,7 @@  discard block
 block discarded – undo
864 863
                     FROM ".prefix_table("log_system")."
865 864
                     WHERE type = %s AND field_1=%i
866 865
                     ORDER BY date DESC
867
-                    LIMIT ".mysqli_real_escape_string($link, filter_var($start, FILTER_SANITIZE_NUMBER_INT)) .", ". mysqli_real_escape_string($link, filter_var($_POST['nb_items_by_page'], FILTER_SANITIZE_NUMBER_INT)),
866
+                    LIMIT ".mysqli_real_escape_string($link, filter_var($start, FILTER_SANITIZE_NUMBER_INT)).", ".mysqli_real_escape_string($link, filter_var($_POST['nb_items_by_page'], FILTER_SANITIZE_NUMBER_INT)),
868 867
                     "user_mngt",
869 868
                     filter_var($_POST['id'], FILTER_SANITIZE_NUMBER_INT)
870 869
                 );
@@ -873,7 +872,7 @@  discard block
 block discarded – undo
873 872
             if (isset($counter) && $counter != 0) {
874 873
                 $nb_pages = ceil($counter / $_POST['nb_items_by_page']);
875 874
                 for ($i = 1; $i <= $nb_pages; $i++) {
876
-                    $pages .= '<td onclick=\'displayLogs('.$i.',\"'.$_POST['scope'].'\")\'><span style=\'cursor:pointer;'.($_POST['page'] == $i ? 'font-weight:bold;font-size:18px;\'>'.$i:'\'>'.$i).'</span></td>';
875
+                    $pages .= '<td onclick=\'displayLogs('.$i.',\"'.$_POST['scope'].'\")\'><span style=\'cursor:pointer;'.($_POST['page'] == $i ? 'font-weight:bold;font-size:18px;\'>'.$i : '\'>'.$i).'</span></td>';
877 876
                 }
878 877
             }
879 878
             $pages .= '</tr></table>';
@@ -1072,7 +1071,7 @@  discard block
 block discarded – undo
1072 1071
 
1073 1072
             $rows = DB::query("SELECT id,title,creator_id FROM ".prefix_table("roles_title"));
1074 1073
             foreach ($rows as $record) {
1075
-                if ($_SESSION['is_admin'] == 1  || ($_SESSION['user_manager'] == 1 && (in_array($record['id'], $my_functions) || $record['creator_id'] == $_SESSION['user_id']))) {
1074
+                if ($_SESSION['is_admin'] == 1 || ($_SESSION['user_manager'] == 1 && (in_array($record['id'], $my_functions) || $record['creator_id'] == $_SESSION['user_id']))) {
1076 1075
                     if (in_array($record['id'], $users_functions)) {
1077 1076
                         $tmp = ' selected="selected"';
1078 1077
 
@@ -1136,7 +1135,7 @@  discard block
 block discarded – undo
1136 1135
                 if (in_array($t->id, $_SESSION['groupes_visibles']) && !in_array($t->id, $_SESSION['personal_visible_groups'])) {
1137 1136
                     $tmp = "";
1138 1137
                     $ident = "";
1139
-                    for ($y = 1;$y < $t->nlevel;$y++) {
1138
+                    for ($y = 1; $y < $t->nlevel; $y++) {
1140 1139
                         $ident .= "&nbsp;&nbsp;";
1141 1140
                     }
1142 1141
                     if (in_array($t->id, $userForbidFolders)) {
@@ -1201,11 +1200,11 @@  discard block
 block discarded – undo
1201 1200
             $arrData['function'] = $functionsList;
1202 1201
             $arrData['managedby'] = $managedBy;
1203 1202
             $arrData['foldersForbid'] = $forbiddenFolders;
1204
-            $arrData['foldersAllow'] = $allowedFolders;//print_r($arrMngBy);
1205
-            $arrData['share_function'] = json_encode($arrFunction, JSON_HEX_TAG|JSON_HEX_APOS|JSON_HEX_QUOT|JSON_HEX_AMP);
1206
-            $arrData['share_managedby'] = json_encode($arrMngBy, JSON_HEX_TAG|JSON_HEX_APOS|JSON_HEX_QUOT|JSON_HEX_AMP);
1207
-            $arrData['share_forbidden'] = json_encode($arrFldForbidden, JSON_HEX_TAG|JSON_HEX_APOS|JSON_HEX_QUOT|JSON_HEX_AMP);
1208
-            $arrData['share_allowed'] = json_encode($arrFldAllowed, JSON_HEX_TAG|JSON_HEX_APOS|JSON_HEX_QUOT|JSON_HEX_AMP);
1203
+            $arrData['foldersAllow'] = $allowedFolders; //print_r($arrMngBy);
1204
+            $arrData['share_function'] = json_encode($arrFunction, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP);
1205
+            $arrData['share_managedby'] = json_encode($arrMngBy, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP);
1206
+            $arrData['share_forbidden'] = json_encode($arrFldForbidden, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP);
1207
+            $arrData['share_allowed'] = json_encode($arrFldAllowed, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP);
1209 1208
             $arrData['gestionnaire'] = $rowUser['gestionnaire'];
1210 1209
             $arrData['read_only'] = $rowUser['read_only'];
1211 1210
             $arrData['can_create_root_folder'] = $rowUser['can_create_root_folder'];
@@ -1213,7 +1212,7 @@  discard block
 block discarded – undo
1213 1212
             $arrData['can_manage_all_users'] = $rowUser['can_manage_all_users'];
1214 1213
             $arrData['admin'] = $rowUser['admin'];
1215 1214
 
1216
-            $return_values = json_encode($arrData, JSON_HEX_TAG|JSON_HEX_APOS|JSON_HEX_QUOT|JSON_HEX_AMP);
1215
+            $return_values = json_encode($arrData, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP);
1217 1216
             echo $return_values;
1218 1217
 
1219 1218
             break;
@@ -1443,7 +1442,7 @@  discard block
 block discarded – undo
1443 1442
             foreach ($rows as $record) {
1444 1443
                 $bFound = false;
1445 1444
                 $x = 0;
1446
-                foreach($arrFolders as $fld) {
1445
+                foreach ($arrFolders as $fld) {
1447 1446
                     if ($fld['id'] === $record['folder_id']) {
1448 1447
                         // get the level of access on the folder
1449 1448
                         $arrFolders[$x]['type'] = evaluate_folder_acces_level($record['type'], $arrFolders[$x]['type']);
@@ -1453,13 +1452,13 @@  discard block
 block discarded – undo
1453 1452
                     $x++;
1454 1453
                 }
1455 1454
                 if ($bFound === false && !in_array($record['folder_id'], $arrData['denied_folders'])) {
1456
-                    array_push($arrFolders, array("id" => $record['folder_id'] , "type" => $record['type']));
1455
+                    array_push($arrFolders, array("id" => $record['folder_id'], "type" => $record['type']));
1457 1456
                 }
1458 1457
             }
1459 1458
 
1460 1459
             $tree_desc = $tree->getDescendants();
1461 1460
             foreach ($tree_desc as $t) {
1462
-                foreach($arrFolders as $fld) {
1461
+                foreach ($arrFolders as $fld) {
1463 1462
                     if ($fld['id'] === $t->id) {
1464 1463
                         // get folder name
1465 1464
                         $row = DB::queryFirstRow(
@@ -1676,7 +1675,7 @@  discard block
 block discarded – undo
1676 1675
 elseif (!empty($_POST['newValue'])) {
1677 1676
     $value = explode('_', $_POST['id']);
1678 1677
     if ($value[0] === "userlanguage") {
1679
-        $value[0]  = "user_language";
1678
+        $value[0] = "user_language";
1680 1679
         $_POST['newValue'] = strtolower($_POST['newValue']);
1681 1680
     }
1682 1681
     DB::update(
Please login to merge, or discard this patch.
sources/kb.queries.categories.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
 }
50 50
 $counter = DB::count();
51 51
 
52
-if ($counter>0) {
52
+if ($counter > 0) {
53 53
     foreach ($rows as $record) {
54 54
         if (empty($sOutput)) {
55 55
             $sOutput = '"'.$record['category'].'"';
Please login to merge, or discard this patch.
sources/favourites.queries.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
61 61
                 prefix_table("users"),
62 62
                 array(
63 63
                     'favourites' => $favs
64
-               ),
64
+                ),
65 65
                 "id = %i",
66 66
                 $_SESSION['user_id']
67 67
             );
Please login to merge, or discard this patch.
sources/admin.queries.php 3 patches
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
                 prefix_table("users"),
137 137
                 array(
138 138
                     'personal_folder' => '1'
139
-               ),
139
+                ),
140 140
                 "id = %i",
141 141
                 $record['id']
142 142
             );
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
                         'parent_id' => '0',
159 159
                         'title' => $record['id'],
160 160
                         'personal_folder' => '1'
161
-                   )
161
+                    )
162 162
                 );
163 163
 
164 164
                 //rebuild fuild tree folder
@@ -169,10 +169,10 @@  discard block
 block discarded – undo
169 169
                     prefix_table("nested_tree"),
170 170
                     array(
171 171
                         'personal_folder' => '1'
172
-                   ),
173
-                   "title=%s AND parent_id=%i",
174
-                   $record['id'],
175
-                   0
172
+                    ),
173
+                    "title=%s AND parent_id=%i",
174
+                    $record['id'],
175
+                    0
176 176
                 );
177 177
                 //rebuild fuild tree folder
178 178
                 $tree->rebuild();
@@ -180,12 +180,12 @@  discard block
 block discarded – undo
180 180
                 // Get an array of all folders
181 181
                 $folders = $tree->getDescendants($data['id'], false, true, true);
182 182
                 foreach ($folders as $folder) {
183
-                 //update PF field for user
183
+                    //update PF field for user
184 184
                     DB::update(
185 185
                         prefix_table("nested_tree"),
186 186
                         array(
187 187
                             'personal_folder' => '1'
188
-                       ),
188
+                        ),
189 189
                         "id = %s",
190 190
                         $folder
191 191
                     );
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
                         'id_user'     => "",
431 431
                         'action'     => "at_creation",
432 432
                         'raison'    => ""
433
-                   )
433
+                    )
434 434
                 );
435 435
             }
436 436
         }
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
             prefix_table("misc"),
594 594
             array(
595 595
                 'valeur' => '1',
596
-           ),
596
+            ),
597 597
             "intitule = %s AND type= %s",
598 598
             "maintenance_mode", "admin"
599 599
         );
@@ -718,7 +718,7 @@  discard block
 block discarded – undo
718 718
                         array(
719 719
                             'pw' => $encrypt['string'],
720 720
                             'pw_iv' => ""
721
-                       ),
721
+                        ),
722 722
                         "id = %i",
723 723
                         $record['id']
724 724
                     );
@@ -728,7 +728,7 @@  discard block
 block discarded – undo
728 728
                         prefix_table('sk_reencrypt_backup'),
729 729
                         array(
730 730
                             'result' => "ok"
731
-                           ),
731
+                            ),
732 732
                         "id=%i",
733 733
                         $newID
734 734
                     );
@@ -790,7 +790,7 @@  discard block
 block discarded – undo
790 790
                             prefix_table('sk_reencrypt_backup'),
791 791
                             array(
792 792
                                 'result' => "ok"
793
-                               ),
793
+                                ),
794 794
                             "id=%i",
795 795
                             $newID
796 796
                         );
@@ -838,7 +838,7 @@  discard block
 block discarded – undo
838 838
                         array(
839 839
                             'data' => $encrypt['string'],
840 840
                             'encryption_type' => 'defuse'
841
-                       ),
841
+                        ),
842 842
                         "id = %i",
843 843
                         $record['id']
844 844
                     );
@@ -848,7 +848,7 @@  discard block
 block discarded – undo
848 848
                         prefix_table('sk_reencrypt_backup'),
849 849
                         array(
850 850
                             'result' => "ok"
851
-                           ),
851
+                            ),
852 852
                         "id=%i",
853 853
                         $newID
854 854
                     );
@@ -976,7 +976,7 @@  discard block
 block discarded – undo
976 976
                             array(
977 977
                                 'value2' => $backup_filename,
978 978
                                 'result' => "ok"
979
-                               ),
979
+                                ),
980 980
                             "id=%i",
981 981
                             $newID
982 982
                         );
@@ -1035,7 +1035,7 @@  discard block
 block discarded – undo
1035 1035
             prefix_table("misc"),
1036 1036
             array(
1037 1037
                 'valeur' => '0',
1038
-           ),
1038
+            ),
1039 1039
             "intitule = %s AND type= %s",
1040 1040
             "maintenance_mode", "admin"
1041 1041
         );
@@ -1157,7 +1157,7 @@  discard block
 block discarded – undo
1157 1157
                     prefix_table("emails"),
1158 1158
                     array(
1159 1159
                         'status' => "not_sent"
1160
-                   ),
1160
+                    ),
1161 1161
                     "timestamp = %s",
1162 1162
                     $record['timestamp']
1163 1163
                 );
@@ -1381,7 +1381,7 @@  discard block
 block discarded – undo
1381 1381
                                 prefix_table('files'),
1382 1382
                                 array(
1383 1383
                                     'status' => $_POST['option'] === "decrypt" ? "0" : "encrypted"
1384
-                                   ),
1384
+                                    ),
1385 1385
                                 "file=%s",
1386 1386
                                 $file
1387 1387
                             );
@@ -1493,14 +1493,14 @@  discard block
 block discarded – undo
1493 1493
                     'type' => "admin",
1494 1494
                     "intitule" => "api",
1495 1495
                     'valeur' => intval($_POST['status'])
1496
-                   )
1496
+                    )
1497 1497
             );
1498 1498
         } else {
1499 1499
             DB::update(
1500 1500
                 prefix_table("misc"),
1501 1501
                 array(
1502 1502
                     'valeur' => intval($_POST['status'])
1503
-                   ),
1503
+                    ),
1504 1504
                 "type = %s AND intitule = %s",
1505 1505
                 "admin",
1506 1506
                 "api"
@@ -1519,14 +1519,14 @@  discard block
 block discarded – undo
1519 1519
                     'type' => "admin",
1520 1520
                     "intitule" => "duo",
1521 1521
                     'valeur' => intval($_POST['status'])
1522
-                   )
1522
+                    )
1523 1523
             );
1524 1524
         } else {
1525 1525
             DB::update(
1526 1526
                 prefix_table("misc"),
1527 1527
                 array(
1528 1528
                     'valeur' => intval($_POST['status'])
1529
-                   ),
1529
+                    ),
1530 1530
                 "type = %s AND intitule = %s",
1531 1531
                 "admin",
1532 1532
                 "duo"
@@ -1801,7 +1801,7 @@  discard block
 block discarded – undo
1801 1801
                     'valeur' => $dataReceived['value'],
1802 1802
                     'type' => $type,
1803 1803
                     'intitule' => $dataReceived['field']
1804
-                   )
1804
+                    )
1805 1805
             );
1806 1806
             // in case of stats enabled, add the actual time
1807 1807
             if ($dataReceived['field'] == 'send_stats') {
@@ -1811,7 +1811,7 @@  discard block
 block discarded – undo
1811 1811
                         'valeur' => time(),
1812 1812
                         'type' => $type,
1813 1813
                         'intitule' => $dataReceived['field'].'_time'
1814
-                       )
1814
+                        )
1815 1815
                 );
1816 1816
             }
1817 1817
         } else {
@@ -1819,7 +1819,7 @@  discard block
 block discarded – undo
1819 1819
                 prefix_table("misc"),
1820 1820
                 array(
1821 1821
                     'valeur' => $dataReceived['value']
1822
-                   ),
1822
+                    ),
1823 1823
                 "type = %s AND intitule = %s",
1824 1824
                 $type,
1825 1825
                 $dataReceived['field']
@@ -1841,14 +1841,14 @@  discard block
 block discarded – undo
1841 1841
                             'valeur' => 0,
1842 1842
                             'type' => $type,
1843 1843
                             'intitule' => $dataReceived['field'].'_time'
1844
-                           )
1844
+                            )
1845 1845
                     );
1846 1846
                 } else {
1847 1847
                     DB::update(
1848 1848
                         prefix_table("misc"),
1849 1849
                         array(
1850 1850
                             'valeur' => 0
1851
-                           ),
1851
+                            ),
1852 1852
                         "type = %s AND intitule = %s",
1853 1853
                         $type,
1854 1854
                         $dataReceived['field']
@@ -1874,7 +1874,7 @@  discard block
 block discarded – undo
1874 1874
                 prefix_table("misc"),
1875 1875
                 array(
1876 1876
                     'valeur' => 0
1877
-                   ),
1877
+                    ),
1878 1878
                 "type = %s AND intitule = %s",
1879 1879
                 $type,
1880 1880
                 'restricted_to_roles'
@@ -2039,7 +2039,7 @@  discard block
 block discarded – undo
2039 2039
             $ldapconn = ldap_connect($ldapURIs);
2040 2040
 
2041 2041
             if ($dataReceived[0]['ldap_tls_input']) {
2042
-               ldap_start_tls($ldapconn);
2042
+                ldap_start_tls($ldapconn);
2043 2043
             }
2044 2044
 
2045 2045
             $debug_ldap .= "LDAP connection : " . ($ldapconn ? "Connected" : "Failed") . "<br/>";
@@ -2054,15 +2054,15 @@  discard block
 block discarded – undo
2054 2054
                     $filter="(&(" . $dataReceived[0]['ldap_user_attribute']. "=$username)(objectClass=" . $dataReceived[0]['ldap_object_class'] ."))";
2055 2055
                     $result=ldap_search($ldapconn, $dataReceived[0]['ldap_search_base'], $filter, array('dn','mail','givenname','sn'));
2056 2056
                     if (isset($dataReceived[0]['ldap_usergroup'])) {
2057
-                       $filter_group = "memberUid=".$username;
2058
-                       $result_group = ldap_search($ldapconn, $dataReceived[0]['ldap_usergroup'],$filter_group, array('dn'));
2057
+                        $filter_group = "memberUid=".$username;
2058
+                        $result_group = ldap_search($ldapconn, $dataReceived[0]['ldap_usergroup'],$filter_group, array('dn'));
2059 2059
 
2060
-                       $debug_ldap .= 'Search filter (group): ' . $filter_group . "<br/>" .
2060
+                        $debug_ldap .= 'Search filter (group): ' . $filter_group . "<br/>" .
2061 2061
                                     'Results : ' . print_r(ldap_get_entries($ldapconn, $result_group), true) . "<br/>";
2062 2062
 
2063
-                       if (!ldap_count_entries($ldapconn, $result_group)) {
2064
-                               $ldapConnection = "Error - No entries found";
2065
-                       }
2063
+                        if (!ldap_count_entries($ldapconn, $result_group)) {
2064
+                                $ldapConnection = "Error - No entries found";
2065
+                        }
2066 2066
                     }
2067 2067
 
2068 2068
                     $debug_ldap .= 'Search filter : ' . $filter . "<br/>" .
Please login to merge, or discard this patch.
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
     # connection to author's cpassman website
67 67
     case "cpm_status":
68 68
         $text = "<ul>";
69
-        $error ="";
69
+        $error = "";
70 70
         if (!isset($k['admin_no_info']) || (isset($k['admin_no_info']) && $k['admin_no_info'] == 0)) {
71 71
             if (isset($_SESSION['settings']['get_tp_info']) && $_SESSION['settings']['get_tp_info'] == 1) {
72 72
                 $handleDistant = array();
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
                 }
94 94
 
95 95
                 if (count($handleDistant) > 0) {
96
-                    while (list($cle,$val) = each($handleDistant)) {
96
+                    while (list($cle, $val) = each($handleDistant)) {
97 97
                         if (substr($val, 0, 3) == "nom") {
98 98
                             $tab = explode('|', $val);
99 99
                             foreach ($tab as $elem) {
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
         }
119 119
         $text .= "</ul>";
120 120
 
121
-        echo '[{"error":"'.$error.'" , "output":"'. str_replace(array("\n", "\t", "\r"), '', $text).'"}]';
121
+        echo '[{"error":"'.$error.'" , "output":"'.str_replace(array("\n", "\t", "\r"), '', $text).'"}]';
122 122
         break;
123 123
 
124 124
     ###########################################################
@@ -284,30 +284,30 @@  discard block
 block discarded – undo
284 284
                 $numFields = DB::count();
285 285
 
286 286
                 // prepare a drop table
287
-                $return.= 'DROP TABLE '.$table.';';
287
+                $return .= 'DROP TABLE '.$table.';';
288 288
                 $row2 = DB::queryfirstrow('SHOW CREATE TABLE '.$table);
289
-                $return.= "\n\n".$row2["Create Table"].";\n\n";
289
+                $return .= "\n\n".$row2["Create Table"].";\n\n";
290 290
 
291 291
                 //prepare all fields and datas
292 292
                 for ($i = 0; $i < $numFields; $i++) {
293 293
                     while ($row = $result->fetch_row()) {
294
-                        $return.= 'INSERT INTO '.$table.' VALUES(';
295
-                        for ($j=0; $j<$numFields; $j++) {
294
+                        $return .= 'INSERT INTO '.$table.' VALUES(';
295
+                        for ($j = 0; $j < $numFields; $j++) {
296 296
                             $row[$j] = addslashes($row[$j]);
297 297
                             $row[$j] = preg_replace("/\n/", "\\n", $row[$j]);
298 298
                             if (isset($row[$j])) {
299
-                                $return.= '"'.$row[$j].'"';
299
+                                $return .= '"'.$row[$j].'"';
300 300
                             } else {
301
-                                $return.= 'NULL';
301
+                                $return .= 'NULL';
302 302
                             }
303
-                            if ($j<($numFields-1)) {
304
-                                $return.= ',';
303
+                            if ($j < ($numFields - 1)) {
304
+                                $return .= ',';
305 305
                             }
306 306
                         }
307
-                        $return.= ");\n";
307
+                        $return .= ");\n";
308 308
                     }
309 309
                 }
310
-                $return.="\n\n\n";
310
+                $return .= "\n\n\n";
311 311
             }
312 312
         }
313 313
 
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
         if ($handle = fopen($file, "r")) {
371 371
             $query = "";
372 372
             while (!feof($handle)) {
373
-                $query.= fgets($handle, 4096);
373
+                $query .= fgets($handle, 4096);
374 374
                 if (substr(rtrim($query), -1) == ';') {
375 375
                     //launch query
376 376
                     DB::queryRaw($query);
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
                     prefix_table("log_items"),
427 427
                     array(
428 428
                         'id_item'     => $item['id'],
429
-                        'date'         => $rowTmp['date']-1,
429
+                        'date'         => $rowTmp['date'] - 1,
430 430
                         'id_user'     => "",
431 431
                         'action'     => "at_creation",
432 432
                         'raison'    => ""
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
 
450 450
         //delete file
451 451
         while ($f = readdir($dir)) {
452
-            if (is_file($dir.$f) && (time()-filectime($dir.$f)) > 604800) {
452
+            if (is_file($dir.$f) && (time() - filectime($dir.$f)) > 604800) {
453 453
                 deleteFile($dir.$f);
454 454
                 $nbFilesDeleted++;
455 455
             }
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
         $error = "";
478 478
 
479 479
         require_once $_SESSION['settings']['cpassman_dir'].'/sources/main.functions.php';
480
-        $ret = handleConfigFile ("rebuild");
480
+        $ret = handleConfigFile("rebuild");
481 481
 
482 482
         if ($ret !== true) $error = $ret;
483 483
         else $error = "rebuild_config_file";
@@ -635,8 +635,8 @@  discard block
 block discarded – undo
635 635
 
636 636
         // delete previous backup files
637 637
         $files = glob($_SESSION['settings']['path_to_upload_folder'].'/*'); // get all file names
638
-        foreach($files as $file){ // iterate files
639
-            if(is_file($file)) {
638
+        foreach ($files as $file) { // iterate files
639
+            if (is_file($file)) {
640 640
                 $file_parts = pathinfo($file);
641 641
                 if (strpos($file_parts['filename'], ".bck-change-sk") !== false) {
642 642
                     unlink($file); // delete file
@@ -681,7 +681,7 @@  discard block
 block discarded – undo
681 681
                     SELECT id, pw, pw_iv
682 682
                     FROM ".prefix_table("items")."
683 683
                     WHERE perso = %s
684
-                    LIMIT ".filter_var($_POST['start'], FILTER_SANITIZE_NUMBER_INT) .", ". filter_var($_POST['length'], FILTER_SANITIZE_NUMBER_INT),
684
+                    LIMIT ".filter_var($_POST['start'], FILTER_SANITIZE_NUMBER_INT).", ".filter_var($_POST['length'], FILTER_SANITIZE_NUMBER_INT),
685 685
                     "0"
686 686
                 );
687 687
                 foreach ($rows as $record) {
@@ -740,7 +740,7 @@  discard block
 block discarded – undo
740 740
                     SELECT raison, increment_id
741 741
                     FROM ".prefix_table("log_items")."
742 742
                     WHERE action = %s AND raison LIKE 'at_pw :%'
743
-                    LIMIT ".filter_var($_POST['start'], FILTER_SANITIZE_NUMBER_INT) .", ". filter_var($_POST['length'], FILTER_SANITIZE_NUMBER_INT),
743
+                    LIMIT ".filter_var($_POST['start'], FILTER_SANITIZE_NUMBER_INT).", ".filter_var($_POST['length'], FILTER_SANITIZE_NUMBER_INT),
744 744
                     "at_modification"
745 745
                 );
746 746
                 foreach ($rows as $record) {
@@ -802,7 +802,7 @@  discard block
 block discarded – undo
802 802
                 $rows = DB::query("
803 803
                     SELECT id, data
804 804
                     FROM ".prefix_table("categories_items")."
805
-                    LIMIT ".filter_var($_POST['start'], FILTER_SANITIZE_NUMBER_INT) .", ". filter_var($_POST['length'], FILTER_SANITIZE_NUMBER_INT)
805
+                    LIMIT ".filter_var($_POST['start'], FILTER_SANITIZE_NUMBER_INT).", ".filter_var($_POST['length'], FILTER_SANITIZE_NUMBER_INT)
806 806
                 );
807 807
                 foreach ($rows as $record) {
808 808
                     // backup data
@@ -872,7 +872,7 @@  discard block
 block discarded – undo
872 872
                     SELECT id, file
873 873
                     FROM ".prefix_table("files")."
874 874
                     WHERE status = 'encrypted'
875
-                    LIMIT ".filter_var($_POST['start'], FILTER_SANITIZE_NUMBER_INT) .", ". filter_var($_POST['length'], FILTER_SANITIZE_NUMBER_INT)
875
+                    LIMIT ".filter_var($_POST['start'], FILTER_SANITIZE_NUMBER_INT).", ".filter_var($_POST['length'], FILTER_SANITIZE_NUMBER_INT)
876 876
                 );
877 877
                 foreach ($rows as $record) {
878 878
                     // backup data
@@ -1182,7 +1182,7 @@  discard block
 block discarded – undo
1182 1182
         $jCryption = new jCryption();
1183 1183
         $numberOfPairs = 100;
1184 1184
         $arrKeyPairs = array();
1185
-        for ($i=0; $i < $numberOfPairs; $i++) {
1185
+        for ($i = 0; $i < $numberOfPairs; $i++) {
1186 1186
             $arrKeyPairs[] = $jCryption->generateKeypair($keyLength);
1187 1187
         }
1188 1188
         $file = array();
@@ -1190,7 +1190,7 @@  discard block
 block discarded – undo
1190 1190
         $file[] = '$arrKeys = ';
1191 1191
         $file[] = var_export($arrKeyPairs, true);
1192 1192
         $file[] = ';';
1193
-        file_put_contents(SECUREPATH."/".$numberOfPairs . "_". $keyLength . "_keys.inc.php", implode("\n", $file));
1193
+        file_put_contents(SECUREPATH."/".$numberOfPairs."_".$keyLength."_keys.inc.php", implode("\n", $file));
1194 1194
 
1195 1195
         echo '[{"result":"generated_keys_file", "error":""}]';
1196 1196
         break;
@@ -1335,7 +1335,7 @@  discard block
 block discarded – undo
1335 1335
             foreach ($filesList as $file) {
1336 1336
                 if ($cpt < 5) {
1337 1337
                     // skip file is Coherancey not respected
1338
-                    if (is_file($_SESSION['settings']['path_to_upload_folder'].'/'.$file)){
1338
+                    if (is_file($_SESSION['settings']['path_to_upload_folder'].'/'.$file)) {
1339 1339
                         $fp = fopen($_SESSION['settings']['path_to_upload_folder'].'/'.$file, "rb");
1340 1340
                         $line = fgets($fp);
1341 1341
                         $skipFile = false;
@@ -1386,7 +1386,7 @@  discard block
 block discarded – undo
1386 1386
                                 $file
1387 1387
                             );
1388 1388
 
1389
-                            $cpt ++;
1389
+                            $cpt++;
1390 1390
                         }
1391 1391
                     }
1392 1392
                 } else {
@@ -1401,7 +1401,7 @@  discard block
 block discarded – undo
1401 1401
 
1402 1402
             if (empty($newFilesList)) $continu = false;
1403 1403
 
1404
-            echo '[{"error":"'.$error.'", "continu":"'.$continu.'", "list":"'.$newFilesList.'", "cpt":"'.($_POST['cpt']+$cpt).'"}]';
1404
+            echo '[{"error":"'.$error.'", "continu":"'.$continu.'", "list":"'.$newFilesList.'", "cpt":"'.($_POST['cpt'] + $cpt).'"}]';
1405 1405
             break;
1406 1406
 
1407 1407
         /*
@@ -1555,9 +1555,9 @@  discard block
 block discarded – undo
1555 1555
         if (file_exists($filename)) {
1556 1556
             // get sk.php file path
1557 1557
             $settingsFile = file($filename);
1558
-            while (list($key,$val) = each($settingsFile)) {
1559
-                if (substr_count($val, 'require_once "')>0 && substr_count($val, 'sk.php')>0) {
1560
-                    $tmp_skfile = substr($val, 14, strpos($val, '";')-14);
1558
+            while (list($key, $val) = each($settingsFile)) {
1559
+                if (substr_count($val, 'require_once "') > 0 && substr_count($val, 'sk.php') > 0) {
1560
+                    $tmp_skfile = substr($val, 14, strpos($val, '";') - 14);
1561 1561
                 }
1562 1562
             }
1563 1563
 
@@ -1903,7 +1903,7 @@  discard block
 block discarded – undo
1903 1903
         $_SESSION['settings'][$dataReceived['field']] = $dataReceived['value'];
1904 1904
 
1905 1905
         // save change in config file
1906
-        handleConfigFile ("update", $dataReceived['field'], $dataReceived['value']);
1906
+        handleConfigFile("update", $dataReceived['field'], $dataReceived['value']);
1907 1907
 
1908 1908
         // Encrypt data to return
1909 1909
         echo prepareExchangedData(
@@ -2025,8 +2025,8 @@  discard block
 block discarded – undo
2025 2025
         }
2026 2026
         if ($dataReceived[0]['ldap_type'] === 'posix-search') {
2027 2027
             $ldapURIs = "";
2028
-            foreach(explode(",", $dataReceived[0]['ldap_domain_controler']) as $domainControler) {
2029
-                if($dataReceived[0]['ldap_ssl_input'] == 1) {
2028
+            foreach (explode(",", $dataReceived[0]['ldap_domain_controler']) as $domainControler) {
2029
+                if ($dataReceived[0]['ldap_ssl_input'] == 1) {
2030 2030
                     $ldapURIs .= "ldaps://".$domainControler.":".$dataReceived[0]['ldap_port']." ";
2031 2031
                 }
2032 2032
                 else {
@@ -2034,7 +2034,7 @@  discard block
 block discarded – undo
2034 2034
                 }
2035 2035
             }
2036 2036
 
2037
-            $debug_ldap .= "LDAP URIs : " . $ldapURIs . "<br/>";
2037
+            $debug_ldap .= "LDAP URIs : ".$ldapURIs."<br/>";
2038 2038
 
2039 2039
             $ldapconn = ldap_connect($ldapURIs);
2040 2040
 
@@ -2042,31 +2042,31 @@  discard block
 block discarded – undo
2042 2042
                ldap_start_tls($ldapconn);
2043 2043
             }
2044 2044
 
2045
-            $debug_ldap .= "LDAP connection : " . ($ldapconn ? "Connected" : "Failed") . "<br/>";
2045
+            $debug_ldap .= "LDAP connection : ".($ldapconn ? "Connected" : "Failed")."<br/>";
2046 2046
 
2047 2047
             ldap_set_option($ldapconn, LDAP_OPT_PROTOCOL_VERSION, 3);
2048 2048
             if ($ldapconn) {
2049 2049
                 $ldapbind = @ldap_bind($ldapconn, $dataReceived[0]['ldap_bind_dn'], $dataReceived[0]['ldap_bind_passwd']);
2050 2050
 
2051
-                $debug_ldap .= "LDAP bind : " . ($ldapbind ? "Bound" : "Failed") . "<br/>";
2051
+                $debug_ldap .= "LDAP bind : ".($ldapbind ? "Bound" : "Failed")."<br/>";
2052 2052
 
2053 2053
                 if ($ldapbind) {
2054
-                    $filter="(&(" . $dataReceived[0]['ldap_user_attribute']. "=$username)(objectClass=" . $dataReceived[0]['ldap_object_class'] ."))";
2055
-                    $result=ldap_search($ldapconn, $dataReceived[0]['ldap_search_base'], $filter, array('dn','mail','givenname','sn'));
2054
+                    $filter = "(&(".$dataReceived[0]['ldap_user_attribute']."=$username)(objectClass=".$dataReceived[0]['ldap_object_class']."))";
2055
+                    $result = ldap_search($ldapconn, $dataReceived[0]['ldap_search_base'], $filter, array('dn', 'mail', 'givenname', 'sn'));
2056 2056
                     if (isset($dataReceived[0]['ldap_usergroup'])) {
2057 2057
                        $filter_group = "memberUid=".$username;
2058
-                       $result_group = ldap_search($ldapconn, $dataReceived[0]['ldap_usergroup'],$filter_group, array('dn'));
2058
+                       $result_group = ldap_search($ldapconn, $dataReceived[0]['ldap_usergroup'], $filter_group, array('dn'));
2059 2059
 
2060
-                       $debug_ldap .= 'Search filter (group): ' . $filter_group . "<br/>" .
2061
-                                    'Results : ' . print_r(ldap_get_entries($ldapconn, $result_group), true) . "<br/>";
2060
+                       $debug_ldap .= 'Search filter (group): '.$filter_group."<br/>".
2061
+                                    'Results : '.print_r(ldap_get_entries($ldapconn, $result_group), true)."<br/>";
2062 2062
 
2063 2063
                        if (!ldap_count_entries($ldapconn, $result_group)) {
2064 2064
                                $ldapConnection = "Error - No entries found";
2065 2065
                        }
2066 2066
                     }
2067 2067
 
2068
-                    $debug_ldap .= 'Search filter : ' . $filter . "<br/>" .
2069
-                            'Results : ' . print_r(ldap_get_entries($ldapconn, $result), true) . "<br/>";
2068
+                    $debug_ldap .= 'Search filter : '.$filter."<br/>".
2069
+                            'Results : '.print_r(ldap_get_entries($ldapconn, $result), true)."<br/>";
2070 2070
 
2071 2071
                     if (ldap_count_entries($ldapconn, $result)) {
2072 2072
                         // try auth
@@ -2086,12 +2086,12 @@  discard block
 block discarded – undo
2086 2086
                 $ldapConnection = "Error - Could not connect to server!";
2087 2087
             }
2088 2088
         } else {
2089
-            $debug_ldap .= "Get all ldap params: <br/>" .
2090
-                '  - base_dn : '.$dataReceived[0]['ldap_domain_dn']."<br/>" .
2091
-                '  - account_suffix : '.$dataReceived[0]['ldap_suffix']."<br/>" .
2092
-                '  - domain_controllers : '.$dataReceived[0]['ldap_domain_controler']."<br/>" .
2093
-                '  - port : '.$dataReceived[0]['ldap_port']."<br/>" .
2094
-                '  - use_ssl : '.$dataReceived[0]['ldap_ssl_input']."<br/>" .
2089
+            $debug_ldap .= "Get all ldap params: <br/>".
2090
+                '  - base_dn : '.$dataReceived[0]['ldap_domain_dn']."<br/>".
2091
+                '  - account_suffix : '.$dataReceived[0]['ldap_suffix']."<br/>".
2092
+                '  - domain_controllers : '.$dataReceived[0]['ldap_domain_controler']."<br/>".
2093
+                '  - port : '.$dataReceived[0]['ldap_port']."<br/>".
2094
+                '  - use_ssl : '.$dataReceived[0]['ldap_ssl_input']."<br/>".
2095 2095
                 '  - use_tls : '.$dataReceived[0]['ldap_tls_input']."<br/>*********<br/>";
2096 2096
 
2097 2097
             $adldap = new SplClassLoader('adLDAP', '../includes/libraries/LDAP');
@@ -2131,7 +2131,7 @@  discard block
 block discarded – undo
2131 2131
                 $ldapConnection = "Not possible to get connected with this user";
2132 2132
             }
2133 2133
 
2134
-            $debug_ldap .= "After authenticate : ".$adldap->getLastError()."<br/><br/>" .
2134
+            $debug_ldap .= "After authenticate : ".$adldap->getLastError()."<br/><br/>".
2135 2135
                 "ldap status : ".$ldapConnection; //Debug
2136 2136
         }
2137 2137
 
@@ -2147,7 +2147,7 @@  discard block
 block discarded – undo
2147 2147
         }
2148 2148
 
2149 2149
         if ($result = DB::query("SHOW TABLES LIKE '".prefix_table("sk_reencrypt_backup")."'")) {
2150
-            if(DB::count() === 1) {
2150
+            if (DB::count() === 1) {
2151 2151
                 echo "1";
2152 2152
             } else {
2153 2153
                 echo "0";
Please login to merge, or discard this patch.
Braces   +20 added lines, -19 removed lines patch added patch discarded remove patch
@@ -479,8 +479,11 @@  discard block
 block discarded – undo
479 479
         require_once $_SESSION['settings']['cpassman_dir'].'/sources/main.functions.php';
480 480
         $ret = handleConfigFile ("rebuild");
481 481
 
482
-        if ($ret !== true) $error = $ret;
483
-        else $error = "rebuild_config_file";
482
+        if ($ret !== true) {
483
+            $error = $ret;
484
+        } else {
485
+            $error = "rebuild_config_file";
486
+        }
484 487
 
485 488
         echo '[{"result":"'.$error.'"}]';
486 489
         break;
@@ -522,8 +525,7 @@  discard block
 block discarded – undo
522 525
                         $_SESSION['settings']['bck_script_path'].'/'.str_replace('encrypted', 'clear', $_POST['option']).'.sql',
523 526
                         $_SESSION['settings']['bck_script_key']
524 527
                     );
525
-                }
526
-                catch (Defuse\Crypto\Exception\WrongKeyOrModifiedCiphertextException $ex) {
528
+                } catch (Defuse\Crypto\Exception\WrongKeyOrModifiedCiphertextException $ex) {
527 529
                     $err = "An attack! Either the wrong key was loaded, or the ciphertext has changed since it was created either corrupted in the database or intentionally modified by someone trying to carry out an attack.";
528 530
                 }
529 531
 
@@ -1399,7 +1401,9 @@  discard block
 block discarded – undo
1399 1401
                 }
1400 1402
             }
1401 1403
 
1402
-            if (empty($newFilesList)) $continu = false;
1404
+            if (empty($newFilesList)) {
1405
+                $continu = false;
1406
+            }
1403 1407
 
1404 1408
             echo '[{"error":"'.$error.'", "continu":"'.$continu.'", "list":"'.$newFilesList.'", "cpt":"'.($_POST['cpt']+$cpt).'"}]';
1405 1409
             break;
@@ -1421,8 +1425,7 @@  discard block
 block discarded – undo
1421 1425
                         'timestamp' => time()
1422 1426
                     )
1423 1427
                 );
1424
-            }
1425
-            else
1428
+            } else
1426 1429
             // update existing key
1427 1430
             if (isset($_POST['action']) && $_POST['action'] == "update") {
1428 1431
                 DB::update(
@@ -1434,8 +1437,7 @@  discard block
 block discarded – undo
1434 1437
                     "id=%i",
1435 1438
                     $_POST['id']
1436 1439
                 );
1437
-            }
1438
-            else
1440
+            } else
1439 1441
             // delete existing key
1440 1442
             if (isset($_POST['action']) && $_POST['action'] == "delete") {
1441 1443
                 DB::query("DELETE FROM ".prefix_table("api")." WHERE id = %i", $_POST['id']);
@@ -1460,8 +1462,7 @@  discard block
 block discarded – undo
1460 1462
                     'timestamp' => time()
1461 1463
                 )
1462 1464
             );
1463
-        }
1464
-        else
1465
+        } else
1465 1466
             // update existing key
1466 1467
             if (isset($_POST['action']) && $_POST['action'] == "update") {
1467 1468
                 DB::update(
@@ -1474,8 +1475,7 @@  discard block
 block discarded – undo
1474 1475
                     "id=%i",
1475 1476
                     $_POST['id']
1476 1477
                 );
1477
-            }
1478
-        else
1478
+            } else
1479 1479
             // delete existing key
1480 1480
             if (isset($_POST['action']) && $_POST['action'] == "delete") {
1481 1481
                 DB::query("DELETE FROM ".prefix_table("api")." WHERE id=%i", $_POST['id']);
@@ -1617,8 +1617,11 @@  discard block
 block discarded – undo
1617 1617
         $dataReceived = prepareExchangedData($_POST['data'], "decode");
1618 1618
 
1619 1619
         // Google Authentication
1620
-        if (htmlspecialchars_decode($dataReceived['google_authentication']) == "false") $tmp = 0;
1621
-        else $tmp = 1;
1620
+        if (htmlspecialchars_decode($dataReceived['google_authentication']) == "false") {
1621
+            $tmp = 0;
1622
+        } else {
1623
+            $tmp = 1;
1624
+        }
1622 1625
         DB::query("SELECT * FROM ".prefix_table("misc")." WHERE type = %s AND intitule = %s", "admin", "google_authentication");
1623 1626
         $counter = DB::count();
1624 1627
         if ($counter == 0) {
@@ -2028,8 +2031,7 @@  discard block
 block discarded – undo
2028 2031
             foreach(explode(",", $dataReceived[0]['ldap_domain_controler']) as $domainControler) {
2029 2032
                 if($dataReceived[0]['ldap_ssl_input'] == 1) {
2030 2033
                     $ldapURIs .= "ldaps://".$domainControler.":".$dataReceived[0]['ldap_port']." ";
2031
-                }
2032
-                else {
2034
+                } else {
2033 2035
                     $ldapURIs .= "ldap://".$domainControler.":".$dataReceived[0]['ldap_port']." ";
2034 2036
                 }
2035 2037
             }
@@ -2100,8 +2102,7 @@  discard block
 block discarded – undo
2100 2102
             // Posix style LDAP handles user searches a bit differently
2101 2103
             if ($dataReceived[0]['ldap_type'] === 'posix') {
2102 2104
                 $ldap_suffix = ','.$dataReceived[0]['ldap_suffix'].','.$dataReceived[0]['ldap_domain_dn'];
2103
-            }
2104
-            elseif ($dataReceived[0]['ldap_type'] === 'windows' && $ldap_suffix === '') { //Multiple Domain Names
2105
+            } elseif ($dataReceived[0]['ldap_type'] === 'windows' && $ldap_suffix === '') { //Multiple Domain Names
2105 2106
                 $ldap_suffix = $dataReceived[0]['ldap_suffix'];
2106 2107
             }
2107 2108
             $adldap = new adLDAP\adLDAP(
Please login to merge, or discard this patch.
sources/SplClassLoader.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -126,11 +126,11 @@
 block discarded – undo
126 126
             if (false !== ($lastNsPos = strripos($className, $this->_namespaceSeparator))) {
127 127
                 $namespace = substr($className, 0, $lastNsPos);
128 128
                 $className = substr($className, $lastNsPos + 1);
129
-                $fileName = str_replace($this->_namespaceSeparator, DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR;
129
+                $fileName = str_replace($this->_namespaceSeparator, DIRECTORY_SEPARATOR, $namespace).DIRECTORY_SEPARATOR;
130 130
             }
131
-            $fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className) . $this->_fileExtension;
131
+            $fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className).$this->_fileExtension;
132 132
 
133
-            require ($this->_includePath !== null ? $this->_includePath . DIRECTORY_SEPARATOR : '') . $fileName;
133
+            require ($this->_includePath !== null ? $this->_includePath.DIRECTORY_SEPARATOR : '').$fileName;
134 134
         }
135 135
     }
136 136
 }
Please login to merge, or discard this patch.
items.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
         "id" => $record['id'],
48 48
         "login" => $record['login'],
49 49
         "email" => $record['email'],
50
-       );
50
+        );
51 51
     $usersString .= $record['id']."#".$record['login'].";";
52 52
 }
53 53
 // Get list of roles
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
     $arrRoles[$reccord['title']] = array(
59 59
         'id' => $reccord['id'],
60 60
         'title' => $reccord['title']
61
-       );
61
+        );
62 62
     if (empty($listRoles)) {
63 63
         $listRoles = $reccord['id'].'#'.$reccord['title'];
64 64
     } else {
Please login to merge, or discard this patch.
Spacing   +14 added lines, -16 removed lines patch added patch discarded remove patch
@@ -115,8 +115,8 @@  discard block
 block discarded – undo
115 115
 }
116 116
 // Is personal SK available
117 117
 echo '
118
-<input type="hidden" name="personal_sk_set" id="personal_sk_set" value="', isset($_SESSION['user_settings']['session_psk']) && !empty($_SESSION['user_settings']['session_psk']) ? '1':'0', '" />
119
-<input type="hidden" id="personal_upgrade_needed" value="', isset($_SESSION['settings']['enable_pf_feature']) && $_SESSION['settings']['enable_pf_feature'] == 1 && $_SESSION['user_admin'] != 1 && isset($_SESSION['user_upgrade_needed']) && $_SESSION['user_upgrade_needed'] == 1 ? '1':'0', '" />';
118
+<input type="hidden" name="personal_sk_set" id="personal_sk_set" value="', isset($_SESSION['user_settings']['session_psk']) && !empty($_SESSION['user_settings']['session_psk']) ? '1' : '0', '" />
119
+<input type="hidden" id="personal_upgrade_needed" value="', isset($_SESSION['settings']['enable_pf_feature']) && $_SESSION['settings']['enable_pf_feature'] == 1 && $_SESSION['user_admin'] != 1 && isset($_SESSION['user_upgrade_needed']) && $_SESSION['user_upgrade_needed'] == 1 ? '1' : '0', '" />';
120 120
 // define what group todisplay in Tree
121 121
 if (isset($_COOKIE['jstree_select']) && !empty($_COOKIE['jstree_select'])) {
122 122
     $firstGroup = str_replace("#li_", "", $_COOKIE['jstree_select']);
@@ -147,9 +147,9 @@  discard block
 block discarded – undo
147 147
                         <li onclick="open_move_group_div()"><i class="fa fa-arrows fa-fw"></i>&nbsp; '.$LANG['item_menu_mov_rep'].'</li>
148 148
                         <li onclick="open_del_group_div()"><i class="fa fa-eraser fa-fw"></i>&nbsp; '.$LANG['item_menu_del_rep'].'</li>
149 149
                         <li onclick="$(\'#div_copy_folder\').dialog(\'open\');"><i class="fa fa-copy fa-fw"></i>&nbsp; '.$LANG['copy_folder'].'</li>
150
-                        ', isset($_SESSION['settings']['allow_import']) && $_SESSION['settings']['allow_import'] == 1 && $_SESSION['user_admin'] != 1 ? '<li onclick="loadImportDialog()"><i class="fa fa-cloud-upload fa-fw"></i>&nbsp; '.$LANG['import_csv_menu_title'].'</li>' : '' ,
151
-                        (isset($_SESSION['settings']['allow_print']) && $_SESSION['settings']['allow_print'] == 1 && $_SESSION['user_admin'] != 1 && $_SESSION['temporary']['user_can_printout'] == true) ? '<li onclick="loadExportDialog()"><i class="fa fa-cloud-download fa-fw"></i>&nbsp; '.$LANG['print_out_menu_title'].'</li>' : '' ,
152
-                        (isset($_SESSION['settings']['settings_offline_mode']) && $_SESSION['settings']['settings_offline_mode'] == 1 && $_SESSION['user_admin'] != 1) ? '<li onclick="loadOfflineDialog()"><i class="fa fa-laptop fa-fw"></i>&nbsp; '.$LANG['offline_menu_title'].'</li>' : '' , '
150
+                        ', isset($_SESSION['settings']['allow_import']) && $_SESSION['settings']['allow_import'] == 1 && $_SESSION['user_admin'] != 1 ? '<li onclick="loadImportDialog()"><i class="fa fa-cloud-upload fa-fw"></i>&nbsp; '.$LANG['import_csv_menu_title'].'</li>' : '',
151
+                        (isset($_SESSION['settings']['allow_print']) && $_SESSION['settings']['allow_print'] == 1 && $_SESSION['user_admin'] != 1 && $_SESSION['temporary']['user_can_printout'] == true) ? '<li onclick="loadExportDialog()"><i class="fa fa-cloud-download fa-fw"></i>&nbsp; '.$LANG['print_out_menu_title'].'</li>' : '',
152
+                        (isset($_SESSION['settings']['settings_offline_mode']) && $_SESSION['settings']['settings_offline_mode'] == 1 && $_SESSION['user_admin'] != 1) ? '<li onclick="loadOfflineDialog()"><i class="fa fa-laptop fa-fw"></i>&nbsp; '.$LANG['offline_menu_title'].'</li>' : '', '
153 153
                     </ul>
154 154
                 </li>
155 155
             </ul>
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
                         <li><i class="fa fa-bars"></i>
173 173
                             <ul class="menu_250">
174 174
                                 <li id="menu_button_add_item" onclick="open_add_item_div()"><i class="fa fa-plus fa-fw"></i>&nbsp; '.$LANG['item_menu_add_elem'].'</li>
175
-                                <li id="menu_button_edit_item" onclick="open_edit_item_div(', isset($_SESSION['settings']['restricted_to_roles']) && $_SESSION['settings']['restricted_to_roles'] == 1 ? 1 : 0 , ')"><i class="fa fa-pencil fa-fw"></i>&nbsp; '.$LANG['item_menu_edi_elem'].'</li>
175
+                                <li id="menu_button_edit_item" onclick="open_edit_item_div(', isset($_SESSION['settings']['restricted_to_roles']) && $_SESSION['settings']['restricted_to_roles'] == 1 ? 1 : 0, ')"><i class="fa fa-pencil fa-fw"></i>&nbsp; '.$LANG['item_menu_edi_elem'].'</li>
176 176
                                 <li id="menu_button_del_item" onclick="open_del_item_div()"><i class="fa fa-eraser fa-fw"></i>&nbsp; '.$LANG['item_menu_del_elem'].'</li>
177 177
                                 <li id="menu_button_copy_item" onclick="open_copy_item_to_folder_div()"><i class="fa fa-copy fa-fw"></i>&nbsp; '.$LANG['item_menu_copy_elem'].'</li>
178 178
                             </ul>
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
                                         (isset($_SESSION['settings']['otv_is_enabled']) && $_SESSION['settings']['otv_is_enabled'] == 1) ? '<li id="menu_button_otv" onclick="prepareOneTimeView()"><i class="fa fa-users fa-fw"></i>&nbsp; '.$LANG['one_time_item_view'].'</li>' : '', '
229 229
                                         ', isset($_SESSION['settings']['enable_email_notification_on_item_shown']) && $_SESSION['settings']['enable_email_notification_on_item_shown'] == 1 ? '
230 230
                                         <li id="menu_button_notify"><i class="fa fa-volume-up fa-fw"></i>&nbsp; '.$LANG['notify_me_on_change'].'</li>' : '', '
231
-                                        ', isset($_SESSION['settings']['enable_server_password_change']) && $_SESSION['settings']['enable_server_password_change'] == 1 && isset($_SESSION['user_read_only']) && $_SESSION['user_read_only'] !== "1"? '
231
+                                        ', isset($_SESSION['settings']['enable_server_password_change']) && $_SESSION['settings']['enable_server_password_change'] == 1 && isset($_SESSION['user_read_only']) && $_SESSION['user_read_only'] !== "1" ? '
232 232
                                         <li onclick="serverAutoChangePwd()"><i class="fa fa-server fa-fw"></i>&nbsp; '.$LANG['update_server_password'].'</li>' : '', '
233 233
                                         ', isset($_SESSION['settings']['enable_suggestion']) && $_SESSION['settings']['enable_suggestion'] == 1 ? '
234 234
                                         <li onclick="OpenDialog(\'div_suggest_change\', \'false\')"><i class="fa fa-random fa-fw"></i>&nbsp; '.$LANG['suggest_password_change'].'</li>' : '', '
@@ -397,8 +397,7 @@  discard block
 block discarded – undo
397 397
             <li><a href="#tabs-02">'.$LANG['index_password'].' &amp; '.$LANG['visibility'].'</a></li>
398 398
             <li><a href="#tabs-03">'.$LANG['files_&_images'].'</a></li>
399 399
             ', isset($_SESSION['settings']['item_extra_fields']) && $_SESSION['settings']['item_extra_fields'] == 1 ?
400
-            '<li id="form_tab_fields"><a href="#tabs-04">'.$LANG['more'].'</a></li>' :
401
-            '', '
400
+            '<li id="form_tab_fields"><a href="#tabs-04">'.$LANG['more'].'</a></li>' : '', '
402 401
         </ul>
403 402
         <div id="tabs-01">';
404 403
 // Line for LABEL
@@ -491,7 +490,7 @@  discard block
 block discarded – undo
491 490
             <input type="text" name="item_tags" id="item_tags" class="input_text text ui-widget-content ui-corner-all" />';
492 491
 // Line for Item modification
493 492
 echo '
494
-            <div style="width:100%;margin:0px 0px 6px 0px;', isset($_SESSION['settings']['anyone_can_modify']) && $_SESSION['settings']['anyone_can_modify'] == 1 ? '':'display:none;', '">
493
+            <div style="width:100%;margin:0px 0px 6px 0px;', isset($_SESSION['settings']['anyone_can_modify']) && $_SESSION['settings']['anyone_can_modify'] == 1 ? '' : 'display:none;', '">
495 494
                 <input type="checkbox" name="anyone_can_modify" id="anyone_can_modify"',
496 495
                     isset($_SESSION['settings']['anyone_can_modify_bydefault'])
497 496
                     && $_SESSION['settings']['anyone_can_modify_bydefault'] == 1 ?
@@ -500,7 +499,7 @@  discard block
 block discarded – undo
500 499
             </div>';
501 500
 // Line for Item automatically deleted
502 501
 echo '
503
-            <div style="width:100%;margin:0px 0px 6px 0px;', isset($_SESSION['settings']['enable_delete_after_consultation']) && $_SESSION['settings']['enable_delete_after_consultation'] == 1 ? '':'display:none;', '">
502
+            <div style="width:100%;margin:0px 0px 6px 0px;', isset($_SESSION['settings']['enable_delete_after_consultation']) && $_SESSION['settings']['enable_delete_after_consultation'] == 1 ? '' : 'display:none;', '">
504 503
                 <input type="checkbox" name="enable_delete_after_consultation" id="enable_delete_after_consultation" />
505 504
                 <label for="enable_delete_after_consultation">'.$LANG['enable_delete_after_consultation'].'</label>
506 505
                 <input type="text" value="1" size="1" id="times_before_deletion" />&nbsp;'.$LANG['times'].'&nbsp;
@@ -585,8 +584,7 @@  discard block
 block discarded – undo
585 584
             <li><a href="#tabs-2">'.$LANG['index_password'].' &amp; '.$LANG['visibility'].'</a></li>
586 585
             <li><a href="#tabs-3">'.$LANG['files_&_images'].'</a></li>
587 586
             ', isset($_SESSION['settings']['item_extra_fields']) && $_SESSION['settings']['item_extra_fields'] == 1 ?
588
-            '<li id="form_edit_tab_fields"><a href="#tabs-4">'.$LANG['more'].'</a></li>' :
589
-            '', '
587
+            '<li id="form_edit_tab_fields"><a href="#tabs-4">'.$LANG['more'].'</a></li>' : '', '
590 588
         </ul>
591 589
         <div id="tabs-1">
592 590
             <label for="" class="cpm_label">'.$LANG['label'].' : </label>
@@ -679,7 +677,7 @@  discard block
 block discarded – undo
679 677
             <input type="text" size="50" name="edit_tags" id="edit_tags" class="input_text text ui-widget-content ui-corner-all" />';
680 678
 // Line for Item modification
681 679
 echo '
682
-            <div style="width:100%;margin:0px 0px 6px 0px;', isset($_SESSION['settings']['anyone_can_modify']) && $_SESSION['settings']['anyone_can_modify'] == 1 ? '':'display:none;', '">
680
+            <div style="width:100%;margin:0px 0px 6px 0px;', isset($_SESSION['settings']['anyone_can_modify']) && $_SESSION['settings']['anyone_can_modify'] == 1 ? '' : 'display:none;', '">
683 681
                 <input type="checkbox" name="edit_anyone_can_modify" id="edit_anyone_can_modify"',
684 682
                     isset($_SESSION['settings']['anyone_can_modify_bydefault'])
685 683
                     && $_SESSION['settings']['anyone_can_modify_bydefault'] == 1 ?
@@ -688,7 +686,7 @@  discard block
 block discarded – undo
688 686
             </div>';
689 687
 // Line for Item automatically deleted
690 688
 echo '
691
-            <div id="edit_to_be_deleted" style="width:100%;margin:0px 0px 6px 0px;', isset($_SESSION['settings']['enable_delete_after_consultation']) && $_SESSION['settings']['enable_delete_after_consultation'] == 1 ? '':'display:none;', '">
689
+            <div id="edit_to_be_deleted" style="width:100%;margin:0px 0px 6px 0px;', isset($_SESSION['settings']['enable_delete_after_consultation']) && $_SESSION['settings']['enable_delete_after_consultation'] == 1 ? '' : 'display:none;', '">
692 690
                 <input type="checkbox" name="edit_enable_delete_after_consultation" id="edit_enable_delete_after_consultation" />
693 691
                 <label for="edit_enable_delete_after_consultation">'.$LANG['enable_delete_after_consultation'].'</label>
694 692
                 <input type="text" value="" size="1" id="edit_times_before_deletion" onchange="$(\'#edit_deletion_after_date\').val(\'\')" />&nbsp;'.$LANG['times'].'&nbsp;
@@ -901,7 +899,7 @@  discard block
 block discarded – undo
901 899
         <div>'.$LANG['item_copy_to_folder'].'</div>
902 900
         <div style="margin:10px;">
903 901
             <select id="copy_in_folder" style="width:300px;">
904
-                ', (isset($_SESSION['can_create_root_folder']) && $_SESSION['can_create_root_folder'] == 1) ? '<option value="0">'.$LANG['root'].'</option>' : '', '' .
902
+                ', (isset($_SESSION['can_create_root_folder']) && $_SESSION['can_create_root_folder'] == 1) ? '<option value="0">'.$LANG['root'].'</option>' : '', ''.
905 903
             '</select>
906 904
         </div>
907 905
     </div>
Please login to merge, or discard this patch.
index.php 2 patches
Spacing   +5 added lines, -6 removed lines patch added patch discarded remove patch
@@ -266,8 +266,7 @@  discard block
 block discarded – undo
266 266
                     <ul class="menu" style="">
267 267
                         <li class="" style="padding:4px;width:40px; text-align:center;"><i class="fa fa-dashboard fa-fw"></i>&nbsp;
268 268
                             <ul class="menu_200" style="text-align:left;">',
269
-                                ($_SESSION['user_admin'] == 1 && $k['admin_full_right'] == true) ? '' :
270
-                                isset($_SESSION['settings']['enable_pf_feature']) && $_SESSION['settings']['enable_pf_feature'] == 1 ? '
269
+                                ($_SESSION['user_admin'] == 1 && $k['admin_full_right'] == true) ? '' : isset($_SESSION['settings']['enable_pf_feature']) && $_SESSION['settings']['enable_pf_feature'] == 1 ? '
271 270
                                 <li onclick="$(\'#div_set_personal_saltkey\').dialog(\'open\')">
272 271
                                     <i class="fa fa-key fa-fw"></i> &nbsp;'.$LANG['home_personal_saltkey_button'].'
273 272
                                 </li>' : '', '
@@ -535,7 +534,7 @@  discard block
 block discarded – undo
535 534
             if ($_SESSION['user_admin'] == 1) {
536 535
                 include($mngPages[$_GET['page']]);
537 536
             } elseif ($_SESSION['user_manager'] == 1) {
538
-                if (($_GET['page'] != "manage_main" &&  $_GET['page'] != "manage_settings")) {
537
+                if (($_GET['page'] != "manage_main" && $_GET['page'] != "manage_settings")) {
539 538
                     include($mngPages[$_GET['page']]);
540 539
                 } else {
541 540
                     $_SESSION['error']['code'] = ERR_NOT_ALLOWED; //not allowed page
@@ -667,7 +666,7 @@  discard block
 block discarded – undo
667 666
         echo '
668 667
                         <div style="margin-bottom:3px;">
669 668
                             <label for="duree_session" class="">'.$LANG['index_session_duration'].'&nbsp;('.$LANG['minutes'].') </label>
670
-                            <input type="text" size="4" id="duree_session" name="duree_session" value="', isset($_SESSION['settings']['default_session_expiration_time']) ? $_SESSION['settings']['default_session_expiration_time'] : "60" ,'" onkeypress="if (event.keyCode == 13) launchIdentify(\'', isset($_SESSION['settings']['duo']) && $_SESSION['settings']['duo'] == 1 ? 1 : '', '\', \''.$nextUrl.'\')" class="input_text text ui-widget-content ui-corner-all numeric_only" />
669
+                            <input type="text" size="4" id="duree_session" name="duree_session" value="', isset($_SESSION['settings']['default_session_expiration_time']) ? $_SESSION['settings']['default_session_expiration_time'] : "60", '" onkeypress="if (event.keyCode == 13) launchIdentify(\'', isset($_SESSION['settings']['duo']) && $_SESSION['settings']['duo'] == 1 ? 1 : '', '\', \''.$nextUrl.'\')" class="input_text text ui-widget-content ui-corner-all numeric_only" />
671 670
                         </div>
672 671
 
673 672
                         <div style="text-align:center;margin-top:5px;font-size:10pt;">
@@ -713,7 +712,7 @@  discard block
 block discarded – undo
713 712
             ', (isset($_SESSION['user_id']) && !empty($_SESSION['user_id'])) ? '<i class="fa fa-users"></i>&nbsp;'.$_SESSION['nb_users_online'].'&nbsp;'.$LANG['users_online'].'&nbsp;|&nbsp;<i class="fa fa-hourglass-end"></i>&nbsp;'.$LANG['index_expiration_in'].'&nbsp;<div style="display:inline;" id="countdown"></div>' : '', '
714 713
         </div><div id="countdown2"></div>
715 714
         <div style="float:right;text-align:right;">
716
-            <i class="fa fa-clock-o"></i>&nbsp;'. $LANG['server_time']." : ".@date($_SESSION['settings']['date_format'], $_SERVER['REQUEST_TIME'])." - ".@date($_SESSION['settings']['time_format'], $_SERVER['REQUEST_TIME']) .'
715
+            <i class="fa fa-clock-o"></i>&nbsp;'. $LANG['server_time']." : ".@date($_SESSION['settings']['date_format'], $_SERVER['REQUEST_TIME'])." - ".@date($_SESSION['settings']['time_format'], $_SERVER['REQUEST_TIME']).'
717 716
         </div>
718 717
     </div>';
719 718
 // PAGE LOADING
@@ -773,7 +772,7 @@  discard block
 block discarded – undo
773 772
 echo '
774 773
 <div id="div_increase_session_time" style="display:none;padding:4px;">
775 774
     <b>'.$LANG['index_session_duration'].':</b>
776
-    <input type="text" id="input_session_duration" style="width:50px;padding:5px;margin:0 10px 0 10px;" class="text ui-widget-content ui-corner-all" value="', isset($_SESSION['user_settings']['session_duration']) ? $_SESSION['user_settings']['session_duration']/60 : 60, '" />
775
+    <input type="text" id="input_session_duration" style="width:50px;padding:5px;margin:0 10px 0 10px;" class="text ui-widget-content ui-corner-all" value="', isset($_SESSION['user_settings']['session_duration']) ? $_SESSION['user_settings']['session_duration'] / 60 : 60, '" />
777 776
     <b>'.$LANG['minutes'].'</b>
778 777
     <div style="display:none;margin-top:5px;text-align:center;padding:4px;" id="input_session_duration_warning" class="ui-widget-content ui-state-error ui-corner-all"></div>
779 778
 </div>';
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -161,8 +161,9 @@
 block discarded – undo
161 161
 <?php
162 162
 
163 163
 // load HEADERS
164
-if (isset($_SESSION['CPM']))
164
+if (isset($_SESSION['CPM'])) {
165 165
     echo $htmlHeaders;
166
+}
166 167
 ?>
167 168
     </head>
168 169
 
Please login to merge, or discard this patch.
admin.settings_api.php 3 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -182,13 +182,13 @@  discard block
 block discarded – undo
182 182
  	 	    </td>
183 183
       	<td>
184 184
         <div id="api_ips_list">';
185
-          $data = DB::query(
185
+            $data = DB::query(
186 186
             "SELECT id, label, value FROM ".prefix_table("api")."
187 187
             WHERE type = %s",
188 188
             'ip'
189
-          );
190
-          $counter = DB::count();
191
-          if ($counter != 0) {
189
+            );
190
+            $counter = DB::count();
191
+            if ($counter != 0) {
192 192
             echo '
193 193
             <table id="tbl_ips">
194 194
               <thead>
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
                     'ip'
207 207
                 );
208 208
                 foreach ($rows as $record) {
209
-                  echo '
209
+                    echo '
210 210
                   <tr id="apiid'.$record['id'].'">
211 211
                     <td id="apiid'.$record['id'].'label">'.$record['label'].'</td>
212 212
                     <td id="apiid'.$record['id'].'value">'.$record['value'].'</td>
@@ -215,13 +215,13 @@  discard block
 block discarded – undo
215 215
                       <i class="fa fa-trash mi-red tip" onclick="deleteApiKey(\''.$record['id'].'\')" title="'.htmlentities(strip_tags($LANG['del_button']), ENT_QUOTES).'"></i></td>
216 216
                   </tr>';
217 217
                 }
218
-              echo '
218
+                echo '
219 219
               </tbody>
220 220
             </table>
221 221
             ';
222
-          }else {
222
+            }else {
223 223
             echo $LANG['settings_api_world_open'];
224
-          }
224
+            }
225 225
         echo '
226 226
         </div>
227 227
         <br />
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -219,7 +219,7 @@
 block discarded – undo
219 219
               </tbody>
220 220
             </table>
221 221
             ';
222
-          }else {
222
+          } else {
223 223
             echo $LANG['settings_api_world_open'];
224 224
           }
225 225
         echo '
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -219,7 +219,7 @@
 block discarded – undo
219 219
               </tbody>
220 220
             </table>
221 221
             ';
222
-          }else {
222
+          } else {
223 223
             echo $LANG['settings_api_world_open'];
224 224
           }
225 225
         echo '
Please login to merge, or discard this patch.