Passed
Branch — development (e0e718)
by Nils
04:45
created
sources/main.functions.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -769,7 +769,7 @@  discard block
 block discarded – undo
769 769
         }
770 770
         // Get IDs of personal folders
771 771
         if (isset($SETTINGS['enable_pf_feature']) === true && $SETTINGS['enable_pf_feature'] === '1'
772
-            && isset($_SESSION['personal_folder']) === true &&  $_SESSION['personal_folder'] === '1'
772
+            && isset($_SESSION['personal_folder']) === true && $_SESSION['personal_folder'] === '1'
773 773
         ) {
774 774
             $persoFld = DB::queryfirstrow(
775 775
                 "SELECT id
@@ -1925,7 +1925,7 @@  discard block
 block discarded – undo
1925 1925
     $antiXss = new protect\AntiXSS\AntiXSS();
1926 1926
 
1927 1927
     // Protect against bad inputs
1928
-    if (is_array($source_file) ||is_array($target_file)) {
1928
+    if (is_array($source_file) || is_array($target_file)) {
1929 1929
         return 'error_cannot_be_array';
1930 1930
     }
1931 1931
 
@@ -2082,7 +2082,7 @@  discard block
 block discarded – undo
2082 2082
     $newArr = array();
2083 2083
 
2084 2084
     foreach ($arr as $key => $value) {
2085
-        $newArr[ $key ] = (is_array($value) ? array_map_r($func, $value) : ( is_array($func) ? call_user_func_array($func, $value) : $func( $value )));
2085
+        $newArr[$key] = (is_array($value) ? array_map_r($func, $value) : (is_array($func) ? call_user_func_array($func, $value) : $func($value)));
2086 2086
     }
2087 2087
 
2088 2088
     return $newArr;
Please login to merge, or discard this patch.
sources/tree.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -130,16 +130,16 @@  discard block
 block discarded – undo
130 130
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
131 131
 
132 132
     // Prepare superGlobal variables
133
-    $session_forbiden_pfs =                         $superGlobal->get("forbiden_pfs", "SESSION");
134
-    $session_groupes_visibles =                     $superGlobal->get("groupes_visibles", "SESSION");
135
-    $session_list_restricted_folders_for_items =    $superGlobal->get("list_restricted_folders_for_items", "SESSION");
136
-    $session_user_id =                              $superGlobal->get("user_id", "SESSION");
137
-    $session_login =                                $superGlobal->get("login", "SESSION");
138
-    $session_no_access_folders =                    $superGlobal->get("no_access_folders", "SESSION");
139
-    $session_list_folders_limited =                 $superGlobal->get("list_folders_limited", "SESSION");
140
-    $session_read_only_folders =                    $superGlobal->get("read_only_folders", "SESSION");
141
-    $session_personal_folders =                    $superGlobal->get("personal_folders", "SESSION");
142
-    $session_personal_visible_groups =                    $superGlobal->get("personal_visible_groups", "SESSION");
133
+    $session_forbiden_pfs = $superGlobal->get("forbiden_pfs", "SESSION");
134
+    $session_groupes_visibles = $superGlobal->get("groupes_visibles", "SESSION");
135
+    $session_list_restricted_folders_for_items = $superGlobal->get("list_restricted_folders_for_items", "SESSION");
136
+    $session_user_id = $superGlobal->get("user_id", "SESSION");
137
+    $session_login = $superGlobal->get("login", "SESSION");
138
+    $session_no_access_folders = $superGlobal->get("no_access_folders", "SESSION");
139
+    $session_list_folders_limited = $superGlobal->get("list_folders_limited", "SESSION");
140
+    $session_read_only_folders = $superGlobal->get("read_only_folders", "SESSION");
141
+    $session_personal_folders = $superGlobal->get("personal_folders", "SESSION");
142
+    $session_personal_visible_groups = $superGlobal->get("personal_visible_groups", "SESSION");
143 143
 
144 144
     // Be sure that user can only see folders he/she is allowed to
145 145
     if (in_array($nodeId, $session_forbiden_pfs) === false
@@ -304,15 +304,15 @@  discard block
 block discarded – undo
304 304
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
305 305
 
306 306
     // Prepare superGlobal variables
307
-    $session_forbiden_pfs =                         $superGlobal->get("forbiden_pfs", "SESSION");
308
-    $session_groupes_visibles =                     $superGlobal->get("groupes_visibles", "SESSION");
309
-    $session_list_restricted_folders_for_items =    $superGlobal->get("list_restricted_folders_for_items", "SESSION");
310
-    $session_user_id =                              $superGlobal->get("user_id", "SESSION");
311
-    $session_login =                                $superGlobal->get("login", "SESSION");
312
-    $session_user_read_only =                       $superGlobal->get("user_read_only", "SESSION");
313
-    $session_no_access_folders =                    $superGlobal->get("no_access_folders", "SESSION");
314
-    $session_list_folders_limited =                 $superGlobal->get("list_folders_limited", "SESSION");
315
-    $session_read_only_folders =                    $superGlobal->get("read_only_folders", "SESSION");
307
+    $session_forbiden_pfs = $superGlobal->get("forbiden_pfs", "SESSION");
308
+    $session_groupes_visibles = $superGlobal->get("groupes_visibles", "SESSION");
309
+    $session_list_restricted_folders_for_items = $superGlobal->get("list_restricted_folders_for_items", "SESSION");
310
+    $session_user_id = $superGlobal->get("user_id", "SESSION");
311
+    $session_login = $superGlobal->get("login", "SESSION");
312
+    $session_user_read_only = $superGlobal->get("user_read_only", "SESSION");
313
+    $session_no_access_folders = $superGlobal->get("no_access_folders", "SESSION");
314
+    $session_list_folders_limited = $superGlobal->get("list_folders_limited", "SESSION");
315
+    $session_read_only_folders = $superGlobal->get("read_only_folders", "SESSION");
316 316
 
317 317
     // Be sure that user can only see folders he/she is allowed to
318 318
     if (in_array($completTree[$nodeId]->id, $session_forbiden_pfs) === false
Please login to merge, or discard this patch.
sources/main.queries.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
             } elseif (null !== filter_input(INPUT_POST, 'change_pw_origine', FILTER_SANITIZE_STRING)
209 209
                 && ((filter_input(INPUT_POST, 'change_pw_origine', FILTER_SANITIZE_STRING) === "admin_change"
210 210
                     || filter_input(INPUT_POST, 'change_pw_origine', FILTER_SANITIZE_STRING) === "user_change"
211
-                    ) && ($_SESSION['user_admin'] === "1"|| $_SESSION['user_manager'] === "1"
211
+                    ) && ($_SESSION['user_admin'] === "1" || $_SESSION['user_manager'] === "1"
212 212
                     || $_SESSION['user_can_manage_all_users'] === "1")
213 213
                 )
214 214
             ) {
@@ -1249,10 +1249,10 @@  discard block
 block discarded – undo
1249 1249
 
1250 1250
                     // Identify url to anonymize it
1251 1251
                     if (strpos($line, 'cpassman_url') > 0 && empty($url_found) === true) {
1252
-                        $url_found = substr($line, 19, strlen($line) - 22);//echo $url_found." ; ";
1252
+                        $url_found = substr($line, 19, strlen($line) - 22); //echo $url_found." ; ";
1253 1253
                         $tmp = parse_url($url_found);
1254
-                        $anonym_url = $tmp['scheme'] . '://<anonym_url>' . $tmp['path'];
1255
-                        $line = "'cpassman_url' => '" . $anonym_url . "\n";
1254
+                        $anonym_url = $tmp['scheme'].'://<anonym_url>'.$tmp['path'];
1255
+                        $line = "'cpassman_url' => '".$anonym_url."\n";
1256 1256
                     }
1257 1257
 
1258 1258
                     // Anonymize all urls
@@ -1319,7 +1319,7 @@  discard block
 block discarded – undo
1319 1319
 
1320 1320
 **Teampass configuration file:**
1321 1321
 ```
1322
-" . $list_of_options . "
1322
+" . $list_of_options."
1323 1323
 ```
1324 1324
 
1325 1325
 **Updated from an older Teampass or fresh install:**
@@ -1334,12 +1334,12 @@  discard block
 block discarded – undo
1334 1334
 
1335 1335
 #### Web server error log
1336 1336
 ```
1337
-" . $err['message']." - ".$err['file']." (".$err['line'] .")
1337
+" . $err['message']." - ".$err['file']." (".$err['line'].")
1338 1338
 ```
1339 1339
 
1340 1340
 #### Teampass 10 last system errors
1341 1341
 ```
1342
-" . $teampass_errors ."
1342
+" . $teampass_errors."
1343 1343
 ```
1344 1344
 
1345 1345
 #### Log from the web-browser developer console (CTRL + SHIFT + i)
Please login to merge, or discard this patch.
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.
admin.settings.load.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -205,9 +205,9 @@  discard block
 block discarded – undo
205 205
                     if (val[4] !== "") {
206 206
                         newList += '<span id="encryt_data_'+val[1]+'" style="margin-left:4px; cursor:pointer;">';
207 207
                         if (val[4] === "1") {
208
-                            newList += '<i class="fa fa-key tip" title="<?php echo $LANG['encrypted_data'];?>" onclick="changeEncrypMode('+val[1]+', 1)"></i>';
208
+                            newList += '<i class="fa fa-key tip" title="<?php echo $LANG['encrypted_data']; ?>" onclick="changeEncrypMode('+val[1]+', 1)"></i>';
209 209
                         } else if (val[4] === "0") {
210
-                            newList += '<span class="fa-stack" title="<?php echo $LANG['not_encrypted_data'];?>" onclick="changeEncrypMode('+val[1]+', 0)"><i class="fa fa-key fa-stack-1x"></i><i class="fa fa-ban fa-stack-1x fa-lg" style="color:red;"></i></span>';
210
+                            newList += '<span class="fa-stack" title="<?php echo $LANG['not_encrypted_data']; ?>" onclick="changeEncrypMode('+val[1]+', 0)"><i class="fa fa-key fa-stack-1x"></i><i class="fa fa-ban fa-stack-1x fa-lg" style="color:red;"></i></span>';
211 211
                         }
212 212
                         newList += '</span>'
213 213
                     }
@@ -215,9 +215,9 @@  discard block
 block discarded – undo
215 215
                     if (val[6] !== "") {
216 216
                         newList += '<span style="margin-left:4px;">';
217 217
                         if (val[6] === "text") {
218
-                            newList += '<i class="fa fa-paragraph tip" title="<?php echo $LANG['data_is_text'];?>"></i>';
218
+                            newList += '<i class="fa fa-paragraph tip" title="<?php echo $LANG['data_is_text']; ?>"></i>';
219 219
                         } else if (val[6] === "masked") {
220
-                            newList += '<i class="fa fa-eye-slash tip" title="<?php echo $LANG['data_is_masked'];?>"></i>';
220
+                            newList += '<i class="fa fa-eye-slash tip" title="<?php echo $LANG['data_is_masked']; ?>"></i>';
221 221
                         }
222 222
                         newList += '</span>'
223 223
                     }
@@ -1028,8 +1028,8 @@  discard block
 block discarded – undo
1028 1028
         function(data) {
1029 1029
             data = prepareExchangedData(data , "decode", "<?php echo $_SESSION['key']; ?>");
1030 1030
 
1031
-            var html_admin_by = '<option value="">-- <?php echo addslashes($LANG['select']);?> --</option>',
1032
-                html_roles = '<option value="">-- <?php echo addslashes($LANG['select']);?> --</option>',
1031
+            var html_admin_by = '<option value="">-- <?php echo addslashes($LANG['select']); ?> --</option>',
1032
+                html_roles = '<option value="">-- <?php echo addslashes($LANG['select']); ?> --</option>',
1033 1033
                 selected_admin_by = 0,
1034 1034
                 selected_role = 0;
1035 1035
 
@@ -1040,7 +1040,7 @@  discard block
 block discarded – undo
1040 1040
                 if (data[i].selected_role === 1) {
1041 1041
                     selected_role = data[i].id;
1042 1042
                 }
1043
-                html_admin_by += '<option value="'+data[i].id+'"><?php echo addslashes($LANG['managers_of']." ");?>'+data[i].title+'</option>';
1043
+                html_admin_by += '<option value="'+data[i].id+'"><?php echo addslashes($LANG['managers_of']." "); ?>'+data[i].title+'</option>';
1044 1044
                 html_roles += '<option value="'+data[i].id+'">'+data[i].title+'</option>';
1045 1045
             }
1046 1046
             $("#ldap_new_user_is_administrated_by").append(html_admin_by);
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.
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
-include dirname(__FILE__) .'/../includes/config/settings.php';
16
-require_once dirname(__FILE__) .'/../includes/config/tp.config.php';
15
+include 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   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -740,7 +740,7 @@  discard block
 block discarded – undo
740 740
             $objects = explode(",", $post_object);
741 741
 
742 742
             // Allowed values for $_POST['object'] : "items,logs,files,categories"
743
-            if (in_array($objects[0], array("items","logs","files","categories")) === false) {
743
+            if (in_array($objects[0], array("items", "logs", "files", "categories")) === false) {
744 744
                 echo '[{"nextAction":"" , "error":"Input `'.$objects[0].'` is not allowed" , "nbOfItems":""}]';
745 745
                 break;
746 746
             }
@@ -1305,7 +1305,7 @@  discard block
 block discarded – undo
1305 1305
             foreach ($rows as $record) {
1306 1306
                 if (is_file($SETTINGS['path_to_upload_folder'].'/'.$record['file'])) {
1307 1307
                     $addFile = 0;
1308
-                    if ($post_option== "decrypt" && $record['status'] === 'encrypted') {
1308
+                    if ($post_option == "decrypt" && $record['status'] === 'encrypted') {
1309 1309
                         $addFile = 1;
1310 1310
                     } elseif ($post_option == "encrypt" && $record['status'] === 'clear') {
1311 1311
                         $addFile = 1;
@@ -2112,16 +2112,16 @@  discard block
 block discarded – undo
2112 2112
                         );
2113 2113
 
2114 2114
                         $debug_ldap .= 'Search filter (group): '.$filter_group."<br/>".
2115
-                          'Results : '.str_replace("\n","<br>", print_r(ldap_get_entries($ldapconn, $result_group), true))."<br/>";
2115
+                          'Results : '.str_replace("\n", "<br>", print_r(ldap_get_entries($ldapconn, $result_group), true))."<br/>";
2116 2116
 
2117 2117
                         if ($result_group) {
2118 2118
                             $entries = ldap_get_entries($ldapconn, $result_group);
2119 2119
 
2120 2120
                             if ($entries['count'] > 0) {
2121 2121
                                 // Now check if group fits
2122
-                                for ($i=0; $i<$entries['count']; $i++) {
2123
-                                  $parsr=ldap_explode_dn($entries[$i]['dn'], 0);
2124
-                                  if (str_replace(array('CN=','cn='), '', $parsr[0]) === $SETTINGS['ldap_usergroup']) {
2122
+                                for ($i = 0; $i < $entries['count']; $i++) {
2123
+                                  $parsr = ldap_explode_dn($entries[$i]['dn'], 0);
2124
+                                  if (str_replace(array('CN=', 'cn='), '', $parsr[0]) === $SETTINGS['ldap_usergroup']) {
2125 2125
                                     $GroupRestrictionEnabled = true;
2126 2126
                                     break;
2127 2127
                                   }
@@ -2134,7 +2134,7 @@  discard block
 block discarded – undo
2134 2134
                     }
2135 2135
 
2136 2136
                     $debug_ldap .= 'Search filter : '.$filter."<br/>".
2137
-                            'Results : '.str_replace("\n","<br>", print_r(ldap_get_entries($ldapconn, $result), true))."<br/>";
2137
+                            'Results : '.str_replace("\n", "<br>", print_r(ldap_get_entries($ldapconn, $result), true))."<br/>";
2138 2138
 
2139 2139
                     if (ldap_count_entries($ldapconn, $result)) {
2140 2140
                         // try auth
Please login to merge, or discard this patch.
sources/identify.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
 		}
337 337
 		$passwordClear = $_SERVER['PHP_AUTH_PW'];
338 338
 		$pwdOldEncryption = encryptOld($_SERVER['PHP_AUTH_PW']);
339
-	}else{
339
+	} else {
340 340
 		$passwordClear = htmlspecialchars_decode($dataReceived['pw']);
341 341
 		$pwdOldEncryption = encryptOld(htmlspecialchars_decode($dataReceived['pw']));
342 342
 		$username = $antiXss->xss_clean(htmlspecialchars_decode($dataReceived['login']));
@@ -487,9 +487,9 @@  discard block
 block discarded – undo
487 487
 
488 488
                                 if ($entries['count'] > 0) {
489 489
                                     // Now check if group fits
490
-                                    for ($i=0; $i<$entries['count']; $i++) {
491
-                                      $parsr=ldap_explode_dn($entries[$i]['dn'], 0);
492
-                                      if (str_replace(array('CN=','cn='), '', $parsr[0]) === $SETTINGS['ldap_usergroup']) {
490
+                                    for ($i = 0; $i < $entries['count']; $i++) {
491
+                                      $parsr = ldap_explode_dn($entries[$i]['dn'], 0);
492
+                                      if (str_replace(array('CN=', 'cn='), '', $parsr[0]) === $SETTINGS['ldap_usergroup']) {
493 493
                                         $GroupRestrictionEnabled = true;
494 494
                                         break;
495 495
                                       }
Please login to merge, or discard this patch.