@@ -27,8 +27,8 @@ discard block |
||
27 | 27 | row1("Current special users", '9'); |
28 | 28 | |
29 | 29 | echo "<tr><td>User</td>"; |
30 | -for ($i=0; $i<S_NFLAGS; $i++) { |
|
31 | - echo "<td width=\"15\">" . $special_user_bitfield[$i] . "</td>\n"; |
|
30 | +for ($i = 0; $i < S_NFLAGS; $i++) { |
|
31 | + echo "<td width=\"15\">".$special_user_bitfield[$i]."</td>\n"; |
|
32 | 32 | } |
33 | 33 | echo "</tr>"; |
34 | 34 | |
@@ -37,13 +37,13 @@ discard block |
||
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\" |
44 | 44 | <tr><td>$foo->name ($foo->id)</td> |
45 | 45 | "; |
46 | - for ($j=0; $j<S_NFLAGS; $j++) { |
|
46 | + for ($j = 0; $j < S_NFLAGS; $j++) { |
|
47 | 47 | $bit = substr($foo->special_user, $j, 1); |
48 | 48 | echo "<td><input type=\"checkbox\" name=\"role".$j."\" value=\"1\""; |
49 | 49 | if ($bit == 1) { |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | echo "<tr><form action=\"manage_special_users_action.php\" method=\"POST\">\n"; |
59 | 59 | echo "<td>Add UserID:<input type=\"text\" name=\"userid\" size=\"6\"></td>"; |
60 | 60 | |
61 | -for ($j=0; $j<S_NFLAGS; $j++) { |
|
61 | +for ($j = 0; $j < S_NFLAGS; $j++) { |
|
62 | 62 | echo "<td><input type=\"checkbox\" name=\"role".$j."\" value=\"1\""; |
63 | 63 | echo "></td>\n"; |
64 | 64 | } |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | // For display, convert query string characters < and > into 'html form' so |
65 | 65 | // that they will be displayed. |
66 | 66 | // |
67 | -$html_text=str_replace('<', '<', str_replace('>', '>', $main_query)); |
|
67 | +$html_text = str_replace('<', '<', str_replace('>', '>', $main_query)); |
|
68 | 68 | |
69 | 69 | echo "<p>Query: <b>$html_text</b><p>\n"; |
70 | 70 | |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | if ($result) { |
160 | 160 | if ($detail == "low") { |
161 | 161 | start_table('table-striped'); |
162 | - switch($table) { |
|
162 | + switch ($table) { |
|
163 | 163 | case "result": |
164 | 164 | result_short_header(); |
165 | 165 | break; |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | admin_page_head("Cancel Jobs"); |
30 | 30 | |
31 | 31 | $limit = get_int('limit', true); |
32 | -if (!$limit || $limit==0) { |
|
32 | +if (!$limit || $limit == 0) { |
|
33 | 33 | $limit = 100; |
34 | 34 | } |
35 | 35 | |
@@ -42,9 +42,9 @@ discard block |
||
42 | 42 | $clause = get_str('clause', true); |
43 | 43 | |
44 | 44 | if ($minid && $maxid) { |
45 | - $qclause = "id >=" . $minid . " AND id <=" . $maxid; |
|
45 | + $qclause = "id >=".$minid." AND id <=".$maxid; |
|
46 | 46 | } else if ($list) { |
47 | - $qclause = "id IN (" . $list . ")"; |
|
47 | + $qclause = "id IN (".$list.")"; |
|
48 | 48 | } else if ($uclause) { |
49 | 49 | $qclause = urldecode($uclause); |
50 | 50 | } else if ($clause) { |
@@ -63,24 +63,24 @@ |
||
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; |
@@ -25,11 +25,11 @@ |
||
25 | 25 | |
26 | 26 | $bitset = ''; |
27 | 27 | |
28 | -for ($i=0;$i<S_NFLAGS;$i++) { |
|
28 | +for ($i = 0; $i < S_NFLAGS; $i++) { |
|
29 | 29 | if (post_int("role".$i, TRUE) == '1') { |
30 | - $bitset = str_pad($bitset, $i+1, '1'); |
|
30 | + $bitset = str_pad($bitset, $i + 1, '1'); |
|
31 | 31 | } else { |
32 | - $bitset = str_pad($bitset, $i+1, '0'); |
|
32 | + $bitset = str_pad($bitset, $i + 1, '0'); |
|
33 | 33 | } |
34 | 34 | } |
35 | 35 | if ($bitset == "0000000") $bitset = ''; |
@@ -37,12 +37,12 @@ discard block |
||
37 | 37 | Average credit: ".$host->expavg_credit." |
38 | 38 | Average update time: ".time_str($host->expavg_time)." |
39 | 39 | IP address: $host->last_ip_addr (same the last $host->nsame_ip_addr times) |
40 | - Domain name: " . $host->domain_name; |
|
40 | + Domain name: ".$host->domain_name; |
|
41 | 41 | $x = $host->timezone/3600; |
42 | - if ($x >= 0) $x="+$x"; |
|
43 | - $host_content.=" |
|
42 | + if ($x >= 0) $x = "+$x"; |
|
43 | + $host_content .= " |
|
44 | 44 | Local Time = UTC $x hours |
45 | - Number of CPUs: " . $host->p_ncpus." |
|
45 | + Number of CPUs: ".$host->p_ncpus." |
|
46 | 46 | CPU: $host->p_vendor $host->p_model |
47 | 47 | FP ops/sec: ".$host->p_fpops." |
48 | 48 | Int ops/sec: ".$host->p_iops." |
@@ -50,28 +50,28 @@ discard block |
||
50 | 50 | Operating System: $host->os_name $host->os_version"; |
51 | 51 | $x = $host->m_nbytes/(1024*1024); |
52 | 52 | $y = round($x, 2); |
53 | - $host_content.=" |
|
53 | + $host_content .= " |
|
54 | 54 | Memory: $y MB"; |
55 | 55 | $x = $host->m_cache/1024; |
56 | 56 | $y = round($x, 2); |
57 | - $host_content.=" |
|
57 | + $host_content .= " |
|
58 | 58 | Cache: $y KB"; |
59 | 59 | $x = $host->m_swap/(1024*1024); |
60 | 60 | $y = round($x, 2); |
61 | - $host_content.=" |
|
61 | + $host_content .= " |
|
62 | 62 | Swap Space: $y MB"; |
63 | 63 | $x = $host->d_total/(1024*1024*1024); |
64 | 64 | $y = round($x, 2); |
65 | - $host_content.=" |
|
65 | + $host_content .= " |
|
66 | 66 | Total Disk Space: $y GB"; |
67 | 67 | $x = $host->d_free/(1024*1024*1024); |
68 | 68 | $y = round($x, 2); |
69 | - $host_content.=" |
|
69 | + $host_content .= " |
|
70 | 70 | Free Disk Space: $y GB |
71 | 71 | Avg network bandwidth (upstream): $host->n_bwup bytes/sec |
72 | 72 | Avg network bandwidth (downstream): $host->n_bwdown bytes/sec"; |
73 | 73 | $x = $host->avg_turnaround/86400; |
74 | - $host_content.=" |
|
74 | + $host_content .= " |
|
75 | 75 | Average turnaround: ".round($x, 2)." days |
76 | 76 | Number of RPCs: $host->rpc_seqno |
77 | 77 | Last RPC: ".time_str($host->rpc_time)." |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | installation. Could you please have a look at it? |
89 | 89 | |
90 | 90 | Sincerely, |
91 | - The ". PROJECT." team |
|
91 | + The ".PROJECT." team |
|
92 | 92 | "; |
93 | 93 | $body .= " |
94 | 94 | |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | " . $host_content." |
97 | 97 | |
98 | 98 | For further information and assistance with ".PROJECT." go to $master_url"; |
99 | - echo nl2br($body) . "<br><br>"; |
|
99 | + echo nl2br($body)."<br><br>"; |
|
100 | 100 | return send_email($user, $subject, $body); |
101 | 101 | |
102 | 102 | } |
@@ -41,10 +41,10 @@ |
||
41 | 41 | return $db->insert_id(); |
42 | 42 | } |
43 | 43 | |
44 | -function create_forum($category, $orderID, $title, $description, $is_dev_blog=0) { |
|
44 | +function create_forum($category, $orderID, $title, $description, $is_dev_blog = 0) { |
|
45 | 45 | $q = "(category, orderID, title, description, is_dev_blog) values ($category, $orderID, '$title', '$description', $is_dev_blog)"; |
46 | 46 | $db = BoincDB::get(); |
47 | - $result = $db->insert("forum",$q); |
|
47 | + $result = $db->insert("forum", $q); |
|
48 | 48 | if (!$result) { |
49 | 49 | $forum = BoincForum::lookup("category=$category and title='$title'"); |
50 | 50 | if ($forum) return $forum->id; |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | \***********************************************************************/ |
28 | 28 | |
29 | 29 | $limit = get_int('limit', true); |
30 | -if (! $limit > 0 ) $limit = 30; |
|
30 | +if (!$limit > 0) $limit = 30; |
|
31 | 31 | |
32 | 32 | |
33 | 33 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | echo "<input class=\"btn btn-default\" type=\"submit\" value=\"Display\">\n"; |
49 | 49 | echo "</form>\n"; |
50 | 50 | |
51 | -$query="SELECT * FROM user ORDER BY create_time DESC LIMIT $limit"; |
|
51 | +$query = "SELECT * FROM user ORDER BY create_time DESC LIMIT $limit"; |
|
52 | 52 | $result = _mysql_query($query); |
53 | 53 | if (_mysql_num_rows($result) < 1) { |
54 | 54 | echo "There are no new users."; |
@@ -66,8 +66,8 @@ discard block |
||
66 | 66 | $joined = time_str($row->create_time); |
67 | 67 | $email_validated = $row->email_validated; |
68 | 68 | |
69 | - $team_name=""; |
|
70 | - if($row->teamid > 0){ |
|
69 | + $team_name = ""; |
|
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 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | // Banished? |
96 | 96 | if (!empty($user->banished_until)) { |
97 | 97 | $dt = $user->banished_until - time(); |
98 | - if( $dt > 0 ) { |
|
98 | + if ($dt > 0) { |
|
99 | 99 | $x = "<span style=\"color: #ff0000\">Currently banished</span>"; |
100 | 100 | } |
101 | 101 | else { |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | } |
51 | 51 | echo "<users>\n"; |
52 | 52 | $users = BoincUser::enum_fields("id, email_addr, send_email, name, total_credit, expavg_credit, expavg_time, has_profile, donated, country, cross_project_id, create_time, url", "teamid=$team->id"); |
53 | - foreach($users as $user) { |
|
53 | + foreach ($users as $user) { |
|
54 | 54 | show_team_member($user, $creditonly); |
55 | 55 | } |
56 | 56 | echo "</users>\n"; |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | } |
82 | 82 | |
83 | 83 | $users = BoincUser::enum_fields("id, email_addr, send_email, name, total_credit, expavg_credit, has_profile, donated, country, cross_project_id, create_time, url", "teamid=$team->id"); |
84 | -foreach($users as $user) { |
|
84 | +foreach ($users as $user) { |
|
85 | 85 | if ($plain) { |
86 | 86 | echo "$user->name $user->id\n"; |
87 | 87 | } else { |