Completed
Pull Request — master (#2135)
by Christian
10:38
created
html/user/submit_example.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 // hardwired app name for now
46 46
 define('APP_NAME', 'remote_test');
47 47
 
48
-$project = $master_url;         // from project.inc
48
+$project = $master_url; // from project.inc
49 49
 $user = get_logged_in_user();
50 50
 $auth = $user->authenticator;
51 51
 
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
     $user_submit = BoincUserSubmit::lookup_userid($user->id);
159 159
     if (!$user_submit) return null;
160 160
     $a = array();
161
-    foreach($apps as $app) {
161
+    foreach ($apps as $app) {
162 162
         if ($user_submit->submit_all) {
163 163
             $a[] = $app;
164 164
         } else {
@@ -235,9 +235,9 @@  discard block
 block discarded – undo
235 235
     $input_url = get_str('input_url');
236 236
     if (!$input_url) error_page("missing input URL");
237 237
     $param_lo = (double)get_str('param_lo');
238
-    if ($param_lo<0 || $param_lo>60) error_page("param lo must be in 0..60");
238
+    if ($param_lo < 0 || $param_lo > 60) error_page("param lo must be in 0..60");
239 239
     $param_hi = (double)get_str('param_hi');
240
-    if ($param_hi<0 || $param_hi>60 || $param_hi <= $param_lo) {
240
+    if ($param_hi < 0 || $param_hi > 60 || $param_hi <= $param_lo) {
241 241
         error_page("param hi must be in 0..60 and > param lo");
242 242
     }
243 243
     $param_inc = (double)get_str('param_inc');
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
     $f->source = $input_url;
255 255
     $f->mode = 'semilocal';
256 256
 
257
-    for ($x=$param_lo; $x<$param_hi; $x += $param_inc) {
257
+    for ($x = $param_lo; $x < $param_hi; $x += $param_inc) {
258 258
         $job = new StdClass;
259 259
         $job->rsc_fpops_est = $x*1e9;
260 260
         $job->command_line = "--t $x";
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
         "status",
344 344
         "Canonical instance<br><p class=\"text-muted\">click to see result page on BOINC server</p>"
345 345
     );
346
-    foreach($batch->jobs as $job) {
346
+    foreach ($batch->jobs as $job) {
347 347
         $id = (int)$job->id;
348 348
         $resultid = (int)$job->canonical_instance_id;
349 349
         if ($resultid) {
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
         "Instance ID<br><p class=\"text-muted\">click for result page on BOINC server</p>",
387 387
         "State", "Output files"
388 388
     );
389
-    foreach($reply->instances as $inst) {
389
+    foreach ($reply->instances as $inst) {
390 390
         echo "<tr>
391 391
             <td><a href=result.php?resultid=$inst->id>$inst->id</a></td>
392 392
             <td>$inst->state</td>
Please login to merge, or discard this patch.
html/user/userw.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,8 +22,8 @@  discard block
 block discarded – undo
22 22
 check_get_args(array("id"));
23 23
 
24 24
 function show_credit_wap($user) {
25
-    $retstr = "<br/>User TotCred: " . format_credit($user->total_credit) . "<br/>";
26
-    $retstr .= "User AvgCred: " . format_credit($user->expavg_credit) . "<br/>";
25
+    $retstr = "<br/>User TotCred: ".format_credit($user->total_credit)."<br/>";
26
+    $retstr .= "User AvgCred: ".format_credit($user->expavg_credit)."<br/>";
27 27
     return $retstr;
28 28
 }
29 29
 
@@ -45,8 +45,8 @@  discard block
 block discarded – undo
45 45
     $wapstr .= show_credit_wap($user);
46 46
     if ($user->teamid && $team) {
47 47
         $wapstr .= "<br/>".tra("Team:")." ".$team->name."<br/>";
48
-        $wapstr .= tra("Team TotCred:")." " . format_credit($team->total_credit) . "<br/>";
49
-        $wapstr .= tra("Team AvgCred:")." " . format_credit($team->expavg_credit) . "<br/>";
48
+        $wapstr .= tra("Team TotCred:")." ".format_credit($team->total_credit)."<br/>";
49
+        $wapstr .= tra("Team AvgCred:")." ".format_credit($team->expavg_credit)."<br/>";
50 50
     } else {
51 51
         $wapstr .= "<br/>".tra("Team: None")."<br/>";
52 52
     }
Please login to merge, or discard this patch.
html/user/ffmail_form.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
 
52 52
 start_table();
53 53
 row2("From:", "$user->name &lt;$user->email_addr>");
54
-for ($i=0; $i<6; $i++) {
54
+for ($i = 0; $i < 6; $i++) {
55 55
     row2(tra("To:"), "<input size=30 name=e$i>");
56 56
 }
57 57
 row2(tra("Subject"), "<input size=80 name=subject value=\"$subject\">");
Please login to merge, or discard this patch.
html/user/info.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,5 +58,5 @@
 block discarded – undo
58 58
     <p>".tra("These other projects are not associated with %1, and we cannot vouch for their security practices or the nature of their research. Join them at your own risk.", PROJECT);
59 59
 }
60 60
 page_tail();
61
-$cvs_version_tracker[]="\$Id$";
61
+$cvs_version_tracker[] = "\$Id$";
62 62
 ?>
Please login to merge, or discard this patch.
html/user/forum_index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 
74 74
 show_forum_header($user);
75 75
 
76
-if (defined('FORUM_QA_MERGED_MODE') && FORUM_QA_MERGED_MODE){
76
+if (defined('FORUM_QA_MERGED_MODE') && FORUM_QA_MERGED_MODE) {
77 77
     $categories = BoincCategory::enum("true order by orderID");
78 78
 } else {
79 79
     echo "<p>"
@@ -140,5 +140,5 @@  discard block
 block discarded – undo
140 140
 page_tail();
141 141
 BoincForumLogging::cleanup();
142 142
 
143
-$cvs_version_tracker[]="\$Id$";  //Generated automatically - do not edit
143
+$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit
144 144
 ?>
Please login to merge, or discard this patch.
html/user/view_profile.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
 
45 45
 $cache_args = "userid=$userid";
46 46
 $cacheddata = get_cached_data(USER_PROFILE_TTL, $cache_args);
47
-if ($cacheddata){
47
+if ($cacheddata) {
48 48
     // Already got a cached version of the information
49 49
     $community_links_object = unserialize($cacheddata);
50 50
 } else {
Please login to merge, or discard this patch.
html/user/team_delta.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
     global $xml;
31 31
     $user = BoincUser::lookup_id($delta->userid);
32 32
     $when = time_str($delta->timestamp);
33
-    $what = $delta->joining?"joined":"quit";
33
+    $what = $delta->joining ? "joined" : "quit";
34 34
     if ($xml) {
35 35
         echo "    <action>
36 36
         <id>$user->id</id>
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
     } else {
44 44
         echo "<tr>
45 45
            <td>$when</td>
46
-           <td>",user_links($user, BADGE_HEIGHT_MEDIUM)," (ID $user->id)</td>
46
+           <td>", user_links($user, BADGE_HEIGHT_MEDIUM), " (ID $user->id)</td>
47 47
            <td>$what</td>
48 48
            <td>$delta->total_credit</td>
49 49
            </tr>
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     );
83 83
 }
84 84
 $deltas = BoincTeamDelta::enum("teamid=$teamid order by timestamp");
85
-foreach($deltas as $delta) {
85
+foreach ($deltas as $delta) {
86 86
     show_delta($delta);
87 87
 }
88 88
 if ($xml) {
Please login to merge, or discard this patch.
html/user/cert_team.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,10 +34,10 @@
 block discarded – undo
34 34
 
35 35
 $border = get_str("border", true);
36 36
 
37
-if ($border=="no") {
37
+if ($border == "no") {
38 38
     $border = 0;
39 39
 } else {
40
-    $border=8;
40
+    $border = 8;
41 41
 }
42 42
 
43 43
 $credit = credit_string($team->total_credit, false);
Please login to merge, or discard this patch.
html/user/server_status.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
         $avg = round($app->info->avg, 2);
172 172
         $min = round($app->info->min, 2);
173 173
         $max = round($app->info->max, 2);
174
-        $x = $max?"$avg ($min - $max)":"---";
174
+        $x = $max ? "$avg ($min - $max)" : "---";
175 175
         $u = $app->info->users;
176 176
         echo "<tr>
177 177
             <td>$app->user_friendly_name</td>
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
         $cmd = trim($cmd);
245 245
         $x = explode(" ", $cmd);
246 246
         $prog = $x[0];
247
-        $pidname = $prog . '.pid';
247
+        $pidname = $prog.'.pid';
248 248
     }
249 249
     $path = "../../pid_$host/$pidname";
250 250
     if (is_file($path)) {
@@ -285,12 +285,12 @@  discard block
 block discarded – undo
285 285
     }
286 286
     $master_host = $u["host"];
287 287
     if ($config->www_host) {
288
-        $web_host = trim((string) $config->www_host);
288
+        $web_host = trim((string)$config->www_host);
289 289
     } else {
290 290
         $web_host = $main_host;
291 291
     }
292 292
     if ($config->sched_host) {
293
-        $sched_host = trim((string) $config->sched_host);
293
+        $sched_host = trim((string)$config->sched_host);
294 294
     } else {
295 295
         $sched_host = $main_host;
296 296
     }
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
 
301 301
     // the upload and download servers are sort of daemons too
302 302
     //
303
-    $url = trim((string) $config->download_url);
303
+    $url = trim((string)$config->download_url);
304 304
     $u = parse_url($url);
305 305
     $h = $u["host"];
306 306
     if ($h == $master_host) {
@@ -312,14 +312,14 @@  discard block
 block discarded – undo
312 312
     } else {
313 313
         $have_remote = true;
314 314
     }
315
-    $url = trim((string) $config->upload_url);
315
+    $url = trim((string)$config->upload_url);
316 316
     $u = parse_url($url);
317 317
     $h = $u["host"];
318 318
     if ($h == $master_host) {
319 319
         $y = new StdClass;
320 320
         $y->cmd = "Upload server";
321 321
         $y->host = $h;
322
-        $y->status = !file_exists("../../stop_upload");;
322
+        $y->status = !file_exists("../../stop_upload"); ;
323 323
         $local_daemons[] = $y;
324 324
     } else {
325 325
         $have_remote = true;
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
         $y = new StdClass;
332 332
         $y->cmd = "Scheduler";
333 333
         $y->host = $sched_host;
334
-        $y->status = !file_exists("../../stop_sched");;
334
+        $y->status = !file_exists("../../stop_sched"); ;
335 335
         $local_daemons[] = $y;
336 336
     } else {
337 337
         $have_remote = true;
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
             $disabled_daemons[] = $x;
348 348
             continue;
349 349
         }
350
-        $host = $d->host?(string)$d->host:$main_host;
350
+        $host = $d->host ? (string)$d->host : $main_host;
351 351
         if ($host != $web_host) {
352 352
             $have_remote = true;
353 353
             continue;
Please login to merge, or discard this patch.