Passed
Pull Request — master (#4777)
by David
08:50
created
html/inc/random_compat/random_bytes_libsodium.inc 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,8 +38,7 @@
 block discarded – undo
38 38
      *
39 39
      * @return string
40 40
      */
41
-    function random_bytes($bytes)
42
-    {
41
+    function random_bytes($bytes) {
43 42
         try {
44 43
             $bytes = RandomCompat_intval($bytes);
45 44
         } catch (TypeError $ex) {
Please login to merge, or discard this patch.
html/inc/random_compat/random_bytes_mcrypt.inc 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,8 +38,7 @@
 block discarded – undo
38 38
      *
39 39
      * @return string
40 40
      */
41
-    function random_bytes($bytes)
42
-    {
41
+    function random_bytes($bytes) {
43 42
         try {
44 43
             $bytes = RandomCompat_intval($bytes);
45 44
         } catch (TypeError $ex) {
Please login to merge, or discard this patch.
html/inc/token.inc 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
     $expiration = $now + $duration;
32 32
     $type = BoincDb::escape_string($type);
33 33
     $ret = BoincToken::insert("(token,userid,type,create_time,expire_time) values ('$token', $userid, '$type', $now, $expiration)");
34
-    if ( !$ret ) {
34
+    if (!$ret) {
35 35
         return null;
36 36
     }
37 37
     return $token;
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 
40 40
 function is_valid_token($userid, $token, $type) {
41 41
     $boincToken = BoincToken::lookup_valid_token($userid, $token, $type);
42
-    if ( $boincToken == null ) {
42
+    if ($boincToken == null) {
43 43
         return false;
44 44
     }
45 45
     return true;
Please login to merge, or discard this patch.
html/ops/result_summary.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,5 +26,5 @@
 block discarded – undo
26 26
 admin_show_result_summary();
27 27
 
28 28
 admin_page_tail();
29
-$cvs_version_tracker[]="\$Id$";  //Generated automatically - do not edit
29
+$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit
30 30
 ?>
Please login to merge, or discard this patch.
html/user/edit_email_action.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
             echo tra("Invalid password.");
63 63
         } else {
64 64
             $passwd_hash = md5($passwd.$email_addr);
65
-            $database_passwd_hash = password_hash($passwd_hash , PASSWORD_DEFAULT);
65
+            $database_passwd_hash = password_hash($passwd_hash, PASSWORD_DEFAULT);
66 66
             $email_addr = BoincDb::escape_string($email_addr);
67 67
             $user->email_addr_change_time = time();
68 68
             $result = $user->update(
Please login to merge, or discard this patch.
html/user/recover_email.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,9 +56,9 @@
 block discarded – undo
56 56
                 "email_addr=previous_email_addr, previous_email_addr='', email_addr_change_time=0, passwd_hash='$database_passwd_hash', email_validated=0"
57 57
             );
58 58
             $result = delete_token($userid, $token, TOKEN_TYPE_CHANGE_EMAIL);
59
-	}
59
+    }
60 60
     } else {
61
-	echo tra("Invalid token.");
61
+    echo tra("Invalid token.");
62 62
     }
63 63
 } else {
64 64
     echo tra("Invalid token.");
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
         } else {
51 51
             echo tra("Email address has been reverted.")."<br /><br />".tra("You need to reset your password:  ")."<a href=\"".secure_url_base()."get_passwd.php\">".secure_url_base()."get_passwd.php</a>";
52 52
 
53
-            $database_passwd_hash = password_hash(random_string() , PASSWORD_DEFAULT);
53
+            $database_passwd_hash = password_hash(random_string(), PASSWORD_DEFAULT);
54 54
             //Change previous_email
55 55
             $result = $tmpuser->update(
56 56
                 "email_addr=previous_email_addr, previous_email_addr='', email_addr_change_time=0, passwd_hash='$database_passwd_hash', email_validated=0"
Please login to merge, or discard this patch.
html/ops/test_token.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -11,39 +11,39 @@
 block discarded – undo
11 11
 BoincToken::insert("(token,userid,type,create_time, expire_time) values ('$token', 0, 'T', $now, $now+3600)");
12 12
 
13 13
 $boincTokens = BoincToken::enum("userid=0");
14
-foreach($boincTokens as $boincToken) {
15
-    echo $boincToken->token . "\n";
16
-    echo $boincToken->userid . "\n";
17
-    echo $boincToken->type . "\n";
18
-    echo $boincToken->create_time . "\n";
19
-    echo $boincToken->expire_time . "\n";
14
+foreach ($boincTokens as $boincToken) {
15
+    echo $boincToken->token."\n";
16
+    echo $boincToken->userid."\n";
17
+    echo $boincToken->type."\n";
18
+    echo $boincToken->create_time."\n";
19
+    echo $boincToken->expire_time."\n";
20 20
 }
21 21
 
22 22
 echo "---------------\n";
23 23
 $boincToken = BoincToken::lookup("userid=0");
24
-echo $boincToken->token . "\n";
25
-echo $boincToken->userid . "\n";
26
-echo $boincToken->type . "\n";
27
-echo $boincToken->create_time . "\n";
28
-echo $boincToken->expire_time . "\n";
24
+echo $boincToken->token."\n";
25
+echo $boincToken->userid."\n";
26
+echo $boincToken->type."\n";
27
+echo $boincToken->create_time."\n";
28
+echo $boincToken->expire_time."\n";
29 29
 
30 30
 echo "---------------\n";
31 31
 $boincToken = BoincToken::lookup_valid_token(0, $token, 'T');
32
-if ( $boincToken != null ) {
32
+if ($boincToken != null) {
33 33
     echo "Found valid token\n";
34 34
 }
35 35
 
36 36
 echo "---------------\n";
37 37
 $boincToken = BoincToken::lookup_valid_token(0, 'notrealtoken', 'T');
38
-if ( $boincToken == null ) {
38
+if ($boincToken == null) {
39 39
     echo "Successfully didn't find invalid token\n";
40 40
 }
41 41
 
42 42
 echo "---------------\n";
43 43
 $user = new BoincUser();
44
-$user->id=0;
44
+$user->id = 0;
45 45
 $token = create_token($user->id, TOKEN_TYPE_DELETE_ACCOUNT, TOKEN_DURATION_ONE_DAY);
46
-if ( is_valid_token($user->id, $token, TOKEN_TYPE_DELETE_ACCOUNT) ) {
46
+if (is_valid_token($user->id, $token, TOKEN_TYPE_DELETE_ACCOUNT)) {
47 47
     echo "Successfully created and validated delete account token";
48 48
 }
49 49
 
Please login to merge, or discard this patch.
html/inc/user_util.inc 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 
57 57
 function check_passwd_ui($user, $passwd) {
58 58
     $passwd_hash = md5($passwd.$user->email_addr);
59
-    if(!check_passwd_hash($user, $passwd_hash)) {
59
+    if (!check_passwd_hash($user, $passwd_hash)) {
60 60
         sleep(LOGIN_FAIL_SLEEP_SEC);
61 61
         page_head("Password incorrect");
62 62
         echo "The password you entered is incorrect. Please go back and try again.\n";
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 function is_banned_email_addr($email_addr) {
69 69
     global $banned_email_domains;
70 70
     if (isset($banned_email_domains)) {
71
-        foreach($banned_email_domains as $d) {
71
+        foreach ($banned_email_domains as $d) {
72 72
             $x = strstr($email_addr, $d);
73 73
             if ($x == $d) return true;
74 74
         }
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 //
97 97
 function make_user(
98 98
     $email_addr, $name, $passwd_hash,
99
-    $country=null, $postal_code=null, $project_prefs=null, $teamid=0
99
+    $country = null, $postal_code = null, $project_prefs = null, $teamid = 0
100 100
 ) {
101 101
     if (!is_valid_email_addr($email_addr)) return null;
102 102
     if (is_banned_email_addr($email_addr)) return null;
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
         show_error(tra("Passwords may only include ASCII characters."));
229 229
     }
230 230
 
231
-    if (strlen($passwd)<$min_passwd_length) {
231
+    if (strlen($passwd) < $min_passwd_length) {
232 232
         show_error(
233 233
             tra("New password is too short: minimum password length is %1 characters.", $min_passwd_length)
234 234
         );
Please login to merge, or discard this patch.
Upper-Lower-Casing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -188,14 +188,14 @@  discard block
 block discarded – undo
188 188
 
189 189
     // Check if consent to terms of use has been given.
190 190
     //
191
-    $myconsent = FALSE;
191
+    $myconsent = false;
192 192
     list($checkct, $ctid) = check_consent_type(CONSENT_TYPE_ENROLL);
193 193
     if ($checkct and check_termsofuse()) {
194 194
         $agree = post_str("agree_to_terms_of_use", true);
195 195
         if (!$agree) {
196 196
             error_page(tra("You have not agreed to our terms of use. Please agree to the terms of use by navigating back to the previous page, in order to create your account"));
197 197
         }
198
-        $myconsent = TRUE;
198
+        $myconsent = true;
199 199
     }
200 200
 
201 201
     // see whether the new account should be pre-enrolled in a team,
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
         $team = BoincTeam::lookup_id($teamid);
207 207
         $clone_user = BoincUser::lookup_id($team->userid);
208 208
         if (!$clone_user) {
209
-            error_page("User $userid not found");
209
+            error_page("user $userid not found");
210 210
         }
211 211
         $project_prefs = $clone_user->project_prefs;
212 212
     } else {
Please login to merge, or discard this patch.
html/user/delete_account_confirm.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -44,9 +44,9 @@
 block discarded – undo
44 44
     page_head(tra("Delete Account"));
45 45
     
46 46
     echo "<p>".tra("Thank you for verifying ownership of your account.")."</p>"
47
-         ."<p>".tra("You can now delete your account by entering in your password below and clicking the \"Delete Account\" button.")."</p>"
48
-         ."<p>".tra("As a reminder, your account <b>cannot be recovered</b> once you delete it.")."</p>"
49
-         ."<br/>";
47
+            ."<p>".tra("You can now delete your account by entering in your password below and clicking the \"Delete Account\" button.")."</p>"
48
+            ."<p>".tra("As a reminder, your account <b>cannot be recovered</b> once you delete it.")."</p>"
49
+            ."<br/>";
50 50
     
51 51
     form_start(secure_url_base()."delete_account_confirm.php", "post");
52 52
     form_input_hidden("token", $token);
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@
 block discarded – undo
82 82
     
83 83
     page_head(tra("Account Deleted"));
84 84
     
85
-    echo "<p>".tra("Your account has been deleted.  If you want to contribute to %1 in the future you will need to create a new account.",PROJECT)."</p>";
85
+    echo "<p>".tra("Your account has been deleted.  If you want to contribute to %1 in the future you will need to create a new account.", PROJECT)."</p>";
86 86
     
87 87
     page_tail();
88 88
 }
Please login to merge, or discard this patch.