@@ -34,7 +34,7 @@ |
||
34 | 34 | |
35 | 35 | function cleanup_orphan_threads() { |
36 | 36 | $threads = BoincThread::enum(""); |
37 | - foreach($threads as $thread) { |
|
37 | + foreach ($threads as $thread) { |
|
38 | 38 | $forum = BoincForum::lookup_id($thread->forum); |
39 | 39 | if (!$forum) { |
40 | 40 | cleanup_thread($thread); |
@@ -84,7 +84,7 @@ |
||
84 | 84 | |
85 | 85 | $result = _mysql_query($query); |
86 | 86 | while ($user = _mysql_fetch_object($result)) { |
87 | - // TODO: might want to also replace TOTAL_CREDIT, RAC, and similar. |
|
87 | + // TODO: might want to also replace TOTAL_CREDIT, RAC, and similar. |
|
88 | 88 | $body_to_send = str_replace("USERNAME", $user->name, $body); |
89 | 89 | $body_to_send .= "\n\nTo opt out of future emails from ".PROJECT.", please edit your project preferences at ".secure_url_base()."prefs.php?subset=project\n"; |
90 | 90 | $retval = send_email($user, $subject, $body_to_send); |
@@ -36,7 +36,7 @@ |
||
36 | 36 | // These are set to large values because otherwise the script has |
37 | 37 | // a tendency to just stop after some time. |
38 | 38 | // |
39 | -ini_set ("memory_limit", "20M"); |
|
39 | +ini_set("memory_limit", "20M"); |
|
40 | 40 | set_time_limit(3600); |
41 | 41 | |
42 | 42 | $receiver = 0; |
@@ -80,41 +80,41 @@ |
||
80 | 80 | die("can't parse config file\n"); |
81 | 81 | } |
82 | 82 | $config = $c->config; |
83 | - $master_url = (string) $config->master_url; |
|
83 | + $master_url = (string)$config->master_url; |
|
84 | 84 | $u = parse_url($master_url); |
85 | 85 | $master_host = $u["host"]; |
86 | 86 | |
87 | - $url = (string) $config->download_url; |
|
87 | + $url = (string)$config->download_url; |
|
88 | 88 | $u = parse_url($url); |
89 | 89 | $h = $u["host"]; |
90 | 90 | if ($h != $master_host) { |
91 | 91 | $y = new StdClass; |
92 | 92 | $y->cmd = 'Download server'; |
93 | 93 | $y->host = $h; |
94 | - $y->status = web_server_running($url)?1:0; |
|
94 | + $y->status = web_server_running($url) ? 1 : 0; |
|
95 | 95 | $x[] = $y; |
96 | 96 | } |
97 | - $url = (string) $config->upload_url; |
|
97 | + $url = (string)$config->upload_url; |
|
98 | 98 | $u = parse_url($url); |
99 | 99 | $h = $u["host"]; |
100 | 100 | if ($h != $master_host) { |
101 | 101 | $y = new StdClass; |
102 | 102 | $y->cmd = 'Upload server'; |
103 | 103 | $y->host = $h; |
104 | - $y->status = web_server_running($url)?1:0; |
|
104 | + $y->status = web_server_running($url) ? 1 : 0; |
|
105 | 105 | $x[] = $y; |
106 | 106 | } |
107 | 107 | |
108 | 108 | $main_host = (string)$c->config->host; |
109 | 109 | if ($c->config->www_host) { |
110 | - $web_host = (string) $c->config->www_host; |
|
110 | + $web_host = (string)$c->config->www_host; |
|
111 | 111 | } else { |
112 | 112 | $web_host = $main_host; |
113 | 113 | } |
114 | 114 | $daemons = $c->daemons; |
115 | 115 | foreach ($daemons->daemon as $d) { |
116 | 116 | if ((int)$d->disabled != 0) continue; |
117 | - $host = $d->host?(string)$d->host:$main_host; |
|
117 | + $host = $d->host ? (string)$d->host : $main_host; |
|
118 | 118 | if ($host != $web_host) { |
119 | 119 | $y = new StdClass; |
120 | 120 | $y->cmd = (string)$d->cmd; |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | $body = " |
29 | 29 | You are due for refresh on the following units from |
30 | 30 | "; |
31 | - foreach($user->refresh as $r) { |
|
31 | + foreach ($user->refresh as $r) { |
|
32 | 32 | } |
33 | 33 | } |
34 | 34 | |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $rs = BoltRefresh::enum("due_time < $now"); |
38 | 38 | $users = array(); |
39 | 39 | |
40 | - foreach($rs as $r) { |
|
40 | + foreach ($rs as $r) { |
|
41 | 41 | $view = BoltView::lookup_id($r->view_id); |
42 | 42 | $user_id = $view->user_id; |
43 | 43 | if (!key_exists($user_id)) { |
@@ -35,10 +35,10 @@ discard block |
||
35 | 35 | start_table(); |
36 | 36 | |
37 | 37 | switch($table){ |
38 | - case "platform": |
|
39 | - break; |
|
40 | - case "app": |
|
41 | - break; |
|
38 | + case "platform": |
|
39 | + break; |
|
40 | + case "app": |
|
41 | + break; |
|
42 | 42 | case "app_version": |
43 | 43 | print_detail_field(); |
44 | 44 | print_query_field(); |
@@ -89,8 +89,8 @@ discard block |
||
89 | 89 | case "user": |
90 | 90 | print_query_field(); |
91 | 91 | break; |
92 | - default: |
|
93 | - echo "Unknown table name\n"; |
|
92 | + default: |
|
93 | + echo "Unknown table name\n"; |
|
94 | 94 | exit(); |
95 | 95 | } |
96 | 96 |
@@ -35,63 +35,63 @@ |
||
35 | 35 | start_table(); |
36 | 36 | |
37 | 37 | switch($table){ |
38 | - case "platform": |
|
39 | - break; |
|
40 | - case "app": |
|
41 | - break; |
|
42 | - case "app_version": |
|
43 | - print_detail_field(); |
|
44 | - print_query_field(); |
|
45 | - break; |
|
46 | - case "host": |
|
47 | - echo " |
|
38 | +case "platform": |
|
39 | + break; |
|
40 | +case "app": |
|
41 | + break; |
|
42 | +case "app_version": |
|
43 | + print_detail_field(); |
|
44 | + print_query_field(); |
|
45 | + break; |
|
46 | +case "host": |
|
47 | + echo " |
|
48 | 48 | <tr> |
49 | 49 | <td align=\"right\">Show Aggregate Information</td> |
50 | 50 | <td> |
51 | 51 | "; |
52 | - print_checkbox("", "show_aggregate", $show_aggregate); |
|
53 | - echo " |
|
52 | + print_checkbox("", "show_aggregate", $show_aggregate); |
|
53 | + echo " |
|
54 | 54 | </td> |
55 | 55 | </tr> |
56 | 56 | "; |
57 | - print_detail_field(); |
|
58 | - print_query_field(); |
|
59 | - break; |
|
60 | - case "workunit": |
|
61 | - print_detail_field(); |
|
62 | - print_query_field(); |
|
63 | - echo "<input type=\"hidden\" name=\"sort_by\" value=\"id\">\n"; |
|
64 | - break; |
|
65 | - case "result": |
|
66 | - echo "<tr><td align=\"right\">Server state</td><td> "; |
|
67 | - server_state_select(); |
|
68 | - echo "</td></tr>\n"; |
|
69 | - //print_text_field( "Batch number:", "batch", $batch ); |
|
70 | - echo "<tr><td align=\"right\">Outcome</td><td>"; |
|
71 | - outcome_select(); |
|
72 | - echo "</td></tr>\n"; |
|
73 | - echo "<tr><td align=\"right\">Client state</td><td>"; |
|
74 | - client_state_select(); |
|
75 | - echo "</td></tr>\n"; |
|
76 | - echo "<tr><td align=\"right\">Validate state</td><td>"; |
|
77 | - validate_state_select(); |
|
78 | - echo "</td></tr>\n"; |
|
79 | - echo "<tr><td align=\"right\">Sort by</td><td>"; |
|
80 | - result_sort_select(); |
|
81 | - sort_order_select(); |
|
82 | - echo "</td></tr>\n"; |
|
83 | - print_detail_field(); |
|
84 | - print_query_field(); |
|
85 | - break; |
|
86 | - case "team": |
|
87 | - print_query_field(); |
|
88 | - break; |
|
89 | - case "user": |
|
90 | - print_query_field(); |
|
91 | - break; |
|
92 | - default: |
|
93 | - echo "Unknown table name\n"; |
|
94 | - exit(); |
|
57 | + print_detail_field(); |
|
58 | + print_query_field(); |
|
59 | + break; |
|
60 | +case "workunit": |
|
61 | + print_detail_field(); |
|
62 | + print_query_field(); |
|
63 | + echo "<input type=\"hidden\" name=\"sort_by\" value=\"id\">\n"; |
|
64 | + break; |
|
65 | +case "result": |
|
66 | + echo "<tr><td align=\"right\">Server state</td><td> "; |
|
67 | + server_state_select(); |
|
68 | + echo "</td></tr>\n"; |
|
69 | + //print_text_field( "Batch number:", "batch", $batch ); |
|
70 | + echo "<tr><td align=\"right\">Outcome</td><td>"; |
|
71 | + outcome_select(); |
|
72 | + echo "</td></tr>\n"; |
|
73 | + echo "<tr><td align=\"right\">Client state</td><td>"; |
|
74 | + client_state_select(); |
|
75 | + echo "</td></tr>\n"; |
|
76 | + echo "<tr><td align=\"right\">Validate state</td><td>"; |
|
77 | + validate_state_select(); |
|
78 | + echo "</td></tr>\n"; |
|
79 | + echo "<tr><td align=\"right\">Sort by</td><td>"; |
|
80 | + result_sort_select(); |
|
81 | + sort_order_select(); |
|
82 | + echo "</td></tr>\n"; |
|
83 | + print_detail_field(); |
|
84 | + print_query_field(); |
|
85 | + break; |
|
86 | +case "team": |
|
87 | + print_query_field(); |
|
88 | + break; |
|
89 | +case "user": |
|
90 | + print_query_field(); |
|
91 | + break; |
|
92 | +default: |
|
93 | + echo "Unknown table name\n"; |
|
94 | + exit(); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | row2("Number of entries to show", "<input name=\"nresults\" value=\"20\">"); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | |
35 | 35 | start_table(); |
36 | 36 | |
37 | -switch($table){ |
|
37 | +switch ($table) { |
|
38 | 38 | case "platform": |
39 | 39 | break; |
40 | 40 | case "app": |
@@ -102,5 +102,5 @@ discard block |
||
102 | 102 | print_describe_table($table, 4); |
103 | 103 | |
104 | 104 | admin_page_tail(); |
105 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
105 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
106 | 106 | ?> |
@@ -34,7 +34,7 @@ |
||
34 | 34 | |
35 | 35 | start_table(); |
36 | 36 | |
37 | -switch($table){ |
|
37 | +switch($table) { |
|
38 | 38 | case "platform": |
39 | 39 | break; |
40 | 40 | case "app": |
@@ -55,5 +55,5 @@ |
||
55 | 55 | </form> |
56 | 56 | "; |
57 | 57 | admin_page_tail(); |
58 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
58 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
59 | 59 | ?> |
@@ -71,9 +71,9 @@ |
||
71 | 71 | "; |
72 | 72 | start_table(); |
73 | 73 | row1("User settings"); |
74 | - $x = ($flags&BOLT_FLAGS_SHOW_ALL)?"checked":""; |
|
74 | + $x = ($flags&BOLT_FLAGS_SHOW_ALL) ? "checked" : ""; |
|
75 | 75 | row2("Show hidden courses?", "<input type=checkbox name=show_all $x>"); |
76 | - $x = ($flags&BOLT_FLAGS_DEBUG)?"checked":""; |
|
76 | + $x = ($flags&BOLT_FLAGS_DEBUG) ? "checked" : ""; |
|
77 | 77 | row2("Show debugging output?", "<input type=checkbox name=debug $x>"); |
78 | 78 | row2("", "<input class=\"btn btn-primary\" type=submit name=submit value=\"Update settings\">"); |
79 | 79 | end_table(); |
@@ -21,11 +21,11 @@ |
||
21 | 21 | // TODO: document - when/why would you want to do this? |
22 | 22 | // TODO: use new DB interface |
23 | 23 | |
24 | -include_once( "../inc/db.inc" ); |
|
25 | -include_once( "../inc/util.inc" ); |
|
26 | -include_once( "../inc/db_ops.inc" ); |
|
27 | -include_once( "../inc/util_ops.inc" ); |
|
28 | -include_once( "../inc/prefs.inc" ); |
|
24 | +include_once("../inc/db.inc"); |
|
25 | +include_once("../inc/util.inc"); |
|
26 | +include_once("../inc/db_ops.inc"); |
|
27 | +include_once("../inc/util_ops.inc"); |
|
28 | +include_once("../inc/prefs.inc"); |
|
29 | 29 | |
30 | 30 | db_init(); |
31 | 31 |
@@ -33,7 +33,7 @@ |
||
33 | 33 | echo "no app for batch $b->id\n"; |
34 | 34 | return; |
35 | 35 | } |
36 | - if ($b->fraction_done>0 && $b->credit_canonical>0) { |
|
36 | + if ($b->fraction_done > 0 && $b->credit_canonical > 0) { |
|
37 | 37 | $credit_total = $b->credit_canonical/$b->fraction_done; |
38 | 38 | $fpops_total = $credit_total*(86400e9/200); |
39 | 39 | } else { |