@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | // - daily total |
24 | 24 | // - breakdown by desc (number, credit) |
25 | 25 | |
26 | -ini_set ("memory_limit", "1G"); |
|
26 | +ini_set("memory_limit", "1G"); |
|
27 | 27 | set_time_limit(0); |
28 | 28 | |
29 | 29 | $cli_only = true; |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | add_to_array($days, $day, $granted); |
77 | 77 | } |
78 | 78 | $i++; |
79 | - if ($i % 10000 == 0) echo "$i\n"; |
|
79 | + if ($i%10000 == 0) echo "$i\n"; |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | uasort($hosts, "compare"); |
@@ -37,14 +37,14 @@ discard block |
||
37 | 37 | |
38 | 38 | // activate/deactivate script |
39 | 39 | if (1) { |
40 | - echo " |
|
40 | + echo " |
|
41 | 41 | This script needs to be activated before it can be run. |
42 | 42 | Once you understand what the script does you can change the |
43 | 43 | if (1) to if (0) at the top of the file to activate it. |
44 | 44 | Be sure to deactivate the script after using it to make sure |
45 | 45 | it is not accidentally run. |
46 | 46 | "; |
47 | - exit; |
|
47 | + exit; |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | db_init(); |
@@ -63,33 +63,33 @@ discard block |
||
63 | 63 | // loop over all users |
64 | 64 | while ($user = _mysql_fetch_object($result)) { |
65 | 65 | |
66 | - $id=$user->id; |
|
67 | - $email_addr=$user->email_addr; |
|
68 | - $cpid=$user->cross_project_id; |
|
66 | + $id=$user->id; |
|
67 | + $email_addr=$user->email_addr; |
|
68 | + $cpid=$user->cross_project_id; |
|
69 | 69 | |
70 | - $new_email=strtolower(trim($email_addr)); |
|
70 | + $new_email=strtolower(trim($email_addr)); |
|
71 | 71 | |
72 | - if (strcmp($email_addr, $new_email)) |
|
72 | + if (strcmp($email_addr, $new_email)) |
|
73 | 73 | echo "Problematic email address [$id] $email_addr becomes $new_email<br/>"; |
74 | 74 | |
75 | - if (!(strcmp($cpid,"0"))) { |
|
75 | + if (!(strcmp($cpid,"0"))) { |
|
76 | 76 | $newcpid=random_string(); |
77 | 77 | echo "Problematic CPID=0 for [$id] $email_addr gets CPID=$newcpid<br/>"; |
78 | - } |
|
79 | - else |
|
78 | + } |
|
79 | + else |
|
80 | 80 | $newcpid=$cpid; |
81 | 81 | |
82 | - if (strcmp($email_addr, $new_email) || strcmp($newcpid,$cpid)) { |
|
82 | + if (strcmp($email_addr, $new_email) || strcmp($newcpid,$cpid)) { |
|
83 | 83 | $update="update user set email_addr='$new_email', cross_project_id='$newcpid' where id='$id'"; |
84 | 84 | if ($confirm != "yes") { |
85 | - echo "QUERY WOULD BE [$id] $query <br/>[click the link at the bottom to enable]<br/>"; |
|
86 | - $update_needed = TRUE; |
|
85 | + echo "QUERY WOULD BE [$id] $query <br/>[click the link at the bottom to enable]<br/>"; |
|
86 | + $update_needed = TRUE; |
|
87 | 87 | } |
88 | 88 | else { |
89 | - _mysql_query($update); |
|
90 | - echo "Doing $update<br/>\n"; |
|
89 | + _mysql_query($update); |
|
90 | + echo "Doing $update<br/>\n"; |
|
91 | + } |
|
91 | 92 | } |
92 | - } |
|
93 | 93 | } |
94 | 94 | if ($confirm != "yes" && $update_needed) { |
95 | 95 | echo "You can enable the changes by <a href=\"make_emails_lowercase.php?confirm=yes\">click</a>"; |
@@ -63,24 +63,24 @@ discard block |
||
63 | 63 | // loop over all users |
64 | 64 | while ($user = _mysql_fetch_object($result)) { |
65 | 65 | |
66 | - $id=$user->id; |
|
67 | - $email_addr=$user->email_addr; |
|
68 | - $cpid=$user->cross_project_id; |
|
66 | + $id = $user->id; |
|
67 | + $email_addr = $user->email_addr; |
|
68 | + $cpid = $user->cross_project_id; |
|
69 | 69 | |
70 | - $new_email=strtolower(trim($email_addr)); |
|
70 | + $new_email = strtolower(trim($email_addr)); |
|
71 | 71 | |
72 | 72 | if (strcmp($email_addr, $new_email)) |
73 | 73 | echo "Problematic email address [$id] $email_addr becomes $new_email<br/>"; |
74 | 74 | |
75 | - if (!(strcmp($cpid,"0"))) { |
|
76 | - $newcpid=random_string(); |
|
75 | + if (!(strcmp($cpid, "0"))) { |
|
76 | + $newcpid = random_string(); |
|
77 | 77 | echo "Problematic CPID=0 for [$id] $email_addr gets CPID=$newcpid<br/>"; |
78 | 78 | } |
79 | 79 | else |
80 | - $newcpid=$cpid; |
|
80 | + $newcpid = $cpid; |
|
81 | 81 | |
82 | - if (strcmp($email_addr, $new_email) || strcmp($newcpid,$cpid)) { |
|
83 | - $update="update user set email_addr='$new_email', cross_project_id='$newcpid' where id='$id'"; |
|
82 | + if (strcmp($email_addr, $new_email) || strcmp($newcpid, $cpid)) { |
|
83 | + $update = "update user set email_addr='$new_email', cross_project_id='$newcpid' where id='$id'"; |
|
84 | 84 | if ($confirm != "yes") { |
85 | 85 | echo "QUERY WOULD BE [$id] $query <br/>[click the link at the bottom to enable]<br/>"; |
86 | 86 | $update_needed = TRUE; |
@@ -99,5 +99,5 @@ discard block |
||
99 | 99 | _mysql_free_result($result); |
100 | 100 | |
101 | 101 | admin_page_tail(); |
102 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
102 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
103 | 103 | ?> |
@@ -75,8 +75,7 @@ discard block |
||
75 | 75 | if (!(strcmp($cpid,"0"))) { |
76 | 76 | $newcpid=random_string(); |
77 | 77 | echo "Problematic CPID=0 for [$id] $email_addr gets CPID=$newcpid<br/>"; |
78 | - } |
|
79 | - else |
|
78 | + } else |
|
80 | 79 | $newcpid=$cpid; |
81 | 80 | |
82 | 81 | if (strcmp($email_addr, $new_email) || strcmp($newcpid,$cpid)) { |
@@ -84,8 +83,7 @@ discard block |
||
84 | 83 | if ($confirm != "yes") { |
85 | 84 | echo "QUERY WOULD BE [$id] $query <br/>[click the link at the bottom to enable]<br/>"; |
86 | 85 | $update_needed = TRUE; |
87 | - } |
|
88 | - else { |
|
86 | + } else { |
|
89 | 87 | _mysql_query($update); |
90 | 88 | echo "Doing $update<br/>\n"; |
91 | 89 | } |
@@ -83,11 +83,11 @@ |
||
83 | 83 | $update="update user set email_addr='$new_email', cross_project_id='$newcpid' where id='$id'"; |
84 | 84 | if ($confirm != "yes") { |
85 | 85 | echo "QUERY WOULD BE [$id] $query <br/>[click the link at the bottom to enable]<br/>"; |
86 | - $update_needed = TRUE; |
|
86 | + $update_needed = true; |
|
87 | 87 | } |
88 | 88 | else { |
89 | 89 | _mysql_query($update); |
90 | - echo "Doing $update<br/>\n"; |
|
90 | + echo "doing $update<br/>\n"; |
|
91 | 91 | } |
92 | 92 | } |
93 | 93 | } |
@@ -100,7 +100,7 @@ |
||
100 | 100 | $f = fopen("temp.xml", "w"); |
101 | 101 | $teams = BoincTeam::enum(null); |
102 | 102 | fwrite($f, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<teams>\n"); |
103 | - foreach($teams as $team) { |
|
103 | + foreach ($teams as $team) { |
|
104 | 104 | handle_team($team, $f); |
105 | 105 | } |
106 | 106 | fwrite($f, "</teams>\n"); |
@@ -39,7 +39,7 @@ |
||
39 | 39 | $i = 0; |
40 | 40 | foreach ($badges as $badge) { |
41 | 41 | echo "<tr class=row$i valign=top><form action=badge_admin.php method=POST>"; |
42 | - $i = 1-$i; |
|
42 | + $i = 1 - $i; |
|
43 | 43 | echo "<td>$badge->id</td>\n"; |
44 | 44 | echo "<input type=hidden name=id value=$badge->id>"; |
45 | 45 | $nu = BoincBadgeUser::count("badge_id=$badge->id"); |
@@ -28,7 +28,7 @@ |
||
28 | 28 | $updates = array(); |
29 | 29 | foreach ($db_updates as $db_update) { |
30 | 30 | if ($db_update[0] > $db_revision) { |
31 | - $db_revision = $db_update[0]; |
|
31 | + $db_revision = $db_update[0]; |
|
32 | 32 | } |
33 | 33 | } |
34 | 34 |
@@ -21,7 +21,7 @@ |
||
21 | 21 | |
22 | 22 | $db_revision = 0; |
23 | 23 | if (file_exists("../../db_revision")) { |
24 | - $db_revision = (int) file_get_contents("../../db_revision"); |
|
24 | + $db_revision = (int)file_get_contents("../../db_revision"); |
|
25 | 25 | } |
26 | 26 | require_once("db_update.php"); |
27 | 27 |
@@ -197,5 +197,5 @@ |
||
197 | 197 | |
198 | 198 | admin_page_tail(); |
199 | 199 | |
200 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
200 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
201 | 201 | ?> |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $post = array(); |
59 | 59 | $post["request"] = $xml; |
60 | 60 | if ($req->type == "upload") { |
61 | - $i=0; |
|
61 | + $i = 0; |
|
62 | 62 | foreach ($files as $f) { |
63 | 63 | if ($f['path'] != "") { |
64 | 64 | $post["file_$i"] = '@'.$f['path']; |
@@ -70,9 +70,9 @@ discard block |
||
70 | 70 | curl_setopt($ch, CURLOPT_POSTFIELDS, $post); |
71 | 71 | $reply = curl_exec($ch); |
72 | 72 | if ($reply) { |
73 | - print $reply . "\n"; |
|
73 | + print $reply."\n"; |
|
74 | 74 | } else { |
75 | - print curl_error($ch) . "\n"; |
|
75 | + print curl_error($ch)."\n"; |
|
76 | 76 | } |
77 | 77 | curl_close($ch); |
78 | 78 | } |
@@ -29,5 +29,5 @@ |
||
29 | 29 | echo "Host RPC time cleared for host ID: $hostid\n"; |
30 | 30 | |
31 | 31 | admin_page_tail(); |
32 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
32 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
33 | 33 | ?> |
@@ -40,7 +40,7 @@ |
||
40 | 40 | } |
41 | 41 | if ($is_helpdesk) { |
42 | 42 | $diff = ($now - $thread->create_time)/86400; |
43 | - $activity = ($thread->sufferers+1)/$diff; |
|
43 | + $activity = ($thread->sufferers + 1)/$diff; |
|
44 | 44 | echo "thread $thread->id helpdesk $diff $activity\n"; |
45 | 45 | } else { |
46 | 46 | $posts = BoincPost::enum("thread=$thread->id"); |