@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | if ($user->authenticator != $auth) die('bad auth'); |
52 | 52 | } |
53 | 53 | |
54 | -function do_result_aux($result, $batch, $file_num=null) { |
|
54 | +function do_result_aux($result, $batch, $file_num = null) { |
|
55 | 55 | $phys_names = get_outfile_names($result); |
56 | 56 | $log_names = get_outfile_log_names($result); |
57 | 57 | if ($file_num !== null) { |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $dir_path = "submit/$batch->id/$result->name"; |
72 | 72 | system("rm -r $dir_path"); |
73 | 73 | mkdir($dir_path); |
74 | - for ($i=0; $i<count($phys_names); $i++) { |
|
74 | + for ($i = 0; $i < count($phys_names); $i++) { |
|
75 | 75 | $cmd = sprintf('ln -s %s %s/%s', |
76 | 76 | upload_path($phys_names[$i]), |
77 | 77 | $dir_path, |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | } |
89 | 89 | } |
90 | 90 | |
91 | -function do_result($result_id, $auth, $file_num=null) { |
|
91 | +function do_result($result_id, $auth, $file_num = null) { |
|
92 | 92 | $result = BoincResult::lookup_id($result_id); |
93 | 93 | if (!$result) die("no result $result_id"); |
94 | 94 | $workunit = BoincWorkunit::lookup_id($result->workunitid); |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | system($cmd); |
136 | 136 | } else { |
137 | 137 | mkdir(sprintf('%s/%s', $dir_path, $result->name)); |
138 | - for ($i=0; $i<count($phys_names); $i++) { |
|
138 | + for ($i = 0; $i < count($phys_names); $i++) { |
|
139 | 139 | $cmd = sprintf('ln -s %s %s/%s/%s', |
140 | 140 | upload_path($phys_names[$i]), |
141 | 141 | $dir_path, |
@@ -43,10 +43,10 @@ discard block |
||
43 | 43 | credit_to_ops($credit, $ops, $unit); |
44 | 44 | |
45 | 45 | if ($bolden) { |
46 | - $lbold="[["; |
|
47 | - $rbold="]]"; |
|
46 | + $lbold = "[["; |
|
47 | + $rbold = "]]"; |
|
48 | 48 | } else { |
49 | - $lbold=""; $rbold=""; |
|
49 | + $lbold = ""; $rbold = ""; |
|
50 | 50 | } |
51 | 51 | return " $lbold$cobbs Cobblestones$rbold of computation ($ops $unit floating-point operations)"; |
52 | 52 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | // |
87 | 87 | function show_share_buttons() { |
88 | 88 | echo '<p>'; |
89 | - $current_url = (empty($_SERVER['HTTPS']) ? 'http' : 'https') . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; |
|
89 | + $current_url = (empty($_SERVER['HTTPS']) ? 'http' : 'https')."://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; |
|
90 | 90 | $cert_url = urlencode($current_url); |
91 | 91 | |
92 | 92 | // Share on Facebook |
@@ -27,10 +27,10 @@ discard block |
||
27 | 27 | if (DISABLE_TEAMS) error_page("Teams are disabled"); |
28 | 28 | |
29 | 29 | $border = get_str("border", true); |
30 | -if ($border=="no") { |
|
31 | - $border=0; |
|
30 | +if ($border == "no") { |
|
31 | + $border = 0; |
|
32 | 32 | } else { |
33 | - $border=8; |
|
33 | + $border = 8; |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | // Make sure user_id is in the URL so that share functions work |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | if (!$user_id) { |
40 | 40 | $user = get_logged_in_user(); |
41 | 41 | Header(sprintf('Location: %s/cert_team.php?user_id=%d%s', |
42 | - url_base(), $user->id, $border==0?'&border=no':'' |
|
42 | + url_base(), $user->id, $border == 0 ? '&border=no' : '' |
|
43 | 43 | )); |
44 | 44 | exit; |
45 | 45 | } |
@@ -24,10 +24,10 @@ discard block |
||
24 | 24 | require_once("../inc/cert.inc"); |
25 | 25 | |
26 | 26 | $border = get_str("border", true); |
27 | -if ($border=="no") { |
|
28 | - $border=0; |
|
27 | +if ($border == "no") { |
|
28 | + $border = 0; |
|
29 | 29 | } else { |
30 | - $border=8; |
|
30 | + $border = 8; |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | // Make sure user_id is in the URL so that share functions work |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | if (!$user_id) { |
37 | 37 | $user = get_logged_in_user(); |
38 | 38 | Header(sprintf('Location: %s/cert1.php?user_id=%d%s', |
39 | - url_base(), $user->id, $border==0?'&border=no':'' |
|
39 | + url_base(), $user->id, $border == 0 ? '&border=no' : '' |
|
40 | 40 | )); |
41 | 41 | exit; |
42 | 42 | } |
@@ -25,10 +25,10 @@ discard block |
||
25 | 25 | require_once("../inc/user.inc"); |
26 | 26 | |
27 | 27 | $border = get_str("border", true); |
28 | -if ($border=="no") { |
|
29 | - $border=0; |
|
28 | +if ($border == "no") { |
|
29 | + $border = 0; |
|
30 | 30 | } else { |
31 | - $border=8; |
|
31 | + $border = 8; |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | // Make sure user_id is in the URL so that share functions work |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | if (!$user_id) { |
38 | 38 | $user = get_logged_in_user(); |
39 | 39 | Header(sprintf('Location: %s/cert_all.php?user_id=%d%s', |
40 | - url_base(), $user->id, $border==0?'&border=no':'' |
|
40 | + url_base(), $user->id, $border == 0 ? '&border=no' : '' |
|
41 | 41 | )); |
42 | 42 | exit; |
43 | 43 | } |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | <tr><th align=left>Project</th><th align=left>Cobblestones</th><th align=left>Joined</th></tr> |
92 | 92 | "; |
93 | 93 | foreach ($user->projects as $p) { |
94 | - if ($p->total_credit<100) continue; |
|
94 | + if ($p->total_credit < 100) continue; |
|
95 | 95 | show_proj($p); |
96 | 96 | } |
97 | 97 | echo " |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | if (!defined("DELETE_DELAY")) define("DELETE_DELAY", 2); |
43 | 43 | |
44 | 44 | function is_delete_account_token_valid($userid, $token) { |
45 | - if (!is_valid_token($userid, $token, TOKEN_TYPE_DELETE_ACCOUNT) ) { |
|
45 | + if (!is_valid_token($userid, $token, TOKEN_TYPE_DELETE_ACCOUNT)) { |
|
46 | 46 | sleep(LOGIN_FAIL_SLEEP_SEC); |
47 | 47 | return false; |
48 | 48 | } |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | // |
127 | 127 | function is_over_but_not_validated($res) { |
128 | 128 | if ($res->server_state == RESULT_SERVER_STATE_OVER && $res->outcome == RESULT_OUTCOME_SUCCESS && |
129 | - ($res->validate_state == VALIDATE_STATE_INIT || $res->validate_state == VALIDATE_STATE_INCONCLUSIVE) ) { |
|
129 | + ($res->validate_state == VALIDATE_STATE_INIT || $res->validate_state == VALIDATE_STATE_INCONCLUSIVE)) { |
|
130 | 130 | return true; |
131 | 131 | } |
132 | 132 | return false; |
@@ -144,8 +144,8 @@ discard block |
||
144 | 144 | // |
145 | 145 | function cancel_results_for_user($user) { |
146 | 146 | $ress = BoincResult::enum("userid = $user->id"); |
147 | - $cancel_clause="server_state=".RESULT_SERVER_STATE_OVER.", outcome=".RESULT_OUTCOME_CLIENT_DETACHED.", validate_state=".VALIDATE_STATE_INVALID; |
|
148 | - $set_id_clause="hostid=0, userid=0"; |
|
147 | + $cancel_clause = "server_state=".RESULT_SERVER_STATE_OVER.", outcome=".RESULT_OUTCOME_CLIENT_DETACHED.", validate_state=".VALIDATE_STATE_INVALID; |
|
148 | + $set_id_clause = "hostid=0, userid=0"; |
|
149 | 149 | foreach ($ress as $res) { |
150 | 150 | if (is_in_progress($res) || is_over_but_not_validated($res)) { |
151 | 151 | $res->update($cancel_clause.", ".$set_id_clause); |
@@ -168,12 +168,12 @@ discard block |
||
168 | 168 | |
169 | 169 | // delete remote submit user |
170 | 170 | // |
171 | - delete_remote_submit_user($user); // from submit_util.inc |
|
171 | + delete_remote_submit_user($user); // from submit_util.inc |
|
172 | 172 | |
173 | 173 | // remove user's team records |
174 | 174 | // |
175 | - user_erase_team_owner($user); // from team.inc |
|
176 | - user_quit_team($user); // from team.inc |
|
175 | + user_erase_team_owner($user); // from team.inc |
|
176 | + user_quit_team($user); // from team.inc |
|
177 | 177 | user_erase_team_delta($user); // from team.inc |
178 | 178 | |
179 | 179 | // Items that do not have logic elsewhere |
@@ -200,6 +200,6 @@ discard block |
||
200 | 200 | BoincTeamAdmin::delete("userid=$user->id"); |
201 | 201 | |
202 | 202 | // final action |
203 | - delete_user($user); //from user_util.inc |
|
203 | + delete_user($user); //from user_util.inc |
|
204 | 204 | return 0; |
205 | 205 | } |
@@ -28,7 +28,7 @@ |
||
28 | 28 | echo "<p>"; |
29 | 29 | |
30 | 30 | form_start(secure_url_base()."edit_passwd_action.php", "post"); |
31 | -form_input_text(tra("New password"), "passwd", "", "password",'id="passwd"',passwd_visible_checkbox("passwd")); |
|
31 | +form_input_text(tra("New password"), "passwd", "", "password", 'id="passwd"', passwd_visible_checkbox("passwd")); |
|
32 | 32 | form_submit(tra("Change password")); |
33 | 33 | form_end(); |
34 | 34 | page_tail(); |
@@ -29,14 +29,14 @@ discard block |
||
29 | 29 | // |
30 | 30 | $idx = strpos($master_url, '://'); |
31 | 31 | if ($idx) { |
32 | - $url = substr($master_url, $idx+strlen('://')); |
|
32 | + $url = substr($master_url, $idx + strlen('://')); |
|
33 | 33 | } else { |
34 | 34 | $url = $master_url; |
35 | 35 | } |
36 | 36 | |
37 | 37 | // convert invalid characters into underscores |
38 | 38 | // |
39 | -for ($i=0; $i<strlen($url); $i++) { |
|
39 | +for ($i = 0; $i < strlen($url); $i++) { |
|
40 | 40 | $c = $url[$i]; |
41 | 41 | if (!ctype_alnum($c) && $c != '.' && $c != '-' && $c != '_') { |
42 | 42 | $url[$i] = '_'; |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | |
46 | 46 | //remove trailing underscore(s) |
47 | 47 | // |
48 | -$account_file = "account_" . rtrim($url, '_') . ".xml"; |
|
48 | +$account_file = "account_".rtrim($url, '_').".xml"; |
|
49 | 49 | |
50 | 50 | page_head(tra("Account keys")); |
51 | 51 | text_start(); |
@@ -57,12 +57,12 @@ discard block |
||
57 | 57 | <p>", |
58 | 58 | tra("This key can be used to:"), |
59 | 59 | "<ul> |
60 | - <li><a href=get_passwd.php>",tra("log in to your account on the web"),"</a>; |
|
60 | + <li><a href=get_passwd.php>",tra("log in to your account on the web"), "</a>; |
|
61 | 61 | <li>", |
62 | 62 | tra("attach a computer to your account without using the BOINC Manager. |
63 | 63 | To do so, install BOINC, |
64 | 64 | create a file named %1 in the BOINC |
65 | - data directory, and set its contents to:","<b>$account_file</b>")," |
|
65 | + data directory, and set its contents to:","<b>$account_file</b>"), " |
|
66 | 66 | <p><pre>", |
67 | 67 | htmlspecialchars( |
68 | 68 | "<account> |
@@ -76,10 +76,10 @@ discard block |
||
76 | 76 | as described above, but cannot be used to log in to your account or change it in any way. |
77 | 77 | If you want to attach untrusted or insecure computers to your account, |
78 | 78 | do so using your weak account key. |
79 | - Your weak account key is:")," |
|
79 | + Your weak account key is:"), " |
|
80 | 80 | <p><pre>$weak_auth</pre><p> |
81 | 81 | ", |
82 | - tra("The key depends on your account's email address and password. If you change either of these, the weak account key will change.")," |
|
82 | + tra("The key depends on your account's email address and password. If you change either of these, the weak account key will change."), " |
|
83 | 83 | </td></tr></table>" |
84 | 84 | ; |
85 | 85 | text_end(); |
@@ -32,12 +32,12 @@ discard block |
||
32 | 32 | |
33 | 33 | function sched_log_name($x) { |
34 | 34 | if ($x == 0) return "NO_SUCH_LOG"; |
35 | - return gmdate('Y-m-d_H/Y-m-d_H:i', $x) . ".txt"; |
|
35 | + return gmdate('Y-m-d_H/Y-m-d_H:i', $x).".txt"; |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | function sched_log_link($x) { |
39 | 39 | if (file_exists("sched_logs")) { |
40 | - return "<a href=\"../sched_logs/" . sched_log_name($x) . "\">" . time_str($x) . "</a>"; |
|
40 | + return "<a href=\"../sched_logs/".sched_log_name($x)."\">".time_str($x)."</a>"; |
|
41 | 41 | } else { |
42 | 42 | return time_str($x); |
43 | 43 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | |
46 | 46 | function location_form($host) { |
47 | 47 | $none = "selected"; |
48 | - $h=$w=$s=$m=""; |
|
48 | + $h = $w = $s = $m = ""; |
|
49 | 49 | if ($host->venue == "home") $h = "selected"; |
50 | 50 | if ($host->venue == "work") $w = "selected"; |
51 | 51 | if ($host->venue == "school") $s = "selected"; |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | row2(tra("Product name"), $host->product_name); |
100 | 100 | } |
101 | 101 | $x = $host->timezone/3600; |
102 | - if ($x >= 0) $x="+$x"; |
|
102 | + if ($x >= 0) $x = "+$x"; |
|
103 | 103 | row2(tra("Local Standard Time"), tra("UTC %1 hours", $x)); |
104 | 104 | } else { |
105 | 105 | $owner = BoincUser::lookup_id($host->userid); |
@@ -259,15 +259,15 @@ discard block |
||
259 | 259 | // "[vbox|5.0.0|1|1]", where now two additional flags give information about |
260 | 260 | // hardware virtualization support. Older clients may have the old-style |
261 | 261 | // serialnum in the DB despite the server being upgraded. |
262 | -function vbox_desc($x){ |
|
263 | - if (preg_match("/\[vbox\|(.*?)(\|([01])\|([01]))?\]/",$x,$matches)){ |
|
262 | +function vbox_desc($x) { |
|
263 | + if (preg_match("/\[vbox\|(.*?)(\|([01])\|([01]))?\]/", $x, $matches)) { |
|
264 | 264 | $desc = "Virtualbox (".$matches[1].") ".tra("installed"); |
265 | - if (sizeof($matches)>2){ |
|
266 | - if ($matches[3]=="1" and $matches[4]=="1") { |
|
265 | + if (sizeof($matches) > 2) { |
|
266 | + if ($matches[3] == "1" and $matches[4] == "1") { |
|
267 | 267 | return $desc.tra(", CPU has hardware virtualization support and it is enabled"); |
268 | - } elseif ($matches[3]=="1" and $matches[4]=="0") { |
|
268 | + } elseif ($matches[3] == "1" and $matches[4] == "0") { |
|
269 | 269 | return $desc.tra(", CPU has hardware virtualization support but it is disabled"); |
270 | - } elseif ($matches[3]=="0") { |
|
270 | + } elseif ($matches[3] == "0") { |
|
271 | 271 | return $desc.tra(", CPU does not have hardware virtualization support"); |
272 | 272 | } |
273 | 273 | } else { |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | // Given string of the form [BOINC|vers][type|model|count|RAM|driver-vers][vbox|vers], |
282 | 282 | // return a human-readable version of the GPU info |
283 | 283 | // |
284 | -function gpu_desc($x, $detail=true) { |
|
284 | +function gpu_desc($x, $detail = true) { |
|
285 | 285 | $descs = explode("]", $x); |
286 | 286 | array_pop($descs); |
287 | 287 | $str = ""; |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | if ($d[0] == "vbox") continue; |
294 | 294 | if (count($d) < 5) continue; |
295 | 295 | if ($str) $str .= "<p>"; |
296 | - if ($d[2]!="" && $d[2]!="1") $str .= "[".$d[2]."] "; |
|
296 | + if ($d[2] != "" && $d[2] != "1") $str .= "[".$d[2]."] "; |
|
297 | 297 | if ($d[0] == "CUDA") { |
298 | 298 | $str .= "NVIDIA"; |
299 | 299 | } else if ($d[0] == "CAL") { |
@@ -500,14 +500,14 @@ discard block |
||
500 | 500 | if ($pos1 === false) return $x; |
501 | 501 | $pos2 = strpos($model, ']'); |
502 | 502 | if ($pos2 === false) return $x; |
503 | - $a = substr($model, $pos1+1, $pos2-$pos1-1); |
|
503 | + $a = substr($model, $pos1 + 1, $pos2 - $pos1 - 1); |
|
504 | 504 | $y = explode(" ", $a); |
505 | 505 | if (count($y) == 0) return $x; |
506 | 506 | if ($y[0] == "Family") { |
507 | 507 | $x->info = $a; |
508 | 508 | } else { |
509 | 509 | $x->arch = $y[0]; |
510 | - $x->info = substr($a, strlen($y[0])+1); |
|
510 | + $x->info = substr($a, strlen($y[0]) + 1); |
|
511 | 511 | } |
512 | 512 | return $x; |
513 | 513 | } |
@@ -596,7 +596,7 @@ discard block |
||
596 | 596 | $avg_time = 0; |
597 | 597 | |
598 | 598 | $results = BoincResult::enum("hostid=$hostid order by received_time"); |
599 | - foreach($results as $result) { |
|
599 | + foreach ($results as $result) { |
|
600 | 600 | if ($result->granted_credit <= 0) continue; |
601 | 601 | $total += $result->granted_credit; |
602 | 602 | |
@@ -689,7 +689,7 @@ discard block |
||
689 | 689 | |
690 | 690 | function link_url($sort, $rev, $show_all) { |
691 | 691 | global $userid; |
692 | - $x = $userid ? "&userid=$userid":""; |
|
692 | + $x = $userid ? "&userid=$userid" : ""; |
|
693 | 693 | return "hosts_user.php?sort=$sort&rev=$rev&show_all=$show_all$x"; |
694 | 694 | } |
695 | 695 | |
@@ -763,7 +763,7 @@ discard block |
||
763 | 763 | } |
764 | 764 | |
765 | 765 | function show_user_hosts($userid, $private, $show_all, $sort, $rev) { |
766 | - $desc = false; // whether the sort order's default is decreasing |
|
766 | + $desc = false; // whether the sort order's default is decreasing |
|
767 | 767 | switch ($sort) { |
768 | 768 | case "total_credit": $sort_clause = "total_credit"; $desc = true; break; |
769 | 769 | case "expavg_credit": $sort_clause = "expavg_credit"; $desc = true; break; |
@@ -786,7 +786,7 @@ discard block |
||
786 | 786 | more_or_less($sort, $rev, $show_all); |
787 | 787 | |
788 | 788 | $now = time(); |
789 | - $old_hosts=0; |
|
789 | + $old_hosts = 0; |
|
790 | 790 | $i = 1; |
791 | 791 | $hosts = BoincHost::enum("userid=$userid order by $sort_clause"); |
792 | 792 | $any_product_name = false; |
@@ -798,9 +798,9 @@ discard block |
||
798 | 798 | } |
799 | 799 | user_host_table_start($private, $sort, $rev, $show_all, $any_product_name); |
800 | 800 | foreach ($hosts as $host) { |
801 | - $is_old=false; |
|
801 | + $is_old = false; |
|
802 | 802 | if (($now - $host->rpc_time) > 30*86400) { |
803 | - $is_old=true; |
|
803 | + $is_old = true; |
|
804 | 804 | $old_hosts++; |
805 | 805 | } |
806 | 806 | if (!$show_all && $is_old) continue; |
@@ -809,7 +809,7 @@ discard block |
||
809 | 809 | } |
810 | 810 | end_table(); |
811 | 811 | |
812 | - if ($old_hosts>0) { |
|
812 | + if ($old_hosts > 0) { |
|
813 | 813 | more_or_less($sort, $rev, $show_all); |
814 | 814 | } |
815 | 815 | |
@@ -829,6 +829,6 @@ discard block |
||
829 | 829 | } |
830 | 830 | } |
831 | 831 | |
832 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
832 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
833 | 833 | |
834 | 834 | ?> |