@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | define('UNIQUE_USER_NAME', true); |
51 | 51 | define("FORUM_QA_MERGED_MODE", true); |
52 | 52 | // Set to true to merge Message boards and Q&A section |
53 | -define ("DISABLE_PROFILES", true); |
|
53 | +define("DISABLE_PROFILES", true); |
|
54 | 54 | // enable profiles only after enabling reCAPTCHA |
55 | 55 | // https://github.com/BOINC/boinc/wiki/ProtectionFromSpam |
56 | 56 | define("USE_STOPFORUMSPAM", true); |
@@ -191,15 +191,15 @@ discard block |
||
191 | 191 | </ol>", PROJECT); |
192 | 192 | } |
193 | 193 | |
194 | -function project_workunit($wu){ |
|
194 | +function project_workunit($wu) { |
|
195 | 195 | // shown in the workunit page |
196 | 196 | } |
197 | 197 | |
198 | -function project_user_summary($user){ |
|
198 | +function project_user_summary($user) { |
|
199 | 199 | // shown in the user summary page |
200 | 200 | } |
201 | 201 | |
202 | -function project_user_page_private($user){ |
|
202 | +function project_user_page_private($user) { |
|
203 | 203 | // shown in the private account page |
204 | 204 | } |
205 | 205 | |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | array("name" => "Uppercase", "short_name" => "UC", "appids" => array(1, 25)), |
283 | 283 | ); |
284 | 284 | |
285 | -function project_user_credit($user){ |
|
285 | +function project_user_credit($user) { |
|
286 | 286 | global $sub_projects; |
287 | 287 | foreach ($sub_projects as $sp) { |
288 | 288 | show_app_credit_user($user, $sp["name"], $sp["appids"]); |
@@ -38,7 +38,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -32,8 +32,8 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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); |
@@ -189,7 +189,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | $db = BoincDb::get(); |
28 | 28 | return $db->lookup('category', 'BoincCategory', $clause); |
29 | 29 | } |
30 | - static function enum($clause=null) { |
|
30 | + static function enum($clause = null) { |
|
31 | 31 | $db = BoincDb::get(); |
32 | 32 | return $db->enum('category', 'BoincCategory', $clause); |
33 | 33 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | $db = BoincDb::get(); |
79 | 79 | return $db->update($this, 'thread', $clause); |
80 | 80 | } |
81 | - static function enum($clause="") { |
|
81 | + static function enum($clause = "") { |
|
82 | 82 | $db = BoincDb::get(); |
83 | 83 | return $db->enum('thread', 'BoincThread', $clause); |
84 | 84 | } |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | $db = BoincDb::get(); |
143 | 143 | $ret = $db->insert('forum_preferences', $clause); |
144 | 144 | } |
145 | - static function lookup(&$user, $nocache=false) { |
|
145 | + static function lookup(&$user, $nocache = false) { |
|
146 | 146 | if (!$user) return; |
147 | 147 | if (isset($user->prefs)) return; |
148 | 148 | if (!$nocache && isset(self::$cache[$user->id])) { |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | $user->prefs = $prefs; |
165 | 165 | } |
166 | 166 | function privilege($specialbit) { |
167 | - return (substr($this->special_user, $specialbit,1)==1); |
|
167 | + return (substr($this->special_user, $specialbit, 1) == 1); |
|
168 | 168 | } |
169 | 169 | function update($clause) { |
170 | 170 | $db = BoincDb::get(); |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | $db = BoincDb::get(); |
176 | 176 | return $db->delete_aux('forum_preferences', "userid=$this->userid"); |
177 | 177 | } |
178 | - static function enum($clause=null) { |
|
178 | + static function enum($clause = null) { |
|
179 | 179 | $db = BoincDb::get(); |
180 | 180 | return $db->enum('forum_preferences', 'BoincForumPrefs', $clause); |
181 | 181 | } |
@@ -215,8 +215,8 @@ discard block |
||
215 | 215 | // |
216 | 216 | $fl = BoincForumLogging::lookup(0, 0); |
217 | 217 | if ($fl) { |
218 | - if ($fl->timestamp<time()-MAX_FORUM_LOGGING_TIME){ |
|
219 | - BoincForumLogging::delete_aux("timestamp<'".(time()-MAX_FORUM_LOGGING_TIME)."' and userid != 0"); |
|
218 | + if ($fl->timestamp < time() - MAX_FORUM_LOGGING_TIME) { |
|
219 | + BoincForumLogging::delete_aux("timestamp<'".(time() - MAX_FORUM_LOGGING_TIME)."' and userid != 0"); |
|
220 | 220 | BoincForumLogging::replace(0, 0, time()); |
221 | 221 | } |
222 | 222 | } else { |
@@ -326,10 +326,10 @@ discard block |
||
326 | 326 | } |
327 | 327 | } |
328 | 328 | |
329 | -define ('NOTIFY_FRIEND_REQ', 1); |
|
330 | -define ('NOTIFY_FRIEND_ACCEPT', 2); |
|
331 | -define ('NOTIFY_PM', 3); |
|
332 | -define ('NOTIFY_SUBSCRIBED_THREAD', 4); |
|
333 | -define ('NOTIFY_SUBSCRIBED_FORUM', 5); |
|
329 | +define('NOTIFY_FRIEND_REQ', 1); |
|
330 | +define('NOTIFY_FRIEND_ACCEPT', 2); |
|
331 | +define('NOTIFY_PM', 3); |
|
332 | +define('NOTIFY_SUBSCRIBED_THREAD', 4); |
|
333 | +define('NOTIFY_SUBSCRIBED_FORUM', 5); |
|
334 | 334 | |
335 | 335 | ?> |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | // - project forums: everyone in POST_REPORT_EMAILS |
25 | 25 | // - team message board: team founder and admins |
26 | 26 | // |
27 | -function mail_report_list($forum, $subject, $body, $must_send=false) { |
|
27 | +function mail_report_list($forum, $subject, $body, $must_send = false) { |
|
28 | 28 | $success = true; |
29 | 29 | switch ($forum->parent_type) { |
30 | 30 | case 0: |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | function send_moderation_email($forum, $post, $thread, $explanation, $action) { |
66 | 66 | global $master_url; |
67 | 67 | |
68 | - $moderator=get_logged_in_user(); |
|
68 | + $moderator = get_logged_in_user(); |
|
69 | 69 | $body = ""; |
70 | 70 | $user = BoincUser::lookup_id($post->user); |
71 | 71 | |
@@ -126,11 +126,11 @@ discard block |
||
126 | 126 | // There's a new post in the thread, which the user is subscribed to. |
127 | 127 | // send them an email notifying them. |
128 | 128 | // |
129 | -function send_thread_notification_email($thread, $user){ |
|
130 | - $title = PROJECT . ": there is a new post in '". $thread->title ."'"; |
|
131 | - $link = secure_url_base() . "forum_thread.php?id=" . $thread->id; |
|
132 | - $body = "A " . PROJECT . " user has posted to the thread |
|
133 | -\"" . $thread->title . "\".\n" |
|
129 | +function send_thread_notification_email($thread, $user) { |
|
130 | + $title = PROJECT.": there is a new post in '".$thread->title."'"; |
|
131 | + $link = secure_url_base()."forum_thread.php?id=".$thread->id; |
|
132 | + $body = "A ".PROJECT." user has posted to the thread |
|
133 | +\"" . $thread->title."\".\n" |
|
134 | 134 | ."To view the updated thread, visit:\n$link |
135 | 135 | |
136 | 136 | -------------------------- |
@@ -144,11 +144,11 @@ discard block |
||
144 | 144 | // There's a new thread in the forum, which the user is subscribed to. |
145 | 145 | // send them an email notifying them. |
146 | 146 | // |
147 | -function send_forum_notification_email($forum, $user){ |
|
148 | - $title = PROJECT . ": there is a new thread in '". $forum->title ."'"; |
|
149 | - $link = secure_url_base() . "forum_forum.php?id=" . $forum->id; |
|
150 | - $body = "A " . PROJECT . " user has added a thread to the forum |
|
151 | -\"" . $thread->title . "\".\n" |
|
147 | +function send_forum_notification_email($forum, $user) { |
|
148 | + $title = PROJECT.": there is a new thread in '".$forum->title."'"; |
|
149 | + $link = secure_url_base()."forum_forum.php?id=".$forum->id; |
|
150 | + $body = "A ".PROJECT." user has added a thread to the forum |
|
151 | +\"" . $thread->title."\".\n" |
|
152 | 152 | ."To view the updated forum, visit:\n$link |
153 | 153 | |
154 | 154 | -------------------------- |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | |
162 | 162 | //////////////////// a user clicks the red "x" to report a post /////////// |
163 | 163 | // |
164 | -function send_report_post_email($user, $forum, $thread, $post, $message) { |
|
164 | +function send_report_post_email($user, $forum, $thread, $post, $message) { |
|
165 | 165 | global $master_url; |
166 | 166 | |
167 | 167 | $body = ""; |
@@ -219,16 +219,16 @@ discard block |
||
219 | 219 | // |
220 | 220 | function send_banish_vote_email($user, $duration, $reason, $end_time) { |
221 | 221 | global $master_url; |
222 | - $now=time(); |
|
222 | + $now = time(); |
|
223 | 223 | $subject = PROJECT." banishment vote underway"; |
224 | 224 | $vote_url = $master_url."forum_banishment_vote.php"; |
225 | 225 | $body = " |
226 | 226 | A vote has been started to banish you |
227 | 227 | from the ".PROJECT." message boards until ".date('M j, |
228 | -Y G:i', $duration+$now).", |
|
228 | +Y G:i', $duration + $now).", |
|
229 | 229 | because your postings have not followed our guidelines. |
230 | 230 | |
231 | -This vote will last until ".date('M j, Y G:i',$end_time)." or until a majority |
|
231 | +This vote will last until ".date('M j, Y G:i', $end_time)." or until a majority |
|
232 | 232 | decision has been reached. If the vote does not result in banishment, you will be |
233 | 233 | able to resume posting at that time. |
234 | 234 | "; |
@@ -28,7 +28,7 @@ |
||
28 | 28 | die("Delete this line first\n"); |
29 | 29 | |
30 | 30 | if (is_numeric($argv[1])) { |
31 | - $user = BoincUser::lookup_id((int) $argv[1]); |
|
31 | + $user = BoincUser::lookup_id((int)$argv[1]); |
|
32 | 32 | if (!$user) die("no such user\n"); |
33 | 33 | $retval = delete_account($user); |
34 | 34 | if ($retval) { |
@@ -44,8 +44,8 @@ discard block |
||
44 | 44 | // close() closes the connection. |
45 | 45 | |
46 | 46 | class BoincDb { |
47 | - static $instance; // a DbConn object, or null |
|
48 | - static $dbnum; // which replica we're connected to |
|
47 | + static $instance; // a DbConn object, or null |
|
48 | + static $dbnum; // which replica we're connected to |
|
49 | 49 | |
50 | 50 | // connect to DB $dbnum (0, 1, ...) |
51 | 51 | // If the requested DB doesn't exist or connection fails, connect to DB 0. |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | self::$instance = null; |
57 | 57 | $config = get_config(); |
58 | 58 | if ($dbnum) { |
59 | - $r = $dbnum==1?'':strval($dbnum); |
|
59 | + $r = $dbnum == 1 ? '' : strval($dbnum); |
|
60 | 60 | $host = parse_config($config, sprintf('<replica%s_db_host>', $r)); |
61 | 61 | $name = parse_config($config, sprintf('<replica%s_db_name>', $r)); |
62 | 62 | $user = parse_config($config, sprintf('<replica%s_db_user>', $r)); |
@@ -201,11 +201,11 @@ discard block |
||
201 | 201 | $db = BoincDb::get(); |
202 | 202 | return $db->update($this, 'user', $clause); |
203 | 203 | } |
204 | - static function enum($where_clause, $order_clause=null) { |
|
204 | + static function enum($where_clause, $order_clause = null) { |
|
205 | 205 | $db = BoincDb::get(); |
206 | 206 | return $db->enum('user', 'BoincUser', $where_clause, $order_clause); |
207 | 207 | } |
208 | - static function enum_fields($fields, $where_clause, $order_clause=null) { |
|
208 | + static function enum_fields($fields, $where_clause, $order_clause = null) { |
|
209 | 209 | $db = BoincDb::get(); |
210 | 210 | return $db->enum_fields( |
211 | 211 | 'user', 'BoincUser', $fields, $where_clause, $order_clause |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | $db = BoincDb::get(); |
256 | 256 | return $db->update($this, 'team', $clause); |
257 | 257 | } |
258 | - static function enum($where_clause, $order_clause=null) { |
|
258 | + static function enum($where_clause, $order_clause = null) { |
|
259 | 259 | $db = BoincDb::get(); |
260 | 260 | return $db->enum('team', 'BoincTeam', $where_clause, $order_clause); |
261 | 261 | } |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | $db = BoincDb::get(); |
281 | 281 | return $db->max('team', $field); |
282 | 282 | } |
283 | - static function enum_fields($fields, $where_clause, $order_clause=null) { |
|
283 | + static function enum_fields($fields, $where_clause, $order_clause = null) { |
|
284 | 284 | $db = BoincDb::get(); |
285 | 285 | return $db->enum_fields( |
286 | 286 | 'team', 'BoincTeam', $fields, $where_clause, $order_clause |
@@ -318,11 +318,11 @@ discard block |
||
318 | 318 | $db = BoincDb::get(); |
319 | 319 | return $db->delete($this, 'host'); |
320 | 320 | } |
321 | - static function enum($where_clause, $order_clause=null) { |
|
321 | + static function enum($where_clause, $order_clause = null) { |
|
322 | 322 | $db = BoincDb::get(); |
323 | 323 | return $db->enum('host', 'BoincHost', $where_clause, $order_clause); |
324 | 324 | } |
325 | - static function enum_fields($fields, $where_clause, $order_clause=null) { |
|
325 | + static function enum_fields($fields, $where_clause, $order_clause = null) { |
|
326 | 326 | $db = BoincDb::get(); |
327 | 327 | return $db->enum_fields( |
328 | 328 | 'host', 'BoincHost', $fields, $where_clause, $order_clause |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | $db = BoincDb::get(); |
445 | 445 | return $db->update($this, 'app', $clause); |
446 | 446 | } |
447 | - static function sum($field, $clause=null) { |
|
447 | + static function sum($field, $clause = null) { |
|
448 | 448 | $db = BoincDb::get(); |
449 | 449 | return $db->sum('app', $field, $clause); |
450 | 450 | } |
@@ -502,11 +502,11 @@ discard block |
||
502 | 502 | $db = BoincDb::get(); |
503 | 503 | return $db->insert('profile', $clause); |
504 | 504 | } |
505 | - static function enum($where_clause=null, $order_clause=null) { |
|
505 | + static function enum($where_clause = null, $order_clause = null) { |
|
506 | 506 | $db = BoincDb::get(); |
507 | 507 | return $db->enum('profile', 'BoincProfile', $where_clause, $order_clause); |
508 | 508 | } |
509 | - static function enum_fields($fields, $where_clause=null, $order_clause=null) { |
|
509 | + static function enum_fields($fields, $where_clause = null, $order_clause = null) { |
|
510 | 510 | $db = BoincDb::get(); |
511 | 511 | return $db->enum_fields('profile', 'BoincProfile', $fields, $where_clause, $order_clause); |
512 | 512 | } |
@@ -901,12 +901,12 @@ discard block |
||
901 | 901 | return $db->enum('consent', 'BoincConsent', $where_clause); |
902 | 902 | } |
903 | 903 | |
904 | - static function insert ($clause) { |
|
904 | + static function insert($clause) { |
|
905 | 905 | $db = BoincDb::get(); |
906 | 906 | return $db->insert('consent', $clause); |
907 | 907 | } |
908 | 908 | |
909 | - static function update ($clause) { |
|
909 | + static function update($clause) { |
|
910 | 910 | $db = BoincDb::get(); |
911 | 911 | return $db->update_aux('consent', $clause); |
912 | 912 | } |
@@ -931,17 +931,17 @@ discard block |
||
931 | 931 | return $db->lookup('consent_type', 'BoincConsentType', $clause); |
932 | 932 | } |
933 | 933 | |
934 | - static function enum($where_clause, $order_clause=null) { |
|
934 | + static function enum($where_clause, $order_clause = null) { |
|
935 | 935 | $db = BoincDb::get(); |
936 | 936 | return $db->enum('consent_type', 'BoincConsentType', $where_clause, $order_clause); |
937 | 937 | } |
938 | 938 | |
939 | - static function insert ($clause) { |
|
939 | + static function insert($clause) { |
|
940 | 940 | $db = BoincDb::get(); |
941 | 941 | return $db->insert('consent_type', $clause); |
942 | 942 | } |
943 | 943 | |
944 | - static function update ($clause) { |
|
944 | + static function update($clause) { |
|
945 | 945 | $db = BoincDb::get(); |
946 | 946 | return $db->update_aux('consent_type', $clause); |
947 | 947 | } |
@@ -967,7 +967,7 @@ discard block |
||
967 | 967 | return $db->lookup('latest_consent', 'BoincLatestConsent', $clause); |
968 | 968 | } |
969 | 969 | |
970 | - static function enum($where_clause, $order_clause=null) { |
|
970 | + static function enum($where_clause, $order_clause = null) { |
|
971 | 971 | $db = BoincDb::get(); |
972 | 972 | return $db->enum('latest_consent', 'BoincLatestConsent', $where_clause, $order_clause); |
973 | 973 | } |
@@ -978,7 +978,7 @@ discard block |
||
978 | 978 | // apply this to any user-supplied strings used in queries |
979 | 979 | // |
980 | 980 | function boinc_real_escape_string($x) { |
981 | - if (version_compare(phpversion(),"4.3.0")>=0) { |
|
981 | + if (version_compare(phpversion(), "4.3.0") >= 0) { |
|
982 | 982 | return BoincDb::escape_string($x); |
983 | 983 | } else { |
984 | 984 | $x = str_replace("'", "\'", $x); |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | $avg = round($app->info->avg, 2); |
181 | 181 | $min = round($app->info->min, 2); |
182 | 182 | $max = round($app->info->max, 2); |
183 | - $x = $max?"$avg ($min - $max)":"---"; |
|
183 | + $x = $max ? "$avg ($min - $max)" : "---"; |
|
184 | 184 | $u = $app->info->users; |
185 | 185 | } else { |
186 | 186 | $x = '---'; |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | $cmd = trim($cmd); |
276 | 276 | $x = explode(" ", $cmd); |
277 | 277 | $prog = $x[0]; |
278 | - $pidname = $prog . '.pid'; |
|
278 | + $pidname = $prog.'.pid'; |
|
279 | 279 | } |
280 | 280 | $path = "../../pid_$host/$pidname"; |
281 | 281 | if (is_file($path)) { |
@@ -316,12 +316,12 @@ discard block |
||
316 | 316 | } |
317 | 317 | $master_host = $u["host"]; |
318 | 318 | if ($config->www_host) { |
319 | - $web_host = trim((string) $config->www_host); |
|
319 | + $web_host = trim((string)$config->www_host); |
|
320 | 320 | } else { |
321 | 321 | $web_host = $main_host; |
322 | 322 | } |
323 | 323 | if ($config->sched_host) { |
324 | - $sched_host = trim((string) $config->sched_host); |
|
324 | + $sched_host = trim((string)$config->sched_host); |
|
325 | 325 | } else { |
326 | 326 | $sched_host = $main_host; |
327 | 327 | } |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | |
332 | 332 | // the upload and download servers are sort of daemons too |
333 | 333 | // |
334 | - $url = trim((string) $config->download_url); |
|
334 | + $url = trim((string)$config->download_url); |
|
335 | 335 | $u = parse_url($url); |
336 | 336 | $h = $u["host"]; |
337 | 337 | if ($h == $master_host) { |
@@ -343,14 +343,14 @@ discard block |
||
343 | 343 | } else { |
344 | 344 | $have_remote = true; |
345 | 345 | } |
346 | - $url = trim((string) $config->upload_url); |
|
346 | + $url = trim((string)$config->upload_url); |
|
347 | 347 | $u = parse_url($url); |
348 | 348 | $h = $u["host"]; |
349 | 349 | if ($h == $master_host) { |
350 | 350 | $y = new StdClass; |
351 | 351 | $y->cmd = "Upload server"; |
352 | 352 | $y->host = $h; |
353 | - $y->status = !file_exists("../../stop_upload");; |
|
353 | + $y->status = !file_exists("../../stop_upload"); ; |
|
354 | 354 | $local_daemons[] = $y; |
355 | 355 | } else { |
356 | 356 | $have_remote = true; |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | $y = new StdClass; |
362 | 362 | $y->cmd = "Scheduler"; |
363 | 363 | $y->host = $sched_host; |
364 | - $y->status = !file_exists("../../stop_sched");; |
|
364 | + $y->status = !file_exists("../../stop_sched"); ; |
|
365 | 365 | $local_daemons[] = $y; |
366 | 366 | |
367 | 367 | foreach ($daemons->daemon as $d) { |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | $disabled_daemons[] = $x; |
375 | 375 | continue; |
376 | 376 | } |
377 | - $host = $d->host?(string)$d->host:$main_host; |
|
377 | + $host = $d->host ? (string)$d->host : $main_host; |
|
378 | 378 | if ($host != $web_host) { |
379 | 379 | $have_remote = true; |
380 | 380 | continue; |