Passed
Pull Request — master (#4923)
by David
10:06
created
html/user/forum_banishment_vote.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -47,13 +47,13 @@  discard block
 block discarded – undo
47 47
 start_table();
48 48
 row1(tra("Banishment Vote"));
49 49
 
50
-if (get_str('action')=="start") {
50
+if (get_str('action') == "start") {
51 51
     if (!$user) {
52 52
         error_page(tra("No user with this ID found."));
53 53
     }
54 54
     BoincForumPrefs::lookup($user);
55 55
     $x = $user->prefs->banished_until;
56
-    if ($x>time()) {
56
+    if ($x > time()) {
57 57
         error_page(tra("User is already banished"));
58 58
     }
59 59
     //display input that selects reason
@@ -77,10 +77,10 @@  discard block
 block discarded – undo
77 77
     "",
78 78
     "<input class=\"btn btn-default\" type=\"submit\" name=\"submit\" value=\"".tra("Proceed with vote")."\">"
79 79
 );
80
-} elseif (get_str('action')=="yes") {
81
-    vote_yes($config,$logged_in_user,$user);
82
-} elseif (get_str('action')=="no") {
83
-    vote_no($config,$logged_in_user,$user);
80
+} elseif (get_str('action') == "yes") {
81
+    vote_yes($config, $logged_in_user, $user);
82
+} elseif (get_str('action') == "no") {
83
+    vote_no($config, $logged_in_user, $user);
84 84
 } else {
85 85
     error_page("Unknown action");
86 86
 }
Please login to merge, or discard this patch.
html/user/donation_ipn.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -30,8 +30,8 @@  discard block
 block discarded – undo
30 30
 // post back to PayPal system to validate
31 31
 $header .= "POST /cgi-bin/webscr HTTP/1.0\r\n";
32 32
 $header .= "Content-Type: application/x-www-form-urlencoded\r\n";
33
-$header .= "Content-Length: " . strlen($req) . "\r\n\r\n";
34
-$fp = fsockopen ('www.paypal.com', 80, $errno, $errstr, 30);
33
+$header .= "Content-Length: ".strlen($req)."\r\n\r\n";
34
+$fp = fsockopen('www.paypal.com', 80, $errno, $errstr, 30);
35 35
 
36 36
 // assign posted variables to local variables
37 37
 $item_name = $_POST['item_name'];
@@ -50,11 +50,11 @@  discard block
 block discarded – undo
50 50
 if (!$fp) {
51 51
     // HTTP ERROR, might want to do additional handling here
52 52
 } else {
53
-    fputs ($fp, $header . $req);
53
+    fputs($fp, $header.$req);
54 54
     while (!feof($fp)) {
55
-        $res = fgets ($fp, 1024);
56
-        if (strcmp ($res, "VERIFIED") == 0) {
57
-            $item_array = explode("_",$item_number);
55
+        $res = fgets($fp, 1024);
56
+        if (strcmp($res, "VERIFIED") == 0) {
57
+            $item_array = explode("_", $item_number);
58 58
             $payment_id = abs($item_array[0]);
59 59
             $order_time = abs($item_array[1]);
60 60
             $result = _mysql_query("SELECT * FROM donation_paypal WHERE order_time = '$order_time' AND id = '$payment_id' AND processed = '0'");
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
             }
70 70
         }
71 71
     }
72
-    fclose ($fp);
72
+    fclose($fp);
73 73
 }
74 74
 
75 75
 ?>
Please login to merge, or discard this patch.
html/user/pm.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
             array(tra("Subject"), tra("Sender and date"), tra("Message")),
80 80
             array('style="width: 12em;"', 'style="width: 10em;"', "")
81 81
         );
82
-        foreach($msgs as $msg) {
82
+        foreach ($msgs as $msg) {
83 83
             $sender = BoincUser::lookup_id($msg->senderid);
84 84
             if (!$sender) {
85 85
                 $msg->delete();
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
     $msgs = BoincPrivateMessage::enum(
311 311
         "userid=$logged_in_user->id"
312 312
     );
313
-    foreach($msgs as $msg) {
313
+    foreach ($msgs as $msg) {
314 314
         $x = "pm_select_$msg->id";
315 315
         if (post_str($x, true)) {
316 316
             $msg = BoincPrivateMessage::lookup_id($msg->id);
@@ -365,5 +365,5 @@  discard block
 block discarded – undo
365 365
     error_page(tra("Unknown action"));
366 366
 }
367 367
 
368
-$cvs_version_tracker[]="\$Id: pm.php 14077 2007-11-03 04:26:47Z davea $";
368
+$cvs_version_tracker[] = "\$Id: pm.php 14077 2007-11-03 04:26:47Z davea $";
369 369
 ?>
Please login to merge, or discard this patch.
html/user/set_language.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
 $languages = get_supported_languages();
23 23
 $lang = sanitize_tags(get_str("lang", true));
24 24
 
25
-if (!in_array($lang, $languages) && $lang!="auto" && $lang!="en") {
25
+if (!in_array($lang, $languages) && $lang != "auto" && $lang != "en") {
26 26
     echo "Language $lang is not supported";
27 27
 } else {
28 28
     send_cookie('lang', $lang, true);
Please login to merge, or discard this patch.
html/user/results.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -37,11 +37,11 @@  discard block
 block discarded – undo
37 37
 $userid = get_int("userid", true);
38 38
 $offset = get_int("offset", true);
39 39
 $appid = get_int("appid", true);
40
-if (!$offset) $offset=0;
40
+if (!$offset) $offset = 0;
41 41
 $state = get_int("state", true);
42
-if (!$state) $state=0;
42
+if (!$state) $state = 0;
43 43
 $show_names = get_int("show_names", true);
44
-if (!$show_names) $show_names=0;
44
+if (!$show_names) $show_names = 0;
45 45
 
46 46
 $s = $state_name[$state];
47 47
 if ($appid) {
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
     $clause = "hostid=$hostid";
58 58
     page_head(tra("$s tasks for computer %1", $host->id));
59 59
     $show_host_link = false;
60
-} else if ($userid){
60
+} else if ($userid) {
61 61
     $user = get_logged_in_user();
62 62
     if ($userid != $user->id) {
63 63
         error_page(tra("No access"));
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
     error_page(tra("Missing user ID or host ID"));
70 70
 }
71 71
 
72
-$clause2 = $clause. $state_clause[$state];
72
+$clause2 = $clause.$state_clause[$state];
73 73
 if ($appid) {
74 74
     $clause2 .= ' AND appid='.$appid;
75 75
 }
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 } else {
80 80
     $order_clause = "order by sent_time desc";
81 81
 }
82
-$query = "$clause2 $order_clause limit $offset,".($results_per_page+1);
82
+$query = "$clause2 $order_clause limit $offset,".($results_per_page + 1);
83 83
 $results = BoincResult::enum($query);
84 84
 
85 85
 $info = new StdClass;
Please login to merge, or discard this patch.
html/user/manage_project.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -112,10 +112,10 @@  discard block
 block discarded – undo
112 112
     $apps = BoincApp::enum("deprecated=0");
113 113
     foreach ($apps as $app) {
114 114
         $us = BoincUserSubmitApp::lookup("user_id=$user_id and app_id=$app->id");
115
-        $checked = $us?"checked":"";
115
+        $checked = $us ? "checked" : "";
116 116
         echo "<br>&nbsp;&nbsp;&nbsp; <input type=checkbox name=app_$app->id $checked> $app->name\n";
117 117
     }
118
-    $q = (string) $usub->quota;
118
+    $q = (string)$usub->quota;
119 119
     $mj = $usub->max_jobs_in_progress;
120 120
     echo "
121 121
         <p>
@@ -151,11 +151,11 @@  discard block
 block discarded – undo
151 151
             }
152 152
         }
153 153
     }
154
-    $quota = (double) get_str('quota');
154
+    $quota = (double)get_str('quota');
155 155
     if ($quota != $us->quota) {
156 156
         $us->update("quota=$quota");
157 157
     }
158
-    $mj = (int) get_str('max_jobs_in_progress');
158
+    $mj = (int)get_str('max_jobs_in_progress');
159 159
     if ($mj != $us->max_jobs_in_progress) {
160 160
         $us->update("max_jobs_in_progress=$mj");
161 161
     }
Please login to merge, or discard this patch.
html/user/add_venue.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 $subset = sanitize_tags(get_str("subset"));
28 28
 $venue = sanitize_tags(get_str("venue"));
29 29
 $columns = get_int("cols", true);
30
-$c = $columns?"&cols=$columns":"";
30
+$c = $columns ? "&cols=$columns" : "";
31 31
 check_venue($venue);
32 32
 check_subset($subset);
33 33
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
             $title = tra("Edit %1 preferences", subset_name($subset));
41 41
             if ($venue) $title = "$title for $venue";
42 42
             page_head($title);
43
-            $x = $venue?"&venue=$venue":"";
43
+            $x = $venue ? "&venue=$venue" : "";
44 44
 
45 45
             echo PREFS_FORM_DESC1;
46 46
             echo PREFS_FORM_ERROR_DESC;
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
             $title = tra("Edit %1 preferences", subset_name($subset));
65 65
             if ($venue) $title = "$title for $venue";
66 66
             page_head($title);
67
-            $x = $venue?"&venue=$venue":"";
67
+            $x = $venue ? "&venue=$venue" : "";
68 68
 
69 69
             echo PREFS_FORM_ERROR_DESC;
70 70
 
@@ -90,5 +90,5 @@  discard block
 block discarded – undo
90 90
     print_prefs_form("add", $subset, $venue, $user, $prefs, $columns);
91 91
 }
92 92
 page_tail();
93
-$cvs_version_tracker[]="\$Id$";  //Generated automatically - do not edit
93
+$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit
94 94
 ?>
Please login to merge, or discard this patch.
html/user/tree_threader.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 ini_set('display_startup_errors', true);
21 21
 
22 22
 $app_name = "treeThreader";
23
-$log = fopen("/tmp/tt_job.log","a+");
23
+$log = fopen("/tmp/tt_job.log", "a+");
24 24
 
25 25
 function error($s) {
26 26
     echo "<error>\n<message>$s</message>\n</error>\n";
@@ -28,14 +28,14 @@  discard block
 block discarded – undo
28 28
 }
29 29
 
30 30
 function handle_submit($r, $user, $app) {
31
-    global $app_name,$log;
31
+    global $app_name, $log;
32 32
 
33
-    $timestamp = date("Y-m-d H:i",time());
33
+    $timestamp = date("Y-m-d H:i", time());
34 34
 	// read the list of template filenames
35 35
 	//
36 36
 	$files = file("../../tree_threader_template_files");
37 37
 	if ($files === false) { 
38
-        fwrite($log,"$timestamp\ttemplate file tree_threader_template_files\n");
38
+        fwrite($log, "$timestamp\ttemplate file tree_threader_template_files\n");
39 39
         error("no templates file");
40 40
         
41 41
     }
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 //
93 93
 function handle_get_output($r, $batch) {
94 94
     global $log;
95
-    $timestamp = date("Y-m-d H:i",time());
95
+    $timestamp = date("Y-m-d H:i", time());
96 96
 	$wus = BoincWorkUnit::enum("batch=$batch->id");
97 97
 	$outdir = "/tmp/treeThreader_result_".$batch->id;
98 98
     @mkdir($outdir);
@@ -131,14 +131,14 @@  discard block
 block discarded – undo
131 131
 		error("can't zip output files");
132 132
 	}
133 133
 	$fname = "treeThreader_result_".$batch->id.".zip";
134
-    $treeThreader_dir="treeThreaderResult";
135
-    if(!is_dir("../../download/$treeThreader_dir"))mkdir("../../download/$treeThreader_dir");
134
+    $treeThreader_dir = "treeThreaderResult";
135
+    if (!is_dir("../../download/$treeThreader_dir"))mkdir("../../download/$treeThreader_dir");
136 136
 	@symlink("/tmp/$fname", "../../download/$treeThreader_dir/$fname");
137 137
     system("rm -fr $outdir");
138 138
     $config = simplexml_load_string(file_get_contents("../../config.xml"));
139 139
     $download_url = trim((string)$config->config->download_url);
140 140
 	echo "<tt_reply>\n<url>$download_url/$treeThreader_dir/$fname</url>\n</tt_reply>\n";
141
-    $log_msg="$timestamp\tuser $batch->user_id downloads results for batch $batch->id : $download_url/$treeThreader_dir/$fname\n";
141
+    $log_msg = "$timestamp\tuser $batch->user_id downloads results for batch $batch->id : $download_url/$treeThreader_dir/$fname\n";
142 142
     fwrite($log, $log_msg);
143 143
 }
144 144
 
Please login to merge, or discard this patch.
html/user/sandbox.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
         </form>
53 53
         <hr>
54 54
     ";
55
-    if (strcmp($err_msg,"")!=0){
55
+    if (strcmp($err_msg, "") != 0) {
56 56
         echo "<p>$err_msg<hr>";
57 57
     }
58 58
     $files = array();
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
     } else {
67 67
         sort($files);
68 68
         start_table();
69
-        table_header("Name<br><p class=\"text-muted\">(click to view)</p>", "Modified", "Size (bytes)", "MD5", "Delete","Download");
69
+        table_header("Name<br><p class=\"text-muted\">(click to view)</p>", "Modified", "Size (bytes)", "MD5", "Delete", "Download");
70 70
         foreach ($files as $f) {
71 71
             $path = "$dir/$f";
72 72
             list($error, $size, $md5) = sandbox_parse_link_file($path);
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
         $s = stat($tmp_name);
117 117
         $size = $s['size'];
118 118
         list($exist, $elf) = sandbox_lf_exist($user, $md5);
119
-        if ($exist){
119
+        if ($exist) {
120 120
             $notice .= "<strong>Notice:</strong> Invalid Upload<br/>";
121 121
             $notice .= "You are trying to upload file  <strong>$name</strong><br/>";
122 122
             $notice .= "Another file <strong>$elf</strong> with the same content (md5: $md5) already exists!<br/>";
@@ -149,15 +149,15 @@  discard block
 block discarded – undo
149 149
         error_page("no such physical file");
150 150
     }
151 151
     $bused = sandbox_file_in_use($user, $name);
152
-    if ($bused){
152
+    if ($bused) {
153 153
         $notice = "<strong>$name</strong> is being used by batch(es), you can not delete it now!<br/>";
154
-    } else{ 
154
+    } else { 
155 155
         $notice = "<strong>$name</strong> is not being used by any batch(es) and successfully deleted from your sandbox<br/>";
156 156
         unlink("$dir/$name");
157 157
         unlink($p);
158 158
     
159 159
     }
160
-    list_files($user,$notice);
160
+    list_files($user, $notice);
161 161
     //Header("Location: sandbox.php");
162 162
 }
163 163
 function download_file($user) {
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 if (!$action) $action = post_str('action', true);
195 195
 
196 196
 switch ($action) {
197
-case '': list_files($user,""); break;
197
+case '': list_files($user, ""); break;
198 198
 case 'upload_file': upload_file($user); break;
199 199
 case 'delete_file': delete_file($user); break;
200 200
 case 'download_file': download_file($user); break;
Please login to merge, or discard this patch.