Passed
Push — vko_msi_refactor ( 225587 )
by Vitalii
11:56
created
html/user/team_email_list.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     }
51 51
     echo "<users>\n";
52 52
     $users = BoincUser::enum_fields("id, email_addr, send_email, name, total_credit, expavg_credit, expavg_time, has_profile, donated, country, cross_project_id, create_time, url", "teamid=$team->id");
53
-    foreach($users as $user) {
53
+    foreach ($users as $user) {
54 54
         show_team_member($user, $creditonly);
55 55
     }
56 56
     echo "</users>\n";
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 }
82 82
 
83 83
 $users = BoincUser::enum_fields("id, email_addr, send_email, name, total_credit, expavg_credit, has_profile, donated, country, cross_project_id, create_time, url", "teamid=$team->id");
84
-foreach($users as $user) {
84
+foreach ($users as $user) {
85 85
     if ($plain) {
86 86
         echo "$user->name $user->id\n";
87 87
     } else {
@@ -94,5 +94,5 @@  discard block
 block discarded – undo
94 94
     page_tail();
95 95
 }
96 96
 
97
-$cvs_version_tracker[]="\$Id$";  //Generated automatically - do not edit
97
+$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit
98 98
 ?>
Please login to merge, or discard this patch.
html/user/brand_stats.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
     $n = 0;
46 46
     $t = 0;
47 47
     $a = 0;
48
-    foreach($hosts as $h) {
48
+    foreach ($hosts as $h) {
49 49
         $t += $h->total_credit;
50 50
         $a += $h->expavg_credit;
51 51
         if ($h->expavg_credit > .1) $n++;
Please login to merge, or discard this patch.
html/user/host_app_versions.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
         if (!$show_dep && $app->deprecated) {
41 41
             return null;
42 42
         }
43
-        $rsc_type = $gavid % 1000000;
43
+        $rsc_type = $gavid%1000000;
44 44
         $r = rsc_name($rsc_type);
45 45
         return "$app->user_friendly_name (".tra("anonymous platform").", $r)";
46 46
     } else {
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
         }
61 61
         $platform = BoincPlatform::lookup_id($av->platformid);
62 62
         if (!$platform) return tra("Missing platform");
63
-        $pc = (strlen($av->plan_class))?"($av->plan_class)":"";
63
+        $pc = (strlen($av->plan_class)) ? "($av->plan_class)" : "";
64 64
         $v = number_format($av->version_num/100, 2);
65 65
         return "$app->user_friendly_name $v $platform->name $pc";
66 66
     }
Please login to merge, or discard this patch.
html/user/gpu_list.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 // $x->linux
61 61
 // $x->mac
62 62
 //
63
-function get_gpu_list($vendor, $alt_vendor=null) {
63
+function get_gpu_list($vendor, $alt_vendor = null) {
64 64
     $clause = "plan_class like '%$vendor%'";
65 65
     if ($alt_vendor) {
66 66
         $clause .= " or plan_class like '%$alt_vendor%'";
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
     }
74 74
 
75 75
     $av_ids = "";
76
-    foreach($avs as $av) {
76
+    foreach ($avs as $av) {
77 77
         $av_ids .= "$av->id, ";
78 78
     }
79 79
     if ($vendor == "cuda") {
@@ -176,14 +176,14 @@  discard block
 block discarded – undo
176 176
         echo tra("No GPU tasks reported");
177 177
         return;
178 178
     }
179
-    $have_win = count($x->win)>0;
180
-    $have_mac = count($x->mac)>0;
181
-    $have_linux = count($x->linux)>0;
179
+    $have_win = count($x->win) > 0;
180
+    $have_mac = count($x->mac) > 0;
181
+    $have_linux = count($x->linux) > 0;
182 182
     $n = 0;
183 183
     if ($have_win) $n++;
184 184
     if ($have_mac) $n++;
185 185
     if ($have_linux) $n++;
186
-    $show_total = $n>1;
186
+    $show_total = $n > 1;
187 187
     start_table();
188 188
     echo "<tr>";
189 189
     if ($show_total) {
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -196,7 +196,7 @@
 block discarded – undo
196 196
 }
197 197
 
198 198
 $d = get_cached_data(86400);
199
-$data = FALSE;
199
+$data = false;
200 200
 if ($d) {
201 201
     $data = unserialize($d);
202 202
 }
Please login to merge, or discard this patch.
html/user/job_file.php 2 patches
Switch Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -80,20 +80,20 @@
 block discarded – undo
80 80
 
81 81
 function upload_error_description($errno) {
82 82
     switch($errno) {
83
-        case UPLOAD_ERR_INI_SIZE:
84
-            return "The uploaded file exceeds upload_max_filesize of php.ini."; break;
85
-        case UPLOAD_ERR_FORM_SIZE:
86
-            return "The uploaded file exceeds the MAX_FILE_SIZE specified in the HTML form."; break;
87
-        case UPLOAD_ERR_PARTIAL:
88
-            return "The uploaded file was only partially uploaded."; break;
89
-        case UPLOAD_ERR_NO_FILE:
90
-            return "No file was uploaded."; break;
91
-        case UPLOAD_ERR_NO_TMP_DIR:
92
-            return "Missing a temporary folder."; break;
93
-        case UPLOAD_ERR_CANT_WRITE:
94
-            return "Failed to write file to disk."; break;
95
-        case UPLOAD_ERR_EXTENSION:
96
-            return "A PHP extension stopped the file upload."; break;
83
+    case UPLOAD_ERR_INI_SIZE:
84
+        return "The uploaded file exceeds upload_max_filesize of php.ini."; break;
85
+    case UPLOAD_ERR_FORM_SIZE:
86
+        return "The uploaded file exceeds the MAX_FILE_SIZE specified in the HTML form."; break;
87
+    case UPLOAD_ERR_PARTIAL:
88
+        return "The uploaded file was only partially uploaded."; break;
89
+    case UPLOAD_ERR_NO_FILE:
90
+        return "No file was uploaded."; break;
91
+    case UPLOAD_ERR_NO_TMP_DIR:
92
+        return "Missing a temporary folder."; break;
93
+    case UPLOAD_ERR_CANT_WRITE:
94
+        return "Failed to write file to disk."; break;
95
+    case UPLOAD_ERR_EXTENSION:
96
+        return "A PHP extension stopped the file upload."; break;
97 97
     }
98 98
 }
99 99
 
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 require_once("../inc/submit_util.inc");
80 80
 
81 81
 function upload_error_description($errno) {
82
-    switch($errno) {
82
+    switch ($errno) {
83 83
         case UPLOAD_ERR_INI_SIZE:
84 84
             return "The uploaded file exceeds upload_max_filesize of php.ini."; break;
85 85
         case UPLOAD_ERR_FORM_SIZE:
@@ -105,13 +105,13 @@  discard block
 block discarded – undo
105 105
     $delete_time = (int)$r->delete_time;
106 106
     $batch_id = (int)$r->batch_id;
107 107
     $fanout = parse_config(get_config(), "<uldl_dir_fanout>");
108
-    $phys_names= array();
109
-    foreach($r->phys_name as $f) {
108
+    $phys_names = array();
109
+    foreach ($r->phys_name as $f) {
110 110
         $phys_names[] = (string)$f;
111 111
     }
112 112
     $i = 0;
113
-    foreach($phys_names as $fname) {
114
-        $path = dir_hier_path($fname, project_dir() . "/download", $fanout);
113
+    foreach ($phys_names as $fname) {
114
+        $path = dir_hier_path($fname, project_dir()."/download", $fanout);
115 115
 
116 116
         // if the job_file record is there,
117 117
         // update the delete time first to avoid race condition
@@ -218,11 +218,11 @@  discard block
 block discarded – undo
218 218
     foreach ($_FILES as $f) {
219 219
         $tmp_name = $f['tmp_name'];
220 220
         $fname = $phys_names[$i];
221
-        $path = dir_hier_path($fname, project_dir() . "/download", $fanout);
221
+        $path = dir_hier_path($fname, project_dir()."/download", $fanout);
222 222
 
223 223
         // see if file is in download hierarchy
224 224
         //
225
-        switch(check_download_file($tmp_name, $path)) {
225
+        switch (check_download_file($tmp_name, $path)) {
226 226
         case 0:
227 227
             // file is already there
228 228
             // note: check_download_file() generates .md5 in cases 1 and 2
@@ -277,10 +277,10 @@  discard block
 block discarded – undo
277 277
 if ($request_log) {
278 278
     $request_log_dir = parse_config(get_config(), "<log_dir>");
279 279
     if ($request_log_dir) {
280
-        $request_log = $request_log_dir . "/" . $request_log;
280
+        $request_log = $request_log_dir."/".$request_log;
281 281
     }
282 282
     if ($file = fopen($request_log, "a+")) {
283
-        fwrite($file, "\n<job_file date=\"" . date(DATE_ATOM) . "\">\n" . $_POST['request'] . "\n</job_file>\n");
283
+        fwrite($file, "\n<job_file date=\"".date(DATE_ATOM)."\">\n".$_POST['request']."\n</job_file>\n");
284 284
         fclose($file);
285 285
     }
286 286
 }
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
     xml_error(-1, "can't parse request message: $req", __FILE__, __LINE__);
293 293
 }
294 294
 
295
-switch($r->getName()) {
295
+switch ($r->getName()) {
296 296
 case 'query_files':
297 297
     query_files($r);
298 298
     break;
Please login to merge, or discard this patch.
html/user/team_quit_form.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,5 +44,5 @@
 block discarded – undo
44 44
 ";
45 45
 page_tail();
46 46
 
47
-$cvs_version_tracker[]="\$Id$";  //Generated automatically - do not edit
47
+$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit
48 48
 ?>
Please login to merge, or discard this patch.
html/user/ffmail_action.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
 
28 28
 page_head(tra("Sending emails"));
29 29
 $found = false;
30
-for ($i=0; $i<6; $i++) {
30
+for ($i = 0; $i < 6; $i++) {
31 31
     $e = get_str("e$i", true);
32 32
     if (!$e) continue;
33 33
     $found = true;
Please login to merge, or discard this patch.
html/user/forum_report_post.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -44,21 +44,21 @@  discard block
 block discarded – undo
44 44
 // Using the same rules as for rating (at least for now)
45 45
 //
46 46
 
47
-if ($user->total_credit<$forum->rate_min_total_credit || $user->expavg_credit<$forum->rate_min_expavg_credit) {
47
+if ($user->total_credit < $forum->rate_min_total_credit || $user->expavg_credit < $forum->rate_min_expavg_credit) {
48 48
     error_page(tra("You need more average or total credit to report a post."));
49 49
 }
50 50
 
51 51
 // Action part
52 52
 //
53
-$success_page=0;
54
-if (get_str("submit",true)){
53
+$success_page = 0;
54
+if (get_str("submit", true)) {
55 55
     check_tokens($user->authenticator);
56 56
     $reason = get_str("reason");
57
-    if (send_report_post_email($user, $forum, $thread, $post, $reason)){
58
-        $success_page=1;
57
+    if (send_report_post_email($user, $forum, $thread, $post, $reason)) {
58
+        $success_page = 1;
59 59
     } else {
60 60
         echo "send email failed";
61
-        $success_page=-1;
61
+        $success_page = -1;
62 62
     }
63 63
 }
64 64
 
@@ -66,13 +66,13 @@  discard block
 block discarded – undo
66 66
 
67 67
 // Display part
68 68
 //
69
-if ($success_page==1) {
69
+if ($success_page == 1) {
70 70
     page_head(tra("Report Registered"));
71 71
     echo tra("Your report has been recorded. Thanks for your input.")."<p>"
72 72
         .tra("A moderator will now look at your report and decide what will happen - this may take a little while, so please be patient");
73 73
 
74 74
     echo "<p><a href=\"forum_thread.php?id=$thread->id&postid=$post->id\">".tra("Return to thread")."</a>";
75
-} elseif ($success_page==0){
75
+} elseif ($success_page == 0) {
76 76
     page_head(tra("Report a forum post"));
77 77
     if (!$no_forum_rating) {
78 78
         echo "<p>".tra("Before reporting this post, consider using the +/- rating system instead. If enough users rate a post negatively it will eventually be hidden.<br />You can find the rating system at the bottom of the post.")."</p>
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
     echo "</td></tr>";
101 101
     end_table();
102 102
     echo "</form>";
103
-} elseif ($success_page==-1) {
103
+} elseif ($success_page == -1) {
104 104
     page_head(tra("Report not registered"));
105 105
     echo "<p>".tra("Your report could not be recorded. Please wait a while and try again.")."</p>
106 106
         <p>".tra("If this is not a temporary error, please report it to the project developers.")."</p>
Please login to merge, or discard this patch.
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -51,10 +51,10 @@  discard block
 block discarded – undo
51 51
 // Action part
52 52
 //
53 53
 $success_page=0;
54
-if (get_str("submit",true)){
54
+if (get_str("submit",true)) {
55 55
     check_tokens($user->authenticator);
56 56
     $reason = get_str("reason");
57
-    if (send_report_post_email($user, $forum, $thread, $post, $reason)){
57
+    if (send_report_post_email($user, $forum, $thread, $post, $reason)) {
58 58
         $success_page=1;
59 59
     } else {
60 60
         echo "send email failed";
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
         .tra("A moderator will now look at your report and decide what will happen - this may take a little while, so please be patient");
73 73
 
74 74
     echo "<p><a href=\"forum_thread.php?id=$thread->id&postid=$post->id\">".tra("Return to thread")."</a>";
75
-} elseif ($success_page==0){
75
+} elseif ($success_page==0) {
76 76
     page_head(tra("Report a forum post"));
77 77
     if (!$no_forum_rating) {
78 78
         echo "<p>".tra("Before reporting this post, consider using the +/- rating system instead. If enough users rate a post negatively it will eventually be hidden.<br />You can find the rating system at the bottom of the post.")."</p>
Please login to merge, or discard this patch.
html/user/pending.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
     $sum = 0;
48 48
     echo "<pending_credit>\n";
49 49
     $results = BoincResult::enum("userid=$user->id AND (validate_state=0 OR validate_state=4) AND claimed_credit > 0");
50
-    foreach($results as $result) {
50
+    foreach ($results as $result) {
51 51
         echo "<result>\n";
52 52
         echo "    <resultid>".$result->id."</resultid>\n";
53 53
         echo "    <workunitid>".$result->workunitid."</workunitid>\n";
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
     start_table();
68 68
     echo "<tr><th>".tra("Result ID")."</th><th>".tra("Workunit ID")."</th><th>".tra("Host ID")."</th><th>".tra("Claimed credit")."</th></tr>\n";
69 69
     $results = BoincResult::enum("userid=$user->id AND (validate_state=0 OR validate_state=4) AND claimed_credit > 0");
70
-    foreach($results as $result) {
70
+    foreach ($results as $result) {
71 71
         echo "<tr>\n";
72 72
         echo "<td><a href=\"result.php?resultid=$result->id\">$result->id</a></td>\n";
73 73
         echo "<td><a href=\"workunit.php?wuid=$result->workunitid\">$result->workunitid</a></td>\n";
@@ -82,5 +82,5 @@  discard block
 block discarded – undo
82 82
     page_tail();
83 83
 }
84 84
 
85
-$cvs_version_tracker[]="\$Id$";  //Generated automatically - do not edit
85
+$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit
86 86
 ?>
Please login to merge, or discard this patch.