Passed
Push — development ( 8a50f9...cdd69c )
by Nils
04:41
created
includes/language/bulgarian.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 14
  */
15 15
 global $LANG;
16
-$LANG = array (
16
+$LANG = array(
17 17
     'report_a_bug' => 'Report a Bug',
18 18
     'user_profile_api_key' => 'Your API key',
19 19
     'settings_ldap_and_local_authentication' => 'Local and LDAP users',
Please login to merge, or discard this patch.
includes/language/chinese.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 14
  */
15 15
 global $LANG;
16
-$LANG = array (
16
+$LANG = array(
17 17
     'report_a_bug' => 'Report a Bug',
18 18
     'user_profile_api_key' => 'Your API key',
19 19
     'settings_ldap_and_local_authentication' => 'Local and LDAP users',
Please login to merge, or discard this patch.
sources/identify.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -446,10 +446,10 @@  discard block
 block discarded – undo
446 446
                 if (($SETTINGS['ldap_bind_dn'] === "" && $SETTINGS['ldap_bind_passwd'] === "") || $ldapbind === true) {
447 447
                     $filter = "(&(".$SETTINGS['ldap_user_attribute']."=".$username.")(objectClass=".$SETTINGS['ldap_object_class']."))";
448 448
                     $result = ldap_search(
449
-                      $ldapconn,
450
-                      $SETTINGS['ldap_search_base'],
451
-                      $filter,
452
-                      array('dn', 'mail', 'givenname', 'sn')
449
+                        $ldapconn,
450
+                        $SETTINGS['ldap_search_base'],
451
+                        $filter,
452
+                        array('dn', 'mail', 'givenname', 'sn')
453 453
                     );
454 454
                     if ($debugLdap == 1) {
455 455
                         fputs(
@@ -496,11 +496,11 @@  discard block
 block discarded – undo
496 496
                                 if ($entries['count'] > 0) {
497 497
                                     // Now check if group fits
498 498
                                     for ($i=0; $i<$entries['count']; $i++) {
499
-                                      $parsr=ldap_explode_dn($entries[$i]['dn'], 0);
500
-                                      if (str_replace(array('CN=','cn='), '', $parsr[0]) === $SETTINGS['ldap_usergroup']) {
499
+                                        $parsr=ldap_explode_dn($entries[$i]['dn'], 0);
500
+                                        if (str_replace(array('CN=','cn='), '', $parsr[0]) === $SETTINGS['ldap_usergroup']) {
501 501
                                         $GroupRestrictionEnabled = true;
502 502
                                         break;
503
-                                      }
503
+                                        }
504 504
                                     }
505 505
 
506 506
                                 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -495,9 +495,9 @@
 block discarded – undo
495 495
 
496 496
                                 if ($entries['count'] > 0) {
497 497
                                     // Now check if group fits
498
-                                    for ($i=0; $i<$entries['count']; $i++) {
499
-                                      $parsr=ldap_explode_dn($entries[$i]['dn'], 0);
500
-                                      if (str_replace(array('CN=','cn='), '', $parsr[0]) === $SETTINGS['ldap_usergroup']) {
498
+                                    for ($i = 0; $i < $entries['count']; $i++) {
499
+                                      $parsr = ldap_explode_dn($entries[$i]['dn'], 0);
500
+                                      if (str_replace(array('CN=', 'cn='), '', $parsr[0]) === $SETTINGS['ldap_usergroup']) {
501 501
                                         $GroupRestrictionEnabled = true;
502 502
                                         break;
503 503
                                       }
Please login to merge, or discard this patch.
includes/language/english.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 14
  */
15 15
 global $LANG;
16
-$LANG = array (
16
+$LANG = array(
17 17
     'at_user_updated' => 'User #user_login# was updated',
18 18
     'report_a_bug' => 'Report a Bug',
19 19
     'user_profile_api_key' => 'Your API key',
Please login to merge, or discard this patch.
sources/checks.php 1 patch
Switch Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -50,23 +50,23 @@
 block discarded – undo
50 50
 Handle CASES
51 51
  */
52 52
 switch (filter_input(INPUT_POST, 'type', FILTER_SANITIZE_STRING)) {
53
-case "checkSessionExists":
54
-    // Case permit to check if SESSION is still valid
55
-    session_start();
56
-    if (isset($_SESSION['CPM']) === true) {
57
-        echo "1";
58
-    } else {
59
-        // In case that no session is available
60
-        // Force the page to be reloaded and attach the CSRFP info
61
-
62
-        // Load CSRFP
63
-        $csrfp_array = include '../includes/libraries/csrfp/libs/csrfp.config.php';
64
-
65
-        // Send back CSRFP info
66
-        echo $csrfp_array['CSRFP_TOKEN'].";".filter_input(INPUT_POST, $csrfp_array['CSRFP_TOKEN'], FILTER_SANITIZE_STRING);
67
-    }
53
+    case "checkSessionExists":
54
+        // Case permit to check if SESSION is still valid
55
+        session_start();
56
+        if (isset($_SESSION['CPM']) === true) {
57
+            echo "1";
58
+        } else {
59
+            // In case that no session is available
60
+            // Force the page to be reloaded and attach the CSRFP info
61
+
62
+            // Load CSRFP
63
+            $csrfp_array = include '../includes/libraries/csrfp/libs/csrfp.config.php';
64
+
65
+            // Send back CSRFP info
66
+            echo $csrfp_array['CSRFP_TOKEN'].";".filter_input(INPUT_POST, $csrfp_array['CSRFP_TOKEN'], FILTER_SANITIZE_STRING);
67
+        }
68 68
 
69
-    break;
69
+        break;
70 70
 }
71 71
 
72 72
 /**
Please login to merge, or discard this patch.
items.load.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -457,28 +457,28 @@  discard block
 block discarded – undo
457 457
 
458 458
         // Prepare error message
459 459
         if (value.pw_status === "encryption_error") {
460
-            pwd_error = '<span class="fa fa-warning fa-sm mi-red tip" title="<?php echo addslashes($LANG['pw_encryption_error']);?>"></span>&nbsp;';
460
+            pwd_error = '<span class="fa fa-warning fa-sm mi-red tip" title="<?php echo addslashes($LANG['pw_encryption_error']); ?>"></span>&nbsp;';
461 461
         }
462 462
 
463 463
         // Prepare anyone can modify icon
464 464
         if (value.anyone_can_modify === "1") {
465
-            icon_all_can_modify = '<span class="fa fa-pencil fa-sm mi-grey-1 pointer tip" title="<?php echo addslashes($LANG['item_menu_collab_enable']);?>" onclick="AfficherDetailsItem(\''+value.item_id+'\',\''+value.sk+'\',\''+value.expired+'\', \''+value.restricted+'\', \''+value.display+'\', \''+value.open_edit+'\', \''+value.reload+'\', \''+value.tree_id+'\')"></span>&nbsp;&nbsp;';
465
+            icon_all_can_modify = '<span class="fa fa-pencil fa-sm mi-grey-1 pointer tip" title="<?php echo addslashes($LANG['item_menu_collab_enable']); ?>" onclick="AfficherDetailsItem(\''+value.item_id+'\',\''+value.sk+'\',\''+value.expired+'\', \''+value.restricted+'\', \''+value.display+'\', \''+value.open_edit+'\', \''+value.reload+'\', \''+value.tree_id+'\')"></span>&nbsp;&nbsp;';
466 466
         }
467 467
 
468 468
         // Prepare mini icons
469 469
         if (value.copy_to_clipboard_small_icons === "1" && value.display_item === 1) {
470 470
             // Login icon
471 471
             if (value.login !== "") {
472
-                icon_login = '<span class="fa fa-sm fa-user mi-black mini_login" data-clipboard-text="'+sanitizeString(value.login)+'" title="<?php echo addslashes($LANG['item_menu_copy_login']);?>" id="minilogin_'+value.item_id+'"></span>&nbsp;';
472
+                icon_login = '<span class="fa fa-sm fa-user mi-black mini_login" data-clipboard-text="'+sanitizeString(value.login)+'" title="<?php echo addslashes($LANG['item_menu_copy_login']); ?>" id="minilogin_'+value.item_id+'"></span>&nbsp;';
473 473
             }
474 474
             // Pwd icon
475 475
             if (value.pw !== "") {
476
-                icon_pwd = '<span class="fa fa-sm fa-lock mi-black mini_pw" data-clipboard-text="'+sanitizeString(value.pw)+'" title="<?php echo addslashes($LANG['item_menu_copy_pw']);?>" data-clipboard-id="'+value.item_id+'" id="minipwd_'+value.item_id+'"></span>&nbsp;';
476
+                icon_pwd = '<span class="fa fa-sm fa-lock mi-black mini_pw" data-clipboard-text="'+sanitizeString(value.pw)+'" title="<?php echo addslashes($LANG['item_menu_copy_pw']); ?>" data-clipboard-id="'+value.item_id+'" id="minipwd_'+value.item_id+'"></span>&nbsp;';
477 477
             }
478 478
 
479 479
             // Now check if pwd is empty. If it is then warn user
480 480
             if (value.pw === "") {
481
-                pwd_error = '&nbsp;<span class="fa fa-exclamation-circle fa-sm mi-yellow tip" title="<?php echo addslashes($LANG['password_is_empty']);?>"></span>&nbsp;';
481
+                pwd_error = '&nbsp;<span class="fa fa-exclamation-circle fa-sm mi-yellow tip" title="<?php echo addslashes($LANG['password_is_empty']); ?>"></span>&nbsp;';
482 482
             }
483 483
         }
484 484
 
@@ -2409,8 +2409,8 @@  discard block
 block discarded – undo
2409 2409
         $("#delete-edit-file_"+file_id)
2410 2410
             .hide()
2411 2411
             .after(
2412
-                '<span class="delete_me">&nbsp;<span id="confirm-delete-edit-file_'+file_id+'" class="fa fa-thumbs-up tip" style="cursor:pointer;" onclick="delete_attached_file('+file_id+', 1)" title="<?php echo addslashes($LANG['confirm']);?>"></span>' +
2413
-                '&nbsp;<span id="cancel-delete-edit-file_'+file_id+'" class="fa fa-thumbs-down tip" style="cursor:pointer;" onclick="cancel_delete_attached_file('+file_id+')" title="<?php echo addslashes($LANG['cancel']);?>"></span>&nbsp;</span>'
2412
+                '<span class="delete_me">&nbsp;<span id="confirm-delete-edit-file_'+file_id+'" class="fa fa-thumbs-up tip" style="cursor:pointer;" onclick="delete_attached_file('+file_id+', 1)" title="<?php echo addslashes($LANG['confirm']); ?>"></span>' +
2413
+                '&nbsp;<span id="cancel-delete-edit-file_'+file_id+'" class="fa fa-thumbs-down tip" style="cursor:pointer;" onclick="cancel_delete_attached_file('+file_id+')" title="<?php echo addslashes($LANG['cancel']); ?>"></span>&nbsp;</span>'
2414 2414
             );
2415 2415
             $(".tip").tooltipster({multiple: true});
2416 2416
     }
@@ -2631,9 +2631,9 @@  discard block
 block discarded – undo
2631 2631
 
2632 2632
                 // Shall we show the root folder
2633 2633
                 if (data.html_json.can_create_root_folder === 1) {
2634
-                    html_visible = '<option value="0"><?php echo addslashes($LANG['root']);?></option>';
2635
-                    html_full_visible = '<option value="0"><?php echo addslashes($LANG['root']);?></option>';
2636
-                    html_active_visible = '<option value="0"><?php echo addslashes($LANG['root']);?></option>';
2634
+                    html_visible = '<option value="0"><?php echo addslashes($LANG['root']); ?></option>';
2635
+                    html_full_visible = '<option value="0"><?php echo addslashes($LANG['root']); ?></option>';
2636
+                    html_active_visible = '<option value="0"><?php echo addslashes($LANG['root']); ?></option>';
2637 2637
                 }
2638 2638
 
2639 2639
                 //
@@ -4674,20 +4674,20 @@  discard block
 block discarded – undo
4674 4674
                     if (value.copy_to_clipboard_small_icons === '1') {
4675 4675
                         // Prepare Login
4676 4676
                         if (value.login !== "") {
4677
-                            value.login = '<span class="fa fa-user fa-lg mi-black mini_login tip" data-clipboard-text="'+value.login+'" title="<?php echo addslashes($LANG['item_menu_copy_login']);?>"></span>&nbsp;';
4677
+                            value.login = '<span class="fa fa-user fa-lg mi-black mini_login tip" data-clipboard-text="'+value.login+'" title="<?php echo addslashes($LANG['item_menu_copy_login']); ?>"></span>&nbsp;';
4678 4678
                         }
4679 4679
 
4680 4680
                         // Prepare PWD
4681 4681
                         if (value.pw !== "") {
4682
-                            value.pw = '<span class="fa fa-lock fa-lg mi-black mini_pw tip" data-clipboard-text="'+value.pw+'" title="<?php echo addslashes($LANG['item_menu_copy_pw']);?>"></span>&nbsp;'
4682
+                            value.pw = '<span class="fa fa-lock fa-lg mi-black mini_pw tip" data-clipboard-text="'+value.pw+'" title="<?php echo addslashes($LANG['item_menu_copy_pw']); ?>"></span>&nbsp;'
4683 4683
                         }
4684 4684
 
4685 4685
                         // Prepare favorite
4686 4686
                         if (value.enable_favourites === '1') {
4687 4687
                             if (value.is_favorite === '1') {
4688
-                                icon_favorite = '<span class="fa fa-star fa-lg mi-yellow tip" onclick="ActionOnQuickIcon('+value.item_id+',0)" class="tip" title="<?php echo addslashes($LANG['item_menu_del_from_fav']);?>"></span>';
4688
+                                icon_favorite = '<span class="fa fa-star fa-lg mi-yellow tip" onclick="ActionOnQuickIcon('+value.item_id+',0)" class="tip" title="<?php echo addslashes($LANG['item_menu_del_from_fav']); ?>"></span>';
4689 4689
                             } else {
4690
-                                icon_favorite = '<span class="fa fa-star-o fa-lg tip" onclick="ActionOnQuickIcon('+value.item_id+',1)" class="tip" title="<?php echo addslashes($LANG['item_menu_add_to_fav']);?>"></span>';
4690
+                                icon_favorite = '<span class="fa fa-star-o fa-lg tip" onclick="ActionOnQuickIcon('+value.item_id+',1)" class="tip" title="<?php echo addslashes($LANG['item_menu_add_to_fav']); ?>"></span>';
4691 4691
                             }
4692 4692
                         } else {
4693 4693
                             icon_favorite = '';
@@ -4701,7 +4701,7 @@  discard block
 block discarded – undo
4701 4701
                     // Append
4702 4702
                     $("#full_items_list").append(
4703 4703
                     '<li class="item trunc_line" id="'+value.item_id+'"><a id="fileclass'+value.item_id+'" class="file_search">' +
4704
-                    '<span class="fa fa-key mi-yellow tip" onclick="AfficherDetailsItem(\''+value.item_id+'\',\''+value.sk+'\',\''+value.expired+'\', \''+value.restricted+'\', \''+value.display+'\', \''+value.open_edit+'\', \''+value.reload+'\', \''+value.tree_id+'\')" title="<?php echo addslashes($LANG['click_to_edit']);?>"></span>&nbsp;' +
4704
+                    '<span class="fa fa-key mi-yellow tip" onclick="AfficherDetailsItem(\''+value.item_id+'\',\''+value.sk+'\',\''+value.expired+'\', \''+value.restricted+'\', \''+value.display+'\', \''+value.open_edit+'\', \''+value.reload+'\', \''+value.tree_id+'\')" title="<?php echo addslashes($LANG['click_to_edit']); ?>"></span>&nbsp;' +
4705 4705
                         '<span class="truncate" onclick="AfficherDetailsItem(\''+value.item_id+'\',\''+value.sk+'\',\''+value.expired+'\', \''+value.restricted+'\', \''+value.display+'\', \'\', \''+value.reload+'\', \''+value.tree_id+'\')"><b>'+value.label + '</b>' +
4706 4706
                         '&nbsp;<span style="font-size:11px;font-style:italic; background-color:#f2e9e5;">&nbsp;<i class="fa fa-folder-o"></i>&nbsp;'+value.folder+'&nbsp;</span>&nbsp;'+value.desc+'' +
4707 4707
                         '</span><span style="float:right;margin:2px 10px 0px 0px;">' +
@@ -4758,20 +4758,20 @@  discard block
 block discarded – undo
4758 4758
                 if (value.copy_to_clipboard_small_icons === "1") {
4759 4759
                     // Prepare Login
4760 4760
                     if (value.login !== "") {
4761
-                        value.login = '<span class="fa fa-user fa-lg mi-black mini_login tip" data-clipboard-text="'+value.login+'" title="<?php echo addslashes($LANG['item_menu_copy_login']);?>"></span>&nbsp;';
4761
+                        value.login = '<span class="fa fa-user fa-lg mi-black mini_login tip" data-clipboard-text="'+value.login+'" title="<?php echo addslashes($LANG['item_menu_copy_login']); ?>"></span>&nbsp;';
4762 4762
                     }
4763 4763
 
4764 4764
                     // Prepare PWD
4765 4765
                     if (value.pw !== "") {
4766
-                        value.pw = '<span class="fa fa-lock fa-lg mi-black mini_pw tip" data-clipboard-text="'+value.pw+'" title="<?php echo addslashes($LANG['item_menu_copy_pw']);?>"></span>&nbsp;'
4766
+                        value.pw = '<span class="fa fa-lock fa-lg mi-black mini_pw tip" data-clipboard-text="'+value.pw+'" title="<?php echo addslashes($LANG['item_menu_copy_pw']); ?>"></span>&nbsp;'
4767 4767
                     }
4768 4768
 
4769 4769
                     // Prepare favorite
4770 4770
                     if (value.enable_favourites === "1") {
4771 4771
                         if (value.is_favorite === 1) {
4772
-                            icon_favorite = '<span class="fa fa-star fa-lg mi-yellow tip" onclick="ActionOnQuickIcon('+value.item_id+',0)" class="tip" title="<?php echo addslashes($LANG['item_menu_del_from_fav']);?>"></span>';
4772
+                            icon_favorite = '<span class="fa fa-star fa-lg mi-yellow tip" onclick="ActionOnQuickIcon('+value.item_id+',0)" class="tip" title="<?php echo addslashes($LANG['item_menu_del_from_fav']); ?>"></span>';
4773 4773
                         } else {
4774
-                            icon_favorite = '<span class="fa fa-star-o fa-lg tip" onclick="ActionOnQuickIcon('+value.item_id+',1)" class="tip" title="<?php echo addslashes($LANG['item_menu_add_to_fav']);?>"></span>';
4774
+                            icon_favorite = '<span class="fa fa-star-o fa-lg tip" onclick="ActionOnQuickIcon('+value.item_id+',1)" class="tip" title="<?php echo addslashes($LANG['item_menu_add_to_fav']); ?>"></span>';
4775 4775
                         }
4776 4776
                     } else {
4777 4777
                         icon_favorite = '';
@@ -4785,7 +4785,7 @@  discard block
 block discarded – undo
4785 4785
                 // Append
4786 4786
                 $("#full_items_list").append(
4787 4787
                 '<li class="item trunc_line" id="'+value.item_id+'"><a id="fileclass'+value.item_id+'" class="file_search">' +
4788
-                '<span class="fa fa-key mi-yellow tip" onclick="AfficherDetailsItem(\''+value.item_id+'\',\''+value.sk+'\',\''+value.expired+'\', \''+value.restricted+'\', \''+value.display+'\', \''+value.open_edit+'\', \''+value.reload+'\', \''+value.tree_id+'\')" title="<?php echo addslashes($LANG['click_to_edit']);?>"></span>&nbsp;' +
4788
+                '<span class="fa fa-key mi-yellow tip" onclick="AfficherDetailsItem(\''+value.item_id+'\',\''+value.sk+'\',\''+value.expired+'\', \''+value.restricted+'\', \''+value.display+'\', \''+value.open_edit+'\', \''+value.reload+'\', \''+value.tree_id+'\')" title="<?php echo addslashes($LANG['click_to_edit']); ?>"></span>&nbsp;' +
4789 4789
                     '<span class="truncate" onclick="AfficherDetailsItem(\''+value.item_id+'\',\''+value.sk+'\',\''+value.expired+'\', \''+value.restricted+'\', \''+value.display+'\', \'\', \''+value.reload+'\', \''+value.tree_id+'\')">'+value.label +
4790 4790
                     value.desc +
4791 4791
                     '&nbsp;<span style="font-size:11px;font-style:italic;"><i class="fa fa-folder-o"></i>&nbsp;'+value.folder+'</span>' +
Please login to merge, or discard this patch.
sources/items.queries.php 2 patches
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -2191,12 +2191,12 @@  discard block
 block discarded – undo
2191 2191
 
2192 2192
             // Check that user can access this folder
2193 2193
             if ((
2194
-                  in_array($post_source_folder_id, $_SESSION['groupes_visibles']) === false ||
2194
+                    in_array($post_source_folder_id, $_SESSION['groupes_visibles']) === false ||
2195 2195
                   in_array($post_target_folder_id, $_SESSION['groupes_visibles']) === false) &&
2196 2196
                   (
2197
-                      $post_target_folder_id === '0' &&
2197
+                        $post_target_folder_id === '0' &&
2198 2198
                       isset($SETTINGS['can_create_root_folder']) === true && $SETTINGS['can_create_root_folder'] === '1'
2199
-                  )
2199
+                    )
2200 2200
             ) {
2201 2201
                 $returnValues = '[{"error" : "'.addslashes($LANG['error_not_allowed_to']).'"}]';
2202 2202
                 echo $returnValues;
@@ -3201,7 +3201,7 @@  discard block
 block discarded – undo
3201 3201
             if ((isset($_SESSION['user_settings']['session_psk']) === false || empty($_SESSION['user_settings']['session_psk']) === true)
3202 3202
                 && ($dataSource['personal_folder'] === '1' || $dataDestination['personal_folder'] === '1')
3203 3203
             ) {
3204
-                 echo '[{"error" : "ERR_PSK_REQUIRED"}]';
3204
+                    echo '[{"error" : "ERR_PSK_REQUIRED"}]';
3205 3205
                 break;
3206 3206
             }
3207 3207
 
@@ -4340,19 +4340,19 @@  discard block
 block discarded – undo
4340 4340
             $ret = sendEmail(
4341 4341
                 $LANG['email_request_access_subject'],
4342 4342
                 str_replace(
4343
-                  array(
4344
-                      '#tp_item_author#',
4345
-                      '#tp_user#',
4346
-                      '#tp_item#',
4347
-                      '#tp_reason#'
4348
-                  ),
4349
-                  array(
4350
-                      " ".addslashes($dataAuthor['login']),
4351
-                      addslashes($_SESSION['login']),
4352
-                      $path,
4353
-                      nl2br(addslashes($emailText))
4354
-                  ),
4355
-                  $LANG['email_request_access_mail']
4343
+                    array(
4344
+                        '#tp_item_author#',
4345
+                        '#tp_user#',
4346
+                        '#tp_item#',
4347
+                        '#tp_reason#'
4348
+                    ),
4349
+                    array(
4350
+                        " ".addslashes($dataAuthor['login']),
4351
+                        addslashes($_SESSION['login']),
4352
+                        $path,
4353
+                        nl2br(addslashes($emailText))
4354
+                    ),
4355
+                    $LANG['email_request_access_mail']
4356 4356
                 ),
4357 4357
                 $dataAuthor['email'],
4358 4358
                 $LANG,
@@ -4361,11 +4361,11 @@  discard block
 block discarded – undo
4361 4361
 
4362 4362
             // Do log
4363 4363
             logItems(
4364
-              $item_id,
4365
-              $dataItem['label'],
4366
-              $_SESSION['user_id'],
4367
-              'at_access',
4368
-              $_SESSION['login']
4364
+                $item_id,
4365
+                $dataItem['label'],
4366
+                $_SESSION['user_id'],
4367
+                'at_access',
4368
+                $_SESSION['login']
4369 4369
             );
4370 4370
 
4371 4371
             // Return
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -896,7 +896,7 @@  discard block
 block discarded – undo
896 896
                     /*FOLDER */
897 897
                     if ($data['id_tree'] != $dataReceived['categorie']) {
898 898
                         // Get name of folders
899
-                        $dataTmp = DB::query("SELECT title FROM ".prefix_table("nested_tree")." WHERE id IN %li", array($data['id_tree'],$dataReceived['categorie']));
899
+                        $dataTmp = DB::query("SELECT title FROM ".prefix_table("nested_tree")." WHERE id IN %li", array($data['id_tree'], $dataReceived['categorie']));
900 900
 
901 901
                         logItems($dataReceived['id'], $label, $_SESSION['user_id'], 'at_modification', $_SESSION['login'], 'at_category : '.$dataTmp[0]['title'].' => '.$dataTmp[1]['title']);
902 902
                         // ask for page reloading
@@ -1974,7 +1974,7 @@  discard block
 block discarded – undo
1974 1974
                         if (empty($path) === true) {
1975 1975
                             $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES).' ';
1976 1976
                         } else {
1977
-                            $path .= '&#8594; ' . htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
1977
+                            $path .= '&#8594; '.htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
1978 1978
                         }
1979 1979
                     }
1980 1980
                     // Build text to show user
@@ -4474,7 +4474,7 @@  discard block
 block discarded – undo
4474 4474
         if (empty($path) === true) {
4475 4475
             $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES).' ';
4476 4476
         } else {
4477
-            $path .= '&#8594; ' . htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
4477
+            $path .= '&#8594; '.htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
4478 4478
         }
4479 4479
     }
4480 4480
     // Build text to show user
Please login to merge, or discard this patch.
backups/script.backup.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,15 +12,15 @@
 block discarded – undo
12 12
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 13
  */
14 14
 
15
-require dirname(__FILE__) .'/../includes/config/settings.php';
16
-require_once dirname(__FILE__) .'/../includes/config/tp.config.php';
15
+require dirname(__FILE__).'/../includes/config/settings.php';
16
+require_once dirname(__FILE__).'/../includes/config/tp.config.php';
17 17
 header("Content-type: text/html; charset=utf-8");
18 18
 
19 19
 $_SESSION['CPM'] = 1;
20 20
 
21 21
 // connect to DB
22
-require_once $SETTINGS['cpassman_dir'] .'/sources/SplClassLoader.php';
23
-require_once $SETTINGS['cpassman_dir'] .'/includes/libraries/Database/Meekrodb/db.class.php';
22
+require_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
23
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
24 24
 
25 25
 // Load libraries
26 26
 require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
Please login to merge, or discard this patch.
sources/export.queries.php 1 patch
Switch Indentation   +172 added lines, -172 removed lines patch added patch discarded remove patch
@@ -452,24 +452,24 @@  discard block
 block discarded – undo
452 452
             break;
453 453
 
454 454
     //CASE export in HTML format
455
-    case "export_to_html_format":
456
-        // step 1:
457
-        // - prepare export file
458
-        // - get full list of objects id to export
459
-        include $SETTINGS['cpassman_dir'].'/includes/config/include.php';
460
-        include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/GibberishAES/GibberishAES.php';
461
-        $idsList = array();
462
-        $objNumber = 0;
463
-
464
-        foreach (explode(';', $post_ids) as $id) {
465
-            if (in_array($id, $_SESSION['forbiden_pfs']) === false
466
-                && in_array($id, $_SESSION['groupes_visibles']) === true
467
-                && (in_array($id, $_SESSION['no_access_folders']) === false)
468
-            ) {
469
-                //echo $id." > ".in_array($id, $_SESSION['groupes_visibles'])." ;; ";
470
-                // count elements to display
471
-                $result = DB::query(
472
-                    "SELECT i.id AS id, i.label AS label, i.restricted_to AS restricted_to, i.perso AS perso
455
+        case "export_to_html_format":
456
+            // step 1:
457
+            // - prepare export file
458
+            // - get full list of objects id to export
459
+            include $SETTINGS['cpassman_dir'].'/includes/config/include.php';
460
+            include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/GibberishAES/GibberishAES.php';
461
+            $idsList = array();
462
+            $objNumber = 0;
463
+
464
+            foreach (explode(';', $post_ids) as $id) {
465
+                if (in_array($id, $_SESSION['forbiden_pfs']) === false
466
+                    && in_array($id, $_SESSION['groupes_visibles']) === true
467
+                    && (in_array($id, $_SESSION['no_access_folders']) === false)
468
+                ) {
469
+                    //echo $id." > ".in_array($id, $_SESSION['groupes_visibles'])." ;; ";
470
+                    // count elements to display
471
+                    $result = DB::query(
472
+                        "SELECT i.id AS id, i.label AS label, i.restricted_to AS restricted_to, i.perso AS perso
473 473
                     FROM ".prefix_table("items")." as i
474 474
                     INNER JOIN ".prefix_table("nested_tree")." as n ON (i.id_tree = n.id)
475 475
                     INNER JOIN ".prefix_table("log_items")." as l ON (i.id = l.id_item)
@@ -477,41 +477,41 @@  discard block
 block discarded – undo
477 477
                     AND i.id_tree= %i
478 478
                     AND (l.action = %s OR (l.action = %s AND l.raison LIKE %s))
479 479
                     ORDER BY i.label ASC, l.date DESC",
480
-                    "0",
481
-                    $id,
482
-                    "at_creation",
483
-                    "at_modification",
484
-                    "at_pw :%"
485
-                );
486
-                foreach ($result as $record) {
487
-                    $restricted_users_array = explode(';', $record['restricted_to']);
488
-                    if (((in_array($id, $_SESSION['personal_visible_groups']) === true
489
-                        && !($record['perso'] == 1 && $_SESSION['user_id'] == $record['restricted_to'])
490
-                        && empty($record['restricted_to']) === false)
491
-                        ||
492
-                        (empty($record['restricted_to']) === false 
493
-                        && in_array($_SESSION['user_id'], $restricted_users_array) === false)
494
-                        ||
495
-                        (in_array($id, $_SESSION['groupes_visibles']))
496
-                        ) && (
497
-                        in_array($record['id'], $idsList) === false
498
-                        )
499
-                    ) {
500
-                        array_push($idsList, $record['id']);
501
-                        $objNumber++;
480
+                        "0",
481
+                        $id,
482
+                        "at_creation",
483
+                        "at_modification",
484
+                        "at_pw :%"
485
+                    );
486
+                    foreach ($result as $record) {
487
+                        $restricted_users_array = explode(';', $record['restricted_to']);
488
+                        if (((in_array($id, $_SESSION['personal_visible_groups']) === true
489
+                            && !($record['perso'] == 1 && $_SESSION['user_id'] == $record['restricted_to'])
490
+                            && empty($record['restricted_to']) === false)
491
+                            ||
492
+                            (empty($record['restricted_to']) === false 
493
+                            && in_array($_SESSION['user_id'], $restricted_users_array) === false)
494
+                            ||
495
+                            (in_array($id, $_SESSION['groupes_visibles']))
496
+                            ) && (
497
+                            in_array($record['id'], $idsList) === false
498
+                            )
499
+                        ) {
500
+                            array_push($idsList, $record['id']);
501
+                            $objNumber++;
502
+                        }
502 503
                     }
503 504
                 }
504 505
             }
505
-        }
506 506
 
507
-            // prepare export file
508
-            //save the file
509
-            $html_file = '/teampass_export_'.time().'_'.generateKey().'.html';
510
-            //print_r($full_listing);
511
-            $outstream = fopen($SETTINGS['path_to_files_folder'].$html_file, "w");
512
-            fwrite(
513
-                $outstream,
514
-                '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
507
+                // prepare export file
508
+                //save the file
509
+                $html_file = '/teampass_export_'.time().'_'.generateKey().'.html';
510
+                //print_r($full_listing);
511
+                $outstream = fopen($SETTINGS['path_to_files_folder'].$html_file, "w");
512
+                fwrite(
513
+                    $outstream,
514
+                    '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
515 515
     <head>
516 516
     <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
517 517
     <title>TeamPass Off-line mode</title>
@@ -551,38 +551,38 @@  discard block
 block discarded – undo
551 551
             <th style="width:20%;">'.$LANG['url'].'</th>
552 552
         </tr></thead>
553 553
         <tbody id="itemsTable_tbody">'
554
-            );
555
-
556
-        fclose($outstream);
554
+                );
557 555
 
558
-        // send back and continue
559
-        echo '[{"loop":"true", "number":"'.$objNumber.'", "file":"'.$SETTINGS['path_to_files_folder'].$html_file.'" , "file_link":"'.$SETTINGS['url_to_files_folder'].$html_file.'"}]';
560
-        break;
556
+            fclose($outstream);
561 557
 
562
-    //CASE export in HTML format - Iteration loop
563
-    case "export_to_html_format_loop":
564
-        // do checks ... if fails, return an error
565
-        if (null === $post_idTree || null === $post_idsList) {
566
-            echo '[{"error":"true"}]';
558
+            // send back and continue
559
+            echo '[{"loop":"true", "number":"'.$objNumber.'", "file":"'.$SETTINGS['path_to_files_folder'].$html_file.'" , "file_link":"'.$SETTINGS['url_to_files_folder'].$html_file.'"}]';
567 560
             break;
568
-        }
569 561
 
570
-        // exclude this folder if not allowed
571
-        if (in_array($post_idTree, $_SESSION['forbiden_pfs']) === true
572
-            || in_array($post_idTree, $_SESSION['groupes_visibles']) === false
573
-            || (in_array($post_idTree, $_SESSION['no_access_folders']) === true)
574
-        ) {
575
-            echo '[{"loop":"true", "number":"'.$post_number.'", "cpt":"'.$post_cpt.'", "file":"'.$post_file.'", "idsList":"'.$post_idsList.'" , "file_link":"'.$post_file_link.'"}]';
576
-            break;
577
-        }
562
+        //CASE export in HTML format - Iteration loop
563
+        case "export_to_html_format_loop":
564
+            // do checks ... if fails, return an error
565
+            if (null === $post_idTree || null === $post_idsList) {
566
+                echo '[{"error":"true"}]';
567
+                break;
568
+            }
578 569
 
579
-        $full_listing = array();
580
-        $items_id_list = array();
581
-        include $SETTINGS['cpassman_dir'].'/includes/config/include.php';
582
-        include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/GibberishAES/GibberishAES.php';
570
+            // exclude this folder if not allowed
571
+            if (in_array($post_idTree, $_SESSION['forbiden_pfs']) === true
572
+                || in_array($post_idTree, $_SESSION['groupes_visibles']) === false
573
+                || (in_array($post_idTree, $_SESSION['no_access_folders']) === true)
574
+            ) {
575
+                echo '[{"loop":"true", "number":"'.$post_number.'", "cpt":"'.$post_cpt.'", "file":"'.$post_file.'", "idsList":"'.$post_idsList.'" , "file_link":"'.$post_file_link.'"}]';
576
+                break;
577
+            }
578
+
579
+            $full_listing = array();
580
+            $items_id_list = array();
581
+            include $SETTINGS['cpassman_dir'].'/includes/config/include.php';
582
+            include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/GibberishAES/GibberishAES.php';
583 583
 
584
-        $rows = DB::query(
585
-            "SELECT i.id as id, i.url as url, i.perso as perso, i.label as label, i.description as description, i.pw as pw, i.login as login, i.id_tree as id_tree,
584
+            $rows = DB::query(
585
+                "SELECT i.id as id, i.url as url, i.perso as perso, i.label as label, i.description as description, i.pw as pw, i.login as login, i.id_tree as id_tree,
586 586
                 l.date as date, i.pw_iv as pw_iv,
587 587
                 n.renewal_period as renewal_period
588 588
             FROM ".prefix_table("items")." as i
@@ -592,108 +592,108 @@  discard block
 block discarded – undo
592 592
             AND i.id_tree= %i
593 593
             AND (l.action = %s OR (l.action = %s AND l.raison LIKE %s))
594 594
             ORDER BY i.label ASC, l.date DESC",
595
-            "0",
596
-            $post_idTree,
597
-            "at_creation",
598
-            "at_modification",
599
-            "at_pw :%"
600
-        );
601
-
602
-        foreach ($rows as $record) {
603
-            //exclude all results except the first one returned by query
604
-            if (empty($id_managed) || $id_managed != $record['id']) {
605
-                // decrypt PW
606
-                if (empty($post_salt_key) === false && null !== $post_salt_key) {
607
-                    $pw = cryption(
608
-                        $record['pw'],
609
-                        mysqli_escape_string($link, stripslashes($post_salt_key)),
610
-                        "decrypt"
595
+                "0",
596
+                $post_idTree,
597
+                "at_creation",
598
+                "at_modification",
599
+                "at_pw :%"
600
+            );
601
+
602
+            foreach ($rows as $record) {
603
+                //exclude all results except the first one returned by query
604
+                if (empty($id_managed) || $id_managed != $record['id']) {
605
+                    // decrypt PW
606
+                    if (empty($post_salt_key) === false && null !== $post_salt_key) {
607
+                        $pw = cryption(
608
+                            $record['pw'],
609
+                            mysqli_escape_string($link, stripslashes($post_salt_key)),
610
+                            "decrypt"
611
+                        );
612
+                    } else {
613
+                        $pw = cryption(
614
+                            $record['pw'],
615
+                            "",
616
+                            "decrypt"
617
+                        );
618
+                    }
619
+                    array_push(
620
+                        $full_listing, array(
621
+                            'id_tree' => $record['id_tree'],
622
+                            'id' => $record['id'],
623
+                            'label' => $record['label'],
624
+                            'description' => addslashes(str_replace(array(";", "<br />"), array("|", "\n\r"), mysqli_escape_string($link, stripslashes(utf8_decode($record['description']))))),
625
+                            'pw' => $pw['string'],
626
+                            'login' => $record['login'],
627
+                            'url' => $record['url'],
628
+                            'perso' => $record['perso']
629
+                        )
611 630
                     );
612
-                } else {
613
-                    $pw = cryption(
614
-                        $record['pw'],
615
-                        "",
616
-                        "decrypt"
631
+                    $i++;
632
+                    array_push($items_id_list, $record['id']);
633
+
634
+                    // log
635
+                    logItems(
636
+                        $record['id'],
637
+                        $record['l SeekableIteratorabel'],
638
+                        $_SESSION['user_id'],
639
+                        'at_export',
640
+                        $_SESSION['login'],
641
+                        'html'
617 642
                     );
618 643
                 }
619
-                array_push(
620
-                    $full_listing, array(
621
-                        'id_tree' => $record['id_tree'],
622
-                        'id' => $record['id'],
623
-                        'label' => $record['label'],
624
-                        'description' => addslashes(str_replace(array(";", "<br />"), array("|", "\n\r"), mysqli_escape_string($link, stripslashes(utf8_decode($record['description']))))),
625
-                        'pw' => $pw['string'],
626
-                        'login' => $record['login'],
627
-                        'url' => $record['url'],
628
-                        'perso' => $record['perso']
629
-                    )
630
-                );
631
-                $i++;
632
-                array_push($items_id_list, $record['id']);
633
-
634
-                // log
635
-                logItems(
636
-                    $record['id'],
637
-                    $record['l SeekableIteratorabel'],
638
-                    $_SESSION['user_id'],
639
-                    'at_export',
640
-                    $_SESSION['login'],
641
-                    'html'
642
-                );
644
+                $id_managed = $record['id'];
643 645
             }
644
-            $id_managed = $record['id'];
645
-        }
646 646
 
647
-        //save in export file
648
-        $outstream = fopen($post_file.'.txt', "a");
647
+            //save in export file
648
+            $outstream = fopen($post_file.'.txt', "a");
649 649
 
650
-        $lineType = "line1";
651
-        $idTree = "";
652
-        foreach ($full_listing as $elem) {
653
-            if ($lineType == "line0") {
654
-                $lineType = "line1";
655
-            } else {
656
-                $lineType = "line0";
657
-            }
658
-            if (empty($elem['description'])) {
659
-                $desc = '&nbsp;';
660
-            } else {
661
-                $desc = addslashes($elem['description']);
662
-            }
663
-            if (empty($elem['login'])) {
664
-                $login = '&nbsp;';
665
-            } else {
666
-                $login = addslashes($elem['login']);
667
-            }
668
-            if (empty($elem['url'])) {
669
-                $url = '&nbsp;';
670
-            } else {
671
-                $url = addslashes($elem['url']);
672
-            }
650
+            $lineType = "line1";
651
+            $idTree = "";
652
+            foreach ($full_listing as $elem) {
653
+                if ($lineType == "line0") {
654
+                    $lineType = "line1";
655
+                } else {
656
+                    $lineType = "line0";
657
+                }
658
+                if (empty($elem['description'])) {
659
+                    $desc = '&nbsp;';
660
+                } else {
661
+                    $desc = addslashes($elem['description']);
662
+                }
663
+                if (empty($elem['login'])) {
664
+                    $login = '&nbsp;';
665
+                } else {
666
+                    $login = addslashes($elem['login']);
667
+                }
668
+                if (empty($elem['url'])) {
669
+                    $url = '&nbsp;';
670
+                } else {
671
+                    $url = addslashes($elem['url']);
672
+                }
673 673
 
674
-            // Prepare tree
675
-            if ($idTree != $elem['id_tree']) {
676
-                $arbo = $tree->getPath($elem['id_tree'], true);
677
-                foreach ($arbo as $folder) {
678
-                    $arboHtml_tmp = htmlspecialchars(stripslashes($folder->title), ENT_QUOTES);
679
-                    if (empty($arboHtml)) {
680
-                        $arboHtml = $arboHtml_tmp;
681
-                    } else {
682
-                        $arboHtml .= ' » '.$arboHtml_tmp;
674
+                // Prepare tree
675
+                if ($idTree != $elem['id_tree']) {
676
+                    $arbo = $tree->getPath($elem['id_tree'], true);
677
+                    foreach ($arbo as $folder) {
678
+                        $arboHtml_tmp = htmlspecialchars(stripslashes($folder->title), ENT_QUOTES);
679
+                        if (empty($arboHtml)) {
680
+                            $arboHtml = $arboHtml_tmp;
681
+                        } else {
682
+                            $arboHtml .= ' » '.$arboHtml_tmp;
683
+                        }
683 684
                     }
685
+                    fputs(
686
+                        $outstream,
687
+                        '
688
+        <tr class="path"><td colspan="5">'.$arboHtml.'</td></tr>'
689
+                    );
690
+                    $idTree = $elem['id_tree'];
684 691
                 }
692
+
693
+                $encPw = GibberishAES::enc($elem['pw'], $post_pdf_password);
685 694
                 fputs(
686 695
                     $outstream,
687 696
                     '
688
-        <tr class="path"><td colspan="5">'.$arboHtml.'</td></tr>'
689
-                );
690
-                $idTree = $elem['id_tree'];
691
-            }
692
-
693
-            $encPw = GibberishAES::enc($elem['pw'], $post_pdf_password);
694
-            fputs(
695
-                $outstream,
696
-                '
697 697
         <tr class="'.$lineType.'">
698 698
             <td>'.addslashes($elem['label']).'</td>
699 699
             <td align="center"><span class="span_pw" id="span_'.$elem['id'].'"><a href="#" onclick="decryptme('.$elem['id'].', \''.$encPw.'\');return false;">Decrypt </a></span><input type="hidden" id="hide_'.$elem['id'].'" value="'.$encPw.'" /></td>
@@ -701,16 +701,16 @@  discard block
 block discarded – undo
701 701
             <td align="center">'.$login.'</td>
702 702
             <td align="center">'.$url.'</td>
703 703
             </tr>'
704
-            );
705
-        }
704
+                );
705
+            }
706 706
 
707
-        fclose($outstream);
707
+            fclose($outstream);
708 708
 
709
-        // send back and continue
710
-        echo '[{"loop":"true", "number":"'.$post_number.'", "cpt":"'.$post_cpt.'", "file":"'.$post_file.'", "idsList":"'.$post_idsList.'" , "file_link":"'.$post_file_link.'"}]';
711
-        break;
709
+            // send back and continue
710
+            echo '[{"loop":"true", "number":"'.$post_number.'", "cpt":"'.$post_cpt.'", "file":"'.$post_file.'", "idsList":"'.$post_idsList.'" , "file_link":"'.$post_file_link.'"}]';
711
+            break;
712 712
 
713
-            //CASE export in HTML format - Iteration loop
713
+                //CASE export in HTML format - Iteration loop
714 714
         case "export_to_html_format_finalize":
715 715
             // Load includes
716 716
             include $SETTINGS['cpassman_dir'].'/includes/config/include.php';
Please login to merge, or discard this patch.