Passed
Push — development ( 92a808...c3b866 )
by Nils
04:34
created
sources/find.queries.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -341,8 +341,8 @@
 block discarded – undo
341 341
         if ($getItemInList === true) {
342 342
             $sOutputConst .= $sOutputItem;
343 343
         } else {
344
-            $iFilteredTotal --;
345
-            $iTotal --;
344
+            $iFilteredTotal--;
345
+            $iTotal--;
346 346
         }
347 347
     }
348 348
     if (!empty($sOutputConst)) {
Please login to merge, or discard this patch.
api/functions.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -633,7 +633,7 @@  discard block
 block discarded – undo
633 633
                             $json[$inc]['nlevel'] = mb_convert_encoding($folder->nlevel, mb_detect_encoding($folder->nlevel), 'UTF-8');
634 634
                             $json[$inc]['personal'] = mb_convert_encoding($folder->personal_folder, mb_detect_encoding($folder->personal_folder), 'UTF-8');
635 635
 
636
-                            $inc ++;
636
+                            $inc++;
637 637
                         }
638 638
                     }
639 639
                 }
@@ -2099,7 +2099,7 @@  discard block
 block discarded – undo
2099 2099
                         $tree = new Tree\NestedTree\NestedTree(prefix_table("nested_tree"), 'id', 'parent_id', 'title');
2100 2100
                         $tree->rebuild();
2101 2101
 
2102
-                        echo json_encode(array('new_id' => $newID , 'err' => ''));
2102
+                        echo json_encode(array('new_id' => $newID, 'err' => ''));
2103 2103
                     } elseif ($GLOBALS['request'][1] === "edit") {
2104 2104
                         // Is this folder a personal one?
2105 2105
                         $fldData = DB::queryFirstRow(
@@ -2166,7 +2166,7 @@  discard block
 block discarded – undo
2166 2166
                             $item_definition['item_id']
2167 2167
                         );
2168 2168
 
2169
-                        echo json_encode(array('new_id' => '' , 'err' => ''));
2169
+                        echo json_encode(array('new_id' => '', 'err' => ''));
2170 2170
                     }
2171 2171
                 } else {
2172 2172
                     rest_error('AUTH_NOT_GRANTED');
Please login to merge, or discard this patch.
sources/identify.php 1 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.
sources/core.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -492,7 +492,7 @@
 block discarded – undo
492 492
             $_SESSION['validite_pw'] = true;
493 493
         } else {
494 494
             $_SESSION['numDaysBeforePwExpiration'] = $SETTINGS['pw_life_duration'] - round(
495
-                (mktime(0, 0, 0, (int)date('m'), (int)date('d'), (int)date('y')) - $_SESSION['last_pw_change']) / (24 * 60 * 60)
495
+                (mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y')) - $_SESSION['last_pw_change']) / (24 * 60 * 60)
496 496
             );
497 497
             if ($_SESSION['numDaysBeforePwExpiration'] <= 0) {
498 498
                 $_SESSION['validite_pw'] = false;
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.
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/admin.queries.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
                         array(
108 108
                             'http' => array(
109 109
                                 'ignore_errors' => true,
110
-                                'proxy' =>  $SETTINGS['proxy_ip'] . ':' . $SETTINGS['proxy_port']
110
+                                'proxy' =>  $SETTINGS['proxy_ip'].':'.$SETTINGS['proxy_port']
111 111
                             )
112 112
                         )
113 113
                     );
@@ -665,7 +665,7 @@  discard block
 block discarded – undo
665 665
 
666 666
 
667 667
         // generate new saltkey
668
-        $old_sk_filename = SECUREPATH."/teampass-seckey.txt".'.'.date("Y_m_d", mktime(0, 0, 0, (int)date('m'), (int)date('d'), (int)date('y'))).'.'.time();
668
+        $old_sk_filename = SECUREPATH."/teampass-seckey.txt".'.'.date("Y_m_d", mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y'))).'.'.time();
669 669
         copy(
670 670
             SECUREPATH."/teampass-seckey.txt",
671 671
             $old_sk_filename
@@ -769,7 +769,7 @@  discard block
 block discarded – undo
769 769
             $objects = explode(",", $post_object);
770 770
 
771 771
             // Allowed values for $_POST['object'] : "items,logs,files,categories"
772
-            if (in_array($objects[0], array("items","logs","files","categories")) === false) {
772
+            if (in_array($objects[0], array("items", "logs", "files", "categories")) === false) {
773 773
                 echo '[{"nextAction":"" , "error":"Input `'.$objects[0].'` is not allowed" , "nbOfItems":""}]';
774 774
                 break;
775 775
             }
@@ -1259,7 +1259,7 @@  discard block
 block discarded – undo
1259 1259
             foreach ($rows as $record) {
1260 1260
                 if (is_file($SETTINGS['path_to_upload_folder'].'/'.$record['file'])) {
1261 1261
                     $addFile = 0;
1262
-                    if ($post_option== "decrypt" && $record['status'] === 'encrypted') {
1262
+                    if ($post_option == "decrypt" && $record['status'] === 'encrypted') {
1263 1263
                         $addFile = 1;
1264 1264
                     } elseif ($post_option == "encrypt" && $record['status'] === 'clear') {
1265 1265
                         $addFile = 1;
@@ -1551,7 +1551,7 @@  discard block
 block discarded – undo
1551 1551
                     $tmp_skfile,
1552 1552
                     $tmp_skfile.'.'.date(
1553 1553
                         "Y_m_d",
1554
-                        mktime(0, 0, 0, (int)date('m'), (int)date('d'), (int)date('y'))
1554
+                        mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y'))
1555 1555
                     )
1556 1556
                 )) {
1557 1557
                     echo '[{"result" : "" , "error" : "Could NOT perform a copy of file: '.$tmp_skfile.'"}]';
@@ -2067,16 +2067,16 @@  discard block
 block discarded – undo
2067 2067
                         );
2068 2068
 
2069 2069
                         $debug_ldap .= 'Search filter (group): '.$filter_group."<br/>".
2070
-                          'Results : '.str_replace("\n","<br>", print_r(ldap_get_entries($ldapconn, $result_group), true))."<br/>";
2070
+                          'Results : '.str_replace("\n", "<br>", print_r(ldap_get_entries($ldapconn, $result_group), true))."<br/>";
2071 2071
 
2072 2072
                         if ($result_group) {
2073 2073
                             $entries = ldap_get_entries($ldapconn, $result_group);
2074 2074
 
2075 2075
                             if ($entries['count'] > 0) {
2076 2076
                                 // Now check if group fits
2077
-                                for ($i=0; $i<$entries['count']; $i++) {
2078
-                                  $parsr=ldap_explode_dn($entries[$i]['dn'], 0);
2079
-                                  if (str_replace(array('CN=','cn='), '', $parsr[0]) === $SETTINGS['ldap_usergroup']) {
2077
+                                for ($i = 0; $i < $entries['count']; $i++) {
2078
+                                  $parsr = ldap_explode_dn($entries[$i]['dn'], 0);
2079
+                                  if (str_replace(array('CN=', 'cn='), '', $parsr[0]) === $SETTINGS['ldap_usergroup']) {
2080 2080
                                     $GroupRestrictionEnabled = true;
2081 2081
                                     break;
2082 2082
                                   }
@@ -2089,7 +2089,7 @@  discard block
 block discarded – undo
2089 2089
                     }
2090 2090
 
2091 2091
                     $debug_ldap .= 'Search filter : '.$filter."<br/>".
2092
-                            'Results : '.str_replace("\n","<br>", print_r(ldap_get_entries($ldapconn, $result), true))."<br/>";
2092
+                            'Results : '.str_replace("\n", "<br>", print_r(ldap_get_entries($ldapconn, $result), true))."<br/>";
2093 2093
 
2094 2094
                     if (ldap_count_entries($ldapconn, $result)) {
2095 2095
                         // try auth
Please login to merge, or discard this patch.
sources/main.functions.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -785,7 +785,7 @@  discard block
 block discarded – undo
785 785
         }
786 786
         // Get IDs of personal folders
787 787
         if (isset($SETTINGS['enable_pf_feature']) === true && $SETTINGS['enable_pf_feature'] === '1'
788
-            && isset($_SESSION['personal_folder']) === true &&  $_SESSION['personal_folder'] === '1'
788
+            && isset($_SESSION['personal_folder']) === true && $_SESSION['personal_folder'] === '1'
789 789
         ) {
790 790
             $persoFld = DB::queryfirstrow(
791 791
                 "SELECT id
@@ -1997,7 +1997,7 @@  discard block
 block discarded – undo
1997 1997
     $antiXss = new protect\AntiXSS\AntiXSS();
1998 1998
 
1999 1999
     // Protect against bad inputs
2000
-    if (is_array($source_file) ||is_array($target_file)) {
2000
+    if (is_array($source_file) || is_array($target_file)) {
2001 2001
         return 'error_cannot_be_array';
2002 2002
     }
2003 2003
 
@@ -2154,7 +2154,7 @@  discard block
 block discarded – undo
2154 2154
     $newArr = array();
2155 2155
 
2156 2156
     foreach ($arr as $key => $value) {
2157
-        $newArr[ $key ] = (is_array($value) ? array_map_r($func, $value) : ( is_array($func) ? call_user_func_array($func, $value) : $func( $value )));
2157
+        $newArr[$key] = (is_array($value) ? array_map_r($func, $value) : (is_array($func) ? call_user_func_array($func, $value) : $func($value)));
2158 2158
     }
2159 2159
 
2160 2160
     return $newArr;
@@ -2289,16 +2289,16 @@  discard block
 block discarded – undo
2289 2289
     $mailname = str_replace($domain, '', $email);
2290 2290
     $name_l = strlen($mailname);
2291 2291
     $domain_l = strlen($domain);
2292
-    for($i = 0; $i <= $name_l/$prop-1; $i++) {
2292
+    for ($i = 0; $i <= $name_l / $prop - 1; $i++) {
2293 2293
         $start .= 'x';
2294 2294
     }
2295 2295
 
2296
-    for($i = 0; $i <= $domain_l/$prop-1; $i++) {
2296
+    for ($i = 0; $i <= $domain_l / $prop - 1; $i++) {
2297 2297
         $end .= 'x';
2298 2298
     }
2299 2299
 
2300
-    return substr_replace($mailname, $start, 2, $name_l/$prop )
2301
-        .substr_replace($domain, $end, 2, $domain_l/$prop); 
2300
+    return substr_replace($mailname, $start, 2, $name_l / $prop)
2301
+        .substr_replace($domain, $end, 2, $domain_l / $prop); 
2302 2302
 }
2303 2303
 
2304 2304
 /**
@@ -2377,9 +2377,9 @@  discard block
 block discarded – undo
2377 2377
 
2378 2378
                             if ($entries['count'] > 0) {
2379 2379
                                 // Now check if group fits
2380
-                                for ($i=0; $i<$entries['count']; $i++) {
2381
-                                    $parsr=ldap_explode_dn($entries[$i]['dn'], 0);
2382
-                                    if (str_replace(array('CN=','cn='), '', $parsr[0]) === $SETTINGS['ldap_usergroup']) {
2380
+                                for ($i = 0; $i < $entries['count']; $i++) {
2381
+                                    $parsr = ldap_explode_dn($entries[$i]['dn'], 0);
2382
+                                    if (str_replace(array('CN=', 'cn='), '', $parsr[0]) === $SETTINGS['ldap_usergroup']) {
2383 2383
                                     $GroupRestrictionEnabled = true;
2384 2384
                                     break;
2385 2385
                                     }
Please login to merge, or discard this patch.
index.php 1 patch
Spacing   +31 added lines, -34 removed lines patch added patch discarded remove patch
@@ -91,35 +91,35 @@  discard block
 block discarded – undo
91 91
 require_once $SETTINGS['cpassman_dir'].'/sources/core.php';
92 92
 
93 93
 // Prepare POST variables
94
-$post_language =        filter_input(INPUT_POST, 'language', FILTER_SANITIZE_STRING);
95
-$post_sig_response =    filter_input(INPUT_POST, 'sig_response', FILTER_SANITIZE_STRING);
96
-$post_duo_login =       filter_input(INPUT_POST, 'duo_login', FILTER_SANITIZE_STRING);
97
-$post_duo_pwd =         filter_input(INPUT_POST, 'duo_pwd', FILTER_SANITIZE_STRING);
98
-$post_duo_data =        filter_input(INPUT_POST, 'duo_data', FILTER_SANITIZE_STRING);
99
-$post_login =           filter_input(INPUT_POST, 'login', FILTER_SANITIZE_STRING);
100
-$post_pw =              filter_input(INPUT_POST, 'pw', FILTER_SANITIZE_STRING);
94
+$post_language = filter_input(INPUT_POST, 'language', FILTER_SANITIZE_STRING);
95
+$post_sig_response = filter_input(INPUT_POST, 'sig_response', FILTER_SANITIZE_STRING);
96
+$post_duo_login = filter_input(INPUT_POST, 'duo_login', FILTER_SANITIZE_STRING);
97
+$post_duo_pwd = filter_input(INPUT_POST, 'duo_pwd', FILTER_SANITIZE_STRING);
98
+$post_duo_data = filter_input(INPUT_POST, 'duo_data', FILTER_SANITIZE_STRING);
99
+$post_login = filter_input(INPUT_POST, 'login', FILTER_SANITIZE_STRING);
100
+$post_pw = filter_input(INPUT_POST, 'pw', FILTER_SANITIZE_STRING);
101 101
 
102 102
 // Prepare superGlobal variables
103
-$session_user_language =        $superGlobal->get("user_language", "SESSION");
104
-$session_user_id =              $superGlobal->get("user_id", "SESSION");
105
-$session_user_flag =            $superGlobal->get("user_language_flag", "SESSION");
106
-$session_user_admin =           $superGlobal->get("user_admin", "SESSION");
103
+$session_user_language = $superGlobal->get("user_language", "SESSION");
104
+$session_user_id = $superGlobal->get("user_id", "SESSION");
105
+$session_user_flag = $superGlobal->get("user_language_flag", "SESSION");
106
+$session_user_admin = $superGlobal->get("user_admin", "SESSION");
107 107
 $session_user_human_resources = $superGlobal->get("user_can_manage_all_users", "SESSION");
108
-$session_user_avatar_thumb =    $superGlobal->get("user_avatar_thumb", "SESSION");
109
-$session_name =                 $superGlobal->get("name", "SESSION");
110
-$session_lastname =             $superGlobal->get("lastname", "SESSION");
111
-$session_user_manager =         $superGlobal->get("user_manager", "SESSION");
112
-$session_user_read_only =       $superGlobal->get("user_read_only", "SESSION");
113
-$session_is_admin =             $superGlobal->get("is_admin", "SESSION");
114
-$session_login =                $superGlobal->get("login", "SESSION");
115
-$session_validite_pw =          $superGlobal->get("validite_pw", "SESSION");
116
-$session_nb_folders =           $superGlobal->get("nb_folders", "SESSION");
117
-$session_nb_roles =             $superGlobal->get("nb_roles", "SESSION");
118
-$session_autoriser =            $superGlobal->get("autoriser", "SESSION");
119
-$session_hide_maintenance =     $superGlobal->get("hide_maintenance", "SESSION");
120
-$session_initial_url =          $superGlobal->get("initial_url", "SESSION");
121
-$server_request_uri =           $superGlobal->get("REQUEST_URI", "SERVER");
122
-$session_nb_users_online =      $superGlobal->get("nb_users_online", "SESSION");
108
+$session_user_avatar_thumb = $superGlobal->get("user_avatar_thumb", "SESSION");
109
+$session_name = $superGlobal->get("name", "SESSION");
110
+$session_lastname = $superGlobal->get("lastname", "SESSION");
111
+$session_user_manager = $superGlobal->get("user_manager", "SESSION");
112
+$session_user_read_only = $superGlobal->get("user_read_only", "SESSION");
113
+$session_is_admin = $superGlobal->get("is_admin", "SESSION");
114
+$session_login = $superGlobal->get("login", "SESSION");
115
+$session_validite_pw = $superGlobal->get("validite_pw", "SESSION");
116
+$session_nb_folders = $superGlobal->get("nb_folders", "SESSION");
117
+$session_nb_roles = $superGlobal->get("nb_roles", "SESSION");
118
+$session_autoriser = $superGlobal->get("autoriser", "SESSION");
119
+$session_hide_maintenance = $superGlobal->get("hide_maintenance", "SESSION");
120
+$session_initial_url = $superGlobal->get("initial_url", "SESSION");
121
+$server_request_uri = $superGlobal->get("REQUEST_URI", "SERVER");
122
+$session_nb_users_online = $superGlobal->get("nb_users_online", "SESSION");
123 123
 
124 124
 /* DEFINE WHAT LANGUAGE TO USE */
125 125
 if (isset($_GET['language']) === true) {
@@ -239,10 +239,7 @@  discard block
 block discarded – undo
239 239
         <div style="float:right; margin:-10px 5px 0 0; color:#FFF;">'
240 240
             .$LANG['index_welcome'].'&nbsp;<b>'.$session_name.'&nbsp;'.$session_lastname
241 241
             .'&nbsp;['.$session_login.']</b>&nbsp;-&nbsp;'
242
-            , $session_user_admin === '1' ? $LANG['god'] :
243
-                ($session_user_manager === '1' ? $LANG['gestionnaire'] :
244
-                    ($session_user_read_only === '1' ? $LANG['read_only_account'] :
245
-                        ($session_user_human_resources === '1' ? $LANG['human_resources'] :$LANG['user'])
242
+            , $session_user_admin === '1' ? $LANG['god'] : ($session_user_manager === '1' ? $LANG['gestionnaire'] : ($session_user_read_only === '1' ? $LANG['read_only_account'] : ($session_user_human_resources === '1' ? $LANG['human_resources'] : $LANG['user'])
246 243
                     )
247 244
                 ), '&nbsp;'.strtolower($LANG['index_login']).'</div>';
248 245
 
@@ -709,7 +706,7 @@  discard block
 block discarded – undo
709 706
 			echo '
710 707
         				<div style="margin-bottom:3px;">
711 708
         			        <label for="login" class="form_label">', isset($SETTINGS['custom_login_text']) && !empty($SETTINGS['custom_login_text']) ? (string) $SETTINGS['custom_login_text'] : $LANG['index_login'], '</label>
712
-        		            <input type="text" size="10" id="login" name="login" class="input_text text ui-widget-content ui-corner-all" value="' , $username , '" readonly />
709
+        		            <input type="text" size="10" id="login" name="login" class="input_text text ui-widget-content ui-corner-all" value="' , $username, '" readonly />
713 710
         		            <span id="login_check_wait" style="display:none; float:right;"><i class="fa fa-cog fa-spin fa-1x"></i></span>
714 711
                         </div>';
715 712
 		} else {
@@ -733,7 +730,7 @@  discard block
 block discarded – undo
733 730
                         </div>';
734 731
         }
735 732
 
736
-        if (!(isset($SETTINGS['enable_http_request_login']) === true && $SETTINGS['enable_http_request_login'] === '1' && isset($_SERVER['PHP_AUTH_USER']) === true   && !(isset($SETTINGS['maintenance_mode']) === true && $SETTINGS['maintenance_mode'] === '1')) ) {
733
+        if (!(isset($SETTINGS['enable_http_request_login']) === true && $SETTINGS['enable_http_request_login'] === '1' && isset($_SERVER['PHP_AUTH_USER']) === true && !(isset($SETTINGS['maintenance_mode']) === true && $SETTINGS['maintenance_mode'] === '1'))) {
737 734
             echo '
738 735
                         <div id="connect_pw" style="margin-bottom:3px;">
739 736
                             <label for="pw" class="form_label" id="user_pwd">'.$LANG['index_password'].'</label>
@@ -788,7 +785,7 @@  discard block
 block discarded – undo
788 785
 <script>
789 786
 var seconds = 1;
790 787
 function updateLogonButton(timeToGo){
791
-    document.getElementById("but_identify_user").value = "' . $LANG['duration_login_attempt'] . ' " + timeToGo;
788
+    document.getElementById("but_identify_user").value = "' . $LANG['duration_login_attempt'].' " + timeToGo;
792 789
 }
793 790
 $( window ).on( "load", function() {
794 791
     updateLogonButton(seconds);
@@ -845,7 +842,7 @@  discard block
 block discarded – undo
845 842
             <a href="https://www.reddit.com/r/TeamPass/" target="_blank" style="color:#F0F0F0;" class="tip" title="'.addslashes($LANG['admin_help']).'"><i class="fa fa-reddit-alien"></i></a>
846 843
             &nbsp;
847 844
             ', ($session_user_id !== null && empty($session_user_id) === false) ? '
848
-            <a href="#" style="color:#F0F0F0;" class="tip" title="'.addslashes($LANG['bugs_page']).'" onclick="generateBugReport()"><i class="fa fa-bug"></i></a>' : '' ,'
845
+            <a href="#" style="color:#F0F0F0;" class="tip" title="'.addslashes($LANG['bugs_page']).'" onclick="generateBugReport()"><i class="fa fa-bug"></i></a>' : '', '
849 846
         </div>
850 847
         <div style="float:left;width:32%;text-align:center;">
851 848
             ', ($session_user_id !== null && empty($session_user_id) === false) ? '<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>' : '', '
Please login to merge, or discard this patch.