@@ -58,10 +58,10 @@ |
||
58 | 58 | //panel(null, 'panel_contents'); |
59 | 59 | } |
60 | 60 | |
61 | -function left(){ |
|
61 | +function left() { |
|
62 | 62 | global $user, $no_web_account_creation, $master_url, $project_id; |
63 | 63 | panel( |
64 | - $user?tra("Welcome, %1", $user->name):tra("What is %1?", PROJECT), |
|
64 | + $user ?tra("Welcome, %1", $user->name) : tra("What is %1?", PROJECT), |
|
65 | 65 | function() use($user) { |
66 | 66 | global $no_web_account_creation, $master_url, $project_id; |
67 | 67 | if ($user) { |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | } |
188 | 188 | |
189 | 189 | if (!is_null($teamid)) { |
190 | - if ($teamid==0) { |
|
190 | + if ($teamid == 0) { |
|
191 | 191 | user_quit_team($user); |
192 | 192 | } else { |
193 | 193 | $team = BoincTeam::lookup_id_nocache($teamid); |
@@ -240,15 +240,15 @@ discard block |
||
240 | 240 | // table. If one or more of these consent_xyz parameters are NOT |
241 | 241 | // present, the RPC will still return 'success', even though the |
242 | 242 | // consent table is not updated. |
243 | -if ( (isset($consent_name) and isset($consent_flag) and isset($consent_not_required) and isset($consent_source)) ) { |
|
243 | +if ((isset($consent_name) and isset($consent_flag) and isset($consent_not_required) and isset($consent_source))) { |
|
244 | 244 | list($checkct, $ctid) = check_consent_type($consent_name); |
245 | 245 | if ($checkct) { |
246 | 246 | |
247 | 247 | // Check to see if latest consent of this name is already |
248 | 248 | // given. |
249 | - $cr= BoincConsent::lookup("userid={$user->id} AND consent_type_id='${ctid}' ORDER BY consent_time DESC LIMIT 1"); |
|
250 | - if ( (($cr) and ($cr->consent_flag!=$consent_flag)) or |
|
251 | - (!$cr) ) { |
|
249 | + $cr = BoincConsent::lookup("userid={$user->id} AND consent_type_id='${ctid}' ORDER BY consent_time DESC LIMIT 1"); |
|
250 | + if ((($cr) and ($cr->consent_flag != $consent_flag)) or |
|
251 | + (!$cr)) { |
|
252 | 252 | |
253 | 253 | $rc = consent_to_a_policy($user, $ctid, $consent_flag, $consent_not_required, $consent_source, time()); |
254 | 254 | if (!$rc) { |
@@ -53,7 +53,7 @@ |
||
53 | 53 | // Toggles the enable flag |
54 | 54 | function mct_toggle_field($field) { |
55 | 55 | $ctid = post_int("consent_type_id"); |
56 | - $toggle = post_str("toggle" . $field); |
|
56 | + $toggle = post_str("toggle".$field); |
|
57 | 57 | if ($toggle == "Click to Enable") { |
58 | 58 | $state = 1; |
59 | 59 | $action = "Enabled"; |
@@ -82,7 +82,7 @@ |
||
82 | 82 | |
83 | 83 | page_head(tra("Account Deleted")); |
84 | 84 | |
85 | - echo "<p>".tra("Your account has been deleted. If you want to contribute to %1 in the future you will need to create a new account.",PROJECT)."</p>"; |
|
85 | + echo "<p>".tra("Your account has been deleted. If you want to contribute to %1 in the future you will need to create a new account.", PROJECT)."</p>"; |
|
86 | 86 | |
87 | 87 | page_tail(); |
88 | 88 | } |
@@ -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"; |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | row2(tra("Product name"), $host->product_name); |
99 | 99 | } |
100 | 100 | $x = $host->timezone/3600; |
101 | - if ($x >= 0) $x="+$x"; |
|
101 | + if ($x >= 0) $x = "+$x"; |
|
102 | 102 | row2(tra("Local Standard Time"), tra("UTC %1 hours", $x)); |
103 | 103 | } else { |
104 | 104 | $owner = BoincUser::lookup_id($host->userid); |
@@ -258,15 +258,15 @@ discard block |
||
258 | 258 | // "[vbox|5.0.0|1|1]", where now two additional flags give information about |
259 | 259 | // hardware virtualization support. Older clients may have the old-style |
260 | 260 | // serialnum in the DB despite the server being upgraded. |
261 | -function vbox_desc($x){ |
|
262 | - if (preg_match("/\[vbox\|(.*?)(\|([01])\|([01]))?\]/",$x,$matches)){ |
|
261 | +function vbox_desc($x) { |
|
262 | + if (preg_match("/\[vbox\|(.*?)(\|([01])\|([01]))?\]/", $x, $matches)) { |
|
263 | 263 | $desc = "Virtualbox (".$matches[1].") ".tra("installed"); |
264 | - if (sizeof($matches)>2){ |
|
265 | - if ($matches[3]=="1" and $matches[4]=="1") { |
|
264 | + if (sizeof($matches) > 2) { |
|
265 | + if ($matches[3] == "1" and $matches[4] == "1") { |
|
266 | 266 | return $desc.tra(", CPU has hardware virtualization support and it is enabled"); |
267 | - } elseif ($matches[3]=="1" and $matches[4]=="0") { |
|
267 | + } elseif ($matches[3] == "1" and $matches[4] == "0") { |
|
268 | 268 | return $desc.tra(", CPU has hardware virtualization support but it is disabled"); |
269 | - } elseif ($matches[3]=="0") { |
|
269 | + } elseif ($matches[3] == "0") { |
|
270 | 270 | return $desc.tra(", CPU does not have hardware virtualization support"); |
271 | 271 | } |
272 | 272 | } else { |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | // Given string of the form [BOINC|vers][type|model|count|RAM|driver-vers][vbox|vers], |
281 | 281 | // return a human-readable version of the GPU info |
282 | 282 | // |
283 | -function gpu_desc($x, $detail=true) { |
|
283 | +function gpu_desc($x, $detail = true) { |
|
284 | 284 | $descs = explode("]", $x); |
285 | 285 | array_pop($descs); |
286 | 286 | $str = ""; |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | if ($d[0] == "BOINC") continue; |
292 | 292 | if ($d[0] == "vbox") continue; |
293 | 293 | if ($str) $str .= "<p>"; |
294 | - if ($d[2]!="" && $d[2]!="1") $str .= "[".$d[2]."] "; |
|
294 | + if ($d[2] != "" && $d[2] != "1") $str .= "[".$d[2]."] "; |
|
295 | 295 | if ($d[0] == "CUDA") { |
296 | 296 | $str .= "NVIDIA"; |
297 | 297 | } else if ($d[0] == "CAL") { |
@@ -498,14 +498,14 @@ discard block |
||
498 | 498 | if ($pos1 === false) return $x; |
499 | 499 | $pos2 = strpos($model, ']'); |
500 | 500 | if ($pos2 === false) return $x; |
501 | - $a = substr($model, $pos1+1, $pos2-$pos1-1); |
|
501 | + $a = substr($model, $pos1 + 1, $pos2 - $pos1 - 1); |
|
502 | 502 | $y = explode(" ", $a); |
503 | 503 | if (count($y) == 0) return $x; |
504 | 504 | if ($y[0] == "Family") { |
505 | 505 | $x->info = $a; |
506 | 506 | } else { |
507 | 507 | $x->arch = $y[0]; |
508 | - $x->info = substr($a, strlen($y[0])+1); |
|
508 | + $x->info = substr($a, strlen($y[0]) + 1); |
|
509 | 509 | } |
510 | 510 | return $x; |
511 | 511 | } |
@@ -594,7 +594,7 @@ discard block |
||
594 | 594 | $avg_time = 0; |
595 | 595 | |
596 | 596 | $results = BoincResult::enum("hostid=$hostid order by received_time"); |
597 | - foreach($results as $result) { |
|
597 | + foreach ($results as $result) { |
|
598 | 598 | if ($result->granted_credit <= 0) continue; |
599 | 599 | $total += $result->granted_credit; |
600 | 600 | |
@@ -687,7 +687,7 @@ discard block |
||
687 | 687 | |
688 | 688 | function link_url($sort, $rev, $show_all) { |
689 | 689 | global $userid; |
690 | - $x = $userid ? "&userid=$userid":""; |
|
690 | + $x = $userid ? "&userid=$userid" : ""; |
|
691 | 691 | return "hosts_user.php?sort=$sort&rev=$rev&show_all=$show_all$x"; |
692 | 692 | } |
693 | 693 | |
@@ -761,7 +761,7 @@ discard block |
||
761 | 761 | } |
762 | 762 | |
763 | 763 | function show_user_hosts($userid, $private, $show_all, $sort, $rev) { |
764 | - $desc = false; // whether the sort order's default is decreasing |
|
764 | + $desc = false; // whether the sort order's default is decreasing |
|
765 | 765 | switch ($sort) { |
766 | 766 | case "total_credit": $sort_clause = "total_credit"; $desc = true; break; |
767 | 767 | case "expavg_credit": $sort_clause = "expavg_credit"; $desc = true; break; |
@@ -784,7 +784,7 @@ discard block |
||
784 | 784 | more_or_less($sort, $rev, $show_all); |
785 | 785 | |
786 | 786 | $now = time(); |
787 | - $old_hosts=0; |
|
787 | + $old_hosts = 0; |
|
788 | 788 | $i = 1; |
789 | 789 | $hosts = BoincHost::enum("userid=$userid order by $sort_clause"); |
790 | 790 | $any_product_name = false; |
@@ -796,9 +796,9 @@ discard block |
||
796 | 796 | } |
797 | 797 | user_host_table_start($private, $sort, $rev, $show_all, $any_product_name); |
798 | 798 | foreach ($hosts as $host) { |
799 | - $is_old=false; |
|
799 | + $is_old = false; |
|
800 | 800 | if (($now - $host->rpc_time) > 30*86400) { |
801 | - $is_old=true; |
|
801 | + $is_old = true; |
|
802 | 802 | $old_hosts++; |
803 | 803 | } |
804 | 804 | if (!$show_all && $is_old) continue; |
@@ -807,7 +807,7 @@ discard block |
||
807 | 807 | } |
808 | 808 | end_table(); |
809 | 809 | |
810 | - if ($old_hosts>0) { |
|
810 | + if ($old_hosts > 0) { |
|
811 | 811 | more_or_less($sort, $rev, $show_all); |
812 | 812 | } |
813 | 813 | |
@@ -827,6 +827,6 @@ discard block |
||
827 | 827 | } |
828 | 828 | } |
829 | 829 | |
830 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
830 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
831 | 831 | |
832 | 832 | ?> |
@@ -53,10 +53,10 @@ discard block |
||
53 | 53 | $preview = post_str("preview", true); |
54 | 54 | $warning = null; |
55 | 55 | |
56 | -if ($content && $title && (!$preview)){ |
|
57 | - if (post_str('add_signature', true) == "add_it"){ |
|
58 | - $add_signature = true; // set a flag and concatenate later |
|
59 | - } else { |
|
56 | +if ($content && $title && (!$preview)) { |
|
57 | + if (post_str('add_signature', true) == "add_it") { |
|
58 | + $add_signature = true; // set a flag and concatenate later |
|
59 | + } else { |
|
60 | 60 | $add_signature = false; |
61 | 61 | } |
62 | 62 | check_tokens($logged_in_user->authenticator); |
@@ -68,14 +68,14 @@ discard block |
||
68 | 68 | $title, $content, $logged_in_user, $forum, $add_signature, $export |
69 | 69 | ); |
70 | 70 | if ($thread) { |
71 | - header('Location: forum_thread.php?id=' . $thread->id); |
|
71 | + header('Location: forum_thread.php?id='.$thread->id); |
|
72 | 72 | } else { |
73 | 73 | error_page("Can't create thread. $forum_error"); |
74 | 74 | } |
75 | 75 | } |
76 | 76 | } |
77 | 77 | |
78 | -page_head(tra("Create new thread"),'','','', $bbcode_js); |
|
78 | +page_head(tra("Create new thread"), '', '', '', $bbcode_js); |
|
79 | 79 | show_forum_header($logged_in_user); |
80 | 80 | |
81 | 81 | if ($warning) { |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | $submit_help = "<br /><font color=\"red\">".tra("Remember to add a title")."</font>"; |
117 | 117 | } |
118 | 118 | |
119 | -if ($force_title && $title){ |
|
119 | +if ($force_title && $title) { |
|
120 | 120 | row2(tra("Title"), htmlspecialchars($title)."<input type=\"hidden\" name=\"title\" value=\"".htmlspecialchars($title)."\">"); |
121 | 121 | } else { |
122 | 122 | row2(tra("Title").$submit_help, |
@@ -132,9 +132,9 @@ discard block |
||
132 | 132 | echo "</td></tr>"; |
133 | 133 | |
134 | 134 | if (!$logged_in_user->prefs->no_signature_by_default) { |
135 | - $enable_signature="checked=\"true\""; |
|
135 | + $enable_signature = "checked=\"true\""; |
|
136 | 136 | } else { |
137 | - $enable_signature=""; |
|
137 | + $enable_signature = ""; |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | if (is_news_forum($forum)) { |
@@ -150,5 +150,5 @@ discard block |
||
150 | 150 | |
151 | 151 | page_tail(); |
152 | 152 | |
153 | -$cvs_version_tracker[]="\$Id$"; |
|
153 | +$cvs_version_tracker[] = "\$Id$"; |
|
154 | 154 | ?> |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | start_table(); |
28 | 28 | echo " |
29 | 29 | <tr><td>" |
30 | - . tra("Leader boards for %1",PROJECT).": |
|
30 | + . tra("Leader boards for %1", PROJECT).": |
|
31 | 31 | <ul> |
32 | 32 | <li><a href=\"top_users.php\">" . tra("Participants")."</a> |
33 | 33 | "; |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | if (!DISABLE_TEAMS) { |
39 | 39 | echo " |
40 | - <li><a href=\"top_teams.php\">" . tra("Teams"). "</a> |
|
40 | + <li><a href=\"top_teams.php\">" . tra("Teams")."</a> |
|
41 | 41 | "; |
42 | 42 | if ($credit_by_app) { |
43 | 43 | echo "<ul><li><a href=per_app_list.php?is_team=1>Per application</a></ul>\n"; |
@@ -22,14 +22,14 @@ |
||
22 | 22 | require_once("../inc/util.inc"); |
23 | 23 | require_once("../inc/cache.inc"); |
24 | 24 | |
25 | -$min_credit = .1; // only count hosts with this much RAC |
|
25 | +$min_credit = .1; // only count hosts with this much RAC |
|
26 | 26 | $total_rac = 0; |
27 | 27 | |
28 | 28 | define("CACHE_PERIOD", 7*86400); |
29 | 29 | |
30 | 30 | function show_type($type, $stats) { |
31 | 31 | global $total_rac; |
32 | - $pct = $total_rac?number_format(100*$stats->rac/$total_rac, 4):0; |
|
32 | + $pct = $total_rac ?number_format(100*$stats->rac/$total_rac, 4) : 0; |
|
33 | 33 | row_array(array($type, $stats->nhosts, "$pct %")); |
34 | 34 | } |
35 | 35 |
@@ -9,11 +9,11 @@ discard block |
||
9 | 9 | * Helper functions |
10 | 10 | */ |
11 | 11 | function _boincuser_delete_goto_admindelete($form, &$form_state) { |
12 | - drupal_goto('/admin/boinc/user_delete/' . $form['#uid']); |
|
12 | + drupal_goto('/admin/boinc/user_delete/'.$form['#uid']); |
|
13 | 13 | } |
14 | 14 | |
15 | 15 | function _boincuser_delete_cancel($form, &$form_state) { |
16 | - drupal_goto('/user/' . $form['#uid'] . '/edit'); |
|
16 | + drupal_goto('/user/'.$form['#uid'].'/edit'); |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | /** |
@@ -24,9 +24,9 @@ discard block |
||
24 | 24 | return form_set_error('current_pass', bts('Authentication is required when requesting account deletion.', array(), NULL, 'boinc:delete-user-account')); |
25 | 25 | } |
26 | 26 | |
27 | - $given_hash = md5($current_pass . $boinc_user->email_addr); |
|
27 | + $given_hash = md5($current_pass.$boinc_user->email_addr); |
|
28 | 28 | |
29 | - if ( (!password_verify($given_hash, $boinc_user->passwd_hash)) and ($given_hash != $boinc_user->passwd_hash) ) { |
|
29 | + if ((!password_verify($given_hash, $boinc_user->passwd_hash)) and ($given_hash != $boinc_user->passwd_hash)) { |
|
30 | 30 | return form_set_error('current_pass', bts('Password entered is not valid. Please verify that it is correct.', array(), NULL, 'boinc:delete-user-account')); |
31 | 31 | } |
32 | 32 | |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | /** |
41 | 41 | * Delete the user function. |
42 | 42 | */ |
43 | -function _boincuser_delete_deleteuser($account, $action=NULL) { |
|
43 | +function _boincuser_delete_deleteuser($account, $action = NULL) { |
|
44 | 44 | require_boinc('user_util'); |
45 | 45 | require_boinc('delete_account'); |
46 | 46 | |
@@ -74,11 +74,11 @@ discard block |
||
74 | 74 | // * erase signature |
75 | 75 | $myarray = array( |
76 | 76 | 'status' => 0, |
77 | - 'name' => 'deleted_' . time() . '_' . random_string(), |
|
78 | - 'mail' => 'deleted_' . time() . '_' . random_string(), |
|
79 | - 'pass' => 'deleted_' . time() . '_' . random_string(), |
|
77 | + 'name' => 'deleted_'.time().'_'.random_string(), |
|
78 | + 'mail' => 'deleted_'.time().'_'.random_string(), |
|
79 | + 'pass' => 'deleted_'.time().'_'.random_string(), |
|
80 | 80 | 'signature' => '', |
81 | - 'init' => 'deleted_' . time() . '_' . random_string(), |
|
81 | + 'init' => 'deleted_'.time().'_'.random_string(), |
|
82 | 82 | ); |
83 | 83 | user_save($account, $myarray); |
84 | 84 | break; |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | |
131 | 131 | if (!empty($mids)) { |
132 | 132 | // Delete recipient entries in {pm_index} of the messages the user wrote. |
133 | - db_query('DELETE FROM {pm_index} WHERE mid IN (' . db_placeholders($mids) . ')', $mids); |
|
133 | + db_query('DELETE FROM {pm_index} WHERE mid IN ('.db_placeholders($mids).')', $mids); |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | // Delete recipient entries of that user. |