@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | // send an email, using PHPMailer or not. |
| 28 | 28 | // |
| 29 | -function send_email($user, $subject, $body, $body_html=null, $email_addr=null) { |
|
| 29 | +function send_email($user, $subject, $body, $body_html = null, $email_addr = null) { |
|
| 30 | 30 | if (!$email_addr) { |
| 31 | 31 | $email_addr = $user->email_addr; |
| 32 | 32 | } |
@@ -69,17 +69,17 @@ discard block |
||
| 69 | 69 | return true; |
| 70 | 70 | } |
| 71 | 71 | } else { |
| 72 | - $headers =""; |
|
| 72 | + $headers = ""; |
|
| 73 | 73 | if (defined('EMAIL_FROM') && defined('EMAIL_FROM_NAME')) { |
| 74 | 74 | $headers = "From: ".EMAIL_FROM_NAME." <".EMAIL_FROM.">"; |
| 75 | 75 | } else if (defined('EMAIL_FROM')) { |
| 76 | - $headers = "From: ". EMAIL_FROM; |
|
| 76 | + $headers = "From: ".EMAIL_FROM; |
|
| 77 | 77 | } |
| 78 | 78 | if ($body_html) { |
| 79 | 79 | $body = "<html><body>\n"; |
| 80 | 80 | $body .= $body_html; |
| 81 | 81 | $body .= "\n</body></html>\n"; |
| 82 | - $headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n"; |
|
| 82 | + $headers .= 'Content-type: text/html; charset=UTF-8'."\r\n"; |
|
| 83 | 83 | } |
| 84 | 84 | return mail($email_addr, $subject, $body, $headers); |
| 85 | 85 | } |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | // otherwise check both IP and email |
| 161 | 161 | if ($ip && filter_var( |
| 162 | 162 | $ip, FILTER_VALIDATE_IP, |
| 163 | - FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE |
|
| 163 | + FILTER_FLAG_NO_PRIV_RANGE|FILTER_FLAG_NO_RES_RANGE |
|
| 164 | 164 | )) { |
| 165 | 165 | $x = @file_get_contents("https://www.stopforumspam.com/api?ip=".$ip."&email=".$addr); |
| 166 | 166 | } else { |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | return md5($key.'oogabooga'); |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | -function opt_out_url($user, $page="opt_out.php") { |
|
| 208 | +function opt_out_url($user, $page = "opt_out.php") { |
|
| 209 | 209 | return sprintf("%s%s?code=%s&userid=%d", |
| 210 | 210 | secure_url_base(), |
| 211 | 211 | $page, |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | |
| 58 | 58 | function check_passwd_ui($user, $passwd) { |
| 59 | 59 | $passwd_hash = md5($passwd.$user->email_addr); |
| 60 | - if(!check_passwd_hash($user, $passwd_hash)) { |
|
| 60 | + if (!check_passwd_hash($user, $passwd_hash)) { |
|
| 61 | 61 | sleep(LOGIN_FAIL_SLEEP_SEC); |
| 62 | 62 | page_head("Password incorrect"); |
| 63 | 63 | echo "The password you entered is incorrect. Please go back and try again.\n"; |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | function is_banned_email_addr($email_addr) { |
| 70 | 70 | global $banned_email_domains; |
| 71 | 71 | if (isset($banned_email_domains)) { |
| 72 | - foreach($banned_email_domains as $d) { |
|
| 72 | + foreach ($banned_email_domains as $d) { |
|
| 73 | 73 | $x = strstr($email_addr, $d); |
| 74 | 74 | if ($x == $d) return true; |
| 75 | 75 | } |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | // |
| 109 | 109 | function make_user( |
| 110 | 110 | $email_addr, $name, $passwd_hash, |
| 111 | - $country=null, $postal_code=null, $project_prefs=null, $teamid=0 |
|
| 111 | + $country = null, $postal_code = null, $project_prefs = null, $teamid = 0 |
|
| 112 | 112 | ) { |
| 113 | 113 | if (!is_valid_email_syntax($email_addr)) return null; |
| 114 | 114 | // caller generally has already checked |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | $users = BoincUser::enum( |
| 244 | 244 | sprintf("name like '%s%%'", $new_name) |
| 245 | 245 | ); |
| 246 | - foreach ($users as $u){ |
|
| 246 | + foreach ($users as $u) { |
|
| 247 | 247 | echo "<p>$u->name\n"; |
| 248 | 248 | } |
| 249 | 249 | page_tail(); |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | show_error(tra("Passwords may only include ASCII characters.")); |
| 279 | 279 | } |
| 280 | 280 | |
| 281 | - if (strlen($passwd)<$min_passwd_length) { |
|
| 281 | + if (strlen($passwd) < $min_passwd_length) { |
|
| 282 | 282 | show_error( |
| 283 | 283 | tra("New password is too short: minimum password length is %1 characters.", $min_passwd_length) |
| 284 | 284 | ); |