@@ -33,8 +33,8 @@ |
||
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | $set_lang = get_str("set_lang", true); |
| 36 | -if ($set_lang){ |
|
| 37 | - if (!in_array($set_lang, $languages) && $set_lang!="auto"){ |
|
| 36 | +if ($set_lang) { |
|
| 37 | + if (!in_array($set_lang, $languages) && $set_lang != "auto") { |
|
| 38 | 38 | error_page("Language not supported"); |
| 39 | 39 | } else { |
| 40 | 40 | send_cookie('lang', $set_lang, true); |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | ; |
| 59 | 59 | $admins = BoincTeamAdmin::enum("teamid=$teamid"); |
| 60 | 60 | start_table(); |
| 61 | - if (count($admins)==0) { |
|
| 61 | + if (count($admins) == 0) { |
|
| 62 | 62 | row1(tra("There are currently no Team Admins")); |
| 63 | 63 | } else { |
| 64 | 64 | row1(tra("Current Team Admins"), 3); |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | |
| 97 | 97 | function add_admin($team) { |
| 98 | 98 | $email_addr = get_str('email_addr'); |
| 99 | - $email_addr = BoincDb::escape_string($email_addr); |
|
| 99 | + $email_addr = BoincDb::escape_string($email_addr); |
|
| 100 | 100 | $user = BoincUser::lookup("email_addr='$email_addr'"); |
| 101 | 101 | if (!$user) error_page(tra("no such user")); |
| 102 | 102 | if ($user->teamid != $team->id) error_page(tra("User is not member of team")); |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | require_founder_login($user, $team); |
| 116 | 116 | |
| 117 | 117 | $action = get_str('action', true); |
| 118 | -switch($action) { |
|
| 118 | +switch ($action) { |
|
| 119 | 119 | case 'remove': |
| 120 | 120 | check_tokens($user->authenticator); |
| 121 | 121 | remove_admin($team); |
@@ -92,7 +92,7 @@ |
||
| 92 | 92 | echo $x; |
| 93 | 93 | break; |
| 94 | 94 | } |
| 95 | - echo "</td><td align=right>".format_credit_large($y->credit),"</td><td align=right>$y->nresults</td></tr>\n"; |
|
| 95 | + echo "</td><td align=right>".format_credit_large($y->credit), "</td><td align=right>$y->nresults</td></tr>\n"; |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | $mode = get_str('mode', true); |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | $auth = post_str("auth"); |
| 24 | 24 | $name = post_str("name"); |
| 25 | 25 | |
| 26 | -if (strlen($name)==0) { |
|
| 26 | +if (strlen($name) == 0) { |
|
| 27 | 27 | error_page(tra("You must supply a name for your account")); |
| 28 | 28 | } |
| 29 | 29 | if ($name != sanitize_tags($name)) { |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | echo " <beta/>\n"; |
| 49 | 49 | } |
| 50 | 50 | } else { |
| 51 | - $b = $app->beta?" (beta test)":""; |
|
| 51 | + $b = $app->beta ? " (beta test)" : ""; |
|
| 52 | 52 | echo " |
| 53 | 53 | <tr><th class=\"bg-primary\" colspan=4>$app->user_friendly_name$b</th></tr> |
| 54 | 54 | <tr> |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | } |
| 62 | 62 | foreach ($platforms as $platform) { |
| 63 | 63 | $avs = latest_avs_app_platform($app->id, $platform->id); |
| 64 | - foreach($avs as $av) { |
|
| 64 | + foreach ($avs as $av) { |
|
| 65 | 65 | $create_time_f = pretty_time_str($av->create_time); |
| 66 | 66 | if ($xml) { |
| 67 | 67 | echo " <version>\n"; |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | $gf = $av->expavg_credit/200; |
| 84 | 84 | $total_gf += $gf; |
| 85 | 85 | $gf = number_format($gf, 0); |
| 86 | - $b = $av->beta?" (beta test)":""; |
|
| 86 | + $b = $av->beta ? " (beta test)" : ""; |
|
| 87 | 87 | echo "<tr> |
| 88 | 88 | <td>$platform->user_friendly_name</td> |
| 89 | 89 | <td>$version_num_f$b</td> |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | if (!hosts_compatible($host, $host2, $detail)) continue; |
| 51 | 51 | $hosts[] = $host2; |
| 52 | 52 | $nhosts++; |
| 53 | - if ($nhosts==500) break; |
|
| 53 | + if ($nhosts == 500) break; |
|
| 54 | 54 | } |
| 55 | 55 | if ($nhosts == 1) { |
| 56 | 56 | echo "<br>".tra("No hosts are eligible for merging with this one."); |
@@ -90,14 +90,14 @@ discard block |
||
| 90 | 90 | <script> |
| 91 | 91 | function set_all() { |
| 92 | 92 | "; |
| 93 | -for ($i=1; $i<$nhosts; $i++) { |
|
| 93 | +for ($i = 1; $i < $nhosts; $i++) { |
|
| 94 | 94 | echo "document.host_list.id_$i.checked=1;\n"; |
| 95 | 95 | } |
| 96 | 96 | echo " |
| 97 | 97 | } |
| 98 | 98 | function clear_all() { |
| 99 | 99 | "; |
| 100 | -for ($i=1; $i<$nhosts; $i++) { |
|
| 100 | +for ($i = 1; $i < $nhosts; $i++) { |
|
| 101 | 101 | echo "document.host_list.id_$i.checked=0;\n"; |
| 102 | 102 | } |
| 103 | 103 | echo " |
@@ -20,16 +20,16 @@ discard block |
||
| 20 | 20 | |
| 21 | 21 | // TODO: document; use new DB interface |
| 22 | 22 | |
| 23 | -include_once( "../inc/db.inc" ); |
|
| 24 | -include_once( "../inc/util.inc" ); |
|
| 25 | -include_once( "../inc/db_ops.inc" ); |
|
| 26 | -include_once( "../inc/util_ops.inc" ); |
|
| 27 | -include_once( "../inc/prefs.inc" ); |
|
| 23 | +include_once("../inc/db.inc"); |
|
| 24 | +include_once("../inc/util.inc"); |
|
| 25 | +include_once("../inc/db_ops.inc"); |
|
| 26 | +include_once("../inc/util_ops.inc"); |
|
| 27 | +include_once("../inc/prefs.inc"); |
|
| 28 | 28 | |
| 29 | 29 | db_init(); |
| 30 | 30 | |
| 31 | 31 | if (get_int('hostid')) { |
| 32 | - $hostid = get_int( 'hostid' ); |
|
| 32 | + $hostid = get_int('hostid'); |
|
| 33 | 33 | } else { |
| 34 | 34 | error_page("no hostid"); |
| 35 | 35 | } |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | admin_page_head($title); |
| 41 | 41 | |
| 42 | -if($hostid > 0) { |
|
| 42 | +if ($hostid > 0) { |
|
| 43 | 43 | $result = _mysql_query("UPDATE host SET max_results_day=1 WHERE id=".$hostid); |
| 44 | 44 | } |
| 45 | 45 | |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | |
| 24 | 24 | set_time_limit(0); |
| 25 | 25 | |
| 26 | -function cache_check_diskspace2(){ |
|
| 26 | +function cache_check_diskspace2() { |
|
| 27 | 27 | $too_old = 86400; |
| 28 | 28 | while (1) { |
| 29 | 29 | $f = disk_free_space("../cache"); |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | break; |
| 34 | 34 | } |
| 35 | 35 | clean_cache($too_old, "../cache"); |
| 36 | - $too_old/=2; |
|
| 36 | + $too_old /= 2; |
|
| 37 | 37 | } |
| 38 | 38 | } |
| 39 | 39 | |
@@ -38,30 +38,30 @@ discard block |
||
| 38 | 38 | if ($cancel && ($cancel == 1)) { |
| 39 | 39 | if ($WU) { |
| 40 | 40 | foreach ($WU as $key => $value) { |
| 41 | - if($WUs != "") { |
|
| 42 | - $WUs = $WUs . ","; |
|
| 41 | + if ($WUs != "") { |
|
| 42 | + $WUs = $WUs.","; |
|
| 43 | 43 | } |
| 44 | - $WUs = $WUs . $value; |
|
| 44 | + $WUs = $WUs.$value; |
|
| 45 | 45 | } |
| 46 | 46 | } |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | // cancel WUs (if not in rops) |
| 50 | 50 | // |
| 51 | -if($WUs != "") { |
|
| 51 | +if ($WUs != "") { |
|
| 52 | 52 | echo "<!--- WUs to cancel: $WUs --->\n"; |
| 53 | 53 | if (!in_rops()) { |
| 54 | - cancel_wus_where("id IN (" . $WUs . ")"); |
|
| 54 | + cancel_wus_where("id IN (".$WUs.")"); |
|
| 55 | 55 | } |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | if ($back) { |
| 59 | 59 | if ($back == "errorwus") { |
| 60 | 60 | $args = "?refresh_cache=1"; |
| 61 | - if ($hide_canceled && $hide_canceled=="on") { |
|
| 61 | + if ($hide_canceled && $hide_canceled == "on") { |
|
| 62 | 62 | $args .= "&hide_canceled=on"; |
| 63 | 63 | } |
| 64 | - if ($hide_dlerr && $hide_dlerr=="on") { |
|
| 64 | + if ($hide_dlerr && $hide_dlerr == "on") { |
|
| 65 | 65 | $args .= "&hide_dlerr=on"; |
| 66 | 66 | } |
| 67 | 67 | if ($appid) { |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | echo "<p><a href=\"errorwus.php$args\">Return to All-error Workunits page</a> (refreshes the cache)</p>"; |
| 71 | 71 | } else if ($back == "cancelwus") { |
| 72 | 72 | if ($clause) { |
| 73 | - $clause=urlencode($clause); |
|
| 73 | + $clause = urlencode($clause); |
|
| 74 | 74 | echo "<p><a href=\"cancel_workunits.php?limit=$limit&uclause=$clause\">"; |
| 75 | 75 | echo "Cancel next (max $limit) Workunits</a></p>"; |
| 76 | 76 | } |