Passed
Pull Request — master (#5930)
by Vitalii
30:02 queued 17:39
created
html/user/friend.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
         if ($notify) {
39 39
             page_head(tra("Request pending"));
40 40
             $t = date_str($friend->create_time);
41
-            echo tra("You requested friendship with %1 on %2.", $destuser->name,$t) . "
41
+            echo tra("You requested friendship with %1 on %2.", $destuser->name, $t)."
42 42
                 <p>" .
43 43
                 tra("This request is still pending confirmation.");
44 44
             page_tail();
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 function check_ignoring($srcuser, $destuser) {
52 52
     BoincForumPrefs::lookup($destuser);
53 53
     if (is_ignoring($destuser, $srcuser)) {
54
-        error_page(tra("%1 is not accepting friendship requests from you",$destuser->name));
54
+        error_page(tra("%1 is not accepting friendship requests from you", $destuser->name));
55 55
     }
56 56
 }
57 57
 
@@ -72,11 +72,11 @@  discard block
 block discarded – undo
72 72
     echo "
73 73
         <form method=post action=friend.php>
74 74
         <input type=hidden name=userid value=$destid>
75
-        <input type=hidden name=action value=add_confirm>" .
75
+        <input type=hidden name=action value=add_confirm>".
76 76
         tra("You have asked to add %1 as a friend. We will notify %1 and will ask him/her to confirm that you are friends.",
77
-        "<b>".$destuser->name."</b>") ."
77
+        "<b>".$destuser->name."</b>")."
78 78
         <p>" .
79
-        tra("Add an optional message here:") ."
79
+        tra("Add an optional message here:")."
80 80
         <br>
81 81
         ".textarea_with_counter("message", 250, "")."
82 82
         <p>
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
         send_friend_request_email($user, $destuser, $msg);
116 116
     }
117 117
     page_head(tra("Friend request sent"));
118
-    echo tra("We have notified %1 of your request.","<b>".$destuser->name."</b>");
118
+    echo tra("We have notified %1 of your request.", "<b>".$destuser->name."</b>");
119 119
     page_tail();
120 120
 }
121 121
 
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
     }
197 197
 
198 198
     page_head(tra("Friendship confirmed"));
199
-    echo tra("Your friendship with %1 has been confirmed.","<b>" . $srcuser->name ."</b>");
199
+    echo tra("Your friendship with %1 has been confirmed.", "<b>".$srcuser->name."</b>");
200 200
     page_tail();
201 201
 }
202 202
 
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
         $notify->delete();
216 216
     }
217 217
     page_head(tra("Friendship declined"));
218
-    echo tra("You have declined friendship with %1","<b>".$srcuser->name."</b>");
218
+    echo tra("You have declined friendship with %1", "<b>".$srcuser->name."</b>");
219 219
     page_tail();
220 220
 }
221 221
 
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
         echo tra("Notification not found");
234 234
     }
235 235
     page_head(tra("Friend confirmed"));
236
-    echo tra("You are now friends with %1.",$destuser->name);
236
+    echo tra("You are now friends with %1.", $destuser->name);
237 237
     page_tail();
238 238
 }
239 239
 
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
     echo
246 246
         tra("Are you sure you want to cancel your friendship with %1?",
247 247
             $destuser->name
248
-        ) ."<p>\n"
248
+        )."<p>\n"
249 249
     ;
250 250
     show_button("friend.php?action=cancel&userid=$destid", tra("Yes"), tra("Cancel friendship"));
251 251
     show_button(HOME_PAGE, tra("No"), tra("Stay friends"));
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
     if (!$destuser) error_page("No such user");
260 260
     BoincFriend::delete($user->id, $destid);
261 261
     page_head(tra("Friendship cancelled"));
262
-    echo tra("Your friendship with %1 has been cancelled.",$destuser->name);
262
+    echo tra("Your friendship with %1 has been cancelled.", $destuser->name);
263 263
     page_tail();
264 264
 }
265 265
 
Please login to merge, or discard this patch.
html/user/edit_forum_preferences_form.php 1 patch
Spacing   +21 added lines, -21 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
 $x = '';
86 86
 if (!NO_COMPUTING) {
87 87
     $x = tra(
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
         tra("Attach signature by default")
104 104
     )
105 105
 );
106
-if ($user->prefs->signature!=""){
106
+if ($user->prefs->signature != "") {
107 107
     row2(tra("Signature preview").
108 108
         "<br><p class=\"text-muted\">".tra("This is how your signature will look in the forums")."</p>",
109 109
         output_transform($user->prefs->signature)
@@ -112,13 +112,13 @@  discard block
 block discarded – undo
112 112
 
113 113
 // ------------ Message display  -----------
114 114
 
115
-$forum_hide_avatars = $user->prefs->hide_avatars?"checked=\"checked\"":"";
116
-$forum_hide_signatures = $user->prefs->hide_signatures?"checked=\"checked\"":"";
117
-$forum_link_popup = $user->prefs->link_popup?"checked=\"checked\"":"";
118
-$forum_image_as_link = $user->prefs->images_as_links?"checked=\"checked\"":"";
119
-$forum_jump_to_unread = $user->prefs->jump_to_unread?"checked=\"checked\"":"";
120
-$forum_ignore_sticky_posts = $user->prefs->ignore_sticky_posts?"checked=\"checked\"":"";
121
-$forum_highlight_special = $user->prefs->highlight_special?"checked=\"checked\"":"";
115
+$forum_hide_avatars = $user->prefs->hide_avatars ? "checked=\"checked\"" : "";
116
+$forum_hide_signatures = $user->prefs->hide_signatures ? "checked=\"checked\"" : "";
117
+$forum_link_popup = $user->prefs->link_popup ? "checked=\"checked\"" : "";
118
+$forum_image_as_link = $user->prefs->images_as_links ? "checked=\"checked\"" : "";
119
+$forum_jump_to_unread = $user->prefs->jump_to_unread ? "checked=\"checked\"" : "";
120
+$forum_ignore_sticky_posts = $user->prefs->ignore_sticky_posts ? "checked=\"checked\"" : "";
121
+$forum_highlight_special = $user->prefs->highlight_special ? "checked=\"checked\"" : "";
122 122
 
123 123
 $forum_minimum_wrap_postcount = intval($user->prefs->minimum_wrap_postcount);
124 124
 $forum_display_wrap_postcount = intval($user->prefs->display_wrap_postcount);
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
                 <input class="btn btn-default" type="submit" name="remove%d" value="%s">
165 165
                 <br>
166 166
             ',
167
-            UNIQUE_USER_NAME?'':"$blocked_user->id -",
167
+            UNIQUE_USER_NAME ? '' : "$blocked_user->id -",
168 168
             user_links($blocked_user),
169 169
             $blocked_user->id,
170 170
             tra("Unblock")
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
         tra("Blocked users"),
179 179
         tra('Ignore message board posts and private messages from these users.')
180 180
     ),
181
-    $blocked_str?$blocked_str:'---'
181
+    $blocked_str ? $blocked_str : '---'
182 182
 );
183 183
 row2(
184 184
     tra('Block user'),
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
             <input type="text" name="forum_filter_user" size=12>
189 189
             <input class="btn btn-default" type="submit" name="add_user_to_filter" value="%s">
190 190
         ',
191
-        UNIQUE_USER_NAME?tra('User name'):tra('User ID (For instance: 123456789)'),
191
+        UNIQUE_USER_NAME ?tra('User name') : tra('User ID (For instance: 123456789)'),
192 192
         tra("Block")
193 193
     )
194 194
 );
@@ -206,5 +206,5 @@  discard block
 block discarded – undo
206 206
 end_table();
207 207
 page_tail();
208 208
 
209
-$cvs_version_tracker[]="\$Id$";  //Generated automatically - do not edit
209
+$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit
210 210
 ?>
Please login to merge, or discard this patch.
html/inc/cache.inc 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -32,8 +32,8 @@  discard block
 block discarded – undo
32 32
         mkdir("../cache", 0770);
33 33
         chmod("../cache", 0770);
34 34
     }
35
-    for ($i=0;$i<256;$i++) {
36
-        $j=sprintf("%02x",$i);
35
+    for ($i = 0; $i < 256; $i++) {
36
+        $j = sprintf("%02x", $i);
37 37
         if (!@filemtime("../cache/$j")) {
38 38
             mkdir("../cache/$j", 0770);
39 39
             chmod("../cache/$j", 0770);
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     }
42 42
 }
43 43
 
44
-function get_path($params, $phpfile=null) {
44
+function get_path($params, $phpfile = null) {
45 45
     if (!@filemtime("../cache/00")) make_cache_dirs();
46 46
     if ($phpfile) {
47 47
         $z = $phpfile;
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
     }
52 52
 
53 53
     // add a layer of subdirectories for reducing file lookup time
54
-    $sz = substr(md5($z."_".urlencode($params)),1,2);
54
+    $sz = substr(md5($z."_".urlencode($params)), 1, 2);
55 55
     $path = "../cache/".$sz."/".$z;
56 56
     if ($params) {
57 57
         $path = $path."_".urlencode($params);
@@ -60,14 +60,14 @@  discard block
 block discarded – undo
60 60
 }
61 61
 
62 62
 function disk_usage($dir) {
63
-    $usage=0;
64
-    if ($handle=@opendir($dir)) {
65
-        while ($file=readdir($handle)) {
63
+    $usage = 0;
64
+    if ($handle = @opendir($dir)) {
65
+        while ($file = readdir($handle)) {
66 66
             if (($file != ".") && ($file != "..")) {
67 67
                 if (@is_dir($dir."/".$file)) {
68
-                    $usage+=disk_usage($dir."/".$file);
68
+                    $usage += disk_usage($dir."/".$file);
69 69
                 } else {
70
-                    $usage+=@filesize($dir."/".$file);
70
+                    $usage += @filesize($dir."/".$file);
71 71
                 }
72 72
             }
73 73
         }
@@ -81,8 +81,8 @@  discard block
 block discarded – undo
81 81
     if (!chdir($dir)) {
82 82
         return;
83 83
     }
84
-    if ($handle=@opendir(".")) {
85
-        while ($file=readdir($handle)) {
84
+    if ($handle = @opendir(".")) {
85
+        while ($file = readdir($handle)) {
86 86
             if ($file == ".") continue;
87 87
             if ($file == "..") continue;
88 88
 
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
             if (@is_dir($file)) {
94 94
                 clean_cache($max_age, $file);
95 95
             } else {
96
-                if ((time()-@filemtime($file))>$max_age) {
96
+                if ((time() - @filemtime($file)) > $max_age) {
97 97
                     //echo "unlinking ".getcwd()."/$file\n";
98 98
                     @unlink($file);
99 99
                 }
@@ -107,8 +107,8 @@  discard block
 block discarded – undo
107 107
 
108 108
 // check cache size every once in a while, purge if too big
109 109
 //
110
-function cache_check_diskspace(){
111
-    if ((rand() % CACHE_SIZE_CHECK_FREQ)) return;
110
+function cache_check_diskspace() {
111
+    if ((rand()%CACHE_SIZE_CHECK_FREQ)) return;
112 112
     if (disk_usage("../cache") < MAX_CACHE_USAGE) return;
113 113
     $x = max(TEAM_PAGE_TTL, USER_PAGE_TTL, USER_HOST_TTL,
114 114
         USER_PROFILE_TTL, TOP_PAGES_TTL, INDEX_PAGE_TTL
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
     clean_cache($x, "../cache");
117 117
 }
118 118
 
119
-function cache_need_to_regenerate($path, $max_age){
119
+function cache_need_to_regenerate($path, $max_age) {
120 120
     $regenerate = false;
121 121
     $request = apache_request_headers();
122 122
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
         // and touch the cached copy so other processes
129 129
         // don't regenerate at the same time
130 130
         //
131
-        if ($lastmodified<time()-$max_age) {
131
+        if ($lastmodified < time() - $max_age) {
132 132
             $regenerate = true;
133 133
             @touch($path);
134 134
         }
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 }
140 140
 
141 141
 // Returns cached data or false if nothing was found
142
-function get_cached_data($max_age, $params=""){
142
+function get_cached_data($max_age, $params = "") {
143 143
     global $no_cache;
144 144
 
145 145
     if ($no_cache) return;
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
             }
156 156
         } else {
157 157
             cache_check_diskspace();
158
-            $regenerate=cache_need_to_regenerate($path, $max_age);
158
+            $regenerate = cache_need_to_regenerate($path, $max_age);
159 159
             if (!$regenerate) {
160 160
                 return file_get_contents($path);
161 161
             }
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 }
166 166
 
167 167
 // DEPRECATED
168
-function start_cache($max_age, $params=""){
168
+function start_cache($max_age, $params = "") {
169 169
     global $no_cache, $caching, $memcache;
170 170
 
171 171
     if ($no_cache) return;
@@ -188,15 +188,15 @@  discard block
 block discarded – undo
188 188
             $regenerate = cache_need_to_regenerate($path, $max_age);
189 189
         }
190 190
         //Is the stored version too old, do we need to regenerate it?
191
-        if ($regenerate){
191
+        if ($regenerate) {
192 192
             // If cached version is too old (or non-existent)
193 193
             // generate the page and write to cache
194 194
             //
195 195
             ob_start();
196 196
             ob_implicit_flush(0);
197
-            Header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
198
-            Header("Expires: " . gmdate("D, d M Y H:i:s",time()+$max_age) . " GMT");
199
-            Header("Cache-Control: public, max-age=" . $max_age);
197
+            Header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
198
+            Header("Expires: ".gmdate("D, d M Y H:i:s", time() + $max_age)." GMT");
199
+            Header("Cache-Control: public, max-age=".$max_age);
200 200
 
201 201
             // allow the calling page to see cache period
202 202
             //
@@ -208,9 +208,9 @@  discard block
 block discarded – undo
208 208
             if (strstr($params, "format=xml")) {
209 209
                 header('Content-type: text/xml');
210 210
             }
211
-            Header("Last-Modified: " . gmdate("D, d M Y H:i:s",$lastmodified) . " GMT");
212
-            Header("Expires: " . gmdate("D, d M Y H:i:s",$lastmodified+$max_age) . " GMT");
213
-            Header("Cache-Control: public, max-age=" . $max_age );
211
+            Header("Last-Modified: ".gmdate("D, d M Y H:i:s", $lastmodified)." GMT");
212
+            Header("Expires: ".gmdate("D, d M Y H:i:s", $lastmodified + $max_age)." GMT");
213
+            Header("Cache-Control: public, max-age=".$max_age);
214 214
             if ($cache && $cache->content) {
215 215
                 echo $cache->content;
216 216
                 exit;
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 
229 229
 // write output buffer both to client and to cache
230 230
 // DEPRECATED
231
-function end_cache($max_age,$params=""){
231
+function end_cache($max_age, $params = "") {
232 232
     global $no_cache;
233 233
     if ($no_cache) return;
234 234
 
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
     }
254 254
 }
255 255
 
256
-function set_cached_data($max_age, $data, $params=""){
256
+function set_cached_data($max_age, $data, $params = "") {
257 257
     // for the benefit of hackers
258 258
     if (strstr($params, "..")) {
259 259
         return "bad params";
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
         }
296 296
         $server_arr = array();
297 297
         $servers = explode('|', MEMCACHE_SERVERS);
298
-        foreach($servers as &$server) {
298
+        foreach ($servers as &$server) {
299 299
             list($ip, $port, $weight) = explode(':', $server);
300 300
             if (!$port) { $port = 11211; }
301 301
             $server_arr[] = array($ip, $port, $weight);
Please login to merge, or discard this patch.
html/user/pm.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -84,20 +84,20 @@  discard block
 block discarded – undo
84 84
             if ($offset === false) $offset = 0;
85 85
             if ($offset >= $nmsgs) $offset = 0;
86 86
             echo sprintf('Showing messages %d to %d of %d',
87
-                $offset+1,
88
-                min($offset+$nshow, $nmsgs),
87
+                $offset + 1,
88
+                min($offset + $nshow, $nmsgs),
89 89
                 $nmsgs
90 90
             );
91 91
             if ($offset) {
92 92
                 echo sprintf(
93 93
                     ' &middot; <a href=pm.php?action=inbox&offset=%d>Previous %d</a>',
94
-                    max(0, $offset-$nshow), $nshow
94
+                    max(0, $offset - $nshow), $nshow
95 95
                 );
96 96
             }
97
-            if ($offset+$nshow < $nmsgs) {
97
+            if ($offset + $nshow < $nmsgs) {
98 98
                 echo sprintf(
99 99
                     ' &middot; <a href=pm.php?action=inbox&offset=%d>Next %d</a>',
100
-                    $offset+$nshow, $nshow
100
+                    $offset + $nshow, $nshow
101 101
                 );
102 102
             }
103 103
         }
@@ -112,12 +112,12 @@  discard block
 block discarded – undo
112 112
             array('style="width: 12em;"', 'style="width: 10em;"', "")
113 113
         );
114 114
         $i = 0;
115
-        foreach($msgs as $msg) {
116
-            if ($i<$offset) {
115
+        foreach ($msgs as $msg) {
116
+            if ($i < $offset) {
117 117
                 $i++;
118 118
                 continue;
119 119
             }
120
-            if ($i>=$offset+$nshow) break;
120
+            if ($i >= $offset + $nshow) break;
121 121
             $i++;
122 122
             $sender = BoincUser::lookup_id($msg->senderid);
123 123
             if (!$sender) {
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
     $msgs = BoincPrivateMessage::enum(
366 366
         "userid=$logged_in_user->id"
367 367
     );
368
-    foreach($msgs as $msg) {
368
+    foreach ($msgs as $msg) {
369 369
         $x = "pm_select_$msg->id";
370 370
         if (post_str($x, true)) {
371 371
             $msg = BoincPrivateMessage::lookup_id($msg->id);
@@ -420,5 +420,5 @@  discard block
 block discarded – undo
420 420
     error_page(tra("Unknown action"));
421 421
 }
422 422
 
423
-$cvs_version_tracker[]="\$Id: pm.php 14077 2007-11-03 04:26:47Z davea $";
423
+$cvs_version_tracker[] = "\$Id: pm.php 14077 2007-11-03 04:26:47Z davea $";
424 424
 ?>
Please login to merge, or discard this patch.
html/user/job_file.php 1 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.
drupal/sites/default/boinc/modules/boincuser/boincuser.module 1 patch
Spacing   +120 added lines, -120 removed lines patch added patch discarded remove patch
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
     'type' => MENU_CALLBACK
190 190
   );
191 191
   $items['account_finish.php'] = array(
192
-    'title' => 'Welcome to ' . variable_get('site_name', 'Drupal-BOINC'),
192
+    'title' => 'Welcome to '.variable_get('site_name', 'Drupal-BOINC'),
193 193
     'description' => 'RPC for after a user has created an account.',
194 194
     'page callback' => 'boincuser_account_finish',
195 195
     'access callback' => TRUE,
@@ -249,8 +249,8 @@  discard block
 block discarded – undo
249 249
   // termsofuse is enabled, by having text in the termsofuse variable.
250 250
   $existinguser_tou = variable_get('boinc_weboptions_existinguser_tou', FALSE);
251 251
   $termsofuse = variable_get('boinc_weboptions_termsofuse', '');
252
-  if ( (!empty($termsofuse)) and ($user->uid) ) {
253
-    if ( !boincuser_check_termsofuse($user) and ($existinguser_tou) ) {
252
+  if ((!empty($termsofuse)) and ($user->uid)) {
253
+    if (!boincuser_check_termsofuse($user) and ($existinguser_tou)) {
254 254
 
255 255
       // Admins are exempt, otherwise the admin may not be able to
256 256
       // access the site!
@@ -264,14 +264,14 @@  discard block
 block discarded – undo
264 264
           'user/termsofuse',
265 265
           'logout',
266 266
           'account/info/edit',
267
-          'user/' . $user->uid . '/edit',
268
-          'user/' . $user->uid . '/recoveremail/*',
267
+          'user/'.$user->uid.'/edit',
268
+          'user/'.$user->uid.'/recoveremail/*',
269 269
           'recover_email.php',
270 270
         );
271 271
         if (module_exists('boincuser_delete')) {
272
-          $paths0[] = 'user/' . $user->uid . '/delete';
273
-          $paths0[] = 'user/' . $user->uid . '/deleteconfirm/*';
274
-          $paths0[] = 'user/' . $user->uid . '/odeleteconfirm/*';
272
+          $paths0[] = 'user/'.$user->uid.'/delete';
273
+          $paths0[] = 'user/'.$user->uid.'/deleteconfirm/*';
274
+          $paths0[] = 'user/'.$user->uid.'/odeleteconfirm/*';
275 275
         }
276 276
 
277 277
         // Paths added by the admin
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
         }
283 283
 
284 284
         // paths to ignore
285
-        $paths_to_ignore = array_unique( array_merge($paths0, $paths2) );
285
+        $paths_to_ignore = array_unique(array_merge($paths0, $paths2));
286 286
 
287 287
         if (!_boincuser_ignore_paths($path, $paths_to_ignore)) {
288 288
           drupal_goto('user/termsofuse');
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
   require_boinc('password_compat/password');
305 305
   // Handle BOINC integration for users with UID > 1 (skip anonymous and admin)
306 306
   if (isset($account->uid) && ($account->uid > 1)) {
307
-    switch($op) {
307
+    switch ($op) {
308 308
     case 'load':
309 309
       // User loading; insert BOINC data into the user object
310 310
       $drupal_user = db_fetch_object(db_query("
@@ -334,11 +334,11 @@  discard block
 block discarded – undo
334 334
       ));
335 335
       $account->boincuser_name = $boinc_user->name;
336 336
       $account->boincuser_account_key = $boinc_user->authenticator;
337
-      $account->boincuser_weak_auth = md5($boinc_user->authenticator . $boinc_user->passwd_hash);
337
+      $account->boincuser_weak_auth = md5($boinc_user->authenticator.$boinc_user->passwd_hash);
338 338
       $account->boincuser_total_credit = round($boinc_user->total_credit);
339 339
       $account->boincuser_expavg_credit = round($boinc_user->expavg_credit);
340 340
       $account->boincuser_expavg_time = round($boinc_user->expavg_time);
341
-      $account->boincuser_cpid = md5($boinc_user->cross_project_id . $account->mail);
341
+      $account->boincuser_cpid = md5($boinc_user->cross_project_id.$account->mail);
342 342
       $account->boincuser_default_pref_set = $boinc_user->venue;
343 343
       $account->boincteam_id = $boinc_user->teamid;
344 344
       $account->boincuser_previous_email_addr = $boinc_user->previous_email_addr;
@@ -507,7 +507,7 @@  discard block
 block discarded – undo
507 507
 
508 508
             // Set password hash appropriately
509 509
             $passwd = ($edit['pass']) ? $edit['pass'] : $edit['current_pass'];
510
-            $passwd_hash = password_hash( md5($passwd.$lower_email_addr), PASSWORD_DEFAULT );
510
+            $passwd_hash = password_hash(md5($passwd.$lower_email_addr), PASSWORD_DEFAULT);
511 511
             // Algorithm for changing email and/or password
512 512
             if ($changing_email) {
513 513
               // locally store current email to set as previous email
@@ -595,8 +595,8 @@  discard block
 block discarded – undo
595 595
   }
596 596
 
597 597
   // Check if user has agreed to terms of use.
598
-  if ( (!empty($termsofuse)) and ($account->uid) and
599
-       (!boincuser_check_termsofuse($account)) and ($existinguser_tou) ) {
598
+  if ((!empty($termsofuse)) and ($account->uid) and
599
+       (!boincuser_check_termsofuse($account)) and ($existinguser_tou)) {
600 600
 
601 601
     // Admins are exempted.
602 602
     $administrator_role = array_search('administrator', user_roles(true));
@@ -610,9 +610,9 @@  discard block
 block discarded – undo
610 610
       $query_for_destination = '';
611 611
       $prevdest = $_REQUEST['destination'];
612 612
       if ($prevdest) {
613
-        $query_for_destination = '?destination=' . $prevdest;
613
+        $query_for_destination = '?destination='.$prevdest;
614 614
       }
615
-      $_REQUEST['destination'] = $path_for_destination . $query_for_destination;
615
+      $_REQUEST['destination'] = $path_for_destination.$query_for_destination;
616 616
 
617 617
     }
618 618
   }
@@ -645,7 +645,7 @@  discard block
 block discarded – undo
645 645
   // In Drupal 7, these operation cases will all exist as their own hooks,
646 646
   // so let's approximate that here so that this function can simply be removed
647 647
   // upon migration to 7
648
-  switch($op) {
648
+  switch ($op) {
649 649
   case 'update':
650 650
     boincuser_node_update($node);
651 651
   }
@@ -656,7 +656,7 @@  discard block
 block discarded – undo
656 656
  * is updated (forward compatible to Drupal 7)
657 657
  */
658 658
 function boincuser_node_update($node) {
659
-  switch($node->type) {
659
+  switch ($node->type) {
660 660
   case 'profile':
661 661
     // Update the BOINC database directly
662 662
     $account = user_load($node->uid);
@@ -778,7 +778,7 @@  discard block
 block discarded – undo
778 778
     }
779 779
 
780 780
     $form['cancel'] = array(
781
-      '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $cancel_dest) . '</li>',
781
+      '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $cancel_dest).'</li>',
782 782
       '#weight' => 1004,
783 783
     );
784 784
     $form['form control tabs suffix'] = array(
@@ -811,7 +811,7 @@  discard block
 block discarded – undo
811 811
     $form['buttons']['preview_changes']['#suffix'] = '</li>';
812 812
     $form['buttons']['preview_changes']['#weight'] = 1004;
813 813
     $form['buttons']['cancel'] = array(
814
-      '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "node/{$form['nid']['#value']}") . '</li>',
814
+      '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "node/{$form['nid']['#value']}").'</li>',
815 815
       '#weight' => 1005,
816 816
     );
817 817
     $form['buttons']['delete']['#prefix'] = '<li class="tab">';
@@ -843,7 +843,7 @@  discard block
 block discarded – undo
843 843
     $form['actions']['submit']['#suffix'] = '</li>';
844 844
     $form['actions']['submit']['#weight'] = 1002;
845 845
     $form['actions']['cancel'] = array(
846
-        '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "node/{$form['nid']['#value']}") . '</li>',
846
+        '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "node/{$form['nid']['#value']}").'</li>',
847 847
       '#weight' => 1005,
848 848
     );
849 849
     $form['actions']['form control tabs suffix'] = array(
@@ -870,7 +870,7 @@  discard block
 block discarded – undo
870 870
     $form['privatemsg']['preview']['#suffix'] = '</li>';
871 871
     $form['privatemsg']['preview']['#weight'] = 1003;
872 872
     $form['privatemsg']['cancel'] = array(
873
-      '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']) . '</li>',
873
+      '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']).'</li>',
874 874
       '#weight' => 1004,
875 875
     );
876 876
     $form['privatemsg']['form control tabs suffix'] = array(
@@ -958,11 +958,11 @@  discard block
 block discarded – undo
958 958
     // Set special message if user has not agreed to TOU
959 959
     $existinguser_tou = variable_get('boinc_weboptions_existinguser_tou', FALSE);
960 960
     $termsofuse = variable_get('boinc_weboptions_termsofuse', '');
961
-    if ( (!boincuser_check_termsofuse($account)) and ($existinguser_tou) and (!empty($termsofuse)) and (!user_access('administer users')) ) {
961
+    if ((!boincuser_check_termsofuse($account)) and ($existinguser_tou) and (!empty($termsofuse)) and (!user_access('administer users'))) {
962 962
       drupal_set_message(
963 963
         bts('INFO: You have not agreed to the terms of use for @project. You may use this form to change your email address and/or password. Please note: you may not delete your account within seven (7) days of changing your email address.',
964 964
         array(
965
-          '@project' => variable_get('site_name','Drupal-BOINC'),
965
+          '@project' => variable_get('site_name', 'Drupal-BOINC'),
966 966
         ), NULL, 'boinc:account-credentials-change')
967 967
       , 'info');
968 968
     }
@@ -1027,36 +1027,36 @@  discard block
 block discarded – undo
1027 1027
     $form['account']['boincuser_id'] = array(
1028 1028
       '#value' => '
1029 1029
         <div class="form-item">
1030
-          <label>' . bts('BOINC user ID', array(), NULL, 'boinc:account-credentials-change') . '</label>
1031
-          <span>' . $account->boincuser_id . '</span>
1030
+          <label>' . bts('BOINC user ID', array(), NULL, 'boinc:account-credentials-change').'</label>
1031
+          <span>' . $account->boincuser_id.'</span>
1032 1032
         </div>',
1033 1033
     );
1034 1034
     $form['account']['user_id'] = array(
1035 1035
       '#value' => '
1036 1036
         <div class="form-item">
1037
-          <label>' . bts('Drupal user ID', array(), NULL, 'boinc:account-credentials-change') . '</label>
1038
-          <span>' . $account->uid . '</span>
1037
+          <label>' . bts('Drupal user ID', array(), NULL, 'boinc:account-credentials-change').'</label>
1038
+          <span>' . $account->uid.'</span>
1039 1039
         </div>',
1040 1040
     );
1041 1041
     $form['account']['account_key'] = array(
1042 1042
       '#value' => '
1043 1043
         <div class="form-item">
1044
-          <label>' . bts('Account key', array(), NULL, 'boinc:account-credentials-change') . '</label>
1045
-          <span>' . $account->boincuser_account_key . '</span>
1044
+          <label>' . bts('Account key', array(), NULL, 'boinc:account-credentials-change').'</label>
1045
+          <span>' . $account->boincuser_account_key.'</span>
1046 1046
         </div>',
1047 1047
     );
1048 1048
     $form['account']['weak_account_key'] = array(
1049 1049
       '#value' => '
1050 1050
         <div class="form-item">
1051
-          <label>' . bts('Weak account key', array(), NULL, 'boinc:account-credentials-change') . '</label>
1052
-          <span>' . "{$account->boincuser_id}_{$account->boincuser_weak_auth}" . '</span>
1051
+          <label>' . bts('Weak account key', array(), NULL, 'boinc:account-credentials-change').'</label>
1052
+          <span>' . "{$account->boincuser_id}_{$account->boincuser_weak_auth}".'</span>
1053 1053
         </div>',
1054 1054
     );
1055 1055
     $form['account']['cpid'] = array(
1056 1056
       '#value' => '
1057 1057
         <div class="form-item">
1058
-          <label>' . bts('Cross-project ID', array(), NULL, 'boinc:account-credentials-change') . '</label>
1059
-          <span>' . $account->boincuser_cpid . '</span>
1058
+          <label>' . bts('Cross-project ID', array(), NULL, 'boinc:account-credentials-change').'</label>
1059
+          <span>' . $account->boincuser_cpid.'</span>
1060 1060
         </div>',
1061 1061
     );
1062 1062
 
@@ -1074,7 +1074,7 @@  discard block
 block discarded – undo
1074 1074
     $form['submit']['#suffix'] = '</li>';
1075 1075
     $form['submit']['#weight'] = 1002;
1076 1076
     $form['cancel'] = array(
1077
-      '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']) . '</li>',
1077
+      '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']).'</li>',
1078 1078
       '#weight' => 1003,
1079 1079
     );
1080 1080
     if (isset($form['delete']) AND is_array($form['delete'])) {
@@ -1170,7 +1170,7 @@  discard block
 block discarded – undo
1170 1170
     $form['buttons']['preview_changes']['#suffix'] = '</li>';
1171 1171
     $form['buttons']['preview_changes']['#weight'] = 1004;
1172 1172
     $form['buttons']['cancel'] = array(
1173
-      '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']) . '</li>',
1173
+      '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']).'</li>',
1174 1174
       '#weight' => 1005,
1175 1175
     );
1176 1176
     $form['buttons']['delete']['#prefix'] = '<li class="tab">';
@@ -1219,11 +1219,11 @@  discard block
 block discarded – undo
1219 1219
     // Set name temporarily to dummy value to beat validation
1220 1220
     $form['name'] = array(
1221 1221
       '#type' => 'hidden',
1222
-      '#value' => rand() . '.' . time()
1222
+      '#value' => rand().'.'.time()
1223 1223
     );
1224 1224
 
1225 1225
     // Add JS for submit button disabling
1226
-    drupal_add_js(drupal_get_path('module', 'boincuser') . '/boincuser.js');
1226
+    drupal_add_js(drupal_get_path('module', 'boincuser').'/boincuser.js');
1227 1227
 
1228 1228
     // Terms of use section
1229 1229
     $termsofuse = variable_get('boinc_weboptions_termsofuse', '');
@@ -1239,7 +1239,7 @@  discard block
 block discarded – undo
1239 1239
 
1240 1240
       $form['termsofuse']['title1'] = array(
1241 1241
         '#weight' => -12,
1242
-        '#value' => '<h2>' . bts(variable_get('boinc_weboptions_registrationtitle', 'Please read and acknowledge our terms of use'), array(), NULL, 'project:user-register' ) . '</h2>',
1242
+        '#value' => '<h2>'.bts(variable_get('boinc_weboptions_registrationtitle', 'Please read and acknowledge our terms of use'), array(), NULL, 'project:user-register').'</h2>',
1243 1243
         '#prefix' => '<div id="register-title1">',
1244 1244
         '#suffix' => '</div>',
1245 1245
       );
@@ -1262,7 +1262,7 @@  discard block
 block discarded – undo
1262 1262
 
1263 1263
     $form['title2'] = array(
1264 1264
       '#weight' => -6,
1265
-      '#value' => '<h2>' . bts(variable_get('boinc_weboptions_registrationtitle2', 'Fill in your name, email, and choose a secure passphrase.'), array(), NULL, 'project:user-register') . '</h2>',
1265
+      '#value' => '<h2>'.bts(variable_get('boinc_weboptions_registrationtitle2', 'Fill in your name, email, and choose a secure passphrase.'), array(), NULL, 'project:user-register').'</h2>',
1266 1266
       '#prefix' => '<div id="register-title2">',
1267 1267
       '#suffix' => '</div>',
1268 1268
     );
@@ -1326,7 +1326,7 @@  discard block
 block discarded – undo
1326 1326
     $form['buttons']['submit']['#suffix'] = '</li>';
1327 1327
     $form['buttons']['submit']['#weight'] = 1002;
1328 1328
     $form['buttons']['cancel'] = array(
1329
-      '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), 'user/login') . '</li>',
1329
+      '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), 'user/login').'</li>',
1330 1330
       '#weight' => 1005,
1331 1331
     );
1332 1332
     $form['buttons']['form control tabs suffix'] = array(
@@ -1408,7 +1408,7 @@  discard block
 block discarded – undo
1408 1408
  */
1409 1409
 function boincuser_token_list($type = 'all') {
1410 1410
   if ($type == 'user' || $type == 'all') {
1411
-    $tokens['user']['display-name']      = t("The user's name that should be displayed");
1411
+    $tokens['user']['display-name'] = t("The user's name that should be displayed");
1412 1412
     return $tokens;
1413 1413
   }
1414 1414
 }
@@ -1420,9 +1420,9 @@  discard block
 block discarded – undo
1420 1420
   if ($view->args) {
1421 1421
     $account_id = $view->args[0];
1422 1422
   }
1423
-  if ($view->name=="user_activity") {
1423
+  if ($view->name == "user_activity") {
1424 1424
     // Run the following custom query for the user_activity view
1425
-    $view->build_info['query']= "
1425
+    $view->build_info['query'] = "
1426 1426
       SELECT node_revisions.vid AS vid,
1427 1427
         node.nid AS node_nid,
1428 1428
         node.uid AS users_node_uid,
@@ -1462,13 +1462,13 @@  discard block
 block discarded – undo
1462 1462
   // Delete expired users in the BOINC database, user_delete table.
1463 1463
   require_boinc('boinc_db');
1464 1464
   $num_deleted = BoincUserDeleted::delete_expired();
1465
-  if ($num_deleted>0) {
1465
+  if ($num_deleted > 0) {
1466 1466
     watchdog('boincuser', "Deleted ${num_deleted} users from user_deleted table", WATCHDOG_NOTICE);
1467 1467
   }
1468 1468
 
1469 1469
   // Delete expired tokens from token table
1470 1470
   $tokens_deleted = BoincToken::delete_expired();
1471
-  if ($tokens_deleted>0) {
1471
+  if ($tokens_deleted > 0) {
1472 1472
     watchdog('boincuser', "Deleted ${tokens_deleted} tokens from token table", WATCHDOG_NOTICE);
1473 1473
   }
1474 1474
 }
@@ -1553,38 +1553,38 @@  discard block
 block discarded – undo
1553 1553
   case 'boinc':
1554 1554
     $output .= '<ol>';
1555 1555
     if ($registration_enabled) {
1556
-      $output .= '<li>' . bts('First !create_an_account here at @sitename.',
1556
+      $output .= '<li>'.bts('First !create_an_account here at @sitename.',
1557 1557
       array(
1558 1558
         '!create_an_account' => l(bts('create an account', array(), NULL, 'boinc:join-page'), 'user/registration'),
1559 1559
         '@sitename' => $site_name,
1560
-      ), NULL, 'boinc:join-page') . '</li>';
1560
+      ), NULL, 'boinc:join-page').'</li>';
1561 1561
     }
1562
-    $output .= '  <li>' . bts("Install BOINC on this device if not already present.", array(), NULL, 'boinc:join-page') . '</li>';
1563
-    $output .= '  <li>' . bts("Select <i>Tools / Add Project</i>. Choose @sitename from the list, or enter @siteurl.",
1562
+    $output .= '  <li>'.bts("Install BOINC on this device if not already present.", array(), NULL, 'boinc:join-page').'</li>';
1563
+    $output .= '  <li>'.bts("Select <i>Tools / Add Project</i>. Choose @sitename from the list, or enter @siteurl.",
1564 1564
     array(
1565 1565
       '@sitename' => $site_name,
1566 1566
       '@siteurl' => $base_url,
1567
-    ), NULL, 'boinc:join-page') . '</li>';
1567
+    ), NULL, 'boinc:join-page').'</li>';
1568 1568
     if ($registration_enabled) {
1569
-      $output .= '<li>' . bts("If you're running a command-line or pre-5.0 version of BOINC, use <b>!boinccmd</b> to add the project.",
1569
+      $output .= '<li>'.bts("If you're running a command-line or pre-5.0 version of BOINC, use <b>!boinccmd</b> to add the project.",
1570 1570
         array(
1571 1571
           '!boinccmd' => l('boinccmd --project_attach', 'http://boinc.berkeley.edu/wiki/Boinccmd_tool'),
1572
-        ), NULL, 'boinc:join-page') . '</li>';
1572
+        ), NULL, 'boinc:join-page').'</li>';
1573 1573
     }
1574 1574
     else {
1575
-      $output .= '<li>' . bts("If you're running a command-line version of BOINC,
1575
+      $output .= '<li>'.bts("If you're running a command-line version of BOINC,
1576 1576
         please follow the <b>!instructionslink</b> to first <i>create an account</i>, and then <i>attach</i> to this project. Use the same project URL as above.",
1577 1577
         array(
1578 1578
           '!instructionslink' => l('instructions', 'http://boinc.berkeley.edu/wiki/Boinccmd_tool'),
1579
-        ), NULL, 'boinc:join-page') . '</li>';
1579
+        ), NULL, 'boinc:join-page').'</li>';
1580 1580
     }
1581
-    $output .= '<li>' . bts("If you're running a pre-5.0 version of BOINC, please
1581
+    $output .= '<li>'.bts("If you're running a pre-5.0 version of BOINC, please
1582 1582
       upgrade to a more recent version of BOINC to create an account
1583 1583
       at @this_project.",
1584 1584
       array(
1585 1585
         '@this_project' => $site_name,
1586
-      ), NULL, 'boinc:join-page') . '</li>';
1587
-    $output .=  '</ol>';
1586
+      ), NULL, 'boinc:join-page').'</li>';
1587
+    $output .= '</ol>';
1588 1588
     break;
1589 1589
   case 'new':
1590 1590
   default:
@@ -1596,37 +1596,37 @@  discard block
 block discarded – undo
1596 1596
     //  $ruleslink = drupal_lookup_path('source', $ruleslinkB);
1597 1597
     //}
1598 1598
 
1599
-    $ruleslink = drupal_lookup_path('source', variable_get('boinc_weboptions_rulespolicies', '') );
1599
+    $ruleslink = drupal_lookup_path('source', variable_get('boinc_weboptions_rulespolicies', ''));
1600 1600
 
1601 1601
     // Join page output
1602 1602
     $output .= '<ol>';
1603 1603
     if ($registration_enabled) {
1604
-      $output .= '<li>' . bts('First !create_an_account here at @sitename.',
1604
+      $output .= '<li>'.bts('First !create_an_account here at @sitename.',
1605 1605
       array(
1606 1606
         '!create_an_account' => l(bts('create an account', array(), NULL, 'boinc:join-page'), 'user/registration'),
1607 1607
         '@sitename' => $site_name,
1608
-      ), NULL, 'boinc:join-page') . '</li>';
1608
+      ), NULL, 'boinc:join-page').'</li>';
1609 1609
     }
1610
-    else if ( menu_valid_path(array('link_path' => $ruleslink)) ) {
1611
-      $output .= '  <li>' . bts("Read our !rules_and_policies.", array(
1610
+    else if (menu_valid_path(array('link_path' => $ruleslink))) {
1611
+      $output .= '  <li>'.bts("Read our !rules_and_policies.", array(
1612 1612
         '!rules_and_policies' => l(bts('Rules and Policies', array(), NULL, 'boinc:join-page'), $ruleslink),
1613
-      ), NULL, 'boinc:join-page') . '</li>';
1613
+      ), NULL, 'boinc:join-page').'</li>';
1614 1614
     }
1615
-    $output .= '  <li>' . bts('Download the BOINC desktop software.', array(), NULL, 'boinc:join-page');
1615
+    $output .= '  <li>'.bts('Download the BOINC desktop software.', array(), NULL, 'boinc:join-page');
1616 1616
     $output .= '    <p>';
1617 1617
     $output .= '      <a class="button" href="http://boinc.berkeley.edu/download.php">Download</a>';
1618 1618
     $output .= '    </p>';
1619
-    $output .= '    ' . bts("For Android devices, visit !fdroid_link or download !apk_link directly.", array(
1619
+    $output .= '    '.bts("For Android devices, visit !fdroid_link or download !apk_link directly.", array(
1620 1620
       '!fdroid_link' => '<a href="https://f-droid.org/en/packages/edu.berkeley.boinc">F-Droid</a>',
1621 1621
       '!apk_link' => '<a href="https://boinc.berkeley.edu/download_all.php">BOINC for Android</a>',
1622 1622
     ), NULL, 'boinc:join-page');
1623 1623
     $output .= '  </li>';
1624
-    $output .= '  <li>' . bts('Run the installer.', array(), NULL, 'boinc:join-page') . '</li>';
1625
-    $output .= '  <li>' . bts('Choose @sitename from the list, or enter @siteurl.', array(
1624
+    $output .= '  <li>'.bts('Run the installer.', array(), NULL, 'boinc:join-page').'</li>';
1625
+    $output .= '  <li>'.bts('Choose @sitename from the list, or enter @siteurl.', array(
1626 1626
       '@sitename' => $site_name,
1627 1627
       '@siteurl' => $base_url,
1628
-    ), NULL, 'boinc:join-page') . '</li>';
1629
-    $output .=  '</ol>';
1628
+    ), NULL, 'boinc:join-page').'</li>';
1629
+    $output .= '</ol>';
1630 1630
   }
1631 1631
   $output .= '</div>';
1632 1632
   return $output;
@@ -1639,7 +1639,7 @@  discard block
 block discarded – undo
1639 1639
   global $user;
1640 1640
   $site_name = variable_get('site_name', 'Drupal-BOINC');
1641 1641
   // get the front page message from database; this is set in the admin interface under BOINC Other
1642
-  $site_message = variable_get('boinc_other_frontpage','');
1642
+  $site_message = variable_get('boinc_other_frontpage', '');
1643 1643
 
1644 1644
   // Determine the user of the day
1645 1645
   $current_uotd = db_fetch_object(db_query("
@@ -1661,30 +1661,30 @@  discard block
 block discarded – undo
1661 1661
   $output .= ($user->uid) ? bts('Welcome back!', array(), NULL, 'boinc:front-page') : ($site_name ? bts('What is @this_project?', array('@this_project' => $site_name)) : bts('Welcome!', array(), NULL, 'boinc:front-page'));
1662 1662
   $output .= '</h2>';
1663 1663
   $output .= '<div class="boinc-overview balance-height-front">';
1664
-  $output .= '  <div>' . bts($site_message, array(), NULL, "project:front page") . ' ' . l(bts('Learn more', array(), NULL, 'boinc:front-page'), 'about') . '</div>';
1664
+  $output .= '  <div>'.bts($site_message, array(), NULL, "project:front page").' '.l(bts('Learn more', array(), NULL, 'boinc:front-page'), 'about').'</div>';
1665 1665
   if ($user->uid) {
1666
-    $output .= '  <div>' . l(bts('View account', array(), NULL, 'boinc:front-page'), 'dashboard', array('attributes' => array('class' => 'join button'))) . '</div>';
1666
+    $output .= '  <div>'.l(bts('View account', array(), NULL, 'boinc:front-page'), 'dashboard', array('attributes' => array('class' => 'join button'))).'</div>';
1667 1667
   }
1668 1668
   else {
1669
-    $output .= '  <div>' . l(bts('Join now', array(), NULL, 'boinc:front-page'), 'join', array('attributes' => array('class' => 'join button'))) . '</div>';
1669
+    $output .= '  <div>'.l(bts('Join now', array(), NULL, 'boinc:front-page'), 'join', array('attributes' => array('class' => 'join button'))).'</div>';
1670 1670
   }
1671 1671
   $output .= '</div>';
1672 1672
   $output .= '<div class="boinc-overview-details">';
1673 1673
   $output .= '  <div class="detail-container">';
1674
-  $output .= '    <a class="user-of-the-day" href="account/' . $uotd->uid . '">';
1674
+  $output .= '    <a class="user-of-the-day" href="account/'.$uotd->uid.'">';
1675 1675
   $output .= '      <div class="picture">';
1676 1676
   $output .= theme('imagefield_image', $uotd_image['image'], $uotd_image['alt'],
1677 1677
     $uotd_image['alt'], array(), FALSE);
1678 1678
   $output .= '      </div>';
1679
-  $output .= '      <div class="text">' . bts('User of the day', array(), NULL, 'boinc:front-page') . '</div>';
1680
-  $output .= '      <div class="detail">' . $uotd->boincuser_name . '</div>';
1679
+  $output .= '      <div class="text">'.bts('User of the day', array(), NULL, 'boinc:front-page').'</div>';
1680
+  $output .= '      <div class="detail">'.$uotd->boincuser_name.'</div>';
1681 1681
   $output .= '    </a>';
1682 1682
   $output .= '    <div class="volunteers">';
1683
-  $output .= '      <div class="text">' . bts('Over 500,000 volunteers and counting.', array(), NULL, 'boinc:front-page') . '</div>';
1683
+  $output .= '      <div class="text">'.bts('Over 500,000 volunteers and counting.', array(), NULL, 'boinc:front-page').'</div>';
1684 1684
   $output .= '      <div class="platforms">';
1685
-  $output .= '        <div class="detail platform windows">' . bts('Windows', array(), NULL, 'boinc:front-page') . '</div>';
1686
-  $output .= '        <div class="detail platform mac">' .  bts('Mac', array(), NULL, 'boinc:front-page') . '</div>';
1687
-  $output .= '        <div class="detail platform linux">' . bts('Linux', array(), NULL, 'boinc:front-page') . '</div>';
1685
+  $output .= '        <div class="detail platform windows">'.bts('Windows', array(), NULL, 'boinc:front-page').'</div>';
1686
+  $output .= '        <div class="detail platform mac">'.bts('Mac', array(), NULL, 'boinc:front-page').'</div>';
1687
+  $output .= '        <div class="detail platform linux">'.bts('Linux', array(), NULL, 'boinc:front-page').'</div>';
1688 1688
   $output .= '      </div>';
1689 1689
   $output .= '    </div>';
1690 1690
   $output .= '  </div>';
@@ -1715,7 +1715,7 @@  discard block
 block discarded – undo
1715 1715
   $enablethisRPC = variable_get('boinc_weboptions_enableaccountcreateRPC', TRUE);
1716 1716
   if (!$enablethisRPC) {
1717 1717
     $mess = bts('Account creation is done through our Web site. Please register at @url', array(
1718
-      '@url' => $base_url . '/user/registration',
1718
+      '@url' => $base_url.'/user/registration',
1719 1719
     ),
1720 1720
     NULL, 'boinc:create_account');
1721 1721
     xml_error(-208, $mess);
@@ -1747,8 +1747,8 @@  discard block
 block discarded – undo
1747 1747
   $boinc_user = BoincUser::lookup_email_addr($params['email_addr']);
1748 1748
   if ($boinc_user) {
1749 1749
     // Return authenticator for existing users
1750
-    if ( ($params['passwd_hash'] == $boinc_user->passwd_hash) or
1751
-    password_verify($params['passwd_hash'], $boinc_user->passwd_hash) ) {
1750
+    if (($params['passwd_hash'] == $boinc_user->passwd_hash) or
1751
+    password_verify($params['passwd_hash'], $boinc_user->passwd_hash)) {
1752 1752
       $output = array('authenticator' => $boinc_user->authenticator);
1753 1753
     }
1754 1754
     else {
@@ -1804,7 +1804,7 @@  discard block
 block discarded – undo
1804 1804
   // Ensure there is a authentication token before continuing
1805 1805
   if (empty($authtoken)) {
1806 1806
     drupal_not_found();
1807
-    return ;
1807
+    return;
1808 1808
   }
1809 1809
 
1810 1810
   if (strlen($authtoken) != 32) {
@@ -1826,8 +1826,8 @@  discard block
 block discarded – undo
1826 1826
   }
1827 1827
 
1828 1828
   // Lookup path to custom account finish page
1829
-  $customaccountfinishpath = drupal_lookup_path('source', variable_get('boinc_weboptions_accountfinish', '') );
1830
-  if ( menu_valid_path(array('link_path' => $customaccountfinishpath)) ) {
1829
+  $customaccountfinishpath = drupal_lookup_path('source', variable_get('boinc_weboptions_accountfinish', ''));
1830
+  if (menu_valid_path(array('link_path' => $customaccountfinishpath))) {
1831 1831
     $node = menu_get_object('node', 1, $customaccountfinishpath);
1832 1832
     if ($node) {
1833 1833
       return node_page_view($node);
@@ -1836,12 +1836,12 @@  discard block
 block discarded – undo
1836 1836
 
1837 1837
   // open links in new window
1838 1838
   $options = array(
1839
-    'attributes' => array( 'target' => '_blank' ),
1839
+    'attributes' => array('target' => '_blank'),
1840 1840
   );
1841 1841
 
1842 1842
   // Check moderation page exists
1843
-  $moderationpath = drupal_lookup_path('source', variable_get('boinc_weboptions_moderationpage', '') );
1844
-  if ( menu_valid_path(array('link_path' => $moderationpath)) ) {
1843
+  $moderationpath = drupal_lookup_path('source', variable_get('boinc_weboptions_moderationpage', ''));
1844
+  if (menu_valid_path(array('link_path' => $moderationpath))) {
1845 1845
     $modsentence = bts('Please note: user profiles are subject to !moderation.', array('!moderation' => l(bts('moderation', array(), NULL, 'boinc:account-finish'), $moderationpath, $options)), NULL, 'boinc:account-finish');
1846 1846
   } else {
1847 1847
     $modsentence = bts('Please note: user profiles are subject to moderation.', array(), NULL, 'boinc:account-finish');
@@ -1849,11 +1849,11 @@  discard block
 block discarded – undo
1849 1849
 
1850 1850
   $username = $user->boincuser_name;
1851 1851
   $site_name = variable_get('site_name', 'Drupal-BOINC');
1852
-  $output = "<p>" . bts('Thank you @user_name for joining @site_name. Your account has been created. Your BOINC client should start working on assigned tasks soon, without any additional action or configuration. Please visit the links below for more information and additional options. (Links will open in a new window.)',
1852
+  $output = "<p>".bts('Thank you @user_name for joining @site_name. Your account has been created. Your BOINC client should start working on assigned tasks soon, without any additional action or configuration. Please visit the links below for more information and additional options. (Links will open in a new window.)',
1853 1853
   array(
1854 1854
     '@user_name' => $username,
1855 1855
     '@site_name' => $site_name,
1856
-  ), NULL, 'boinc:account-finish') . "</p>";
1856
+  ), NULL, 'boinc:account-finish')."</p>";
1857 1857
 
1858 1858
   $links = array(
1859 1859
     array(
@@ -1919,7 +1919,7 @@  discard block
 block discarded – undo
1919 1919
   );
1920 1920
 
1921 1921
   //List of links
1922
-  $output .= theme_item_list($links, $title = NULL, $type='ul');
1922
+  $output .= theme_item_list($links, $title = NULL, $type = 'ul');
1923 1923
 
1924 1924
   return $output;
1925 1925
 }
@@ -2036,7 +2036,7 @@  discard block
 block discarded – undo
2036 2036
     global $base_url;
2037 2037
     global $base_path;
2038 2038
     $site_name = variable_get('site_name', 'Drupal-BOINC');
2039
-    $site_url = $base_url . $base_path;
2039
+    $site_url = $base_url.$base_path;
2040 2040
     $moderator = user_load($user->uid);
2041 2041
     $profile->moderate = 0;
2042 2042
     $profile->status = 0;
@@ -2097,7 +2097,7 @@  discard block
 block discarded – undo
2097 2097
       global $base_url;
2098 2098
       global $base_path;
2099 2099
       $site_name = variable_get('site_name', 'Drupal-BOINC');
2100
-      $site_url = $base_url . $base_path;
2100
+      $site_url = $base_url.$base_path;
2101 2101
       $moderator = user_load($user->uid);
2102 2102
       $settings = array(
2103 2103
         'from' => '',
@@ -2201,25 +2201,25 @@  discard block
 block discarded – undo
2201 2201
   if (!$projects) return bts('no projects...', array(), NULL, 'boinc:account-dashboard');
2202 2202
 
2203 2203
   $output = '';
2204
-  $output .= '<table class="user-projects">' . "\n";
2205
-  $output .= '<thead>' . "\n";
2206
-  $output .= '  <tr>' . "\n";
2207
-  $output .= '    <th>' . bts('Name', array(), NULL, 'boinc:project-name:-1:ignoreoverwrite') . '</th>' . "\n";
2208
-  $output .= '    <th class="numeric">' . bts('Avg credit', array(), NULL, 'boinc:account-dashboard') . '</th>' . "\n";
2209
-  $output .= '    <th class="numeric">' . bts('Total credit', array(), NULL, 'boinc:user-or-team-total-credits') . '</th>' . "\n";
2210
-  $output .= '  </tr>' . "\n";
2211
-  $output .= '</thead>' . "\n";
2212
-  $output .= '<tbody>' . "\n";
2204
+  $output .= '<table class="user-projects">'."\n";
2205
+  $output .= '<thead>'."\n";
2206
+  $output .= '  <tr>'."\n";
2207
+  $output .= '    <th>'.bts('Name', array(), NULL, 'boinc:project-name:-1:ignoreoverwrite').'</th>'."\n";
2208
+  $output .= '    <th class="numeric">'.bts('Avg credit', array(), NULL, 'boinc:account-dashboard').'</th>'."\n";
2209
+  $output .= '    <th class="numeric">'.bts('Total credit', array(), NULL, 'boinc:user-or-team-total-credits').'</th>'."\n";
2210
+  $output .= '  </tr>'."\n";
2211
+  $output .= '</thead>'."\n";
2212
+  $output .= '<tbody>'."\n";
2213 2213
   foreach ($projects AS $project) {
2214
-    $url = rtrim($project->url, '/') . '/show_user.php?userid=' . $project->id;
2215
-    $output .= '  <tr>' . "\n";
2216
-    $output .= '    <td>' . l($project->name, $url) . '</td>' . "\n";
2217
-    $output .= '    <td class="numeric">' . boincwork_format_stats((float) $project->expavg_credit) . '</td>' . "\n";
2218
-    $output .= '    <td class="numeric">' . boincwork_format_stats((float) $project->total_credit) . '</td>' . "\n";
2219
-    $output .= '  </tr>' . "\n";
2214
+    $url = rtrim($project->url, '/').'/show_user.php?userid='.$project->id;
2215
+    $output .= '  <tr>'."\n";
2216
+    $output .= '    <td>'.l($project->name, $url).'</td>'."\n";
2217
+    $output .= '    <td class="numeric">'.boincwork_format_stats((float)$project->expavg_credit).'</td>'."\n";
2218
+    $output .= '    <td class="numeric">'.boincwork_format_stats((float)$project->total_credit).'</td>'."\n";
2219
+    $output .= '  </tr>'."\n";
2220 2220
   }
2221
-  $output .= '</tbody>' . "\n";
2222
-  $output .= '</table>' . "\n";
2221
+  $output .= '</tbody>'."\n";
2222
+  $output .= '</table>'."\n";
2223 2223
   $more_link = ($account) ? "user/{$account->uid}/stats" : 'account/stats';
2224 2224
   //$output .= "<div class=\"more-link\"><a href=\"{$more_link}\">More stats</a></div>" . "\n";
2225 2225
   return $output;
@@ -2239,8 +2239,8 @@  discard block
 block discarded – undo
2239 2239
     'cpid' => $cpid
2240 2240
   );
2241 2241
   $args = array();
2242
-  foreach ($get as $arg => $value) $args[] = "{$arg}=" . rawurlencode($value);
2243
-  $query = '?' . implode('&', $args);
2242
+  foreach ($get as $arg => $value) $args[] = "{$arg}=".rawurlencode($value);
2243
+  $query = '?'.implode('&', $args);
2244 2244
 
2245 2245
   // Load XML from RPC
2246 2246
   $target_url = "http://{$stats_server}/{$stats_rpc}{$query}";
@@ -2312,12 +2312,12 @@  discard block
 block discarded – undo
2312 2312
     $output .= '<ul class="tab-list">';
2313 2313
     $count = 0;
2314 2314
     foreach ($links as $key => $link) {
2315
-      $output .= '<li class="' . (($count == 0) ? 'first primary ' : '') . 'tab">';
2315
+      $output .= '<li class="'.(($count == 0) ? 'first primary ' : '').'tab">';
2316 2316
       $output .= l($link['title'], $link['href'], array('query' => drupal_get_destination()));
2317 2317
       $output .= '</li>';
2318 2318
       $count++;
2319 2319
     }
2320
-    $output .= '<li class="' . (($count) ? '' : 'first ') . 'last tab">' . flag_create_link('abuse_user_meta', $account->uid) . '</li>';
2320
+    $output .= '<li class="'.(($count) ? '' : 'first ').'last tab">'.flag_create_link('abuse_user_meta', $account->uid).'</li>';
2321 2321
     $output .= '</ul>';
2322 2322
   }
2323 2323
   return $output;
@@ -2358,7 +2358,7 @@  discard block
 block discarded – undo
2358 2358
 function boincuser_apachesolr_index_documents_alter(array &$documents, $entity, $entity_type, $env_id) {
2359 2359
 
2360 2360
   foreach ($documents as $document) {
2361
-    if ( $document->entity_type=='node' AND $document->bundle=='profile' ) {
2361
+    if ($document->entity_type == 'node' AND $document->bundle == 'profile') {
2362 2362
       // Node information.
2363 2363
       $nid = $document->entity_id;
2364 2364
       $node = node_load($nid);
@@ -2408,11 +2408,11 @@  discard block
 block discarded – undo
2408 2408
   // privatemsg module. We need to convert them back to spaces for the
2409 2409
   // check below.
2410 2410
   $boincname = preg_replace("/\\xc2\\xa0/", " ", $boincname);
2411
-  if ($drupalid>0) {
2411
+  if ($drupalid > 0) {
2412 2412
     if ($recipient = user_load(array('uid' => $drupalid))) {
2413 2413
       // Double-check that the loaded user matches both boincuser_id
2414 2414
       // and boincuser_name.
2415
-      if ( ($boincid == $recipient->boincuser_id) AND ($boincname == $recipient->boincuser_name) ) {
2415
+      if (($boincid == $recipient->boincuser_id) AND ($boincname == $recipient->boincuser_name)) {
2416 2416
         return $recipient;
2417 2417
       }
2418 2418
     }
Please login to merge, or discard this patch.
html/user/forum_search.php 1 patch
Spacing   +10 added lines, -10 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,11 +76,11 @@  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"),
@@ -98,5 +98,5 @@  discard block
 block discarded – undo
98 98
 
99 99
 page_tail();
100 100
 
101
-$cvs_version_tracker[]="\$Id$";  //Generated automatically - do not edit
101
+$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit
102 102
 ?>
Please login to merge, or discard this patch.
html/inc/user.inc 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 // they've participated in
34 34
 //
35 35
 function get_other_projects($user) {
36
-    $cpid = md5($user->cross_project_id . $user->email_addr);
36
+    $cpid = md5($user->cross_project_id.$user->email_addr);
37 37
     $url = "http://boinc.netsoft-online.com/get_user.php?cpid=".$cpid;
38 38
 
39 39
     // Check the cache for that URL
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 
122 122
     usort($user->projects, "cmp");
123 123
     if ($personal) {
124
-        $t  = tra("Projects in which you are participating");
124
+        $t = tra("Projects in which you are participating");
125 125
     } else {
126 126
         $t = tra("Projects in which %1 is participating", $user->name);
127 127
     }
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
     }
181 181
 
182 182
     if (!NO_STATS) {
183
-        $cpid = md5($user->cross_project_id . $user->email_addr);
183
+        $cpid = md5($user->cross_project_id.$user->email_addr);
184 184
         $x = "";
185 185
         shuffle($cpid_stats_sites);
186 186
         foreach ($cpid_stats_sites as $site) {
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
         $u = normalize_user_url($user->url);
265 265
         row2(
266 266
             tra("URL"),
267
-            $u?sprintf('<a href="%s">%s</a>', $u, $u):tra('Invalid URL')
267
+            $u ?sprintf('<a href="%s">%s</a>', $u, $u) : tra('Invalid URL')
268 268
         );
269 269
     }
270 270
     if (USER_COUNTRY) {
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
 // if $badge_height is > 0, show badges
376 376
 // if $name_limit, limit name to N chars
377 377
 //
378
-function user_links($user, $badge_height=0, $name_limit=0) {
378
+function user_links($user, $badge_height = 0, $name_limit = 0) {
379 379
     if (!$user) {
380 380
         error_log("user_links(): null arg\n");
381 381
         return;
@@ -407,13 +407,13 @@  discard block
 block discarded – undo
407 407
         $user->id,
408 408
         $name
409 409
     );
410
-    if (function_exists("project_user_links")){
410
+    if (function_exists("project_user_links")) {
411 411
         $x .= project_user_links($user);
412 412
     }
413 413
     if ($badge_height) {
414 414
         $x .= badges_string(true, $user, $badge_height);
415 415
     }
416
-    return $name_limit?"<nobr>$x</nobr>":$x;
416
+    return $name_limit ? "<nobr>$x</nobr>" : $x;
417 417
 }
418 418
 
419 419
 function show_community_private($user) {
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
 
461 461
             // if there's a foundership request, notify the founder
462 462
             //
463
-            if ($user->id==$team->userid && $team->ping_user >0) {
463
+            if ($user->id == $team->userid && $team->ping_user > 0) {
464 464
                 $x .= "<p class=\"text-danger\">".tra("(foundership change request pending)")."</p>";
465 465
             }
466 466
             row2(tra("Member of team"), $x);
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
     $friends = BoincFriend::enum("user_src=$user->id and reciprocated=1");
485 485
     $x = [];
486 486
     if ($friends) {
487
-        foreach($friends as $friend) {
487
+        foreach ($friends as $friend) {
488 488
             $fuser = BoincUser::lookup_id($friend->user_dest);
489 489
             if (!$fuser) continue;
490 490
             $x[] = friend_links($fuser);
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
 
531 531
 // return an object with data to show the user's community links
532 532
 //
533
-function get_community_links_object($user){
533
+function get_community_links_object($user) {
534 534
     $cache_object = new StdClass;
535 535
     $cache_object->post_count = total_posts($user);
536 536
     $cache_object->user = $user;
@@ -538,7 +538,7 @@  discard block
 block discarded – undo
538 538
     $cache_object->friends = array();
539 539
 
540 540
     $friends = BoincFriend::enum("user_src=$user->id and reciprocated=1");
541
-    foreach($friends as $friend) {
541
+    foreach ($friends as $friend) {
542 542
         $fuser = BoincUser::lookup_id($friend->user_dest);
543 543
         if (!$fuser) continue;
544 544
         $cache_object->friends[] = $fuser;
@@ -548,7 +548,7 @@  discard block
 block discarded – undo
548 548
 
549 549
 // show community links of another user (described by $clo)
550 550
 //
551
-function community_links($clo, $logged_in_user){
551
+function community_links($clo, $logged_in_user) {
552 552
     $user = $clo->user;
553 553
     if (!$user) {
554 554
         error_log("community_links(): null user\n");
@@ -578,15 +578,15 @@  discard block
 block discarded – undo
578 578
                 "<a href=\"friend.php?action=cancel_confirm&userid=$user->id\">".tra("Cancel friendship")."</a>"
579 579
             );
580 580
         } else if ($friend) {
581
-            row2(tra("Friends"),  "<a href=\"friend.php?action=add&userid=$user->id\">".tra("Request pending")."</a>");
581
+            row2(tra("Friends"), "<a href=\"friend.php?action=add&userid=$user->id\">".tra("Request pending")."</a>");
582 582
         } else {
583
-            row2(tra("Friends"),  "<a href=\"friend.php?action=add&userid=$user->id\">".tra("Add as friend")."</a>");
583
+            row2(tra("Friends"), "<a href=\"friend.php?action=add&userid=$user->id\">".tra("Add as friend")."</a>");
584 584
         }
585 585
     }
586 586
 
587 587
     if ($friends) {
588 588
         $x = [];
589
-        foreach($friends as $friend) {
589
+        foreach ($friends as $friend) {
590 590
             $x[] = friend_links($friend);
591 591
         }
592 592
         row2(tra('Friends'), implode('<br>', $x));
@@ -653,6 +653,6 @@  discard block
 block discarded – undo
653 653
 }
654 654
 
655 655
 
656
-$cvs_version_tracker[]="\$Id$";  //Generated automatically - do not edit
656
+$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit
657 657
 
658 658
 ?>
Please login to merge, or discard this patch.
html/inc/host.inc 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -32,12 +32,12 @@  discard block
 block discarded – undo
32 32
 
33 33
 function sched_log_name($x) {
34 34
     if ($x == 0) return "NO_SUCH_LOG";
35
-    return gmdate('Y-m-d_H/Y-m-d_H:i', $x) . ".txt";
35
+    return gmdate('Y-m-d_H/Y-m-d_H:i', $x).".txt";
36 36
 }
37 37
 
38 38
 function sched_log_link($x) {
39 39
     if (file_exists("sched_logs")) {
40
-        return "<a href=\"../sched_logs/" . sched_log_name($x) . "\">" . time_str($x) . "</a>";
40
+        return "<a href=\"../sched_logs/".sched_log_name($x)."\">".time_str($x)."</a>";
41 41
     } else {
42 42
         return time_str($x);
43 43
     }
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 
46 46
 function location_form($host) {
47 47
     $none = "selected";
48
-    $h=$w=$s=$m="";
48
+    $h = $w = $s = $m = "";
49 49
     if ($host->venue == "home") $h = "selected";
50 50
     if ($host->venue == "work") $w = "selected";
51 51
     if ($host->venue == "school") $s = "selected";
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
             row2(tra("Product name"), $host->product_name);
100 100
         }
101 101
         $x = $host->timezone/3600;
102
-        if ($x >= 0) $x="+$x";
102
+        if ($x >= 0) $x = "+$x";
103 103
         row2(tra("Local Standard Time"), tra("UTC %1 hours", $x));
104 104
     } else {
105 105
         $owner = BoincUser::lookup_id($host->userid);
@@ -259,15 +259,15 @@  discard block
 block discarded – undo
259 259
 // "[vbox|5.0.0|1|1]", where now two additional flags give information about
260 260
 // hardware virtualization support. Older clients may have the old-style
261 261
 // serialnum in the DB despite the server being upgraded.
262
-function vbox_desc($x){
263
-    if (preg_match("/\[vbox\|(.*?)(\|([01])\|([01]))?\]/",$x,$matches)){
262
+function vbox_desc($x) {
263
+    if (preg_match("/\[vbox\|(.*?)(\|([01])\|([01]))?\]/", $x, $matches)) {
264 264
         $desc = "Virtualbox (".$matches[1].") ".tra("installed");
265
-        if (sizeof($matches)>2){
266
-            if ($matches[3]=="1" and $matches[4]=="1") {
265
+        if (sizeof($matches) > 2) {
266
+            if ($matches[3] == "1" and $matches[4] == "1") {
267 267
                 return $desc.tra(", CPU has hardware virtualization support and it is enabled");
268
-            } elseif ($matches[3]=="1" and $matches[4]=="0") {
268
+            } elseif ($matches[3] == "1" and $matches[4] == "0") {
269 269
                 return $desc.tra(", CPU has hardware virtualization support but it is disabled");
270
-            } elseif ($matches[3]=="0") {
270
+            } elseif ($matches[3] == "0") {
271 271
                 return $desc.tra(", CPU does not have hardware virtualization support");
272 272
             }
273 273
         } else {
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 // Given string of the form [BOINC|vers][type|model|count|RAM|driver-vers][vbox|vers],
282 282
 // return a human-readable version of the GPU info
283 283
 //
284
-function gpu_desc($x, $detail=true) {
284
+function gpu_desc($x, $detail = true) {
285 285
     $descs = explode("]", $x);
286 286
     array_pop($descs);
287 287
     $str = "";
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
         if ($d[0] == "vbox") continue;
294 294
         if (count($d) < 4) continue;
295 295
         if ($str) $str .= "<p>";
296
-        if ($d[2]!="" && $d[2]!="1") $str .= "[".$d[2]."] ";
296
+        if ($d[2] != "" && $d[2] != "1") $str .= "[".$d[2]."] ";
297 297
         if ($d[0] == "CUDA") {
298 298
             $str .= "NVIDIA";
299 299
         } else if ($d[0] == "CAL") {
@@ -500,14 +500,14 @@  discard block
 block discarded – undo
500 500
     if ($pos1 === false) return $x;
501 501
     $pos2 = strpos($model, ']');
502 502
     if ($pos2 === false) return $x;
503
-    $a = substr($model, $pos1+1, $pos2-$pos1-1);
503
+    $a = substr($model, $pos1 + 1, $pos2 - $pos1 - 1);
504 504
     $y = explode(" ", $a);
505 505
     if (count($y) == 0) return $x;
506 506
     if ($y[0] == "Family") {
507 507
         $x->info = $a;
508 508
     } else {
509 509
         $x->arch = $y[0];
510
-        $x->info = substr($a, strlen($y[0])+1);
510
+        $x->info = substr($a, strlen($y[0]) + 1);
511 511
     }
512 512
     return $x;
513 513
 }
@@ -596,7 +596,7 @@  discard block
 block discarded – undo
596 596
     $avg_time = 0;
597 597
 
598 598
     $results = BoincResult::enum("hostid=$hostid order by received_time");
599
-    foreach($results as $result) {
599
+    foreach ($results as $result) {
600 600
         if ($result->granted_credit <= 0) continue;
601 601
         $total += $result->granted_credit;
602 602
 
@@ -689,7 +689,7 @@  discard block
 block discarded – undo
689 689
 
690 690
 function link_url($sort, $rev, $show_all) {
691 691
     global $userid;
692
-    $x = $userid ? "&userid=$userid":"";
692
+    $x = $userid ? "&userid=$userid" : "";
693 693
     return "hosts_user.php?sort=$sort&rev=$rev&show_all=$show_all$x";
694 694
 }
695 695
 
@@ -763,7 +763,7 @@  discard block
 block discarded – undo
763 763
 }
764 764
 
765 765
 function show_user_hosts($userid, $private, $show_all, $sort, $rev) {
766
-    $desc = false;  // whether the sort order's default is decreasing
766
+    $desc = false; // whether the sort order's default is decreasing
767 767
     switch ($sort) {
768 768
     case "total_credit": $sort_clause = "total_credit"; $desc = true; break;
769 769
     case "expavg_credit": $sort_clause = "expavg_credit"; $desc = true; break;
@@ -786,7 +786,7 @@  discard block
 block discarded – undo
786 786
     more_or_less($sort, $rev, $show_all);
787 787
 
788 788
     $now = time();
789
-    $old_hosts=0;
789
+    $old_hosts = 0;
790 790
     $i = 1;
791 791
     $hosts = BoincHost::enum("userid=$userid order by $sort_clause");
792 792
     $any_product_name = false;
@@ -798,9 +798,9 @@  discard block
 block discarded – undo
798 798
     }
799 799
     user_host_table_start($private, $sort, $rev, $show_all, $any_product_name);
800 800
     foreach ($hosts as $host) {
801
-        $is_old=false;
801
+        $is_old = false;
802 802
         if (($now - $host->rpc_time) > 30*86400) {
803
-            $is_old=true;
803
+            $is_old = true;
804 804
             $old_hosts++;
805 805
         }
806 806
         if (!$show_all && $is_old) continue;
@@ -809,7 +809,7 @@  discard block
 block discarded – undo
809 809
     }
810 810
     end_table();
811 811
 
812
-    if ($old_hosts>0) {
812
+    if ($old_hosts > 0) {
813 813
         more_or_less($sort, $rev, $show_all);
814 814
     }
815 815
 
@@ -829,6 +829,6 @@  discard block
 block discarded – undo
829 829
     }
830 830
 }
831 831
 
832
-$cvs_version_tracker[]="\$Id$";  //Generated automatically - do not edit
832
+$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit
833 833
 
834 834
 ?>
Please login to merge, or discard this patch.