Completed
Pull Request — master (#2472)
by Kevin
10:40
created
html/ops/test_token.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,13 +28,13 @@
 block discarded – undo
28 28
 echo "---------------\n";
29 29
 $boincToken = BoincToken::lookup_valid_token(0, $token, 'T');
30 30
 if ( $boincToken != null ) {
31
-   echo "Found valid token\n";
31
+    echo "Found valid token\n";
32 32
 }
33 33
 
34 34
 echo "---------------\n";
35 35
 $boincToken = BoincToken::lookup_valid_token(0, 'notrealtoken', 'T');
36 36
 if ( $boincToken == null ) {
37
-   echo "Successfully didn't find invalid token\n";
37
+    echo "Successfully didn't find invalid token\n";
38 38
 }
39 39
 
40 40
 echo "---------------\n";
Please login to merge, or discard this patch.
html/user/delete_account_request.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
         ."</ul><br/>";
38 38
     
39 39
     form_start(secure_url_base()."delete_account_request.php", "post");
40
-    form_input_text(tra("Password"), "passwd", "", "password",'id="passwd"',passwd_visible_checkbox("passwd"));
40
+    form_input_text(tra("Password"), "passwd", "", "password", 'id="passwd"', passwd_visible_checkbox("passwd"));
41 41
     form_submit(tra("Send Confirmation Email"));
42 42
     form_end();
43 43
     
Please login to merge, or discard this patch.
html/inc/token.inc 1 patch
Doc Comments   +7 added lines patch added patch discarded remove patch
@@ -25,6 +25,10 @@  discard block
 block discarded – undo
25 25
 // Constants for token durations
26 26
 define("TOKEN_DURATION_ONE_DAY", 86400);
27 27
 
28
+/**
29
+ * @param string $type
30
+ * @param integer $duration
31
+ */
28 32
 function create_token($userid, $type, $duration) {
29 33
     $token = random_string();
30 34
     $now = time();
@@ -37,6 +41,9 @@  discard block
 block discarded – undo
37 41
     return $token;
38 42
 }
39 43
 
44
+/**
45
+ * @param string $type
46
+ */
40 47
 function is_valid_token($userid, $token, $type) {
41 48
     $boincToken = BoincToken::lookup_valid_token($userid, $token, $type);
42 49
     if ( $boincToken == null ) {
Please login to merge, or discard this patch.
html/inc/email.inc 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
 // send an email, using PHPMailer or not.
27 27
 //
28
-function send_email($user, $subject, $body, $body_html=null) {
28
+function send_email($user, $subject, $body, $body_html = null) {
29 29
     if (function_exists("make_php_mailer")) {
30 30
         require_once("../inc/phpmailer/class.phpmailer.php");
31 31
         $mail = make_php_mailer();
@@ -44,11 +44,11 @@  discard block
 block discarded – undo
44 44
             return true;
45 45
         }
46 46
     } else {
47
-        $headers ="";
47
+        $headers = "";
48 48
         if (defined('EMAIL_FROM') && defined('EMAIL_FROM_NAME')) {
49 49
             $headers = "From: ".EMAIL_FROM_NAME." <".EMAIL_FROM.">";
50 50
         } else if (defined('EMAIL_FROM')) {
51
-            $headers = "From: ". EMAIL_FROM;
51
+            $headers = "From: ".EMAIL_FROM;
52 52
         }
53 53
         return mail($user->email_addr, $subject, $body, $headers);
54 54
     }
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
     if (defined("USE_STOPFORUMSPAM") && USE_STOPFORUMSPAM && array_key_exists('REMOTE_ADDR', $_SERVER)) {
97 97
         $ip = $_SERVER['REMOTE_ADDR'];
98 98
         // For obviously private IPs check just the email against SFS, otherwise check both IP and email
99
-        if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) {
99
+        if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE|FILTER_FLAG_NO_RES_RANGE)) {
100 100
             $x = @file_get_contents("https://www.stopforumspam.com/api?ip=".$ip."&email=".$addr);
101 101
         } else {
102 102
             $x = @file_get_contents("https://www.stopforumspam.com/api?email=".$addr);
@@ -107,12 +107,12 @@  discard block
 block discarded – undo
107 107
     }
108 108
     $pattern = '/^([^@]+)@([^@\.]+)\.([^@]{2,})$/';
109 109
     $match = preg_match($pattern, $addr);
110
-    return (bool) $match;
110
+    return (bool)$match;
111 111
 }
112 112
 
113 113
 function send_confirm_delete_email($user) {
114 114
     $token = create_token($user->id, TOKEN_TYPE_DELETE_ACCOUNT, TOKEN_DURATION_ONE_DAY);
115
-    if ( $token == null ) {
115
+    if ($token == null) {
116 116
         error_page("Error creating token.  Please try again later.");
117 117
     }
118 118
     
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
@@ -32,9 +32,9 @@
 block discarded – undo
32 32
     page_head(tra("Delete Account"));
33 33
     
34 34
     echo "<p>".tra("Thank you for verifying ownership of your account.")."</p>"
35
-         ."<p>".tra("You can now delete your account by entering in your password below and clicking the \"Delete Account\" button.")."</p>"
36
-         ."<p>".tra("As a reminder, your account <b>cannot be recovered</b> once you delete it.")."</p>"
37
-         ."<br/>";
35
+            ."<p>".tra("You can now delete your account by entering in your password below and clicking the \"Delete Account\" button.")."</p>"
36
+            ."<p>".tra("As a reminder, your account <b>cannot be recovered</b> once you delete it.")."</p>"
37
+            ."<br/>";
38 38
     
39 39
     form_start(secure_url_base()."delete_account_confirm.php", "post");
40 40
     form_input_hidden("token",$token);
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -37,9 +37,9 @@  discard block
 block discarded – undo
37 37
          ."<br/>";
38 38
     
39 39
     form_start(secure_url_base()."delete_account_confirm.php", "post");
40
-    form_input_hidden("token",$token);
41
-    form_input_hidden("id",$userid);
42
-    form_input_text(tra("Password"), "passwd", "", "password",'id="passwd"',passwd_visible_checkbox("passwd"));
40
+    form_input_hidden("token", $token);
41
+    form_input_hidden("id", $userid);
42
+    form_input_text(tra("Password"), "passwd", "", "password", 'id="passwd"', passwd_visible_checkbox("passwd"));
43 43
     form_submit(tra("Delete Account"));
44 44
     form_end();
45 45
     
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
     $passwd = post_str("passwd");
58 58
     check_passwd_ui($user, $passwd);
59 59
     
60
-    if ( !delete_account($user) ) {
60
+    if (!delete_account($user)) {
61 61
         error_page(
62 62
             tra("Failed to delete your account.  Please contact the project administrator.")
63 63
         );    
Please login to merge, or discard this patch.
html/inc/user.inc 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -33,13 +33,13 @@  discard block
 block discarded – undo
33 33
 // they've participated in
34 34
 //
35 35
 function get_other_projects($user) {
36
-    $cpid = md5($user->cross_project_id . $user->email_addr);
36
+    $cpid = md5($user->cross_project_id.$user->email_addr);
37 37
     $url = "http://boinc.netsoft-online.com/get_user.php?cpid=".$cpid;
38 38
 
39 39
     // Check the cache for that URL
40 40
     //
41 41
     $cacheddata = get_cached_data(REMOTE_PROJECTS_TTL, $url);
42
-    if ($cacheddata){
42
+    if ($cacheddata) {
43 43
         $remote = unserialize($cacheddata);
44 44
     } else {
45 45
         // Fetch the XML, use curl if fopen() is disallowed
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 
111 111
 function cmp($a, $b) {
112 112
     if ($a->expavg_credit == $b->expavg_credit) return 0;
113
-    return ($a->expavg_credit < $b->expavg_credit)? 1 : -1;
113
+    return ($a->expavg_credit < $b->expavg_credit) ? 1 : -1;
114 114
 }
115 115
 
116 116
 function show_other_projects($user, $personal) {
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
         ),
134 134
         array("", ALIGN_RIGHT, ALIGN_RIGHT, ALIGN_RIGHT)
135 135
     );
136
-    foreach($user->projects as $project) {
136
+    foreach ($user->projects as $project) {
137 137
         show_project($project);
138 138
     }
139 139
     end_table();
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
     }
175 175
 
176 176
     if (!NO_STATS) {
177
-        $cpid = md5($user->cross_project_id . $user->email_addr);
177
+        $cpid = md5($user->cross_project_id.$user->email_addr);
178 178
         $x = "";
179 179
         shuffle($cpid_stats_sites);
180 180
         foreach ($cpid_stats_sites as $site) {
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
     } else {
263 263
         $delete_account_str = "";
264 264
         $config = get_config();
265
-        if ( parse_bool($config, "enable_delete_account") ) {
265
+        if (parse_bool($config, "enable_delete_account")) {
266 266
             $delete_account_str = " &middot; <a href=\"delete_account_request.php\">".tra("delete account")."</a>";
267 267
         }
268 268
         
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 // show user name, with links to profile if present.
328 328
 // if $badge_height is > 0, show badges
329 329
 //
330
-function user_links($user, $badge_height=0) {
330
+function user_links($user, $badge_height = 0) {
331 331
     BoincForumPrefs::lookup($user);
332 332
     if (is_banished($user)) {
333 333
         return "(banished: ID $user->id)";
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
         $x .= ' <a href="'.url_base().'view_profile.php?userid='.$user->id.'"><img title="View the profile of '.$user->name.'" src="'.$img_url.'" alt="Profile"></a>';
339 339
     }
340 340
     $x .= " <a href=\"".url_base()."show_user.php?userid=".$user->id."\">".$user->name."</a>";
341
-    if (function_exists("project_user_links")){
341
+    if (function_exists("project_user_links")) {
342 342
         $x .= project_user_links($user);
343 343
     }
344 344
     if ($badge_height) {
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
 
392 392
             // if there's a foundership request, notify the founder
393 393
             //
394
-            if ($user->id==$team->userid && $team->ping_user >0) {
394
+            if ($user->id == $team->userid && $team->ping_user > 0) {
395 395
                 $x .= "<p class=\"text-danger\">".tra("(foundership change request pending)")."</p>";
396 396
             }
397 397
             row2(tra("Member of team"), $x);
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
     $x = "<a href=\"user_search.php\">".tra("Find friends")."</a><br/>\n";
417 417
     $n = count($friends);
418 418
     if ($n) {
419
-        foreach($friends as $friend) {
419
+        foreach ($friends as $friend) {
420 420
             $fuser = BoincUser::lookup_id($friend->user_dest);
421 421
             if (!$fuser) continue;
422 422
             $x .= friend_links($fuser);
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
 // Returns a cacheable community links data object
460 460
 // @param user The user to produce a community links object for
461 461
 
462
-function get_community_links_object($user){
462
+function get_community_links_object($user) {
463 463
     $cache_object = new StdClass;
464 464
     $cache_object->post_count = total_posts($user);
465 465
     $cache_object->user = $user;
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
     $cache_object->friends = array();
468 468
 
469 469
     $friends = BoincFriend::enum("user_src=$user->id and reciprocated=1");
470
-    foreach($friends as $friend) {
470
+    foreach ($friends as $friend) {
471 471
         $fuser = BoincUser::lookup_id($friend->user_dest);
472 472
         if (!$fuser) continue;
473 473
         $cache_object->friends[] = $fuser;
@@ -475,7 +475,7 @@  discard block
 block discarded – undo
475 475
     return $cache_object;
476 476
 }
477 477
 
478
-function community_links($clo, $logged_in_user){
478
+function community_links($clo, $logged_in_user) {
479 479
     $user = $clo->user;
480 480
     $team = $clo->team;
481 481
     $friends = $clo->friends;
@@ -501,15 +501,15 @@  discard block
 block discarded – undo
501 501
                 "<a href=\"friend.php?action=cancel_confirm&userid=$user->id\">".tra("Cancel friendship")."</a>"
502 502
             );
503 503
         } else if ($friend) {
504
-            row2(tra("Friends"),  "<a href=\"friend.php?action=add&userid=$user->id\">".tra("Request pending")."</a>");
504
+            row2(tra("Friends"), "<a href=\"friend.php?action=add&userid=$user->id\">".tra("Request pending")."</a>");
505 505
         } else {
506
-            row2(tra("Friends"),  "<a href=\"friend.php?action=add&userid=$user->id\">".tra("Add as friend")."</a>");
506
+            row2(tra("Friends"), "<a href=\"friend.php?action=add&userid=$user->id\">".tra("Add as friend")."</a>");
507 507
         }
508 508
     }
509 509
     
510 510
     if ($friends) {
511 511
         $x = "";
512
-        foreach($friends as $friend) {
512
+        foreach ($friends as $friend) {
513 513
             $x .= friend_links($friend);
514 514
         }
515 515
         row2(tra("Friends")." (".sizeof($friends).")", $x);
@@ -554,6 +554,6 @@  discard block
 block discarded – undo
554 554
 }
555 555
 
556 556
 
557
-$cvs_version_tracker[]="\$Id$";  //Generated automatically - do not edit
557
+$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit
558 558
 
559 559
 ?>
Please login to merge, or discard this patch.
html/inc/delete_account.inc 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -32,14 +32,14 @@  discard block
 block discarded – undo
32 32
 define("DELETE_ACCOUNT_METHOD_PROJECT_DEFINED", 3);
33 33
 
34 34
 $config = get_config();
35
-if ( !parse_bool($config, "enable_delete_account") ) {
35
+if (!parse_bool($config, "enable_delete_account")) {
36 36
     error_page(
37 37
         tra("This feature is disabled.  Please contact the project administrator.")
38 38
     );
39 39
 }
40 40
 
41 41
 function check_delete_account_token($userid, $token) {
42
-    if( !is_valid_token($userid, $token, TOKEN_TYPE_DELETE_ACCOUNT) ) {
42
+    if (!is_valid_token($userid, $token, TOKEN_TYPE_DELETE_ACCOUNT)) {
43 43
         sleep(LOGIN_FAIL_SLEEP_SEC);
44 44
         error_page(
45 45
             tra("The token you used has expired or is otherwise not valid.  Please request a new one <a href=\"delete_account_request.php\">here</a>")
@@ -65,11 +65,11 @@  discard block
 block discarded – undo
65 65
 function delete_account($user) {
66 66
     $config = get_config();
67 67
     $enable_delete_account = parse_config($config, "<enable_delete_account>");
68
-    if ( $enable_delete_account == DELETE_ACCOUNT_METHOD_OBFUSCATE ) {
68
+    if ($enable_delete_account == DELETE_ACCOUNT_METHOD_OBFUSCATE) {
69 69
         return obfuscate_account($user);
70
-    } else if ( $enable_delete_account == DELETE_ACCOUNT_METHOD_WIPE ) {
70
+    } else if ($enable_delete_account == DELETE_ACCOUNT_METHOD_WIPE) {
71 71
         return wipe_account($user);
72
-    } else if ( $enable_delete_account == DELETE_ACCOUNT_METHOD_PROJECT_DEFINED ) {
72
+    } else if ($enable_delete_account == DELETE_ACCOUNT_METHOD_PROJECT_DEFINED) {
73 73
         return project_delete_account($user);
74 74
     } else {
75 75
         error_page(
@@ -109,11 +109,11 @@  discard block
 block discarded – undo
109 109
     insert_deleted_records($user);
110 110
 
111 111
     // delete remote submit user
112
-    delete_remote_submit_user($user);  // from submit_util.inc
112
+    delete_remote_submit_user($user); // from submit_util.inc
113 113
     
114 114
     // remove user's team records
115
-    user_erase_team_owner($user);      // from team.inc
116
-    user_quit_team($user);        // from team.inc
115
+    user_erase_team_owner($user); // from team.inc
116
+    user_quit_team($user); // from team.inc
117 117
     user_erase_team_delta($user); // from team.inc
118 118
     
119 119
     // Items that do not have logic elsewhere
@@ -136,6 +136,6 @@  discard block
 block discarded – undo
136 136
     BoincHost::delete_for_user($user->id);
137 137
 
138 138
     // final action
139
-    delete_user($user);  //from user_util.inc
139
+    delete_user($user); //from user_util.inc
140 140
     return true;
141 141
 }
142 142
\ No newline at end of file
Please login to merge, or discard this patch.
html/inc/team.inc 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     row2('<b>'.tra('Search criteria (use one or more)').'</b>', '');
41 41
     row2(
42 42
         tra('Key words').'<br><small>'.tra('Find teams with these words in their names or descriptions').'</small>',
43
-        '<input class="form-control" type="text" name="keywords" value="' . htmlspecialchars($params->keywords) . '">');
43
+        '<input class="form-control" type="text" name="keywords" value="'.htmlspecialchars($params->keywords).'">');
44 44
     row2_init(tra('Country'), '');
45 45
     echo '<select class="form-control" name="country"><option value="" selected>---</option>';
46 46
     $country = $params->country;
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
     echo country_select_options($country);
49 49
     echo "</select></td></tr>\n";
50 50
     row2(tra('Type of team'), team_type_select($params->type, true));
51
-    $checked = $params->active?"checked":"";
51
+    $checked = $params->active ? "checked" : "";
52 52
     row2(tra('Show only active teams'), "<input type=checkbox name=active $checked>");
53 53
     row2("", "<input class=\"btn btn-primary\" type=submit name=submit value=\"".tra('Search')."\">");
54 54
     end_table();
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
     row2("Created", date_str($team->create_time));
97 97
     if (defined("SHOW_NONVALIDATED_TEAMS")) {
98 98
         $founder = $team->founder;
99
-        row2("Founder email validated", $founder->email_validated?"Yes":"No (team will not be exported)");
99
+        row2("Founder email validated", $founder->email_validated ? "Yes" : "No (team will not be exported)");
100 100
     }
101 101
     if (strlen($team->url)) {;
102 102
         if (strstr($team->url, "http://")) {
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
     }
170 170
     row1(tra('Members'));
171 171
     row2(tra('Founder'),
172
-        $team->founder?user_links($team->founder, BADGE_HEIGHT_MEDIUM):"---"
172
+        $team->founder ?user_links($team->founder, BADGE_HEIGHT_MEDIUM) : "---"
173 173
     );
174 174
     if (count($team->admins)) {
175 175
         $first = true;
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
         foreach ($deltas as $delta) {
354 354
             $u = BoincUser::lookup_id($delta->userid);
355 355
             if ($u->teamid == $teamid) {
356
-                $new_members[] = $u;  // they might have later quit
356
+                $new_members[] = $u; // they might have later quit
357 357
             }
358 358
         }
359 359
     }
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
     if (!$user->teamid) return;
437 437
     $user->update("teamid=0");
438 438
     $team = BoincTeam::lookup_id($user->teamid);
439
-    if ($team && $team->ping_user==$user->id) {
439
+    if ($team && $team->ping_user == $user->id) {
440 440
         $team->update("ping_user=-ping_user");
441 441
     }
442 442
     BoincTeamAdmin::delete("teamid=$user->teamid and userid=$user->id");
@@ -475,34 +475,34 @@  discard block
 block discarded – undo
475 475
     start_table();
476 476
     row2(tra('Team name, text version').'
477 477
         <br><p class=\"text-muted\">'.tra('Don\'t use HTML tags.').'</p>',
478
-        '<input class="form-control" name="name" type="text" size="50" value="'.($team?$team->name:"").'">'
478
+        '<input class="form-control" name="name" type="text" size="50" value="'.($team ? $team->name : "").'">'
479 479
     );
480 480
     row2(tra('Team name, HTML version').'
481 481
         <br><p class=\"text-muted\">
482 482
         '.tra('You may use %1 limited HTML tags %2.', '<a href="html.php" target="_new">', '</a>').'
483 483
         '.tra('If you don\'t know HTML, leave this box blank.').'</p>',
484
-        '<input class="form-control" name="name_html" type="text" size="50" value="'.str_replace('"',"'",($team?$team->name_html:"")).'">'
484
+        '<input class="form-control" name="name_html" type="text" size="50" value="'.str_replace('"', "'", ($team ? $team->name_html : "")).'">'
485 485
     );
486 486
     row2(tra('URL of team web page, if any').':<br><font size=-2>('.tra('without "http://"').')
487 487
         '.tra('This URL will be linked to from the team\'s page on this site.'),
488
-        '<input class="form-control" type="text" name="url" size="60" value="'.($team?$team->url:"").'">'
488
+        '<input class="form-control" type="text" name="url" size="60" value="'.($team ? $team->url : "").'">'
489 489
     );
490 490
     row2(tra('Description of team').':
491 491
         <br><p class=\"text-muted\">
492 492
         '.tra('You may use %1 limited HTML tags %2.', '<a href="html.php" target="_new">', '</a>').'
493 493
         </p>',
494
-        '<textarea class="form-control" name="description" rows=10>'.($team?$team->description:"").'</textarea>'
494
+        '<textarea class="form-control" name="description" rows=10>'.($team ? $team->description : "").'</textarea>'
495 495
     );
496 496
 
497
-    row2(tra('Type of team').':', team_type_select($team?$team->type:null));
497
+    row2(tra('Type of team').':', team_type_select($team ? $team->type : null));
498 498
 
499 499
     row2_init(tra('Country'),
500 500
         '<select class="form-control" name="country">'
501 501
     );
502
-    echo country_select_options($team?$team->country:null);
502
+    echo country_select_options($team ? $team->country : null);
503 503
 
504 504
     echo "</select></td></tr>\n";
505
-    $x = (!$team || $team->joinable)?"checked":"";
505
+    $x = (!$team || $team->joinable) ? "checked" : "";
506 506
     row2(tra("Accept new members?"), "<input type=checkbox name=joinable $x>");
507 507
     // Check if we're using reCaptcha to prevent spam accounts
508 508
     //
@@ -566,12 +566,12 @@  discard block
 block discarded – undo
566 566
 //
567 567
 function new_transfer_request_ok($team, $now) {
568 568
     if ($team->ping_user <= 0) {
569
-        if ($team->ping_time < $now - 60 * 86400) {
569
+        if ($team->ping_time < $now - 60*86400) {
570 570
             return true;
571 571
         }
572 572
         return false;
573 573
     }
574
-    if ($team->ping_time < $now - 90 * 86400) {
574
+    if ($team->ping_time < $now - 90*86400) {
575 575
         return true;
576 576
     }
577 577
     return false;
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
     if (!is_valid_country($country)) {
607 607
         $country = tra('None');
608 608
     }
609
-    $country = BoincDb::escape_string($country);  // for Cote d'Ivoire
609
+    $country = BoincDb::escape_string($country); // for Cote d'Ivoire
610 610
 
611 611
     $clause = sprintf(
612 612
         "(userid, create_time, name, name_lc, url, type, name_html, description, country, nusers, expavg_time) values(%d, %d, '%s', '%s', '%s', %d, '%s', '%s', '%s', %d, unix_timestamp())",
@@ -629,6 +629,6 @@  discard block
 block discarded – undo
629 629
     }
630 630
 }
631 631
 
632
-$cvs_version_tracker[]="\$Id$";  //Generated automatically - do not edit
632
+$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit
633 633
 
634 634
 ?>
Please login to merge, or discard this patch.
html/inc/user_util.inc 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
 }
56 56
 
57 57
 function check_passwd_ui($user, $passwd) {
58
-		$passwd_hash = md5($passwd.$user->email_addr);
58
+        $passwd_hash = md5($passwd.$user->email_addr);
59 59
     if( !check_passwd_hash($user, $passwd_hash) ) {
60 60
         sleep(LOGIN_FAIL_SLEEP_SEC);
61 61
         page_head("Password incorrect");
Please login to merge, or discard this patch.
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;
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
         show_error(tra("Passwords may only include ASCII characters."));
225 225
     }
226 226
 
227
-    if (strlen($passwd)<$min_passwd_length) {
227
+    if (strlen($passwd) < $min_passwd_length) {
228 228
         show_error(
229 229
             tra("New password is too short: minimum password length is %1 characters.", $min_passwd_length)
230 230
         );
Please login to merge, or discard this patch.