Passed
Pull Request — master (#3312)
by David
06:57
created
html/user/bolt.php 2 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
         $view = BoltView::lookup_id($e->last_view_id);
43 43
         $ago = time_diff(time() - $view->start_time);
44 44
         $pct = number_format($view->fraction_done*100, 0);
45
-        $status = "Started $start
45
+        $status = "started $start
46 46
             <br>Last visit: $ago ago
47 47
             <br>$pct% done
48 48
         ";
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
     if ($course->hidden && !($user->bolt->flags&BOLT_FLAG_SHOW_ALL)) {
37 37
         continue;
38 38
     }
39
-    $e = $user?BoltEnrollment::lookup($user->id, $course->id):null;
39
+    $e = $user ?BoltEnrollment::lookup($user->id, $course->id) : null;
40 40
     if ($e) {
41 41
         $start = date_str($e->create_time);
42 42
         $view = BoltView::lookup_id($e->last_view_id);
Please login to merge, or discard this patch.
html/user/forum_reply.php 2 patches
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     $parent_post_id = 0;
51 51
 }
52 52
 
53
-if ($filter != "false"){
53
+if ($filter != "false") {
54 54
     $filter = true;
55 55
 } else {
56 56
     $filter = false;
@@ -65,10 +65,10 @@  discard block
 block discarded – undo
65 65
 }
66 66
 
67 67
 $warning = null;
68
-if ($content && (!$preview)){
69
-    if (post_str('add_signature',true)=="add_it"){
68
+if ($content && (!$preview)) {
69
+    if (post_str('add_signature',true)=="add_it") {
70 70
         $add_signature=true;    // set a flag and concatenate later
71
-    }  else {
71
+    } else {
72 72
         $add_signature=false;
73 73
     }
74 74
     check_tokens($logged_in_user->authenticator);
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     $parent_post_id = 0;
51 51
 }
52 52
 
53
-if ($filter != "false"){
53
+if ($filter != "false") {
54 54
     $filter = true;
55 55
 } else {
56 56
     $filter = false;
@@ -65,11 +65,11 @@  discard block
 block discarded – undo
65 65
 }
66 66
 
67 67
 $warning = null;
68
-if ($content && (!$preview)){
69
-    if (post_str('add_signature',true)=="add_it"){
70
-        $add_signature=true;    // set a flag and concatenate later
71
-    }  else {
72
-        $add_signature=false;
68
+if ($content && (!$preview)) {
69
+    if (post_str('add_signature', true) == "add_it") {
70
+        $add_signature = true; // set a flag and concatenate later
71
+    } else {
72
+        $add_signature = false;
73 73
     }
74 74
     check_tokens($logged_in_user->authenticator);
75 75
     if (!akismet_check($logged_in_user, $content)) {
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
     }
89 89
 }
90 90
 
91
-page_head(tra("Post to thread"),'','','', $bbcode_js);
91
+page_head(tra("Post to thread"), '', '', '', $bbcode_js);
92 92
 
93 93
 show_forum_header($logged_in_user);
94 94
 
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
     $x1 = tra("Message:").bbcode_info().post_warning();
143 143
     $x2 = "";
144 144
     if ($parent_post) {
145
-        $x2 .=" ".tra("reply to %1 Message ID %2:", "<a href=#".$parent_post->id.">", " ".$parent_post->id."</a>");
145
+        $x2 .= " ".tra("reply to %1 Message ID %2:", "<a href=#".$parent_post->id.">", " ".$parent_post->id."</a>");
146 146
     }
147 147
     $x2 .= "<form action=forum_reply.php?thread=".$thread->id;
148 148
 
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
     $x2 .= " method=\"post\" name=\"post\" onsubmit=\"return checkForm(this)\">\n";
154 154
     $x2 .= form_tokens($logged_in_user->authenticator);
155 155
     $x2 .= start_table_str().$bbcode_html.end_table_str()."<textarea class=\"form-control\" name=\"content\" rows=\"18\">";
156
-    $no_quote = get_int("no_quote", true)==1;
156
+    $no_quote = get_int("no_quote", true) == 1;
157 157
     if ($preview) {
158 158
         $x2 .= htmlspecialchars($content);
159 159
     } else if (!$no_quote) {
@@ -162,9 +162,9 @@  discard block
 block discarded – undo
162 162
         }
163 163
     }
164 164
     if (!$logged_in_user->prefs->no_signature_by_default) {
165
-        $enable_signature="checked=\"true\"";
165
+        $enable_signature = "checked=\"true\"";
166 166
     } else {
167
-        $enable_signature="";
167
+        $enable_signature = "";
168 168
     }
169 169
     $x2 .= "</textarea><p> </p>
170 170
         <input class=\"btn btn-primary btn-sm \" type=\"submit\" name=\"preview\" value=\"".tra("Preview")."\">
@@ -179,9 +179,9 @@  discard block
 block discarded – undo
179 179
 }
180 180
 
181 181
 function quote_text($text) {
182
-    $text = "[quote]" . $text . "[/quote]";
182
+    $text = "[quote]".$text."[/quote]";
183 183
     return $text;
184 184
 }
185 185
 
186
-$cvs_version_tracker[]="\$Id$";
186
+$cvs_version_tracker[] = "\$Id$";
187 187
 ?>
Please login to merge, or discard this patch.
html/user/submit_status.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
     if (!$batch || $batch->user_id != $user->id) {
33 33
         error_page("no batch");
34 34
     }
35
-    page_head("Batch $batch->id");
35
+    page_head("batch $batch->id");
36 36
     $results = BoincResult::enum("batch=$batch->id order by workunitid");
37 37
     result_table_start(true, true, null);
38 38
     foreach ($results as $result) {
Please login to merge, or discard this patch.
html/user/edit_forum_preferences_form.php 2 patches
Braces   +6 added lines, -5 removed lines patch added patch discarded remove patch
@@ -53,8 +53,9 @@  discard block
 block discarded – undo
53 53
 // ------------ Forum identity -----------
54 54
 
55 55
 $select_0 = $select_1 = $select_2 = "";
56
-if (strlen($user->prefs->avatar)){
57
-    if (substr($user->prefs->avatar, 0, 23) == 'http://www.gravatar.com' || substr($user->prefs->avatar, 0, 18)=="//www.gravatar.com") { // Gravatar
56
+if (strlen($user->prefs->avatar)) {
57
+    if (substr($user->prefs->avatar, 0, 23) == 'http://www.gravatar.com' || substr($user->prefs->avatar, 0, 18)=="//www.gravatar.com") {
58
+// Gravatar
58 59
         $select_1 = "checked=\"true\"";
59 60
     } else {
60 61
         $select_2 = "checked=\"true\"";
@@ -73,7 +74,7 @@  discard block
 block discarded – undo
73 74
     <input type=\"radio\" id=\"avatar_select_2\" name=\"avatar_select\" value=\"2\" ".$select_2.">
74 75
         <label for=\"avatar_select_2\">".tra("Use this uploaded avatar:")."</label> <input type=\"file\" name=\"picture\">"
75 76
 );
76
-if (strlen($user->prefs->avatar)){
77
+if (strlen($user->prefs->avatar)) {
77 78
     row2(tra("Avatar preview")."<br><p class=\"text-muted\">".tra("This is how your avatar will look")."</p>",
78 79
     "<img src=\"".$user->prefs->avatar."\" width=\"100\" height=\"100\">");
79 80
 }
@@ -92,7 +93,7 @@  discard block
 block discarded – undo
92 93
     textarea_with_counter("signature", 250, $signature)
93 94
     ."<br><input type=\"checkbox\" name=\"signature_by_default\" ".$signature_by_default."> ".tra("Attach signature by default")
94 95
 );
95
-if ($user->prefs->signature!=""){
96
+if ($user->prefs->signature!="") {
96 97
     row2(tra("Signature preview").
97 98
         "<br><p class=\"text-muted\">".tra("This is how your signature will look in the forums")."</p>",
98 99
         output_transform($user->prefs->signature)
@@ -138,7 +139,7 @@  discard block
 block discarded – undo
138 139
 
139 140
 $filtered_userlist = get_ignored_list($user);
140 141
 $forum_filtered_userlist = "";
141
-for ($i=0; $i<sizeof($filtered_userlist); $i++){
142
+for ($i=0; $i<sizeof($filtered_userlist); $i++) {
142 143
     $id = (int)$filtered_userlist[$i];
143 144
     if ($id) {
144 145
         $filtered_user = BoincUser::lookup_id($id);
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -38,9 +38,9 @@  discard block
 block discarded – undo
38 38
 // ------------ Notification -----------
39 39
 
40 40
 row1(tra("Notifications"));
41
-$ch0 = $user->prefs->pm_notification==0?"checked":"";
42
-$ch1 = $user->prefs->pm_notification==1?"checked":"";
43
-$ch2 = $user->prefs->pm_notification==2?"checked":"";
41
+$ch0 = $user->prefs->pm_notification == 0 ? "checked" : "";
42
+$ch1 = $user->prefs->pm_notification == 1 ? "checked" : "";
43
+$ch2 = $user->prefs->pm_notification == 2 ? "checked" : "";
44 44
 row2(
45 45
     tra("How should we notify you of new private messages, friend requests, posts in subscribed threads, and other events?"),
46 46
     "<input type=radio name=pm_notification value=0 $ch0> ".tra("On my Account page (no email)")."
@@ -53,8 +53,8 @@  discard block
 block discarded – undo
53 53
 // ------------ Forum identity -----------
54 54
 
55 55
 $select_0 = $select_1 = $select_2 = "";
56
-if (strlen($user->prefs->avatar)){
57
-    if (substr($user->prefs->avatar, 0, 23) == 'http://www.gravatar.com' || substr($user->prefs->avatar, 0, 18)=="//www.gravatar.com") { // Gravatar
56
+if (strlen($user->prefs->avatar)) {
57
+    if (substr($user->prefs->avatar, 0, 23) == 'http://www.gravatar.com' || substr($user->prefs->avatar, 0, 18) == "//www.gravatar.com") { // Gravatar
58 58
         $select_1 = "checked=\"true\"";
59 59
     } else {
60 60
         $select_2 = "checked=\"true\"";
@@ -73,15 +73,15 @@  discard block
 block discarded – undo
73 73
     <input type=\"radio\" id=\"avatar_select_2\" name=\"avatar_select\" value=\"2\" ".$select_2.">
74 74
         <label for=\"avatar_select_2\">".tra("Use this uploaded avatar:")."</label> <input type=\"file\" name=\"picture\">"
75 75
 );
76
-if (strlen($user->prefs->avatar)){
76
+if (strlen($user->prefs->avatar)) {
77 77
     row2(tra("Avatar preview")."<br><p class=\"text-muted\">".tra("This is how your avatar will look")."</p>",
78 78
     "<img src=\"".$user->prefs->avatar."\" width=\"100\" height=\"100\">");
79 79
 }
80 80
 
81
-$signature_by_default = $user->prefs->no_signature_by_default==false?"checked=\"checked\"":"";
81
+$signature_by_default = $user->prefs->no_signature_by_default == false ? "checked=\"checked\"" : "";
82 82
 
83
-$signature=$user->prefs->signature;
84
-$maxlen=250;
83
+$signature = $user->prefs->signature;
84
+$maxlen = 250;
85 85
 row2(
86 86
     tra("Signature for message board posts")
87 87
     .bbcode_info()
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
     textarea_with_counter("signature", 250, $signature)
93 93
     ."<br><input type=\"checkbox\" name=\"signature_by_default\" ".$signature_by_default."> ".tra("Attach signature by default")
94 94
 );
95
-if ($user->prefs->signature!=""){
95
+if ($user->prefs->signature != "") {
96 96
     row2(tra("Signature preview").
97 97
         "<br><p class=\"text-muted\">".tra("This is how your signature will look in the forums")."</p>",
98 98
         output_transform($user->prefs->signature)
@@ -101,13 +101,13 @@  discard block
 block discarded – undo
101 101
 
102 102
 // ------------ Message display  -----------
103 103
 
104
-$forum_hide_avatars = $user->prefs->hide_avatars?"checked=\"checked\"":"";
105
-$forum_hide_signatures = $user->prefs->hide_signatures?"checked=\"checked\"":"";
106
-$forum_link_popup = $user->prefs->link_popup?"checked=\"checked\"":""; 
107
-$forum_image_as_link = $user->prefs->images_as_links?"checked=\"checked\"":"";
108
-$forum_jump_to_unread = $user->prefs->jump_to_unread?"checked=\"checked\"":"";
109
-$forum_ignore_sticky_posts = $user->prefs->ignore_sticky_posts?"checked=\"checked\"":"";
110
-$forum_highlight_special = $user->prefs->highlight_special?"checked=\"checked\"":"";
104
+$forum_hide_avatars = $user->prefs->hide_avatars ? "checked=\"checked\"" : "";
105
+$forum_hide_signatures = $user->prefs->hide_signatures ? "checked=\"checked\"" : "";
106
+$forum_link_popup = $user->prefs->link_popup ? "checked=\"checked\"" : ""; 
107
+$forum_image_as_link = $user->prefs->images_as_links ? "checked=\"checked\"" : "";
108
+$forum_jump_to_unread = $user->prefs->jump_to_unread ? "checked=\"checked\"" : "";
109
+$forum_ignore_sticky_posts = $user->prefs->ignore_sticky_posts ? "checked=\"checked\"" : "";
110
+$forum_highlight_special = $user->prefs->highlight_special ? "checked=\"checked\"" : "";
111 111
 
112 112
 $forum_minimum_wrap_postcount = intval($user->prefs->minimum_wrap_postcount);
113 113
 $forum_display_wrap_postcount = intval($user->prefs->display_wrap_postcount);
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 
139 139
 $filtered_userlist = get_ignored_list($user);
140 140
 $forum_filtered_userlist = "";
141
-for ($i=0; $i<sizeof($filtered_userlist); $i++){
141
+for ($i = 0; $i < sizeof($filtered_userlist); $i++) {
142 142
     $id = (int)$filtered_userlist[$i];
143 143
     if ($id) {
144 144
         $filtered_user = BoincUser::lookup_id($id);
@@ -168,5 +168,5 @@  discard block
 block discarded – undo
168 168
 end_table();
169 169
 page_tail();
170 170
 
171
-$cvs_version_tracker[]="\$Id$";  //Generated automatically - do not edit
171
+$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit
172 172
 ?>
Please login to merge, or discard this patch.
html/user/submit_rpc_handler.php 4 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -691,7 +691,8 @@
 block discarded – undo
691 691
         <id>$result->id</id>
692 692
         <state>".state_string($result)."</state>
693 693
 ";
694
-        if ($result->server_state == 5) {   // over?
694
+        if ($result->server_state == 5) {
695
+// over?
695 696
             $paths = get_outfile_paths($result);
696 697
             foreach($paths as $path) {
697 698
                 if (is_file($path)) {
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -595,7 +595,7 @@
 block discarded – undo
595 595
 // return a batch specified by the command, using either ID or name
596 596
 //
597 597
 function get_batch($r) {
598
-    $batch = NULL;
598
+    $batch = null;
599 599
     if (!empty($r->batch_id)) {
600 600
         $batch_id = (int)($r->batch_id);
601 601
         $batch = BoincBatch::lookup_id($batch_id);
Please login to merge, or discard this patch.
Switch Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -1049,24 +1049,24 @@
 block discarded – undo
1049 1049
 log_write("----- Handling RPC; command ".$r->getName());
1050 1050
 
1051 1051
 switch ($r->getName()) {
1052
-    case 'abort_batch': handle_abort_batch($r); break;
1053
-    case 'abort_jobs': handle_abort_jobs($r); break;
1054
-    case 'create_batch': create_batch($r); break;
1055
-    case 'estimate_batch': estimate_batch($r); break;
1056
-    case 'get_templates': get_templates($r); break;
1057
-    case 'ping': ping($r); break;
1058
-    case 'query_batch': query_batch($r); break;
1059
-    case 'query_batch2': query_batch2($r); break;
1060
-    case 'query_batches': query_batches($r); break;
1061
-    case 'query_job': query_job($r); break;
1062
-    case 'query_completed_job': query_completed_job($r); break;
1063
-    case 'retire_batch': handle_retire_batch($r); break;
1064
-    case 'set_expire_time': handle_set_expire_time($r); break;
1065
-    case 'submit_batch': submit_batch($r); break;
1066
-    default:
1067
-        log_write("bad command");
1068
-        xml_error(-1, "bad command: ".$r->getName());
1069
-        break;
1052
+case 'abort_batch': handle_abort_batch($r); break;
1053
+case 'abort_jobs': handle_abort_jobs($r); break;
1054
+case 'create_batch': create_batch($r); break;
1055
+case 'estimate_batch': estimate_batch($r); break;
1056
+case 'get_templates': get_templates($r); break;
1057
+case 'ping': ping($r); break;
1058
+case 'query_batch': query_batch($r); break;
1059
+case 'query_batch2': query_batch2($r); break;
1060
+case 'query_batches': query_batches($r); break;
1061
+case 'query_job': query_job($r); break;
1062
+case 'query_completed_job': query_completed_job($r); break;
1063
+case 'retire_batch': handle_retire_batch($r); break;
1064
+case 'set_expire_time': handle_set_expire_time($r); break;
1065
+case 'submit_batch': submit_batch($r); break;
1066
+default:
1067
+    log_write("bad command");
1068
+    xml_error(-1, "bad command: ".$r->getName());
1069
+    break;
1070 1070
 }
1071 1071
 
1072 1072
 log_write("RPC done");
Please login to merge, or discard this patch.
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
     if ($template) {
62 62
         $t = (double)$template->workunit->rsc_fpops_est;
63 63
     }
64
-    foreach($r->batch->job as $job) {
64
+    foreach ($r->batch->job as $job) {
65 65
         $y = (double)$job->rsc_fpops_est;
66 66
         if ($y) {
67 67
             $x += $y;
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 function est_elapsed_time($r, $template) {
88 88
     // crude estimate: batch FLOPs / project FLOPS
89 89
     //
90
-    return batch_flop_count($r, $template) / project_flops();
90
+    return batch_flop_count($r, $template)/project_flops();
91 91
 }
92 92
 
93 93
 // if batch-level input template filename was given, read it;
@@ -97,9 +97,9 @@  discard block
 block discarded – undo
97 97
 //
98 98
 function read_input_template($app, $r) {
99 99
     if ((isset($r->batch)) && (isset($r->batch->workunit_template_file)) && ($r->batch->workunit_template_file)) {
100
-        $path = project_dir() . "/templates/".$r->batch->workunit_template_file;
100
+        $path = project_dir()."/templates/".$r->batch->workunit_template_file;
101 101
     } else {
102
-        $path = project_dir() . "/templates/$app->name"."_in";
102
+        $path = project_dir()."/templates/$app->name"."_in";
103 103
     }
104 104
     if (file_exists($path)) {
105 105
         $x = simplexml_load_file($path);
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 function validate_batch($jobs, $template) {
145 145
     $i = 0;
146 146
     $n = count($template->file_info);
147
-    foreach($jobs as $job) {
147
+    foreach ($jobs as $job) {
148 148
         $m = count($job->input_files);
149 149
         if ($n != $m) {
150 150
             log_write("wrong # of input files for job $i: need $n, got $m");
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 // stage all the files
206 206
 //
207 207
 function stage_files(&$jobs) {
208
-    foreach($jobs as $job) {
208
+    foreach ($jobs as $job) {
209 209
         foreach ($job->input_files as $file) {
210 210
             if ($file->mode != "remote") {
211 211
                 $file->name = stage_file($file);
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 //
219 219
 function submit_jobs(
220 220
     $jobs, $job_params, $app, $batch_id, $priority, $app_version_num,
221
-    $input_template_filename,        // batch-level; can also specify per job
221
+    $input_template_filename, // batch-level; can also specify per job
222 222
     $output_template_filename
223 223
 ) {
224 224
     global $input_templates, $output_templates;
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
     // one line per job
228 228
     //
229 229
     $x = "";
230
-    foreach($jobs as $job) {
230
+    foreach ($jobs as $job) {
231 231
         if ($job->name) {
232 232
             $x .= " --wu_name $job->name";
233 233
         }
@@ -259,8 +259,8 @@  discard block
 block discarded – undo
259 259
         $x .= "\n";
260 260
     }
261 261
 
262
-    $errfile = "/tmp/create_work_" . getmypid() . ".err";
263
-    $cmd = "cd " . project_dir() . "; ./bin/create_work --appname $app->name --batch $batch_id --priority $priority";
262
+    $errfile = "/tmp/create_work_".getmypid().".err";
263
+    $cmd = "cd ".project_dir()."; ./bin/create_work --appname $app->name --batch $batch_id --priority $priority";
264 264
     if ($input_template_filename) {
265 265
         $cmd .= " --wu_template templates/$input_template_filename";
266 266
     }
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
 //
357 357
 function xml_get_jobs($r) {
358 358
     $jobs = array();
359
-    foreach($r->batch->job as $j) {
359
+    foreach ($r->batch->job as $j) {
360 360
         $job = new StdClass;
361 361
         $job->input_files = array();
362 362
         $job->command_line = (string)$j->command_line;
@@ -438,16 +438,16 @@  discard block
 block discarded – undo
438 438
     // - use that for batch logical end time and job priority
439 439
     //
440 440
     $total_flops = 0;
441
-    foreach($jobs as $job) {
441
+    foreach ($jobs as $job) {
442 442
         //print_r($job);
443 443
         if ($job->rsc_fpops_est) {
444 444
             $total_flops += $job->rsc_fpops_est;
445 445
         } else if ($job->input_template && $job->input_template->workunit->rsc_fpops_est) {
446
-            $total_flops += (double) $job->input_template->workunit->rsc_fpops_est;
446
+            $total_flops += (double)$job->input_template->workunit->rsc_fpops_est;
447 447
         } else if ($r->batch->job_params->rsc_fpops_est) {
448
-            $total_flops += (double) $r->batch->job_params->rsc_fpops_est;
448
+            $total_flops += (double)$r->batch->job_params->rsc_fpops_est;
449 449
         } else {
450
-            $x = (double) $template->workunit->rsc_fpops_est;
450
+            $x = (double)$template->workunit->rsc_fpops_est;
451 451
             if ($x) {
452 452
                 $total_flops += $x;
453 453
             } else {
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
             }
457 457
         }
458 458
     }
459
-    $cmd = "cd " . project_dir() . "/bin; ./adjust_user_priority --user $user->id --flops $total_flops --app $app->name";
459
+    $cmd = "cd ".project_dir()."/bin; ./adjust_user_priority --user $user->id --flops $total_flops --app $app->name";
460 460
     $x = exec($cmd);
461 461
     if (!is_numeric($x) || (double)$x == 0) {
462 462
         log_write("$cmd returned $x");
@@ -487,15 +487,15 @@  discard block
 block discarded – undo
487 487
     }
488 488
     
489 489
     $job_params = new StdClass;
490
-    $job_params->rsc_disk_bound = (double) $r->batch->job_params->rsc_disk_bound;
491
-    $job_params->rsc_fpops_est = (double) $r->batch->job_params->rsc_fpops_est;
492
-    $job_params->rsc_fpops_bound = (double) $r->batch->job_params->rsc_fpops_bound;
493
-    $job_params->rsc_memory_bound = (double) $r->batch->job_params->rsc_memory_bound;
494
-    $job_params->delay_bound = (double) $r->batch->job_params->delay_bound;
490
+    $job_params->rsc_disk_bound = (double)$r->batch->job_params->rsc_disk_bound;
491
+    $job_params->rsc_fpops_est = (double)$r->batch->job_params->rsc_fpops_est;
492
+    $job_params->rsc_fpops_bound = (double)$r->batch->job_params->rsc_fpops_bound;
493
+    $job_params->rsc_memory_bound = (double)$r->batch->job_params->rsc_memory_bound;
494
+    $job_params->delay_bound = (double)$r->batch->job_params->delay_bound;
495 495
         // could add quorum-related stuff
496 496
 
497
-    $input_template_filename = (string) $r->batch->input_template_filename;
498
-    $output_template_filename = (string) $r->batch->output_template_filename;
497
+    $input_template_filename = (string)$r->batch->input_template_filename;
498
+    $output_template_filename = (string)$r->batch->output_template_filename;
499 499
         // possibly empty
500 500
     
501 501
     submit_jobs(
@@ -583,7 +583,7 @@  discard block
 block discarded – undo
583 583
 }
584 584
 
585 585
 function n_outfiles($wu) {
586
-    $path = project_dir() . "/$wu->output_template_filename";
586
+    $path = project_dir()."/$wu->output_template_filename";
587 587
     $r = simplexml_load_file($path);
588 588
     return count($r->file_info);
589 589
 }
@@ -790,7 +790,7 @@  discard block
 block discarded – undo
790 790
 ";
791 791
         if ($result->server_state == 5) {   // over?
792 792
             $paths = get_outfile_paths($result);
793
-            foreach($paths as $path) {
793
+            foreach ($paths as $path) {
794 794
                 if (is_file($path)) {
795 795
                     $size = filesize($path);
796 796
                     echo "        <outfile>
@@ -834,7 +834,7 @@  discard block
 block discarded – undo
834 834
     } else {
835 835
         $results = BoincResult::enum("workunitid=$job_id");
836 836
         foreach ($results as $r) {
837
-            switch($r->outcome) {
837
+            switch ($r->outcome) {
838 838
             case 1:
839 839
             case 3:
840 840
             case 6:
@@ -949,8 +949,8 @@  discard block
 block discarded – undo
949 949
     }
950 950
 
951 951
     list($user, $user_submit) = authenticate_user($r, $app);
952
-    $in = file_get_contents(project_dir() . "/templates/".$app->name."_in");
953
-    $out = file_get_contents(project_dir() . "/templates/".$app->name."_out");
952
+    $in = file_get_contents(project_dir()."/templates/".$app->name."_in");
953
+    $out = file_get_contents(project_dir()."/templates/".$app->name."_out");
954 954
     if ($in === false || $out === false) {
955 955
         log_write("template file missing");
956 956
         xml_error(-1, "template file missing");
@@ -962,7 +962,7 @@  discard block
 block discarded – undo
962 962
 
963 963
 function ping($r) {
964 964
     xml_start_tag("ping");
965
-    BoincDb::get();     // errors out if DB down or web disabled
965
+    BoincDb::get(); // errors out if DB down or web disabled
966 966
     echo "<success>1</success>
967 967
         </ping>
968 968
     ";
@@ -1029,9 +1029,9 @@  discard block
 block discarded – undo
1029 1029
 $request_log = parse_config(get_config(), "<remote_submit_request_log>");
1030 1030
 if ($request_log) {
1031 1031
     $log_dir = parse_config(get_config(), "<log_dir>");
1032
-    $request_log = $log_dir . "/" . $request_log;
1032
+    $request_log = $log_dir."/".$request_log;
1033 1033
     if ($file = fopen($request_log, "a")) {
1034
-        fwrite($file, "\n<submit_rpc_handler date=\"" . date(DATE_ATOM) . "\">\n" . $_POST['request'] . "\n</submit_rpc_handler>\n");
1034
+        fwrite($file, "\n<submit_rpc_handler date=\"".date(DATE_ATOM)."\">\n".$_POST['request']."\n</submit_rpc_handler>\n");
1035 1035
         fclose($file);
1036 1036
     }
1037 1037
 }
Please login to merge, or discard this patch.
html/user/get_project_config.php 3 patches
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,10 +28,10 @@
 block discarded – undo
28 28
 //
29 29
 function show_platforms() {
30 30
     $xmlFragment = unserialize(get_cached_data(3600, "project_config_platform_xml"));
31
-    if ($xmlFragment==false){
31
+    if ($xmlFragment==false) {
32 32
         $platforms = BoincDB::get()->enum_fields("platform, DBNAME.app_version, DBNAME.app", "BoincPlatform", "platform.name, platform.user_friendly_name, plan_class", "app_version.platformid = platform.id and app_version.appid = app.id and app_version.deprecated=0 and app.deprecated=0 group by platform.name, plan_class", "");
33 33
         $xmlFragment = "    <platforms>";
34
-        foreach ($platforms as $platform){
34
+        foreach ($platforms as $platform) {
35 35
             $xmlFragment .= "
36 36
             <platform>
37 37
                 <platform_name>$platform->name</platform_name>
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -86,11 +86,11 @@  discard block
 block discarded – undo
86 86
 }
87 87
 
88 88
 if ($disable_account_creation || defined('INVITE_CODES')) {
89
-	echo "    <account_creation_disabled/>\n";
89
+    echo "    <account_creation_disabled/>\n";
90 90
 }
91 91
 
92 92
 if (defined('INVITE_CODES')) {
93
-	echo "    <invite_code_required/>\n";
93
+    echo "    <invite_code_required/>\n";
94 94
 }
95 95
 
96 96
 echo "    <min_passwd_length>$min_passwd_length</min_passwd_length>\n";
@@ -113,9 +113,9 @@  discard block
 block discarded – undo
113 113
 // the terms_of_use.txt file in the project base directory.
114 114
 //
115 115
 if (defined('TERMSOFUSE_FILE')) {
116
-  $tou_file = TERMSOFUSE_FILE;
116
+    $tou_file = TERMSOFUSE_FILE;
117 117
 } else {
118
-  $tou_file =  "../../terms_of_use.txt";
118
+    $tou_file =  "../../terms_of_use.txt";
119 119
 }
120 120
 if (file_exists($tou_file)) {
121 121
     $terms_of_use = trim(file_get_contents($tou_file));
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,10 +30,10 @@  discard block
 block discarded – undo
30 30
 //
31 31
 function show_platforms() {
32 32
     $xmlFragment = unserialize(get_cached_data(3600, "project_config_platform_xml"));
33
-    if ($xmlFragment==false){
33
+    if ($xmlFragment == false) {
34 34
         $platforms = BoincDB::get()->enum_fields("platform, DBNAME.app_version, DBNAME.app", "BoincPlatform", "platform.name, platform.user_friendly_name, plan_class", "app_version.platformid = platform.id and app_version.appid = app.id and app_version.deprecated=0 and app.deprecated=0 group by platform.name, plan_class", "");
35 35
         $xmlFragment = "    <platforms>";
36
-        foreach ($platforms as $platform){
36
+        foreach ($platforms as $platform) {
37 37
             $xmlFragment .= "
38 38
             <platform>
39 39
                 <platform_name>$platform->name</platform_name>
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 if (defined('TERMSOFUSE_FILE')) {
116 116
   $tou_file = TERMSOFUSE_FILE;
117 117
 } else {
118
-  $tou_file =  "../../terms_of_use.txt";
118
+  $tou_file = "../../terms_of_use.txt";
119 119
 }
120 120
 if (file_exists($tou_file)) {
121 121
     $terms_of_use = trim(file_get_contents($tou_file));
Please login to merge, or discard this patch.
html/user/forum_search.php 2 patches
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
     </select>");
57 57
 
58 58
 $forumid = null;
59
-if (get_str("forumid",true)){
59
+if (get_str("forumid",true)) {
60 60
     $forumid = get_str("forumid");
61 61
 }
62 62
 $forumlist="<option value=\"-1\">".tra("All")."</option>";
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 foreach ($categories as $category) {
65 65
     $forums = BoincForum::enum("parent_type=0 and category=$category->id");
66 66
     foreach ($forums as $forum) {
67
-        if ($forum->id==$forumid){
67
+        if ($forum->id==$forumid) {
68 68
             $forumlist.="<option selected value=\"".$forum->id."\">".$forum->title."</option>";
69 69
         } else {
70 70
             $forumlist.="<option value=\"".$forum->id."\">".$forum->title."</option>";
@@ -76,8 +76,8 @@  discard block
 block discarded – undo
76 76
     '<select class="form-control" name="search_forum">'.$forumlist.'</select');
77 77
 
78 78
 $sortlist = null;
79
-foreach ($thread_sort_styles as $id => $style){
80
-    if ($id == CREATE_TIME_NEW){
79
+foreach ($thread_sort_styles as $id => $style) {
80
+    if ($id == CREATE_TIME_NEW) {
81 81
         $sortlist.="<option selected value=\"".$id."\">".$style."</option>";
82 82
     } else {
83 83
         $sortlist.="<option value=\"".$id."\">".$style."</option>";
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -56,18 +56,18 @@  discard block
 block discarded – undo
56 56
     </select>");
57 57
 
58 58
 $forumid = null;
59
-if (get_str("forumid",true)){
59
+if (get_str("forumid", true)) {
60 60
     $forumid = get_str("forumid");
61 61
 }
62
-$forumlist="<option value=\"-1\">".tra("All")."</option>";
62
+$forumlist = "<option value=\"-1\">".tra("All")."</option>";
63 63
 $categories = BoincCategory::enum();
64 64
 foreach ($categories as $category) {
65 65
     $forums = BoincForum::enum("parent_type=0 and category=$category->id");
66 66
     foreach ($forums as $forum) {
67
-        if ($forum->id==$forumid){
68
-            $forumlist.="<option selected value=\"".$forum->id."\">".$forum->title."</option>";
67
+        if ($forum->id == $forumid) {
68
+            $forumlist .= "<option selected value=\"".$forum->id."\">".$forum->title."</option>";
69 69
         } else {
70
-            $forumlist.="<option value=\"".$forum->id."\">".$forum->title."</option>";
70
+            $forumlist .= "<option value=\"".$forum->id."\">".$forum->title."</option>";
71 71
         }
72 72
     }
73 73
 }
@@ -76,22 +76,22 @@  discard block
 block discarded – undo
76 76
     '<select class="form-control" name="search_forum">'.$forumlist.'</select');
77 77
 
78 78
 $sortlist = null;
79
-foreach ($thread_sort_styles as $id => $style){
80
-    if ($id == CREATE_TIME_NEW){
81
-        $sortlist.="<option selected value=\"".$id."\">".$style."</option>";
79
+foreach ($thread_sort_styles as $id => $style) {
80
+    if ($id == CREATE_TIME_NEW) {
81
+        $sortlist .= "<option selected value=\"".$id."\">".$style."</option>";
82 82
     } else {
83
-        $sortlist.="<option value=\"".$id."\">".$style."</option>";
83
+        $sortlist .= "<option value=\"".$id."\">".$style."</option>";
84 84
     }
85 85
 }
86 86
 row2(tra("Sort by"), 
87 87
     '<select class="form-control" name="search_sort">'.$sortlist.'</select');
88 88
 
89 89
 row1("&nbsp;");
90
-row2("","<input class=\"btn btn-success\" type=\"submit\" value=\"".tra("Start the search")."\">");
90
+row2("", "<input class=\"btn btn-success\" type=\"submit\" value=\"".tra("Start the search")."\">");
91 91
 echo "</form>";
92 92
 end_table();
93 93
 
94 94
 page_tail();
95 95
 
96
-$cvs_version_tracker[]="\$Id$";  //Generated automatically - do not edit
96
+$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit
97 97
 ?>
Please login to merge, or discard this patch.
html/user/create_account_form.php 2 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
     $team = BoincTeam::lookup_id($teamid);
58 58
     $user = BoincUser::lookup_id($team->userid);
59 59
     if (!$user) {
60
-        error_page("Team $team->name has no founder");
60
+        error_page("team $team->name has no founder");
61 61
         $teamid = 0;
62 62
     } else {
63 63
         echo "<b>".tra("This account will belong to the team %1 and will have the project preferences of its founder.", "<a href=\"team_display.php?teamid=$team->id\">$team->name</a>")."</b><p>";
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
     }
67 67
 }
68 68
 
69
-form_start("create_account_action.php","post");
69
+form_start("create_account_action.php", "post");
70 70
 create_account_form($teamid, $next_url);
71 71
 global $recaptcha_public_key;
72 72
 if ($recaptcha_public_key) {
@@ -77,5 +77,5 @@  discard block
 block discarded – undo
77 77
 
78 78
 page_tail();
79 79
 
80
-$cvs_version_tracker[]="\$Id$";  //Generated automatically - do not edit
80
+$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit
81 81
 ?>
Please login to merge, or discard this patch.
html/user/forum_edit.php 2 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@
 block discarded – undo
70 70
         $now = time();
71 71
         $post->update("signature=$add_signature, content='$content', modified=$now");
72 72
     
73
-        if ($can_edit_title){
73
+        if ($can_edit_title) {
74 74
             $title = trim($title);
75 75
             $title = sanitize_tags($title);
76 76
             $title = BoincDb::escape_string($title);
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 
45 45
 $post_owner = BoincUser::lookup_id($post->user);
46 46
 if (($logged_in_user->id != $post_owner->id) || (can_reply($thread, $forum, $logged_in_user) == false)) {
47
-    error_page (tra("You are not authorized to edit this post."));
47
+    error_page(tra("You are not authorized to edit this post."));
48 48
 }
49 49
 
50 50
 $thread_owner = BoincUser::lookup_id($thread->owner);
@@ -53,13 +53,13 @@  discard block
 block discarded – undo
53 53
 // (ie. not a response to another post)
54 54
 // allow the user to modify the thread title
55 55
 //
56
-$can_edit_title = ($post->parent_post==0 && $thread_owner->id==$logged_in_user->id && !is_banished($logged_in_user));
56
+$can_edit_title = ($post->parent_post == 0 && $thread_owner->id == $logged_in_user->id && !is_banished($logged_in_user));
57 57
 
58 58
 $content = post_str("content", true);
59 59
 $title = post_str("title", true);
60 60
 $preview = post_str("preview", true);
61 61
 
62
-if (post_str('submit',true) && (!$preview)) {
62
+if (post_str('submit', true) && (!$preview)) {
63 63
     if (POST_MAX_LINKS
64 64
         && link_count($content) > POST_MAX_LINKS
65 65
         && !is_moderator($logged_in_user, $forum)
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
     }
69 69
     check_tokens($logged_in_user->authenticator);
70 70
     
71
-    $add_signature = (post_str('add_signature', true) == "1")?1:0;
71
+    $add_signature = (post_str('add_signature', true) == "1") ? 1 : 0;
72 72
     $content = substr($content, 0, 64000);
73 73
     $content = trim($content);
74 74
     if (strlen($content)) {
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
         $now = time();
77 77
         $post->update("signature=$add_signature, content='$content', modified=$now");
78 78
     
79
-        if ($can_edit_title){
79
+        if ($can_edit_title) {
80 80
             $title = trim($title);
81 81
             $title = sanitize_tags($title);
82 82
             $title = BoincDb::escape_string($title);
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
     }
90 90
 }
91 91
 
92
-page_head(tra("Edit post"),'','','', $bbcode_js);
92
+page_head(tra("Edit post"), '', '', '', $bbcode_js);
93 93
 
94 94
 show_forum_header($logged_in_user);
95 95
 switch ($forum->parent_type) {
@@ -144,9 +144,9 @@  discard block
 block discarded – undo
144 144
 }
145 145
 
146 146
 if ($post->signature) {
147
-    $enable_signature="checked=\"true\"";
147
+    $enable_signature = "checked=\"true\"";
148 148
 } else {
149
-    $enable_signature="";
149
+    $enable_signature = "";
150 150
 }
151 151
 row2("", "<input id=\"add_signature\" name=\"add_signature\" value=\"1\" ".$enable_signature." type=\"checkbox\">
152 152
     <label for=\"add_signature\">".tra("Add my signature to this post")."</label>");
@@ -159,5 +159,5 @@  discard block
 block discarded – undo
159 159
 
160 160
 page_tail();
161 161
 
162
-$cvs_version_tracker[]="\$Id$";  //Generated automatically - do not edit
162
+$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit
163 163
 ?>
Please login to merge, or discard this patch.