@@ -39,8 +39,8 @@ discard block |
||
39 | 39 | |
40 | 40 | // Delete a user if they have no credit, results, or posts |
41 | 41 | // |
42 | -function possibly_delete_user($user){ |
|
43 | - if ($user->total_credit > 0.0){ |
|
42 | +function possibly_delete_user($user) { |
|
43 | + if ($user->total_credit > 0.0) { |
|
44 | 44 | admin_error_page("Cannot delete user: User has credit."); |
45 | 45 | } |
46 | 46 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | admin_error_page("Cannot delete user: User has forum posts."); |
57 | 57 | } |
58 | 58 | |
59 | - if ($user->teamid){ |
|
59 | + if ($user->teamid) { |
|
60 | 60 | user_quit_team($user); |
61 | 61 | } |
62 | 62 | delete_user($user); |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | |
101 | 101 | // put a timestamp in wiki to trigger re-validation of credentials |
102 | 102 | |
103 | - if (function_exists('touch_wiki_user')){ |
|
103 | + if (function_exists('touch_wiki_user')) { |
|
104 | 104 | touch_wiki_user($user); |
105 | 105 | } |
106 | 106 |
@@ -43,14 +43,15 @@ |
||
43 | 43 | $forum_preferencess = _mysql_query("select * from forum_preferences where userid>$start_id order by userid"); |
44 | 44 | echo _mysql_error(); |
45 | 45 | $i=0; |
46 | - while ($forum_preferences = _mysql_fetch_object($forum_preferencess)){ |
|
46 | + while ($forum_preferences = _mysql_fetch_object($forum_preferencess)) { |
|
47 | 47 | $i++; |
48 | - if ($i%100 == 0) { //For every 100 forum_preferencess |
|
48 | + if ($i%100 == 0) { |
|
49 | +//For every 100 forum_preferencess |
|
49 | 50 | echo $forum_preferences->userid.". "; flush(); // print out where we are |
50 | 51 | //usleep(200000); |
51 | 52 | } |
52 | 53 | |
53 | - if ($forum_preferences->userid > $start_id){ |
|
54 | + if ($forum_preferences->userid > $start_id) { |
|
54 | 55 | fix_forum_preferences($forum_preferences); |
55 | 56 | } |
56 | 57 | } |
@@ -45,14 +45,15 @@ |
||
45 | 45 | $posts = _mysql_query("select * from post where id>$start_id order by id"); |
46 | 46 | echo _mysql_error(); |
47 | 47 | $i=0; |
48 | - while ($post = _mysql_fetch_object($posts)){ |
|
48 | + while ($post = _mysql_fetch_object($posts)) { |
|
49 | 49 | $i++; |
50 | - if ($i%100 == 0) { //For every 100 posts |
|
50 | + if ($i%100 == 0) { |
|
51 | +//For every 100 posts |
|
51 | 52 | echo $post->id.". "; flush(); // print out where we are |
52 | 53 | //usleep(200000); |
53 | 54 | } |
54 | 55 | |
55 | - if ($post->id > $start_id){ |
|
56 | + if ($post->id > $start_id) { |
|
56 | 57 | fix_post($post); |
57 | 58 | } |
58 | 59 | } |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | $email_validated = $row->email_validated; |
68 | 68 | |
69 | 69 | $team_name=""; |
70 | - if($row->teamid > 0){ |
|
70 | + if($row->teamid > 0) { |
|
71 | 71 | $team = BoincTeam::lookup_id($row->teamid); |
72 | 72 | $team_name = $team->name; |
73 | 73 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | if ($special_bits != "0") { |
81 | 81 | for ($i = 0; $i < 7; $i++) { |
82 | 82 | $bit = substr($special_bits, $i, 1); |
83 | - if ($bit == '1'){ |
|
83 | + if ($bit == '1') { |
|
84 | 84 | if (!empty($roles)) { |
85 | 85 | $roles .= ", "; |
86 | 86 | } |
@@ -97,8 +97,7 @@ discard block |
||
97 | 97 | $dt = $user->banished_until - time(); |
98 | 98 | if( $dt > 0 ) { |
99 | 99 | $x = "<span style=\"color: #ff0000\">Currently banished</span>"; |
100 | - } |
|
101 | - else { |
|
100 | + } else { |
|
102 | 101 | $x = "<span style=\"color: #ff9900\">Previously banished</span>"; |
103 | 102 | } |
104 | 103 | $roles .= $x; |
@@ -37,7 +37,7 @@ |
||
37 | 37 | FROM forum_preferences as prefs, user |
38 | 38 | WHERE CONVERT(special_user, DECIMAL) > 0 and prefs.userid=user.id" |
39 | 39 | ); |
40 | -for ($i=1; $i<=_mysql_num_rows($result); $i++){ |
|
40 | +for ($i=1; $i<=_mysql_num_rows($result); $i++) { |
|
41 | 41 | $foo = _mysql_fetch_object($result); |
42 | 42 | echo "<form action=\"manage_special_users_action.php\" method=\"POST\">\n"; |
43 | 43 | echo "<input type=\"hidden\" name=\"userid\" value=\"$foo->userid\" |
@@ -34,7 +34,7 @@ |
||
34 | 34 | |
35 | 35 | start_table(); |
36 | 36 | |
37 | -switch($table){ |
|
37 | +switch($table) { |
|
38 | 38 | case "platform": |
39 | 39 | break; |
40 | 40 | case "app": |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | do_query("alter table host add max_results_day integer not null"); |
277 | 277 | } |
278 | 278 | |
279 | -function update_4_20_2005(){ |
|
279 | +function update_4_20_2005() { |
|
280 | 280 | do_query("ALTER TABLE `thread` ADD `sticky` TINYINT UNSIGNED DEFAULT '0' NOT NULL"); |
281 | 281 | do_query("ALTER TABLE `forum` ADD `post_min_total_credit` INT NOT NULL AFTER `posts`"); |
282 | 282 | do_query("ALTER TABLE `forum` ADD `post_min_expavg_credit` INT NOT NULL AFTER `posts`"); |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | do_query("ALTER TABLE `forum_preferences` ADD `last_post` INT( 14 ) UNSIGNED NOT NULL AFTER `posts`"); |
287 | 287 | } |
288 | 288 | |
289 | -function update_4_30_2005(){ |
|
289 | +function update_4_30_2005() { |
|
290 | 290 | do_query("ALTER TABLE `forum_preferences` ADD `ignore_sticky_posts` TINYINT( 1 ) UNSIGNED NOT NULL"); |
291 | 291 | } |
292 | 292 | |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | do_query("update user set country='Macedonia' where country='Macedonia, The Former Yugoslav Republic of'"); |
314 | 314 | } |
315 | 315 | |
316 | -function update_11_24_2005(){ |
|
316 | +function update_11_24_2005() { |
|
317 | 317 | do_query("ALTER TABLE `forum_preferences` ADD `minimum_wrap_postcount` INT DEFAULT '100' NOT NULL AFTER `high_rating_threshold` , |
318 | 318 | ADD `display_wrap_postcount` INT DEFAULT '75' NOT NULL AFTER `minimum_wrap_postcount`"); |
319 | 319 | } |
@@ -618,7 +618,7 @@ discard block |
||
618 | 618 | "); |
619 | 619 | } |
620 | 620 | |
621 | -function update_10_05_2008(){ |
|
621 | +function update_10_05_2008() { |
|
622 | 622 | do_query("alter table forum_preferences add highlight_special tinyint default '1' not null"); |
623 | 623 | } |
624 | 624 |
@@ -43,14 +43,15 @@ |
||
43 | 43 | $profiles = _mysql_query("select * from profile where userid>$start_id order by userid"); |
44 | 44 | echo _mysql_error(); |
45 | 45 | $i=0; |
46 | - while ($profile = _mysql_fetch_object($profiles)){ |
|
46 | + while ($profile = _mysql_fetch_object($profiles)) { |
|
47 | 47 | $i++; |
48 | - if ($i%100 == 0) { //For every 100 profiles |
|
48 | + if ($i%100 == 0) { |
|
49 | +//For every 100 profiles |
|
49 | 50 | echo $profile->userid.". "; flush(); // print out where we are |
50 | 51 | //usleep(200000); |
51 | 52 | } |
52 | 53 | |
53 | - if ($profile->userid > $start_id){ |
|
54 | + if ($profile->userid > $start_id) { |
|
54 | 55 | fix_profile($profile); |
55 | 56 | } |
56 | 57 | } |
@@ -345,8 +345,7 @@ discard block |
||
345 | 345 | if (!$account) { |
346 | 346 | global $user; |
347 | 347 | $account = user_load($user->id); |
348 | - } |
|
349 | - elseif (is_numeric($account)) { |
|
348 | + } elseif (is_numeric($account)) { |
|
350 | 349 | $account = user_load($account); |
351 | 350 | } |
352 | 351 | |
@@ -422,13 +421,11 @@ discard block |
||
422 | 421 | // (except in cases where password is being reset) |
423 | 422 | if (isset($_SESSION['reset_pass'])) { |
424 | 423 | unset($_SESSION['reset_pass']); |
425 | - } |
|
426 | - else { |
|
424 | + } else { |
|
427 | 425 | $given_hash = md5($edit['current_pass'] . strtolower($account->mail)); |
428 | 426 | if (!$edit['current_pass']) { |
429 | 427 | form_set_error('current_pass', bts('Authentication is required when changing E-mail address or setting new password.', array(), NULL, 'boinc:account-credentials-change')); |
430 | - } |
|
431 | - elseif ( (!password_verify($given_hash, $boinc_user->passwd_hash)) and ($given_hash != $boinc_user->passwd_hash) ) { |
|
428 | + } elseif ( (!password_verify($given_hash, $boinc_user->passwd_hash)) and ($given_hash != $boinc_user->passwd_hash) ) { |
|
432 | 429 | form_set_error('current_pass', bts('Password entered is not valid. Please verify that it is correct.', array(), NULL, 'boinc:account-credentials-change')); |
433 | 430 | } |
434 | 431 |