@@ -23,15 +23,15 @@ |
||
23 | 23 | admin_page_head("Account Ownership Keys"); |
24 | 24 | |
25 | 25 | if (!file_exists($account_ownership_private_key_file_path)) { |
26 | - echo "<p>The account ownership private key '" . $account_ownership_private_key_file_name . "' <b>doesn't</b> exist. Please run the 'generate_account_ownership_keys.php' script from the command line in the BOINC web server ops directory.</p>"; |
|
26 | + echo "<p>The account ownership private key '".$account_ownership_private_key_file_name."' <b>doesn't</b> exist. Please run the 'generate_account_ownership_keys.php' script from the command line in the BOINC web server ops directory.</p>"; |
|
27 | 27 | } else { |
28 | - echo "<p>The account ownership private key '" . $account_ownership_private_key_file_name . "' exists.</p>"; |
|
28 | + echo "<p>The account ownership private key '".$account_ownership_private_key_file_name."' exists.</p>"; |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | if (!file_exists($account_ownership_public_key_file_path)) { |
32 | - echo "<p>The account ownership public key '" . $account_ownership_public_key_file_name . "' <b>doesn't</b> exist. Please run the 'generate_account_ownership_keys.php' script from the command line in the BOINC web server ops directory.</p>"; |
|
32 | + echo "<p>The account ownership public key '".$account_ownership_public_key_file_name."' <b>doesn't</b> exist. Please run the 'generate_account_ownership_keys.php' script from the command line in the BOINC web server ops directory.</p>"; |
|
33 | 33 | } else { |
34 | - echo "<p>The account ownership public key '" . $account_ownership_public_key_file_name . "' exists.</p>"; |
|
34 | + echo "<p>The account ownership public key '".$account_ownership_public_key_file_name."' exists.</p>"; |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | echo "<p>For more info see the related wiki page: <a href=\"https://boinc.berkeley.edu/trac/wiki/ProofOfOwnership\">ProofOfOwnership</a></p>"; |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | require_once("../inc/boinc_db.inc"); |
22 | 22 | require_once("../inc/util.inc"); |
23 | 23 | |
24 | -define('CONSENT_TYPE_ENROLL','ENROLL'); |
|
24 | +define('CONSENT_TYPE_ENROLL', 'ENROLL'); |
|
25 | 25 | |
26 | 26 | // Utility function to check the terms of use. |
27 | 27 | function check_termsofuse() { |
@@ -30,13 +30,13 @@ discard block |
||
30 | 30 | |
31 | 31 | function consent_to_a_policy($user, $consent_type_id, $consent_flag, $consent_not_required, $source, $ctime = 0) { |
32 | 32 | $mys = BoincDb::escape_string($source); |
33 | - if ($ctime==0) { |
|
33 | + if ($ctime == 0) { |
|
34 | 34 | $mytime = $user->create_time; |
35 | 35 | } else { |
36 | 36 | $mytime = $ctime; |
37 | 37 | } |
38 | 38 | return BoincConsent::insert( |
39 | - "(userid, consent_type_id, consent_time, consent_flag, consent_not_required, source) " . |
|
39 | + "(userid, consent_type_id, consent_time, consent_flag, consent_not_required, source) ". |
|
40 | 40 | "values($user->id, $consent_type_id, $mytime, $consent_flag, $consent_not_required, '$mys')" |
41 | 41 | ); |
42 | 42 | |
@@ -60,9 +60,9 @@ discard block |
||
60 | 60 | // if checkenabled=TRUE, if the consent_type is enabled/available for |
61 | 61 | // use. The integer is the consent_type_id- the id from consent_type |
62 | 62 | // table. If the boolean is FALSE, the integer returned is -1. |
63 | -function check_consent_type($name, $checkenabled=TRUE) { |
|
63 | +function check_consent_type($name, $checkenabled = TRUE) { |
|
64 | 64 | $ct = BoincConsentType::lookup("shortname = '{$name}'"); |
65 | - if ($ct and ( !$checkenabled or ($ct->enabled)) ) { |
|
65 | + if ($ct and (!$checkenabled or ($ct->enabled))) { |
|
66 | 66 | return array(TRUE, $ct->id); |
67 | 67 | } |
68 | 68 | return array(FALSE, -1); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | function intercept_login($user, $perm, $in_next_url = "") { |
75 | 75 | list($checkct, $ctid) = check_consent_type(CONSENT_TYPE_ENROLL); |
76 | 76 | $config = get_config(); |
77 | - if ( parse_bool($config, "enable_login_mustagree_termsofuse") and $checkct and check_termsofuse() and (!check_user_consent($user, CONSENT_TYPE_ENROLL))) { |
|
77 | + if (parse_bool($config, "enable_login_mustagree_termsofuse") and $checkct and check_termsofuse() and (!check_user_consent($user, CONSENT_TYPE_ENROLL))) { |
|
78 | 78 | // sent user to terms-of-use Web form after login |
79 | 79 | $mytoken = create_token($user->id, TOKEN_TYPE_LOGIN_INTERCEPT, TOKEN_DURATION_TWO_HOURS); |
80 | 80 | send_cookie('logintoken', $mytoken, false); |
@@ -412,9 +412,9 @@ discard block |
||
412 | 412 | "Canonical instance<br><small>click to see result page on BOINC server</smallp>", |
413 | 413 | "Download Results" |
414 | 414 | ); |
415 | - foreach($wus as $wu) { |
|
415 | + foreach ($wus as $wu) { |
|
416 | 416 | $resultid = $wu->canonical_resultid; |
417 | - $durl = boinc_get_wu_output_files_url($user,$wu->id); |
|
417 | + $durl = boinc_get_wu_output_files_url($user, $wu->id); |
|
418 | 418 | if ($resultid) { |
419 | 419 | $x = "<a href=result.php?resultid=$resultid>$resultid</a>"; |
420 | 420 | $y = '<font color="green">completed</font>'; |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | $text = "---"; |
425 | 425 | if ($batch->state == BATCH_STATE_COMPLETE) { |
426 | 426 | $y = '<font color="red">failed</font>'; |
427 | - } else { |
|
427 | + } else { |
|
428 | 428 | $y = "in progress"; |
429 | 429 | } |
430 | 430 | } |
@@ -489,7 +489,7 @@ discard block |
||
489 | 489 | $results = BoincResult::enum("workunitid=$wuid"); |
490 | 490 | $upload_dir = parse_config(get_config(), "<upload_dir>"); |
491 | 491 | $fanout = parse_config(get_config(), "<uldl_dir_fanout>"); |
492 | - foreach($results as $result) { |
|
492 | + foreach ($results as $result) { |
|
493 | 493 | echo "<tr> |
494 | 494 | <td><a href=result.php?resultid=$result->id>$result->id · $result->name </a></td> |
495 | 495 | <td>".state_string($result)."</td> |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | require_once("../inc/util.inc"); |
34 | 34 | require_once("../inc/account_ownership.inc"); |
35 | 35 | |
36 | -if ( !function_exists('openssl_pkey_new') ) { |
|
36 | +if (!function_exists('openssl_pkey_new')) { |
|
37 | 37 | echo "WARNING: OpenSSL functions not available. Not generating account ownership keys.\n"; |
38 | 38 | exit(1); |
39 | 39 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | throw new Exception('Failed to generate account ownership keypair.'); |
74 | 74 | } |
75 | 75 | } catch (Exception $e) { |
76 | - echo 'Caught exception during account ownership key generation: ', $e->getMessage(), "\n"; |
|
76 | + echo 'Caught exception during account ownership key generation: ', $e->getMessage(), "\n"; |
|
77 | 77 | } |
78 | 78 | } else { |
79 | 79 | echo "The private and public keys already exist. Repeat the command with the 'overwrite' parameter to replace the existing ownership keys. \n"; |
@@ -42,27 +42,27 @@ discard block |
||
42 | 42 | // @return String A user readable DateTime-String in UTC |
43 | 43 | // @param Integer $x The mysql-Timestamp to convert |
44 | 44 | function mysqltime_str($x) { |
45 | - if(strpos($x,"-")==4) { |
|
45 | + if (strpos($x, "-") == 4) { |
|
46 | 46 | // Syntax of supplied mysql-timestamp is YYYY-MM-DD HH:MM:SS |
47 | - $year = substr($x,0,4); |
|
48 | - $month = substr($x,5,2); |
|
49 | - $day = substr($x,8,2); |
|
50 | - $hour = substr($x,11,2); |
|
51 | - $minute = substr($x,14,2); |
|
52 | - $second = substr($x,17,2); |
|
47 | + $year = substr($x, 0, 4); |
|
48 | + $month = substr($x, 5, 2); |
|
49 | + $day = substr($x, 8, 2); |
|
50 | + $hour = substr($x, 11, 2); |
|
51 | + $minute = substr($x, 14, 2); |
|
52 | + $second = substr($x, 17, 2); |
|
53 | 53 | } else { |
54 | 54 | // Syntax of supplied mysql-timestamp is YYYYMMDDHHMMSS |
55 | - $year = substr($x,0,4); |
|
56 | - $month = substr($x,4,2); |
|
57 | - $day = substr($x,6,2); |
|
58 | - $hour = substr($x,8,2); |
|
59 | - $minute = substr($x,10,2); |
|
60 | - $second = substr($x,12,2); |
|
55 | + $year = substr($x, 0, 4); |
|
56 | + $month = substr($x, 4, 2); |
|
57 | + $day = substr($x, 6, 2); |
|
58 | + $hour = substr($x, 8, 2); |
|
59 | + $minute = substr($x, 10, 2); |
|
60 | + $second = substr($x, 12, 2); |
|
61 | 61 | |
62 | 62 | } |
63 | 63 | //make a Unix-Timestamp |
64 | 64 | // echo "Time string is " . "$x"; |
65 | - $time = mktime($hour,$minute,$second,$month,$day,$year); |
|
65 | + $time = mktime($hour, $minute, $second, $month, $day, $year); |
|
66 | 66 | return time_str($time); |
67 | 67 | } |
68 | 68 | |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | $constants = get_defined_constants(true); |
101 | 101 | foreach ($constants['mysqli'] as $c => $n) if (preg_match('/^MYSQLI_TYPE_(.*)/', $c, $m)) $types[$n] = $m[1]; |
102 | 102 | } |
103 | - return array_key_exists($type_id, $types)? strtolower($types[$type_id]) : "unknown"; |
|
103 | + return array_key_exists($type_id, $types) ? strtolower($types[$type_id]) : "unknown"; |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | // Function prints a description of $table |
@@ -110,38 +110,38 @@ discard block |
||
110 | 110 | $result = $db->do_query("SELECT * from $table LIMIT 1"); |
111 | 111 | $fields = $result->field_count; |
112 | 112 | |
113 | - $avgnum=(int)($fields/$columns); |
|
114 | - if ($avgnum*$columns<$fields) { |
|
113 | + $avgnum = (int)($fields/$columns); |
|
114 | + if ($avgnum*$columns < $fields) { |
|
115 | 115 | $avgnum++; |
116 | 116 | } |
117 | 117 | |
118 | - $actualcolumns=0; |
|
119 | - while ($avgnum*$actualcolumns<$fields) { |
|
118 | + $actualcolumns = 0; |
|
119 | + while ($avgnum*$actualcolumns < $fields) { |
|
120 | 120 | $actualcolumns++; |
121 | 121 | } |
122 | 122 | |
123 | - if ($which>$actualcolumns) { |
|
123 | + if ($which > $actualcolumns) { |
|
124 | 124 | return 0; |
125 | 125 | } |
126 | 126 | |
127 | - $bot=($which-1)*$avgnum; |
|
128 | - $top=$which*$avgnum; |
|
127 | + $bot = ($which - 1)*$avgnum; |
|
128 | + $top = $which*$avgnum; |
|
129 | 129 | |
130 | - $width=100.0/$actualcolumns; |
|
130 | + $width = 100.0/$actualcolumns; |
|
131 | 131 | |
132 | 132 | echo "<td>"; |
133 | 133 | start_table('table-striped'); |
134 | 134 | echo "<tr><th align=\"left\">NAME</th><th align=\"left\">Type</th><th align=\"left\">Bytes</th>\n"; |
135 | - for ($count=$bot; $count<$top; $count++) { |
|
136 | - if ($count<$fields) { |
|
135 | + for ($count = $bot; $count < $top; $count++) { |
|
136 | + if ($count < $fields) { |
|
137 | 137 | $x = $result->fetch_field_direct($count); |
138 | 138 | $name = $x->name; |
139 | 139 | $type = mysql_fieldtype_str($x->type); |
140 | 140 | $length = $x->length; |
141 | 141 | } else { |
142 | - $name="<br/> "; |
|
143 | - $type="<br/>"; |
|
144 | - $length="<br/>"; |
|
142 | + $name = "<br/> "; |
|
143 | + $type = "<br/>"; |
|
144 | + $length = "<br/>"; |
|
145 | 145 | } |
146 | 146 | echo "\t<tr><td><b>$name</b></td><td>$type</td><td>$length</td></tr>\n"; |
147 | 147 | } |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | echo "<h2>Description of <b>$table</b> table fields:</h2>\n"; |
157 | 157 | start_table(); |
158 | 158 | echo "<tr>"; |
159 | - for ($i=1; $i<=$how_many_columns; $i++) { |
|
159 | + for ($i = 1; $i <= $how_many_columns; $i++) { |
|
160 | 160 | print_describe_table_onecol($table, $i, $how_many_columns); |
161 | 161 | } |
162 | 162 | echo "</tr>"; |
@@ -175,10 +175,10 @@ discard block |
||
175 | 175 | } |
176 | 176 | |
177 | 177 | function print_query_field() { |
178 | - $currenttime=time(); |
|
179 | - $hourago=$currenttime-3600; |
|
180 | - $dayago=$currenttime-24*3600; |
|
181 | - $weekago=$currenttime-7*24*3600; |
|
178 | + $currenttime = time(); |
|
179 | + $hourago = $currenttime - 3600; |
|
180 | + $dayago = $currenttime - 24*3600; |
|
181 | + $weekago = $currenttime - 7*24*3600; |
|
182 | 182 | echo " |
183 | 183 | <tr> |
184 | 184 | <td align=\"right\">Additional clauses</td> |
@@ -202,11 +202,11 @@ discard block |
||
202 | 202 | } |
203 | 203 | } |
204 | 204 | |
205 | -function append_sql_query($original,$addition,$first) { |
|
205 | +function append_sql_query($original, $addition, $first) { |
|
206 | 206 | if ($first == 1) { |
207 | - return $original . " where " . $addition; |
|
207 | + return $original." where ".$addition; |
|
208 | 208 | } else { |
209 | - return $original . " and " . $addition; |
|
209 | + return $original." and ".$addition; |
|
210 | 210 | } |
211 | 211 | } |
212 | 212 | |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | if (isset($_GET[$name])) { |
308 | 308 | $value = $_GET[$name]; |
309 | 309 | } else { |
310 | - $value=null; |
|
310 | + $value = null; |
|
311 | 311 | } |
312 | 312 | if (isset($_GET[$order])) { |
313 | 313 | $order = $_GET[$order]; |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | } |
349 | 349 | |
350 | 350 | function get_url($base = "db_action.php") { |
351 | - $s = $base . "?table=$this->table$this->urlquery"; |
|
351 | + $s = $base."?table=$this->table$this->urlquery"; |
|
352 | 352 | return $s; |
353 | 353 | } |
354 | 354 | |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | $this->addeq('app_version_id'); |
364 | 364 | $this->addeq('exit_status'); |
365 | 365 | if (isset($_GET['nsecs'])) { |
366 | - $_GET['mod_time'] = date("YmdHis",time() - $_GET['nsecs']); |
|
366 | + $_GET['mod_time'] = date("YmdHis", time() - $_GET['nsecs']); |
|
367 | 367 | } |
368 | 368 | $this->addgt('mod_time'); |
369 | 369 | $this->addeq_not_CHOOSE_ALL('server_state'); |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | if ($n == '0') { // intentional compare by string |
385 | 385 | return "0"; |
386 | 386 | } else { |
387 | - if(strlen($clauses)) { |
|
387 | + if (strlen($clauses)) { |
|
388 | 388 | return "<a href=\"db_action.php?table=result&query=$mq&$query&clauses=".urlencode($clauses)."&sort_by=mod_time&detail=low\">$n</a>"; |
389 | 389 | } |
390 | 390 | else { |
@@ -397,13 +397,13 @@ discard block |
||
397 | 397 | // Determines if in stderr_out is an error reported and prints as human readable String |
398 | 398 | // @return String A human readable string if error otherwise FALSE |
399 | 399 | // @param String $stderr_out the stderr_out value to parse |
400 | -function stderr_error_string($stderr_out){ |
|
400 | +function stderr_error_string($stderr_out) { |
|
401 | 401 | $y = parse_element($stderr_out, "<error_code>"); |
402 | 402 | $x = 0; |
403 | 403 | if ($y) { |
404 | 404 | $x = (int)$y; |
405 | 405 | } |
406 | - if (0<=$x && $x<=9) { |
|
406 | + if (0 <= $x && $x <= 9) { |
|
407 | 407 | return FALSE; |
408 | 408 | } else { |
409 | 409 | return "$x ".error_code_str($x); |
@@ -411,8 +411,8 @@ discard block |
||
411 | 411 | } |
412 | 412 | |
413 | 413 | function admin_show_result_summary() { |
414 | - $ntotal =0; // TODO: how to count $result? |
|
415 | - $nvalid = 0; // for SUCCESS results |
|
414 | + $ntotal = 0; // TODO: how to count $result? |
|
415 | + $nvalid = 0; // for SUCCESS results |
|
416 | 416 | $ninvalid = 0; |
417 | 417 | $nfile_deleted = 0; |
418 | 418 | |
@@ -420,20 +420,20 @@ discard block |
||
420 | 420 | $outcome = array(); |
421 | 421 | $client_state = array(); |
422 | 422 | |
423 | - for ($ss=1; $ss<6; $ss++) { |
|
423 | + for ($ss = 1; $ss < 6; $ss++) { |
|
424 | 424 | $server_state[$ss] = 0; |
425 | 425 | } |
426 | - for ($ro=0; $ro<8; $ro++) { |
|
426 | + for ($ro = 0; $ro < 8; $ro++) { |
|
427 | 427 | $outcome[$ro] = 0; |
428 | 428 | } |
429 | - for ($cs=1; $cs<7; $cs++) { |
|
429 | + for ($cs = 1; $cs < 7; $cs++) { |
|
430 | 430 | $client_state[$cs] = 0; |
431 | 431 | } |
432 | - for ($fds=0; $fds<4; $fds++) { |
|
432 | + for ($fds = 0; $fds < 4; $fds++) { |
|
433 | 433 | $delete_state[$fds] = 0; |
434 | 434 | } |
435 | - for ($vs=0; $vs<NVALIDATE_STATES; $vs++) { |
|
436 | - $validate_state[$vs]=0; |
|
435 | + for ($vs = 0; $vs < NVALIDATE_STATES; $vs++) { |
|
436 | + $validate_state[$vs] = 0; |
|
437 | 437 | } |
438 | 438 | |
439 | 439 | $_GET['table'] = 'result'; |
@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | // |
509 | 509 | $delay = parse_config(get_config(), "<delete_delay_hours>"); |
510 | 510 | if ($delay) { |
511 | - $start2 = $start - $delay*3600;; |
|
511 | + $start2 = $start - $delay*3600; ; |
|
512 | 512 | $main_query .= " and ((file_delete_state>1 and mod_time>FROM_UNIXTIME($start2)) or (mod_time>FROM_UNIXTIME($start)))"; |
513 | 513 | } else { |
514 | 514 | $main_query .= " and mod_time > FROM_UNIXTIME($start)"; |
@@ -567,20 +567,20 @@ discard block |
||
567 | 567 | |
568 | 568 | start_table(); |
569 | 569 | echo "<tr valign=\"top\">"; |
570 | - echo "<td><h2>" . link_results("$ntotal results", $urlquery, '', '') . "</h2></td>"; |
|
571 | - echo "<td><h2>" . link_results("'Over' results", $urlquery, "server_state=5", '') . "</h2></td>"; |
|
572 | - echo "<td><h2>" . link_results("'Success' results", $urlquery, "outcome=1", '') . "</h2></td>"; |
|
573 | - echo "<td><h2>" . link_results("'Client error' results", $urlquery, "outcome=3", '') . "</h2></td>"; |
|
570 | + echo "<td><h2>".link_results("$ntotal results", $urlquery, '', '')."</h2></td>"; |
|
571 | + echo "<td><h2>".link_results("'Over' results", $urlquery, "server_state=5", '')."</h2></td>"; |
|
572 | + echo "<td><h2>".link_results("'Success' results", $urlquery, "outcome=1", '')."</h2></td>"; |
|
573 | + echo "<td><h2>".link_results("'Client error' results", $urlquery, "outcome=3", '')."</h2></td>"; |
|
574 | 574 | echo "</tr>"; |
575 | 575 | echo "<tr valign=\"top\">"; |
576 | 576 | echo "<td>"; |
577 | 577 | start_table('table-striped'); |
578 | 578 | echo "<tr><th>Server state</th><th># results</th></tr>\n"; |
579 | - for ($ss=1; $ss<6; $ss++) { |
|
579 | + for ($ss = 1; $ss < 6; $ss++) { |
|
580 | 580 | $res = new StdClass; |
581 | 581 | $res->server_state = $ss; |
582 | 582 | row2(result_server_state_string($res), |
583 | - link_results("$server_state[$ss]", $urlquery,"server_state=$ss", '') |
|
583 | + link_results("$server_state[$ss]", $urlquery, "server_state=$ss", '') |
|
584 | 584 | ); |
585 | 585 | } |
586 | 586 | end_table(); |
@@ -590,11 +590,11 @@ discard block |
||
590 | 590 | start_table('table-striped'); |
591 | 591 | echo "<tr><th>Outcome</th><th># results</th></tr>\n"; |
592 | 592 | |
593 | - for ($ro=0; $ro<8; $ro++) { |
|
593 | + for ($ro = 0; $ro < 8; $ro++) { |
|
594 | 594 | $res = new StdClass; |
595 | 595 | $res->outcome = $ro; |
596 | 596 | $res->exit_status = 0; |
597 | - c_row2($outcome[$ro]?outcome_color($ro):'', result_outcome_string($res), |
|
597 | + c_row2($outcome[$ro] ?outcome_color($ro) : '', result_outcome_string($res), |
|
598 | 598 | link_results("$outcome[$ro]", $urlquery, "outcome=$ro", '') |
599 | 599 | ); |
600 | 600 | } |
@@ -604,18 +604,18 @@ discard block |
||
604 | 604 | echo "<td>"; |
605 | 605 | start_table('table-striped'); |
606 | 606 | echo "<tr><th>Validate state</th><th># results</th></tr>\n"; |
607 | - for ($vs=0; $vs<NVALIDATE_STATES; $vs++) { |
|
607 | + for ($vs = 0; $vs < NVALIDATE_STATES; $vs++) { |
|
608 | 608 | $res = new StdClass; |
609 | 609 | $res->validate_state = $vs; |
610 | 610 | $res->exit_status = 0; |
611 | - c_row2($validate_state[$vs]?validate_color($vs):'', validate_state_str($res), |
|
611 | + c_row2($validate_state[$vs] ?validate_color($vs) : '', validate_state_str($res), |
|
612 | 612 | link_results("$validate_state[$vs]", $urlquery, "validate_state=$vs", "outcome=1")); |
613 | 613 | } |
614 | 614 | end_table(); |
615 | 615 | start_table('table-striped'); |
616 | 616 | echo "<tr><th>File Delete state</th><th># results</th></tr>\n"; |
617 | 617 | |
618 | - for ($fds=0; $fds<4; $fds++) { |
|
618 | + for ($fds = 0; $fds < 4; $fds++) { |
|
619 | 619 | row2(file_delete_state_str($fds), |
620 | 620 | link_results("$file_delete[$fds]", $urlquery, "outcome=1", "file_delete_state=$fds")); |
621 | 621 | } |
@@ -627,7 +627,7 @@ discard block |
||
627 | 627 | echo "<td>"; |
628 | 628 | start_table('table-striped'); |
629 | 629 | echo "<tr><th>Client state</th><th># results</th></tr>\n"; |
630 | - for ($cs=1; $cs<7; $cs++) { |
|
630 | + for ($cs = 1; $cs < 7; $cs++) { |
|
631 | 631 | $res = new StdClass; |
632 | 632 | $res->client_state = $cs; |
633 | 633 | $res->exit_status = 0; |
@@ -646,9 +646,9 @@ discard block |
||
646 | 646 | <select name=\"server_state\"> |
647 | 647 | <option value=\"CHOOSE_ALL\" selected=\"selected\"> Any </option> |
648 | 648 | "; |
649 | - for ($i=1; $i<6; $i++) { |
|
649 | + for ($i = 1; $i < 6; $i++) { |
|
650 | 650 | $res = new StdClass; |
651 | - $res->server_state=$i; |
|
651 | + $res->server_state = $i; |
|
652 | 652 | echo "<option value=\"$i\"> "."[$i] ".' '.result_server_state_string($res)."</option>\n"; |
653 | 653 | } |
654 | 654 | echo "</select>\n"; |
@@ -659,7 +659,7 @@ discard block |
||
659 | 659 | <select name=\"outcome\"> |
660 | 660 | <option value=\"CHOOSE_ALL\" selected=\"selected\"> Any </option> |
661 | 661 | "; |
662 | - for ($i=0; $i<8; $i++) { |
|
662 | + for ($i = 0; $i < 8; $i++) { |
|
663 | 663 | $res = new StdClass; |
664 | 664 | $res->outcome = $i; |
665 | 665 | $res->exit_status = 0; |
@@ -673,7 +673,7 @@ discard block |
||
673 | 673 | <select name=\"validate_state\"> |
674 | 674 | <option value=\"CHOOSE_ALL\" selected=\"selected\"> Any </option> |
675 | 675 | "; |
676 | - for ($vs=0; $vs<NVALIDATE_STATES; $vs++) { |
|
676 | + for ($vs = 0; $vs < NVALIDATE_STATES; $vs++) { |
|
677 | 677 | $res = new StdClass; |
678 | 678 | $res->validate_state = $vs; |
679 | 679 | $res->exit_status = 0; |
@@ -687,7 +687,7 @@ discard block |
||
687 | 687 | <select name=\"client_state\"> |
688 | 688 | <option value=\"CHOOSE_ALL\" selected=\"selected\"> Any </option> |
689 | 689 | "; |
690 | - for ($i=0; $i<7; $i++) { |
|
690 | + for ($i = 0; $i < 7; $i++) { |
|
691 | 691 | $res = new StdClass; |
692 | 692 | $res->client_state = $i; |
693 | 693 | $res->exit_status = 0; |
@@ -724,7 +724,7 @@ discard block |
||
724 | 724 | } |
725 | 725 | |
726 | 726 | function table_title($table) { |
727 | - switch($table) { |
|
727 | + switch ($table) { |
|
728 | 728 | case "platform": return "Platforms"; |
729 | 729 | case "app": return "Applications"; |
730 | 730 | case "app_version": return "Application Versions"; |
@@ -744,7 +744,7 @@ discard block |
||
744 | 744 | row("Created", time_str($platform->create_time)); |
745 | 745 | row("Name", $platform->name); |
746 | 746 | row("User friendly name", $platform->user_friendly_name); |
747 | - row("","<a href=\"db_action.php?table=app_version&platformid=$platform->id\">App versions for this platform</a>"); |
|
747 | + row("", "<a href=\"db_action.php?table=app_version&platformid=$platform->id\">App versions for this platform</a>"); |
|
748 | 748 | end_table(); |
749 | 749 | } |
750 | 750 | |
@@ -756,8 +756,8 @@ discard block |
||
756 | 756 | row("User-friendly name", $app->user_friendly_name); |
757 | 757 | row("Deprecated", $app->deprecated); |
758 | 758 | row("Homogeneous redundancy", $app->homogeneous_redundancy); |
759 | - row("","<a href=\"db_action.php?table=app_version&appid=$app->id\">App Versions for this application</a>"); |
|
760 | - row("","<a href=\"db_action.php?table=workunit&appid=$app->id&detail=low\">Workunits for this application</a>"); |
|
759 | + row("", "<a href=\"db_action.php?table=app_version&appid=$app->id\">App Versions for this application</a>"); |
|
760 | + row("", "<a href=\"db_action.php?table=workunit&appid=$app->id&detail=low\">Workunits for this application</a>"); |
|
761 | 761 | end_table(); |
762 | 762 | } |
763 | 763 | |
@@ -765,9 +765,9 @@ discard block |
||
765 | 765 | start_table(); |
766 | 766 | row("ID", $app_version->id); |
767 | 767 | row("Created", time_str($app_version->create_time)); |
768 | - row("Application", "<a href=\"db_action.php?table=app&id=$app_version->appid\">" . app_name_by_id($app_version->appid) . "</a>"); |
|
768 | + row("Application", "<a href=\"db_action.php?table=app&id=$app_version->appid\">".app_name_by_id($app_version->appid)."</a>"); |
|
769 | 769 | row("Version num", $app_version->version_num); |
770 | - row("Platform", "<a href=\"db_action.php?table=platform&id=$app_version->platformid\">" . platform_name_by_id($app_version->platformid) . "</a>" ); |
|
770 | + row("Platform", "<a href=\"db_action.php?table=platform&id=$app_version->platformid\">".platform_name_by_id($app_version->platformid)."</a>"); |
|
771 | 771 | row("Plan Class", $app_version->plan_class); |
772 | 772 | row("XML doc", "<pre>".htmlspecialchars($app_version->xml_doc)."</pre>"); |
773 | 773 | row("min_core_version", $app_version->min_core_version); |
@@ -902,7 +902,7 @@ discard block |
||
902 | 902 | row("External IP address", "$host->external_ip_addr<br>"); |
903 | 903 | row("Domain name", $host->domain_name); |
904 | 904 | $x = $host->timezone/3600; |
905 | - if ($x >= 0) $x="+$x"; |
|
905 | + if ($x >= 0) $x = "+$x"; |
|
906 | 906 | row("Local Standard Time", "UTC $x hours"); |
907 | 907 | row("Number of CPUs", $host->p_ncpus); |
908 | 908 | row("CPU", "$host->p_vendor $host->p_model"); |
@@ -954,10 +954,10 @@ discard block |
||
954 | 954 | start_table(); |
955 | 955 | row("Created", time_str($wu->create_time)); |
956 | 956 | row("Transition Time", time_str($wu->transition_time)); |
957 | - row("Last time modified",mysqltime_str($wu->mod_time)); |
|
957 | + row("Last time modified", mysqltime_str($wu->mod_time)); |
|
958 | 958 | row("Name", $wu->name); |
959 | 959 | row("XML doc", "<pre>".htmlspecialchars($wu->xml_doc)."</pre>"); |
960 | - row("Application", "<a href=\"db_action.php?table=app&id=$wu->appid\">" . app_name_by_id($wu->appid) . " [".$wu->appid."]</a>"); |
|
960 | + row("Application", "<a href=\"db_action.php?table=app&id=$wu->appid\">".app_name_by_id($wu->appid)." [".$wu->appid."]</a>"); |
|
961 | 961 | row("Application version number", $wu->app_version_num); |
962 | 962 | row("Batch", $wu->batch); |
963 | 963 | $x = number_format($wu->rsc_fpops_est/1e9, 2); |
@@ -970,12 +970,12 @@ discard block |
||
970 | 970 | $x = $wu->rsc_disk_bound/(1024*1024); |
971 | 971 | $y = number_format($x, 2); |
972 | 972 | row("Max Disk Usage", "$y MB"); |
973 | - row("Need validate?", ($wu->need_validate?"yes [":"no [").$wu->need_validate."]"); |
|
973 | + row("Need validate?", ($wu->need_validate ? "yes [" : "no [").$wu->need_validate."]"); |
|
974 | 974 | row("Canonical resultid", |
975 | 975 | "<a href=\"db_action.php?table=result&id=$wu->canonical_resultid\">".$wu->canonical_resultid."</a>"); |
976 | 976 | row("Canonical credit", $wu->canonical_credit); |
977 | 977 | //row("Timeout check time", time_str($wu->timeout_check_time)); |
978 | - row("Delay bound", "$wu->delay_bound" . " = " . time_diff($wu->delay_bound) ); |
|
978 | + row("Delay bound", "$wu->delay_bound"." = ".time_diff($wu->delay_bound)); |
|
979 | 979 | row("Error mask", wu_error_mask_str($wu->error_mask)); |
980 | 980 | row("File delete state", file_delete_state_str($wu->file_delete_state)." [".$wu->file_delete_state."]"); |
981 | 981 | row("Assimilation state", assimilate_state_str($wu->assimilate_state)." [".$wu->assimilate_state."]"); |
@@ -985,7 +985,7 @@ discard block |
||
985 | 985 | row("max error results", $wu->max_error_results); |
986 | 986 | row("max total results", $wu->max_total_results); |
987 | 987 | row("max success results", $wu->max_success_results); |
988 | - row("result template file",$wu->result_template_file); |
|
988 | + row("result template file", $wu->result_template_file); |
|
989 | 989 | row("hr_class", $wu->hr_class); |
990 | 990 | row("opaque", $wu->opaque); |
991 | 991 | row("Priority", $wu->priority); |
@@ -1063,7 +1063,7 @@ discard block |
||
1063 | 1063 | } |
1064 | 1064 | |
1065 | 1065 | function outcome_color($outcome) { |
1066 | - switch($outcome) { |
|
1066 | + switch ($outcome) { |
|
1067 | 1067 | case 0: return '9900cc'; // "Init", purple |
1068 | 1068 | case 1: return '33cc33'; // "Success", green |
1069 | 1069 | case 3: return 'ff3333'; // "Client error", red |
@@ -1090,18 +1090,18 @@ discard block |
||
1090 | 1090 | row("Sent", time_str($result->sent_time)); |
1091 | 1091 | row("Report deadline", time_str($result->report_deadline)); |
1092 | 1092 | row("Received", time_str($result->received_time)); |
1093 | - row("Last time modified",mysqltime_str($result->mod_time)); |
|
1093 | + row("Last time modified", mysqltime_str($result->mod_time)); |
|
1094 | 1094 | row("Name", $result->name); |
1095 | - row("Workunit", "<a href=\"db_action.php?table=workunit&id=$result->workunitid\">" . wu_name_by_id($result->workunitid) . "</a> [$result->workunitid]" ); |
|
1095 | + row("Workunit", "<a href=\"db_action.php?table=workunit&id=$result->workunitid\">".wu_name_by_id($result->workunitid)."</a> [$result->workunitid]"); |
|
1096 | 1096 | row("Server state", result_server_state_string($result)." [$result->server_state]"); |
1097 | 1097 | row("Outcome", result_outcome_string($result)." [$result->outcome]"); |
1098 | 1098 | row("Client state", result_client_state_string($result)." [$result->client_state]"); |
1099 | 1099 | row("Exit status", exit_status_string($result->exit_status)); |
1100 | - row("Host ID", "<a href=\"db_action.php?table=host&id=$result->hostid\">" . host_name_by_id($result->hostid) . "</a> [$result->hostid]"); |
|
1101 | - row("User ID", "<a href=\"db_action.php?table=user&id=$result->userid\">" . user_name_by_id($result->userid) . "</a> [$result->userid]"); |
|
1100 | + row("Host ID", "<a href=\"db_action.php?table=host&id=$result->hostid\">".host_name_by_id($result->hostid)."</a> [$result->hostid]"); |
|
1101 | + row("User ID", "<a href=\"db_action.php?table=user&id=$result->userid\">".user_name_by_id($result->userid)."</a> [$result->userid]"); |
|
1102 | 1102 | row("CPU time", $result->cpu_time); |
1103 | 1103 | row("Elapsed time", $result->elapsed_time); |
1104 | - if($error=stderr_error_string($result->stderr_out)) { |
|
1104 | + if ($error = stderr_error_string($result->stderr_out)) { |
|
1105 | 1105 | row("error in stderr out", $error); |
1106 | 1106 | } |
1107 | 1107 | row("Batch", $result->batch); |
@@ -1118,16 +1118,16 @@ discard block |
||
1118 | 1118 | row("App version", $x1.app_version_string($result).$x2); |
1119 | 1119 | row("App version ID", $result->app_version_id); |
1120 | 1120 | row("Estimated GFLOPS", number_format($result->flops_estimate/1e9, 2)); |
1121 | - row("Random",$result->random); |
|
1122 | - row("Opaque",$result->opaque); |
|
1123 | - row("Teamid",$result->teamid); |
|
1124 | - row("Priority",$result->priority); |
|
1121 | + row("Random", $result->random); |
|
1122 | + row("Opaque", $result->opaque); |
|
1123 | + row("Teamid", $result->teamid); |
|
1124 | + row("Priority", $result->priority); |
|
1125 | 1125 | row("XML doc in", "<pre>".htmlspecialchars($result->xml_doc_in)."</pre>"); |
1126 | 1126 | row("XML doc out", "<pre>".htmlspecialchars($result->xml_doc_out)."</pre>"); |
1127 | 1127 | row("stderr out", "<pre>" |
1128 | 1128 | .htmlspecialchars( |
1129 | 1129 | $result->stderr_out, |
1130 | - ENT_QUOTES | (defined('ENT_SUBSTITUTE')?ENT_SUBSTITUTE:0), |
|
1130 | + ENT_QUOTES|(defined('ENT_SUBSTITUTE') ?ENT_SUBSTITUTE:0), |
|
1131 | 1131 | 'utf-8' |
1132 | 1132 | ) |
1133 | 1133 | ."</pre>" |
@@ -1175,23 +1175,23 @@ discard block |
||
1175 | 1175 | } else { |
1176 | 1176 | // result has not been received yet, so show report deadline either |
1177 | 1177 | // in green if in the future or in red if in the past. |
1178 | - $timenow=time(); |
|
1179 | - if ($result->report_deadline==0) { |
|
1178 | + $timenow = time(); |
|
1179 | + if ($result->report_deadline == 0) { |
|
1180 | 1180 | // not sent -- show create time in purple |
1181 | - $received = "<font color=\"9900cc\">". time_str($result->create_time) . "</font>"; |
|
1182 | - } else if ($result->report_deadline>=$timenow) { |
|
1181 | + $received = "<font color=\"9900cc\">".time_str($result->create_time)."</font>"; |
|
1182 | + } else if ($result->report_deadline >= $timenow) { |
|
1183 | 1183 | // overdue -- show deadline in red |
1184 | - $received = "<font color=\"#33cc33\">". time_str($result->report_deadline) . "</font>"; |
|
1184 | + $received = "<font color=\"#33cc33\">".time_str($result->report_deadline)."</font>"; |
|
1185 | 1185 | } else { |
1186 | 1186 | // in progress and not overdue -- show deadline in green |
1187 | - $received = "<font color=\"#ff3333\">". time_str($result->report_deadline) . "</font>"; |
|
1187 | + $received = "<font color=\"#ff3333\">".time_str($result->report_deadline)."</font>"; |
|
1188 | 1188 | } |
1189 | 1189 | } |
1190 | 1190 | $version = app_version_string($result)." (<a href=\"db_action.php?table=app_version&id=$result->app_version_id\">$result->app_version_id</a>)"; |
1191 | 1191 | $outcome_color = outcome_color($result->outcome); |
1192 | 1192 | $validate_color = validate_color($result->validate_state); |
1193 | 1193 | $host_user = host_user_link($result->hostid); |
1194 | - $cpu_hours = sprintf("%.1f",$result->cpu_time / 3600); |
|
1194 | + $cpu_hours = sprintf("%.1f", $result->cpu_time/3600); |
|
1195 | 1195 | $granted_credit = "<a href=credit.php?wu_id=$result->workunitid>".credit_str($result->granted_credit)."</a>"; |
1196 | 1196 | $delete_state = file_delete_state_str($result->file_delete_state); |
1197 | 1197 | |
@@ -1219,7 +1219,7 @@ discard block |
||
1219 | 1219 | row("ID", $user->id); |
1220 | 1220 | row("Created", time_str($user->create_time)); |
1221 | 1221 | row("Name", $user->name); |
1222 | - if(!in_rops()) { |
|
1222 | + if (!in_rops()) { |
|
1223 | 1223 | row("Authenticator", $user->authenticator); |
1224 | 1224 | } |
1225 | 1225 | row("Email address", $user->email_addr); |
@@ -1234,7 +1234,7 @@ discard block |
||
1234 | 1234 | row("Default venue", $user->venue); |
1235 | 1235 | row("Hosts", "<a href=\"db_action.php?table=host&userid=$user->id&detail=low\">click</a>"); |
1236 | 1236 | row("Cross project ID", $user->cross_project_id); |
1237 | - if(!in_rops()) { |
|
1237 | + if (!in_rops()) { |
|
1238 | 1238 | row("Password Hash", $user->passwd_hash); |
1239 | 1239 | } |
1240 | 1240 | row("Donated", $user->donated); |
@@ -1285,7 +1285,7 @@ discard block |
||
1285 | 1285 | echo "</table></td>"; |
1286 | 1286 | echo "<td><table border=\"2\">\n"; |
1287 | 1287 | echo "<tr><th>User</th><th># posts</th></tr>\n"; |
1288 | - for ($p=1; $p<=10; $p++) { |
|
1288 | + for ($p = 1; $p <= 10; $p++) { |
|
1289 | 1289 | row2_plain(user_links_ops($top10poster[$p]), $top10poster[$p]->posts); |
1290 | 1290 | } |
1291 | 1291 | echo "</table></td>"; |
@@ -1324,10 +1324,10 @@ discard block |
||
1324 | 1324 | function admin_show_team($team) { |
1325 | 1325 | start_table(); |
1326 | 1326 | row("ID", $team->id); |
1327 | - row("Team Founder", "<a href=\"db_action.php?table=user&id=$team->userid\">" . user_name_by_id($team->userid) . "</a>"); |
|
1327 | + row("Team Founder", "<a href=\"db_action.php?table=user&id=$team->userid\">".user_name_by_id($team->userid)."</a>"); |
|
1328 | 1328 | row("Name", $team->name); |
1329 | - row("Name (HTML Formatted)", "<pre>" . htmlspecialchars($team->name_html) . "</pre>" ); |
|
1330 | - row("Url", "<a href=\"http://$team->url\">" . $team->url . "</a>"); |
|
1329 | + row("Name (HTML Formatted)", "<pre>".htmlspecialchars($team->name_html)."</pre>"); |
|
1330 | + row("Url", "<a href=\"http://$team->url\">".$team->url."</a>"); |
|
1331 | 1331 | row("Type", team_type_string($team->type)); |
1332 | 1332 | row("Description", $team->description); |
1333 | 1333 | row("", "<a href=\"db_action.php?table=user&teamid=$team->id\">List All Members</a>"); |
@@ -1370,7 +1370,7 @@ discard block |
||
1370 | 1370 | if (!strlen($host->domain_name) && !strlen($host->last_ip_addr)) { |
1371 | 1371 | return "(blank)"; |
1372 | 1372 | } else { |
1373 | - return $host->domain_name . " (" . $host->last_ip_addr . ")"; |
|
1373 | + return $host->domain_name." (".$host->last_ip_addr.")"; |
|
1374 | 1374 | } |
1375 | 1375 | } |
1376 | 1376 |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | function flag_abuse_reason_views_api() { |
31 | 31 | return array( |
32 | 32 | 'api' => 2.0, |
33 | - 'path' => drupal_get_path('module', 'flag_abuse_reason') . '/includes', |
|
33 | + 'path' => drupal_get_path('module', 'flag_abuse_reason').'/includes', |
|
34 | 34 | ); |
35 | 35 | } |
36 | 36 | |
@@ -47,8 +47,8 @@ discard block |
||
47 | 47 | * Here we change our flag event/action to 'reset'. |
48 | 48 | */ |
49 | 49 | function flag_abuse_reason_preprocess_flag(&$vars) { |
50 | - drupal_add_js(drupal_get_path('module', 'flag_abuse_reason') . "/includes/flag_abuse_reason.js"); |
|
51 | - drupal_add_css(drupal_get_path('module', 'flag_abuse_reason') . "/css/flag_abuse_reason.css"); |
|
50 | + drupal_add_js(drupal_get_path('module', 'flag_abuse_reason')."/includes/flag_abuse_reason.js"); |
|
51 | + drupal_add_css(drupal_get_path('module', 'flag_abuse_reason')."/css/flag_abuse_reason.css"); |
|
52 | 52 | $myuser = $vars['user']; |
53 | 53 | $metaflags = array('abuse_node_meta', 'abuse_comment_meta', 'abuse_user_meta'); |
54 | 54 | |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | // If there are flags on this content, clear the flags and |
81 | 81 | // lock the content. |
82 | 82 | if (user_access('reset abuse flags', $myuser)) { |
83 | - if ($count>0) { |
|
83 | + if ($count > 0) { |
|
84 | 84 | $vars['action'] = 'reset'; |
85 | 85 | $vars['link_text'] = t('Clear Reports and Lock'); |
86 | 86 | $vars['link_title'] = t('Remove all flags on this content and prevent any new flagging.'); |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | // Normal users may cancel their all their reported flags on this |
153 | 153 | // content. |
154 | 154 | else { |
155 | - if ( ($event=='unflag') && (in_array($flag->name, $metaflags)) ) { |
|
155 | + if (($event == 'unflag') && (in_array($flag->name, $metaflags))) { |
|
156 | 156 | $allflags = flag_get_user_flags($flag->content_type, $content_id, $account->uid); |
157 | 157 | foreach ($allflags as $subflag) { |
158 | 158 | $myflag = flag_get_flag(NULL, $subflag->fid); |
@@ -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 |
@@ -594,8 +594,8 @@ discard block |
||
594 | 594 | } |
595 | 595 | |
596 | 596 | // Check if user has agreed to terms of use. |
597 | - if ( (!empty($termsofuse)) and ($account->uid) and |
|
598 | - (!boincuser_check_termsofuse($account)) and ($existinguser_tou) ) { |
|
597 | + if ((!empty($termsofuse)) and ($account->uid) and |
|
598 | + (!boincuser_check_termsofuse($account)) and ($existinguser_tou)) { |
|
599 | 599 | |
600 | 600 | // Admins are exempted. |
601 | 601 | $administrator_role = array_search('administrator', user_roles(true)); |
@@ -609,9 +609,9 @@ discard block |
||
609 | 609 | $query_for_destination = ''; |
610 | 610 | $prevdest = $_REQUEST['destination']; |
611 | 611 | if ($prevdest) { |
612 | - $query_for_destination = '?destination=' . $prevdest; |
|
612 | + $query_for_destination = '?destination='.$prevdest; |
|
613 | 613 | } |
614 | - $_REQUEST['destination'] = $path_for_destination . $query_for_destination; |
|
614 | + $_REQUEST['destination'] = $path_for_destination.$query_for_destination; |
|
615 | 615 | |
616 | 616 | } |
617 | 617 | } |
@@ -644,7 +644,7 @@ discard block |
||
644 | 644 | // In Drupal 7, these operation cases will all exist as their own hooks, |
645 | 645 | // so let's approximate that here so that this function can simply be removed |
646 | 646 | // upon migration to 7 |
647 | - switch($op) { |
|
647 | + switch ($op) { |
|
648 | 648 | case 'update': |
649 | 649 | boincuser_node_update($node); |
650 | 650 | } |
@@ -655,7 +655,7 @@ discard block |
||
655 | 655 | * is updated (forward compatible to Drupal 7) |
656 | 656 | */ |
657 | 657 | function boincuser_node_update($node) { |
658 | - switch($node->type) { |
|
658 | + switch ($node->type) { |
|
659 | 659 | case 'profile': |
660 | 660 | // Update the BOINC database directly |
661 | 661 | $account = user_load($node->uid); |
@@ -777,7 +777,7 @@ discard block |
||
777 | 777 | } |
778 | 778 | |
779 | 779 | $form['cancel'] = array( |
780 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $cancel_dest) . '</li>', |
|
780 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $cancel_dest).'</li>', |
|
781 | 781 | '#weight' => 1004, |
782 | 782 | ); |
783 | 783 | $form['form control tabs suffix'] = array( |
@@ -810,7 +810,7 @@ discard block |
||
810 | 810 | $form['buttons']['preview_changes']['#suffix'] = '</li>'; |
811 | 811 | $form['buttons']['preview_changes']['#weight'] = 1004; |
812 | 812 | $form['buttons']['cancel'] = array( |
813 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "node/{$form['nid']['#value']}") . '</li>', |
|
813 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "node/{$form['nid']['#value']}").'</li>', |
|
814 | 814 | '#weight' => 1005, |
815 | 815 | ); |
816 | 816 | $form['buttons']['delete']['#prefix'] = '<li class="tab">'; |
@@ -842,7 +842,7 @@ discard block |
||
842 | 842 | $form['actions']['submit']['#suffix'] = '</li>'; |
843 | 843 | $form['actions']['submit']['#weight'] = 1002; |
844 | 844 | $form['actions']['cancel'] = array( |
845 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "node/{$form['nid']['#value']}") . '</li>', |
|
845 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "node/{$form['nid']['#value']}").'</li>', |
|
846 | 846 | '#weight' => 1005, |
847 | 847 | ); |
848 | 848 | $form['actions']['form control tabs suffix'] = array( |
@@ -869,7 +869,7 @@ discard block |
||
869 | 869 | $form['privatemsg']['preview']['#suffix'] = '</li>'; |
870 | 870 | $form['privatemsg']['preview']['#weight'] = 1003; |
871 | 871 | $form['privatemsg']['cancel'] = array( |
872 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']) . '</li>', |
|
872 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']).'</li>', |
|
873 | 873 | '#weight' => 1004, |
874 | 874 | ); |
875 | 875 | $form['privatemsg']['form control tabs suffix'] = array( |
@@ -957,11 +957,11 @@ discard block |
||
957 | 957 | // Set special message if user has not agreed to TOU |
958 | 958 | $existinguser_tou = variable_get('boinc_weboptions_existinguser_tou', FALSE); |
959 | 959 | $termsofuse = variable_get('boinc_weboptions_termsofuse', ''); |
960 | - if ( (!boincuser_check_termsofuse($account)) and ($existinguser_tou) and (!empty($termsofuse)) and (!user_access('administer users')) ) { |
|
960 | + if ((!boincuser_check_termsofuse($account)) and ($existinguser_tou) and (!empty($termsofuse)) and (!user_access('administer users'))) { |
|
961 | 961 | drupal_set_message( |
962 | 962 | 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.', |
963 | 963 | array( |
964 | - '@project' => variable_get('site_name','Drupal-BOINC'), |
|
964 | + '@project' => variable_get('site_name', 'Drupal-BOINC'), |
|
965 | 965 | ), NULL, 'boinc:account-credentials-change') |
966 | 966 | , 'info'); |
967 | 967 | } |
@@ -1026,36 +1026,36 @@ discard block |
||
1026 | 1026 | $form['account']['boincuser_id'] = array( |
1027 | 1027 | '#value' => ' |
1028 | 1028 | <div class="form-item"> |
1029 | - <label>' . bts('BOINC user ID', array(), NULL, 'boinc:account-credentials-change') . '</label> |
|
1030 | - <span>' . $account->boincuser_id . '</span> |
|
1029 | + <label>' . bts('BOINC user ID', array(), NULL, 'boinc:account-credentials-change').'</label> |
|
1030 | + <span>' . $account->boincuser_id.'</span> |
|
1031 | 1031 | </div>', |
1032 | 1032 | ); |
1033 | 1033 | $form['account']['user_id'] = array( |
1034 | 1034 | '#value' => ' |
1035 | 1035 | <div class="form-item"> |
1036 | - <label>' . bts('Drupal user ID', array(), NULL, 'boinc:account-credentials-change') . '</label> |
|
1037 | - <span>' . $account->uid . '</span> |
|
1036 | + <label>' . bts('Drupal user ID', array(), NULL, 'boinc:account-credentials-change').'</label> |
|
1037 | + <span>' . $account->uid.'</span> |
|
1038 | 1038 | </div>', |
1039 | 1039 | ); |
1040 | 1040 | $form['account']['account_key'] = array( |
1041 | 1041 | '#value' => ' |
1042 | 1042 | <div class="form-item"> |
1043 | - <label>' . bts('Account key', array(), NULL, 'boinc:account-credentials-change') . '</label> |
|
1044 | - <span>' . $account->boincuser_account_key . '</span> |
|
1043 | + <label>' . bts('Account key', array(), NULL, 'boinc:account-credentials-change').'</label> |
|
1044 | + <span>' . $account->boincuser_account_key.'</span> |
|
1045 | 1045 | </div>', |
1046 | 1046 | ); |
1047 | 1047 | $form['account']['weak_account_key'] = array( |
1048 | 1048 | '#value' => ' |
1049 | 1049 | <div class="form-item"> |
1050 | - <label>' . bts('Weak account key', array(), NULL, 'boinc:account-credentials-change') . '</label> |
|
1051 | - <span>' . "{$account->boincuser_id}_{$account->boincuser_weak_auth}" . '</span> |
|
1050 | + <label>' . bts('Weak account key', array(), NULL, 'boinc:account-credentials-change').'</label> |
|
1051 | + <span>' . "{$account->boincuser_id}_{$account->boincuser_weak_auth}".'</span> |
|
1052 | 1052 | </div>', |
1053 | 1053 | ); |
1054 | 1054 | $form['account']['cpid'] = array( |
1055 | 1055 | '#value' => ' |
1056 | 1056 | <div class="form-item"> |
1057 | - <label>' . bts('Cross-project ID', array(), NULL, 'boinc:account-credentials-change') . '</label> |
|
1058 | - <span>' . $account->boincuser_cpid . '</span> |
|
1057 | + <label>' . bts('Cross-project ID', array(), NULL, 'boinc:account-credentials-change').'</label> |
|
1058 | + <span>' . $account->boincuser_cpid.'</span> |
|
1059 | 1059 | </div>', |
1060 | 1060 | ); |
1061 | 1061 | |
@@ -1073,7 +1073,7 @@ discard block |
||
1073 | 1073 | $form['submit']['#suffix'] = '</li>'; |
1074 | 1074 | $form['submit']['#weight'] = 1002; |
1075 | 1075 | $form['cancel'] = array( |
1076 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']) . '</li>', |
|
1076 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']).'</li>', |
|
1077 | 1077 | '#weight' => 1003, |
1078 | 1078 | ); |
1079 | 1079 | if (isset($form['delete']) AND is_array($form['delete'])) { |
@@ -1169,7 +1169,7 @@ discard block |
||
1169 | 1169 | $form['buttons']['preview_changes']['#suffix'] = '</li>'; |
1170 | 1170 | $form['buttons']['preview_changes']['#weight'] = 1004; |
1171 | 1171 | $form['buttons']['cancel'] = array( |
1172 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']) . '</li>', |
|
1172 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']).'</li>', |
|
1173 | 1173 | '#weight' => 1005, |
1174 | 1174 | ); |
1175 | 1175 | $form['buttons']['delete']['#prefix'] = '<li class="tab">'; |
@@ -1218,11 +1218,11 @@ discard block |
||
1218 | 1218 | // Set name temporarily to dummy value to beat validation |
1219 | 1219 | $form['name'] = array( |
1220 | 1220 | '#type' => 'hidden', |
1221 | - '#value' => rand() . '.' . time() |
|
1221 | + '#value' => rand().'.'.time() |
|
1222 | 1222 | ); |
1223 | 1223 | |
1224 | 1224 | // Add JS for submit button disabling |
1225 | - drupal_add_js(drupal_get_path('module', 'boincuser') . '/boincuser.js'); |
|
1225 | + drupal_add_js(drupal_get_path('module', 'boincuser').'/boincuser.js'); |
|
1226 | 1226 | |
1227 | 1227 | // Terms of use section |
1228 | 1228 | $termsofuse = variable_get('boinc_weboptions_termsofuse', ''); |
@@ -1238,7 +1238,7 @@ discard block |
||
1238 | 1238 | |
1239 | 1239 | $form['termsofuse']['title1'] = array( |
1240 | 1240 | '#weight' => -12, |
1241 | - '#value' => '<h2>' . bts(variable_get('boinc_weboptions_registrationtitle', 'Please read and acknowledge our terms of use'), array(), NULL, 'project:user-register' ) . '</h2>', |
|
1241 | + '#value' => '<h2>'.bts(variable_get('boinc_weboptions_registrationtitle', 'Please read and acknowledge our terms of use'), array(), NULL, 'project:user-register').'</h2>', |
|
1242 | 1242 | '#prefix' => '<div id="register-title1">', |
1243 | 1243 | '#suffix' => '</div>', |
1244 | 1244 | ); |
@@ -1261,7 +1261,7 @@ discard block |
||
1261 | 1261 | |
1262 | 1262 | $form['title2'] = array( |
1263 | 1263 | '#weight' => -6, |
1264 | - '#value' => '<h2>' . bts(variable_get('boinc_weboptions_registrationtitle2', 'Fill in your name, email, and choose a secure passphrase.'), array(), NULL, 'project:user-register') . '</h2>', |
|
1264 | + '#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 | 1265 | '#prefix' => '<div id="register-title2">', |
1266 | 1266 | '#suffix' => '</div>', |
1267 | 1267 | ); |
@@ -1323,7 +1323,7 @@ discard block |
||
1323 | 1323 | $form['buttons']['submit']['#suffix'] = '</li>'; |
1324 | 1324 | $form['buttons']['submit']['#weight'] = 1002; |
1325 | 1325 | $form['buttons']['cancel'] = array( |
1326 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), 'user/login') . '</li>', |
|
1326 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), 'user/login').'</li>', |
|
1327 | 1327 | '#weight' => 1005, |
1328 | 1328 | ); |
1329 | 1329 | $form['buttons']['form control tabs suffix'] = array( |
@@ -1405,7 +1405,7 @@ discard block |
||
1405 | 1405 | */ |
1406 | 1406 | function boincuser_token_list($type = 'all') { |
1407 | 1407 | if ($type == 'user' || $type == 'all') { |
1408 | - $tokens['user']['display-name'] = t("The user's name that should be displayed"); |
|
1408 | + $tokens['user']['display-name'] = t("The user's name that should be displayed"); |
|
1409 | 1409 | return $tokens; |
1410 | 1410 | } |
1411 | 1411 | } |
@@ -1417,9 +1417,9 @@ discard block |
||
1417 | 1417 | if ($view->args) { |
1418 | 1418 | $account_id = $view->args[0]; |
1419 | 1419 | } |
1420 | - if ($view->name=="user_activity") { |
|
1420 | + if ($view->name == "user_activity") { |
|
1421 | 1421 | // Run the following custom query for the user_activity view |
1422 | - $view->build_info['query']= " |
|
1422 | + $view->build_info['query'] = " |
|
1423 | 1423 | SELECT node_revisions.vid AS vid, |
1424 | 1424 | node.nid AS node_nid, |
1425 | 1425 | node.uid AS users_node_uid, |
@@ -1459,13 +1459,13 @@ discard block |
||
1459 | 1459 | // Delete expired users in the BOINC database, user_delete table. |
1460 | 1460 | require_boinc('boinc_db'); |
1461 | 1461 | $num_deleted = BoincUserDeleted::delete_expired(); |
1462 | - if ($num_deleted>0) { |
|
1462 | + if ($num_deleted > 0) { |
|
1463 | 1463 | watchdog('boincuser', "Deleted ${num_deleted} users from user_deleted table", WATCHDOG_NOTICE); |
1464 | 1464 | } |
1465 | 1465 | |
1466 | 1466 | // Delete expired tokens from token table |
1467 | 1467 | $tokens_deleted = BoincToken::delete_expired(); |
1468 | - if ($tokens_deleted>0) { |
|
1468 | + if ($tokens_deleted > 0) { |
|
1469 | 1469 | watchdog('boincuser', "Deleted ${tokens_deleted} tokens from token table", WATCHDOG_NOTICE); |
1470 | 1470 | } |
1471 | 1471 | } |
@@ -1550,38 +1550,38 @@ discard block |
||
1550 | 1550 | case 'boinc': |
1551 | 1551 | $output .= '<ol>'; |
1552 | 1552 | if ($registration_enabled) { |
1553 | - $output .= '<li>' . bts('First !create_an_account here at @sitename.', |
|
1553 | + $output .= '<li>'.bts('First !create_an_account here at @sitename.', |
|
1554 | 1554 | array( |
1555 | 1555 | '!create_an_account' => l(bts('create an account', array(), NULL, 'boinc:join-page'), 'user/registration'), |
1556 | 1556 | '@sitename' => $site_name, |
1557 | - ), NULL, 'boinc:join-page') . '</li>'; |
|
1557 | + ), NULL, 'boinc:join-page').'</li>'; |
|
1558 | 1558 | } |
1559 | - $output .= ' <li>' . bts("Install BOINC on this device if not already present.", array(), NULL, 'boinc:join-page') . '</li>'; |
|
1560 | - $output .= ' <li>' . bts("Select <i>Tools / Add Project</i>. Choose @sitename from the list, or enter @siteurl.", |
|
1559 | + $output .= ' <li>'.bts("Install BOINC on this device if not already present.", array(), NULL, 'boinc:join-page').'</li>'; |
|
1560 | + $output .= ' <li>'.bts("Select <i>Tools / Add Project</i>. Choose @sitename from the list, or enter @siteurl.", |
|
1561 | 1561 | array( |
1562 | 1562 | '@sitename' => $site_name, |
1563 | 1563 | '@siteurl' => $base_url, |
1564 | - ), NULL, 'boinc:join-page') . '</li>'; |
|
1564 | + ), NULL, 'boinc:join-page').'</li>'; |
|
1565 | 1565 | if ($registration_enabled) { |
1566 | - $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.", |
|
1566 | + $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.", |
|
1567 | 1567 | array( |
1568 | 1568 | '!boinccmd' => l('boinccmd --project_attach', 'http://boinc.berkeley.edu/wiki/Boinccmd_tool'), |
1569 | - ), NULL, 'boinc:join-page') . '</li>'; |
|
1569 | + ), NULL, 'boinc:join-page').'</li>'; |
|
1570 | 1570 | } |
1571 | 1571 | else { |
1572 | - $output .= '<li>' . bts("If you're running a command-line version of BOINC, |
|
1572 | + $output .= '<li>'.bts("If you're running a command-line version of BOINC, |
|
1573 | 1573 | 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.", |
1574 | 1574 | array( |
1575 | 1575 | '!instructionslink' => l('instructions', 'http://boinc.berkeley.edu/wiki/Boinccmd_tool'), |
1576 | - ), NULL, 'boinc:join-page') . '</li>'; |
|
1576 | + ), NULL, 'boinc:join-page').'</li>'; |
|
1577 | 1577 | } |
1578 | - $output .= '<li>' . bts("If you're running a pre-5.0 version of BOINC, please |
|
1578 | + $output .= '<li>'.bts("If you're running a pre-5.0 version of BOINC, please |
|
1579 | 1579 | upgrade to a more recent version of BOINC to create an account |
1580 | 1580 | at @this_project.", |
1581 | 1581 | array( |
1582 | 1582 | '@this_project' => $site_name, |
1583 | - ), NULL, 'boinc:join-page') . '</li>'; |
|
1584 | - $output .= '</ol>'; |
|
1583 | + ), NULL, 'boinc:join-page').'</li>'; |
|
1584 | + $output .= '</ol>'; |
|
1585 | 1585 | break; |
1586 | 1586 | case 'new': |
1587 | 1587 | default: |
@@ -1593,34 +1593,34 @@ discard block |
||
1593 | 1593 | // $ruleslink = drupal_lookup_path('source', $ruleslinkB); |
1594 | 1594 | //} |
1595 | 1595 | |
1596 | - $ruleslink = drupal_lookup_path('source', variable_get('boinc_weboptions_rulespolicies', '') ); |
|
1596 | + $ruleslink = drupal_lookup_path('source', variable_get('boinc_weboptions_rulespolicies', '')); |
|
1597 | 1597 | |
1598 | 1598 | // Join page output |
1599 | 1599 | $output .= '<ol>'; |
1600 | 1600 | if ($registration_enabled) { |
1601 | - $output .= '<li>' . bts('First !create_an_account here at @sitename.', |
|
1601 | + $output .= '<li>'.bts('First !create_an_account here at @sitename.', |
|
1602 | 1602 | array( |
1603 | 1603 | '!create_an_account' => l(bts('create an account', array(), NULL, 'boinc:join-page'), 'user/registration'), |
1604 | 1604 | '@sitename' => $site_name, |
1605 | - ), NULL, 'boinc:join-page') . '</li>'; |
|
1605 | + ), NULL, 'boinc:join-page').'</li>'; |
|
1606 | 1606 | } |
1607 | - else if ( menu_valid_path(array('link_path' => $ruleslink)) ) { |
|
1608 | - $output .= ' <li>' . bts("Read our !rules_and_policies.", array( |
|
1607 | + else if (menu_valid_path(array('link_path' => $ruleslink))) { |
|
1608 | + $output .= ' <li>'.bts("Read our !rules_and_policies.", array( |
|
1609 | 1609 | '!rules_and_policies' => l(bts('Rules and Policies', array(), NULL, 'boinc:join-page'), $ruleslink), |
1610 | - ), NULL, 'boinc:join-page') . '</li>'; |
|
1610 | + ), NULL, 'boinc:join-page').'</li>'; |
|
1611 | 1611 | } |
1612 | - $output .= ' <li>' . bts('Download the BOINC desktop software.', array(), NULL, 'boinc:join-page'); |
|
1612 | + $output .= ' <li>'.bts('Download the BOINC desktop software.', array(), NULL, 'boinc:join-page'); |
|
1613 | 1613 | $output .= ' <p>'; |
1614 | 1614 | $output .= ' <a class="button" href="http://boinc.berkeley.edu/download.php">Download</a>'; |
1615 | 1615 | $output .= ' </p>'; |
1616 | - $output .= ' ' . bts("For Android devices, download BOINC from the Google Play Store or Amazon App Store.", array(), NULL, 'boinc:join-page'); |
|
1616 | + $output .= ' '.bts("For Android devices, download BOINC from the Google Play Store or Amazon App Store.", array(), NULL, 'boinc:join-page'); |
|
1617 | 1617 | $output .= ' </li>'; |
1618 | - $output .= ' <li>' . bts('Run the installer.', array(), NULL, 'boinc:join-page') . '</li>'; |
|
1619 | - $output .= ' <li>' . bts('Choose @sitename from the list, or enter @siteurl.', array( |
|
1618 | + $output .= ' <li>'.bts('Run the installer.', array(), NULL, 'boinc:join-page').'</li>'; |
|
1619 | + $output .= ' <li>'.bts('Choose @sitename from the list, or enter @siteurl.', array( |
|
1620 | 1620 | '@sitename' => $site_name, |
1621 | 1621 | '@siteurl' => $base_url, |
1622 | - ), NULL, 'boinc:join-page') . '</li>'; |
|
1623 | - $output .= '</ol>'; |
|
1622 | + ), NULL, 'boinc:join-page').'</li>'; |
|
1623 | + $output .= '</ol>'; |
|
1624 | 1624 | } |
1625 | 1625 | $output .= '</div>'; |
1626 | 1626 | return $output; |
@@ -1633,7 +1633,7 @@ discard block |
||
1633 | 1633 | global $user; |
1634 | 1634 | $site_name = variable_get('site_name', 'Drupal-BOINC'); |
1635 | 1635 | // get the front page message from database; this is set in the admin interface under BOINC Other |
1636 | - $site_message = variable_get('boinc_other_frontpage',''); |
|
1636 | + $site_message = variable_get('boinc_other_frontpage', ''); |
|
1637 | 1637 | |
1638 | 1638 | // Determine the user of the day |
1639 | 1639 | $current_uotd = db_fetch_object(db_query(" |
@@ -1655,30 +1655,30 @@ discard block |
||
1655 | 1655 | $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')); |
1656 | 1656 | $output .= '</h2>'; |
1657 | 1657 | $output .= '<div class="boinc-overview balance-height-front">'; |
1658 | - $output .= ' <div>' . bts($site_message, array(), NULL, "project:front page") . ' ' . l(bts('Learn more', array(), NULL, 'boinc:front-page'), 'about') . '</div>'; |
|
1658 | + $output .= ' <div>'.bts($site_message, array(), NULL, "project:front page").' '.l(bts('Learn more', array(), NULL, 'boinc:front-page'), 'about').'</div>'; |
|
1659 | 1659 | if ($user->uid) { |
1660 | - $output .= ' <div>' . l(bts('View account', array(), NULL, 'boinc:front-page'), 'dashboard', array('attributes' => array('class' => 'join button'))) . '</div>'; |
|
1660 | + $output .= ' <div>'.l(bts('View account', array(), NULL, 'boinc:front-page'), 'dashboard', array('attributes' => array('class' => 'join button'))).'</div>'; |
|
1661 | 1661 | } |
1662 | 1662 | else { |
1663 | - $output .= ' <div>' . l(bts('Join now', array(), NULL, 'boinc:front-page'), 'join', array('attributes' => array('class' => 'join button'))) . '</div>'; |
|
1663 | + $output .= ' <div>'.l(bts('Join now', array(), NULL, 'boinc:front-page'), 'join', array('attributes' => array('class' => 'join button'))).'</div>'; |
|
1664 | 1664 | } |
1665 | 1665 | $output .= '</div>'; |
1666 | 1666 | $output .= '<div class="boinc-overview-details">'; |
1667 | 1667 | $output .= ' <div class="detail-container">'; |
1668 | - $output .= ' <a class="user-of-the-day" href="account/' . $uotd->uid . '">'; |
|
1668 | + $output .= ' <a class="user-of-the-day" href="account/'.$uotd->uid.'">'; |
|
1669 | 1669 | $output .= ' <div class="picture">'; |
1670 | 1670 | $output .= theme('imagefield_image', $uotd_image['image'], $uotd_image['alt'], |
1671 | 1671 | $uotd_image['alt'], array(), FALSE); |
1672 | 1672 | $output .= ' </div>'; |
1673 | - $output .= ' <div class="text">' . bts('User of the day', array(), NULL, 'boinc:front-page') . '</div>'; |
|
1674 | - $output .= ' <div class="detail">' . $uotd->boincuser_name . '</div>'; |
|
1673 | + $output .= ' <div class="text">'.bts('User of the day', array(), NULL, 'boinc:front-page').'</div>'; |
|
1674 | + $output .= ' <div class="detail">'.$uotd->boincuser_name.'</div>'; |
|
1675 | 1675 | $output .= ' </a>'; |
1676 | 1676 | $output .= ' <div class="volunteers">'; |
1677 | - $output .= ' <div class="text">' . bts('Over 500,000 volunteers and counting.', array(), NULL, 'boinc:front-page') . '</div>'; |
|
1677 | + $output .= ' <div class="text">'.bts('Over 500,000 volunteers and counting.', array(), NULL, 'boinc:front-page').'</div>'; |
|
1678 | 1678 | $output .= ' <div class="platforms">'; |
1679 | - $output .= ' <div class="detail platform windows">' . bts('Windows', array(), NULL, 'boinc:front-page') . '</div>'; |
|
1680 | - $output .= ' <div class="detail platform mac">' . bts('Mac', array(), NULL, 'boinc:front-page') . '</div>'; |
|
1681 | - $output .= ' <div class="detail platform linux">' . bts('Linux', array(), NULL, 'boinc:front-page') . '</div>'; |
|
1679 | + $output .= ' <div class="detail platform windows">'.bts('Windows', array(), NULL, 'boinc:front-page').'</div>'; |
|
1680 | + $output .= ' <div class="detail platform mac">'.bts('Mac', array(), NULL, 'boinc:front-page').'</div>'; |
|
1681 | + $output .= ' <div class="detail platform linux">'.bts('Linux', array(), NULL, 'boinc:front-page').'</div>'; |
|
1682 | 1682 | $output .= ' </div>'; |
1683 | 1683 | $output .= ' </div>'; |
1684 | 1684 | $output .= ' </div>'; |
@@ -1709,7 +1709,7 @@ discard block |
||
1709 | 1709 | $enablethisRPC = variable_get('boinc_weboptions_enableaccountcreateRPC', TRUE); |
1710 | 1710 | if (!$enablethisRPC) { |
1711 | 1711 | $mess = bts('Account creation is done through our Web site. Please register at @url', array( |
1712 | - '@url' => $base_url . '/user/registration', |
|
1712 | + '@url' => $base_url.'/user/registration', |
|
1713 | 1713 | ), |
1714 | 1714 | NULL, 'boinc:create_account'); |
1715 | 1715 | xml_error(-208, $mess); |
@@ -1741,8 +1741,8 @@ discard block |
||
1741 | 1741 | $boinc_user = BoincUser::lookup_email_addr($params['email_addr']); |
1742 | 1742 | if ($boinc_user) { |
1743 | 1743 | // Return authenticator for existing users |
1744 | - if ( ($params['passwd_hash'] == $boinc_user->passwd_hash) or |
|
1745 | - password_verify($params['passwd_hash'], $boinc_user->passwd_hash) ) { |
|
1744 | + if (($params['passwd_hash'] == $boinc_user->passwd_hash) or |
|
1745 | + password_verify($params['passwd_hash'], $boinc_user->passwd_hash)) { |
|
1746 | 1746 | $output = array('authenticator' => $boinc_user->authenticator); |
1747 | 1747 | } |
1748 | 1748 | else { |
@@ -1798,7 +1798,7 @@ discard block |
||
1798 | 1798 | // Ensure there is a authentication token before continuing |
1799 | 1799 | if (empty($authtoken)) { |
1800 | 1800 | drupal_not_found(); |
1801 | - return ; |
|
1801 | + return; |
|
1802 | 1802 | } |
1803 | 1803 | |
1804 | 1804 | if (strlen($authtoken) != 32) { |
@@ -1820,8 +1820,8 @@ discard block |
||
1820 | 1820 | } |
1821 | 1821 | |
1822 | 1822 | // Lookup path to custom account finish page |
1823 | - $customaccountfinishpath = drupal_lookup_path('source', variable_get('boinc_weboptions_accountfinish', '') ); |
|
1824 | - if ( menu_valid_path(array('link_path' => $customaccountfinishpath)) ) { |
|
1823 | + $customaccountfinishpath = drupal_lookup_path('source', variable_get('boinc_weboptions_accountfinish', '')); |
|
1824 | + if (menu_valid_path(array('link_path' => $customaccountfinishpath))) { |
|
1825 | 1825 | $node = menu_get_object('node', 1, $customaccountfinishpath); |
1826 | 1826 | if ($node) { |
1827 | 1827 | return node_page_view($node); |
@@ -1830,12 +1830,12 @@ discard block |
||
1830 | 1830 | |
1831 | 1831 | // open links in new window |
1832 | 1832 | $options = array( |
1833 | - 'attributes' => array( 'target' => '_blank' ), |
|
1833 | + 'attributes' => array('target' => '_blank'), |
|
1834 | 1834 | ); |
1835 | 1835 | |
1836 | 1836 | // Check moderation page exists |
1837 | - $moderationpath = drupal_lookup_path('source', variable_get('boinc_weboptions_moderationpage', '') ); |
|
1838 | - if ( menu_valid_path(array('link_path' => $moderationpath)) ) { |
|
1837 | + $moderationpath = drupal_lookup_path('source', variable_get('boinc_weboptions_moderationpage', '')); |
|
1838 | + if (menu_valid_path(array('link_path' => $moderationpath))) { |
|
1839 | 1839 | $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'); |
1840 | 1840 | } else { |
1841 | 1841 | $modsentence = bts('Please note: user profiles are subject to moderation.', array(), NULL, 'boinc:account-finish'); |
@@ -1843,11 +1843,11 @@ discard block |
||
1843 | 1843 | |
1844 | 1844 | $username = $user->boincuser_name; |
1845 | 1845 | $site_name = variable_get('site_name', 'Drupal-BOINC'); |
1846 | - $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.)', |
|
1846 | + $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.)', |
|
1847 | 1847 | array( |
1848 | 1848 | '@user_name' => $username, |
1849 | 1849 | '@site_name' => $site_name, |
1850 | - ), NULL, 'boinc:account-finish') . "</p>"; |
|
1850 | + ), NULL, 'boinc:account-finish')."</p>"; |
|
1851 | 1851 | |
1852 | 1852 | $links = array( |
1853 | 1853 | array( |
@@ -1913,7 +1913,7 @@ discard block |
||
1913 | 1913 | ); |
1914 | 1914 | |
1915 | 1915 | //List of links |
1916 | - $output .= theme_item_list($links, $title = NULL, $type='ul'); |
|
1916 | + $output .= theme_item_list($links, $title = NULL, $type = 'ul'); |
|
1917 | 1917 | |
1918 | 1918 | return $output; |
1919 | 1919 | } |
@@ -2030,7 +2030,7 @@ discard block |
||
2030 | 2030 | global $base_url; |
2031 | 2031 | global $base_path; |
2032 | 2032 | $site_name = variable_get('site_name', 'Drupal-BOINC'); |
2033 | - $site_url = $base_url . $base_path; |
|
2033 | + $site_url = $base_url.$base_path; |
|
2034 | 2034 | $moderator = user_load($user->uid); |
2035 | 2035 | $profile->moderate = 0; |
2036 | 2036 | $profile->status = 0; |
@@ -2091,7 +2091,7 @@ discard block |
||
2091 | 2091 | global $base_url; |
2092 | 2092 | global $base_path; |
2093 | 2093 | $site_name = variable_get('site_name', 'Drupal-BOINC'); |
2094 | - $site_url = $base_url . $base_path; |
|
2094 | + $site_url = $base_url.$base_path; |
|
2095 | 2095 | $moderator = user_load($user->uid); |
2096 | 2096 | $settings = array( |
2097 | 2097 | 'from' => '', |
@@ -2195,25 +2195,25 @@ discard block |
||
2195 | 2195 | if (!$projects) return bts('no projects...', array(), NULL, 'boinc:account-dashboard'); |
2196 | 2196 | |
2197 | 2197 | $output = ''; |
2198 | - $output .= '<table class="user-projects">' . "\n"; |
|
2199 | - $output .= '<thead>' . "\n"; |
|
2200 | - $output .= ' <tr>' . "\n"; |
|
2201 | - $output .= ' <th>' . bts('Name', array(), NULL, 'boinc:project-name:-1:ignoreoverwrite') . '</th>' . "\n"; |
|
2202 | - $output .= ' <th class="numeric">' . bts('Avg credit', array(), NULL, 'boinc:account-dashboard') . '</th>' . "\n"; |
|
2203 | - $output .= ' <th class="numeric">' . bts('Total credit', array(), NULL, 'boinc:user-or-team-total-credits') . '</th>' . "\n"; |
|
2204 | - $output .= ' </tr>' . "\n"; |
|
2205 | - $output .= '</thead>' . "\n"; |
|
2206 | - $output .= '<tbody>' . "\n"; |
|
2198 | + $output .= '<table class="user-projects">'."\n"; |
|
2199 | + $output .= '<thead>'."\n"; |
|
2200 | + $output .= ' <tr>'."\n"; |
|
2201 | + $output .= ' <th>'.bts('Name', array(), NULL, 'boinc:project-name:-1:ignoreoverwrite').'</th>'."\n"; |
|
2202 | + $output .= ' <th class="numeric">'.bts('Avg credit', array(), NULL, 'boinc:account-dashboard').'</th>'."\n"; |
|
2203 | + $output .= ' <th class="numeric">'.bts('Total credit', array(), NULL, 'boinc:user-or-team-total-credits').'</th>'."\n"; |
|
2204 | + $output .= ' </tr>'."\n"; |
|
2205 | + $output .= '</thead>'."\n"; |
|
2206 | + $output .= '<tbody>'."\n"; |
|
2207 | 2207 | foreach ($projects AS $project) { |
2208 | - $url = rtrim($project->url, '/') . '/show_user.php?userid=' . $project->id; |
|
2209 | - $output .= ' <tr>' . "\n"; |
|
2210 | - $output .= ' <td>' . l($project->name, $url) . '</td>' . "\n"; |
|
2211 | - $output .= ' <td class="numeric">' . boincwork_format_stats((float) $project->expavg_credit) . '</td>' . "\n"; |
|
2212 | - $output .= ' <td class="numeric">' . boincwork_format_stats((float) $project->total_credit) . '</td>' . "\n"; |
|
2213 | - $output .= ' </tr>' . "\n"; |
|
2208 | + $url = rtrim($project->url, '/').'/show_user.php?userid='.$project->id; |
|
2209 | + $output .= ' <tr>'."\n"; |
|
2210 | + $output .= ' <td>'.l($project->name, $url).'</td>'."\n"; |
|
2211 | + $output .= ' <td class="numeric">'.boincwork_format_stats((float)$project->expavg_credit).'</td>'."\n"; |
|
2212 | + $output .= ' <td class="numeric">'.boincwork_format_stats((float)$project->total_credit).'</td>'."\n"; |
|
2213 | + $output .= ' </tr>'."\n"; |
|
2214 | 2214 | } |
2215 | - $output .= '</tbody>' . "\n"; |
|
2216 | - $output .= '</table>' . "\n"; |
|
2215 | + $output .= '</tbody>'."\n"; |
|
2216 | + $output .= '</table>'."\n"; |
|
2217 | 2217 | $more_link = ($account) ? "user/{$account->uid}/stats" : 'account/stats'; |
2218 | 2218 | //$output .= "<div class=\"more-link\"><a href=\"{$more_link}\">More stats</a></div>" . "\n"; |
2219 | 2219 | return $output; |
@@ -2233,8 +2233,8 @@ discard block |
||
2233 | 2233 | 'cpid' => $cpid |
2234 | 2234 | ); |
2235 | 2235 | $args = array(); |
2236 | - foreach ($get as $arg => $value) $args[] = "{$arg}=" . rawurlencode($value); |
|
2237 | - $query = '?' . implode('&', $args); |
|
2236 | + foreach ($get as $arg => $value) $args[] = "{$arg}=".rawurlencode($value); |
|
2237 | + $query = '?'.implode('&', $args); |
|
2238 | 2238 | |
2239 | 2239 | // Load XML from RPC |
2240 | 2240 | $target_url = "http://{$stats_server}/{$stats_rpc}{$query}"; |
@@ -2306,12 +2306,12 @@ discard block |
||
2306 | 2306 | $output .= '<ul class="tab-list">'; |
2307 | 2307 | $count = 0; |
2308 | 2308 | foreach ($links as $key => $link) { |
2309 | - $output .= '<li class="' . (($count == 0) ? 'first primary ' : '') . 'tab">'; |
|
2309 | + $output .= '<li class="'.(($count == 0) ? 'first primary ' : '').'tab">'; |
|
2310 | 2310 | $output .= l($link['title'], $link['href'], array('query' => drupal_get_destination())); |
2311 | 2311 | $output .= '</li>'; |
2312 | 2312 | $count++; |
2313 | 2313 | } |
2314 | - $output .= '<li class="' . (($count) ? '' : 'first ') . 'last tab">' . flag_create_link('abuse_user_meta', $account->uid) . '</li>'; |
|
2314 | + $output .= '<li class="'.(($count) ? '' : 'first ').'last tab">'.flag_create_link('abuse_user_meta', $account->uid).'</li>'; |
|
2315 | 2315 | $output .= '</ul>'; |
2316 | 2316 | } |
2317 | 2317 | return $output; |
@@ -2352,7 +2352,7 @@ discard block |
||
2352 | 2352 | function boincuser_apachesolr_index_documents_alter(array &$documents, $entity, $entity_type, $env_id) { |
2353 | 2353 | |
2354 | 2354 | foreach ($documents as $document) { |
2355 | - if ( $document->entity_type=='node' AND $document->bundle=='profile' ) { |
|
2355 | + if ($document->entity_type == 'node' AND $document->bundle == 'profile') { |
|
2356 | 2356 | // Node information. |
2357 | 2357 | $nid = $document->entity_id; |
2358 | 2358 | $node = node_load($nid); |
@@ -2402,11 +2402,11 @@ discard block |
||
2402 | 2402 | // privatemsg module. We need to convert them back to spaces for the |
2403 | 2403 | // check below. |
2404 | 2404 | $boincname = preg_replace("/\\xc2\\xa0/", " ", $boincname); |
2405 | - if ($drupalid>0) { |
|
2405 | + if ($drupalid > 0) { |
|
2406 | 2406 | if ($recipient = user_load(array('uid' => $drupalid))) { |
2407 | 2407 | // Double-check that the loaded user matches both boincuser_id |
2408 | 2408 | // and boincuser_name. |
2409 | - if ( ($boincid == $recipient->boincuser_id) AND ($boincname == $recipient->boincuser_name) ) { |
|
2409 | + if (($boincid == $recipient->boincuser_id) AND ($boincname == $recipient->boincuser_name)) { |
|
2410 | 2410 | return $recipient; |
2411 | 2411 | } |
2412 | 2412 | } |
@@ -100,12 +100,12 @@ discard block |
||
100 | 100 | // Consistency checks |
101 | 101 | // |
102 | 102 | if (!check_termsofuse()) { |
103 | - error_log("Project configuration error! " . |
|
103 | + error_log("Project configuration error! ". |
|
104 | 104 | "Terms of use undefined while 'account_creation_rpc_require_consent' enabled!" |
105 | 105 | ); |
106 | 106 | } |
107 | 107 | if (!$checkct) { |
108 | - error_log("Project configuration error! " . |
|
108 | + error_log("Project configuration error! ". |
|
109 | 109 | "'CONSENT_TYPE_ENROLL' disabled while 'account_creation_rpc_require_consent' enabled!" |
110 | 110 | ); |
111 | 111 | } |
@@ -114,9 +114,9 @@ discard block |
||
114 | 114 | // |
115 | 115 | if (is_null($consent_flag) or !$source) { |
116 | 116 | xml_error(ERR_ACCT_REQUIRE_CONSENT, |
117 | - "This project requires you to consent to its terms of use. " . |
|
118 | - "Please update your BOINC software " . |
|
119 | - "or register via the project's website " . |
|
117 | + "This project requires you to consent to its terms of use. ". |
|
118 | + "Please update your BOINC software ". |
|
119 | + "or register via the project's website ". |
|
120 | 120 | "or contact your account manager's provider." |
121 | 121 | ); |
122 | 122 | } |
@@ -152,13 +152,13 @@ discard block |
||
152 | 152 | // * not agree. |
153 | 153 | // -> no create account RPC at all |
154 | 154 | // |
155 | - if ( (!is_null($consent_flag)) and $source) { |
|
155 | + if ((!is_null($consent_flag)) and $source) { |
|
156 | 156 | // Record the user giving consent in database - if consent_flag is 0, |
157 | 157 | // this is an 'anonymous account' and consent_not_required is |
158 | 158 | // set to 1. |
159 | - if ($consent_flag==0) { |
|
159 | + if ($consent_flag == 0) { |
|
160 | 160 | $rc = consent_to_a_policy($user, $ctid, 0, 1, $source); |
161 | - } else { |
|
161 | + } else { |
|
162 | 162 | $rc = consent_to_a_policy($user, $ctid, 1, 0, $source); |
163 | 163 | } |
164 | 164 | if (!$rc) { |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | }// switch |
72 | 72 | } else { |
73 | 73 | $form_state['storage']['wip'] = TRUE; |
74 | - if ( !in_array($prefs_preset, array('standard','maximum','green','minimum','custom')) ) { |
|
74 | + if (!in_array($prefs_preset, array('standard', 'maximum', 'green', 'minimum', 'custom'))) { |
|
75 | 75 | if ($established) { |
76 | 76 | $prefs_preset = 'custom'; |
77 | 77 | } else { |
@@ -141,10 +141,10 @@ discard block |
||
141 | 141 | ); |
142 | 142 | $form['hour_options'] = array( |
143 | 143 | '#type' => 'value', |
144 | - '#value' => array('0:00','1:00','2:00','3:00','4:00', |
|
145 | - '5:00','6:00','7:00','8:00','9:00','10:00','11:00', |
|
146 | - '12:00','13:00','14:00','15:00','16:00','17:00', |
|
147 | - '18:00','19:00','20:00','21:00','22:00','23:00') |
|
144 | + '#value' => array('0:00', '1:00', '2:00', '3:00', '4:00', |
|
145 | + '5:00', '6:00', '7:00', '8:00', '9:00', '10:00', '11:00', |
|
146 | + '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', |
|
147 | + '18:00', '19:00', '20:00', '21:00', '22:00', '23:00') |
|
148 | 148 | ); |
149 | 149 | |
150 | 150 | // Identify preference sets that are established to distinguish what has been |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | '#description' => bts('Suspend computing when your computer is busy running other programs.', array(), NULL, 'boinc:account-preferences-computing'), |
282 | 282 | ); |
283 | 283 | $form['prefs']['advanced']['processor']['hour_label'] = array( |
284 | - '#value' => '<div class="form-item"><label>' . bts('Compute only between:', array(), NULL, 'boinc:account-preferences-computing') . '</label></div>' |
|
284 | + '#value' => '<div class="form-item"><label>'.bts('Compute only between:', array(), NULL, 'boinc:account-preferences-computing').'</label></div>' |
|
285 | 285 | ); |
286 | 286 | $form['prefs']['advanced']['processor']['start_hour'] = array( |
287 | 287 | '#type' => 'select', |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | '#default_value' => $default['start_hour'] |
290 | 290 | ); |
291 | 291 | $form['prefs']['advanced']['processor']['hour_delimiter'] = array( |
292 | - '#value' => '<span>' . bts('and', array(), NULL, 'boinc:account-preference') . '</span>' |
|
292 | + '#value' => '<span>'.bts('and', array(), NULL, 'boinc:account-preference').'</span>' |
|
293 | 293 | ); |
294 | 294 | $form['prefs']['advanced']['processor']['end_hour'] = array( |
295 | 295 | '#type' => 'select', |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | '#default_value' => $default['end_hour'] |
298 | 298 | ); |
299 | 299 | $form['prefs']['advanced']['processor']['hour_description'] = array( |
300 | - '#value' => '<div class="form-item slim"><div class="description">' . bts('Compute only during a particular period each day.', array(), NULL, 'boinc:account-preferences-computing') . '</div></div>' |
|
300 | + '#value' => '<div class="form-item slim"><div class="description">'.bts('Compute only during a particular period each day.', array(), NULL, 'boinc:account-preferences-computing').'</div></div>' |
|
301 | 301 | ); |
302 | 302 | $form['prefs']['advanced']['processor']['leave_apps_in_memory'] = array( |
303 | 303 | '#title' => bts('Leave non-GPU tasks in memory while suspended?', array(), NULL, 'boinc:account-preferences-computing'), |
@@ -454,7 +454,7 @@ discard block |
||
454 | 454 | '#description' => bts('Limit the upload rate of file transfers.', array(), NULL, 'boinc:account-preferences-computing') |
455 | 455 | ); |
456 | 456 | $form['prefs']['advanced']['network']['hour_label'] = array( |
457 | - '#value' => '<div class="form-item"><label>' . bts('Transfer files only between', array(), NULL, 'boinc:account-preferences-computing') . '</label></div>' |
|
457 | + '#value' => '<div class="form-item"><label>'.bts('Transfer files only between', array(), NULL, 'boinc:account-preferences-computing').'</label></div>' |
|
458 | 458 | ); |
459 | 459 | $form['prefs']['advanced']['network']['net_start_hour'] = array( |
460 | 460 | '#type' => 'select', |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | '#default_value' => $default['net_start_hour'] |
463 | 463 | ); |
464 | 464 | $form['prefs']['advanced']['network']['hour_delimiter'] = array( |
465 | - '#value' => '<span>' . bts('and', array(), NULL, 'boinc:account-preference') . '</span>' |
|
465 | + '#value' => '<span>'.bts('and', array(), NULL, 'boinc:account-preference').'</span>' |
|
466 | 466 | ); |
467 | 467 | $form['prefs']['advanced']['network']['net_end_hour'] = array( |
468 | 468 | '#type' => 'select', |
@@ -470,7 +470,7 @@ discard block |
||
470 | 470 | '#default_value' => $default['net_end_hour'] |
471 | 471 | ); |
472 | 472 | $form['prefs']['advanced']['network']['hour_description'] = array( |
473 | - '#value' => '<div class="form-item slim"><div class="description">' . bts('Transfer files only during a particular period each day.', array(), NULL, 'boinc:account-preferences-computing') . '</div></div>' |
|
473 | + '#value' => '<div class="form-item slim"><div class="description">'.bts('Transfer files only during a particular period each day.', array(), NULL, 'boinc:account-preferences-computing').'</div></div>' |
|
474 | 474 | ); |
475 | 475 | $form['prefs']['advanced']['network']['daily_xfer_limit_mb'] = array( |
476 | 476 | '#title' => bts('Limit usage to', array(), NULL, 'boinc:account-preferences-computing'), |
@@ -530,23 +530,23 @@ discard block |
||
530 | 530 | '#suffix' => '</li>' |
531 | 531 | ); |
532 | 532 | $form['prefs']['form control tabs'] = array( |
533 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), drupal_get_path_alias("account/prefs/computing/edit")) . '</li>' |
|
533 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), drupal_get_path_alias("account/prefs/computing/edit")).'</li>' |
|
534 | 534 | ); |
535 | 535 | if ($venue AND $venue != 'generic') { |
536 | 536 | global $base_path; |
537 | - $form['prefs']['form control tabs']['#value'] .= '<li class="tab">' . |
|
537 | + $form['prefs']['form control tabs']['#value'] .= '<li class="tab">'. |
|
538 | 538 | l(bts('Clear', array(), NULL, 'boinc:form-clear'), "account/prefs/computing/clear/{$venue}", |
539 | 539 | array( |
540 | - 'query' => 'destination=' . urlencode(drupal_get_path_alias('account/prefs/computing/combined')), |
|
540 | + 'query' => 'destination='.urlencode(drupal_get_path_alias('account/prefs/computing/combined')), |
|
541 | 541 | 'attributes' => array( |
542 | - 'onclick' => 'return confirm(\'' . bts('This will remove all of your settings from the @name preference set. Are you sure?', |
|
543 | - array('@name' => $venue), NULL, 'boinc:account-preferences') . '\')' |
|
542 | + 'onclick' => 'return confirm(\''.bts('This will remove all of your settings from the @name preference set. Are you sure?', |
|
543 | + array('@name' => $venue), NULL, 'boinc:account-preferences').'\')' |
|
544 | 544 | ) |
545 | 545 | ) |
546 | - ) . '</li>'; |
|
546 | + ).'</li>'; |
|
547 | 547 | } |
548 | 548 | $form['prefs']['view control'] = array( |
549 | - '#value' => '<li class="first alt tab">' . l('(' . bts('Show comparison view', array(), NULL, 'boinc:account-preferences') . ')', 'account/prefs/computing/combined') . '</li>' |
|
549 | + '#value' => '<li class="first alt tab">'.l('('.bts('Show comparison view', array(), NULL, 'boinc:account-preferences').')', 'account/prefs/computing/combined').'</li>' |
|
550 | 550 | ); |
551 | 551 | $form['prefs']['form control tabs suffix'] = array( |
552 | 552 | '#value' => '</ul>' |
@@ -784,7 +784,7 @@ discard block |
||
784 | 784 | return FALSE; |
785 | 785 | } |
786 | 786 | |
787 | - if ($new_host->userid==0) { |
|
787 | + if ($new_host->userid == 0) { |
|
788 | 788 | rules_invoke_event('boincwork_zombie_merge_error', $old_host->id, $new_host->id, variable_get('boinc_admin_mailing_list_subject_tag', '')); |
789 | 789 | watchdog('boincwork', |
790 | 790 | 'Zombie merge attempted, target host has userid=0: old host id=%old_host, target host id=%new_host', |
@@ -880,9 +880,9 @@ discard block |
||
880 | 880 | } |
881 | 881 | |
882 | 882 | $form['overview'] = array( |
883 | - '#value' => '<p>' . bts('Sometimes BOINC assigns separate identities to' |
|
883 | + '#value' => '<p>'.bts('Sometimes BOINC assigns separate identities to' |
|
884 | 884 | . ' the same computer by mistake. You can correct this by merging old' |
885 | - . ' identities with the newest one.', array(), NULL, 'boinc:account-host-merge') . '</p>' |
|
885 | + . ' identities with the newest one.', array(), NULL, 'boinc:account-host-merge').'</p>' |
|
886 | 886 | . '<p>' |
887 | 887 | . bts('Check the computers that are the same as @name' |
888 | 888 | . ' (created on @date at @time with computer ID @id)', |
@@ -892,7 +892,7 @@ discard block |
||
892 | 892 | '@time' => date('G:i:s T', $current_host->create_time), |
893 | 893 | '@id' => $current_host->id, |
894 | 894 | ), |
895 | - NULL, 'boinc:account-host-merge') . '</p>', |
|
895 | + NULL, 'boinc:account-host-merge').'</p>', |
|
896 | 896 | ); |
897 | 897 | |
898 | 898 | $options = array(); |
@@ -926,7 +926,7 @@ discard block |
||
926 | 926 | '#suffix' => '</li>' |
927 | 927 | ); |
928 | 928 | $form['prefs']['form control tabs'] = array( |
929 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "host/{$host_id}") . '</li>' |
|
929 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "host/{$host_id}").'</li>' |
|
930 | 930 | ); |
931 | 931 | |
932 | 932 | return $form; |
@@ -971,7 +971,7 @@ discard block |
||
971 | 971 | if (count($merged) == 2) { |
972 | 972 | $oxford_comma = ''; |
973 | 973 | } |
974 | - $list = implode(', ', $list) . $oxford_comma . ' ' . $conjunction . ' ' . $last; |
|
974 | + $list = implode(', ', $list).$oxford_comma.' '.$conjunction.' '.$last; |
|
975 | 975 | } |
976 | 976 | else { |
977 | 977 | $list = $last; |
@@ -1220,23 +1220,23 @@ discard block |
||
1220 | 1220 | '#suffix' => '</li>' |
1221 | 1221 | ); |
1222 | 1222 | $form['prefs']['form control tabs'] = array( |
1223 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']) . '</li>' |
|
1223 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']).'</li>' |
|
1224 | 1224 | ); |
1225 | 1225 | if ($venue AND $venue != 'generic') { |
1226 | 1226 | global $base_path; |
1227 | - $form['prefs']['form control tabs']['#value'] .= '<li class="tab">' . |
|
1227 | + $form['prefs']['form control tabs']['#value'] .= '<li class="tab">'. |
|
1228 | 1228 | l(bts('Clear', array(), NULL, 'boinc:form-clear'), "account/prefs/project/clear/{$venue}", |
1229 | 1229 | array( |
1230 | - 'query' => 'destination=' . urlencode(drupal_get_path_alias('account/prefs/project/combined')), |
|
1230 | + 'query' => 'destination='.urlencode(drupal_get_path_alias('account/prefs/project/combined')), |
|
1231 | 1231 | 'attributes' => array( |
1232 | - 'onclick' => 'return confirm(\'' . bts('This will remove all of your settings from the @name preference set. Are you sure?', |
|
1233 | - array('@name' => $venue), NULL, 'boinc:account-preferences') . '\')' |
|
1232 | + 'onclick' => 'return confirm(\''.bts('This will remove all of your settings from the @name preference set. Are you sure?', |
|
1233 | + array('@name' => $venue), NULL, 'boinc:account-preferences').'\')' |
|
1234 | 1234 | ) |
1235 | 1235 | ) |
1236 | - ) . '</li>'; |
|
1236 | + ).'</li>'; |
|
1237 | 1237 | } |
1238 | 1238 | $form['prefs']['view control'] = array( |
1239 | - '#value' => '<li class="first alt tab">' . l('(' . bts('Show comparison view', array(), NULL, 'boinc:account-preferences') . ')', 'account/prefs/project/combined') . '</li>' |
|
1239 | + '#value' => '<li class="first alt tab">'.l('('.bts('Show comparison view', array(), NULL, 'boinc:account-preferences').')', 'account/prefs/project/combined').'</li>' |
|
1240 | 1240 | ); |
1241 | 1241 | $form['prefs']['form control tabs suffix'] = array( |
1242 | 1242 | '#value' => '</ul>' |
@@ -1279,7 +1279,7 @@ discard block |
||
1279 | 1279 | |
1280 | 1280 | foreach ($xml['project_specific_preferences'] as $wrapped_element) { |
1281 | 1281 | $type = key($wrapped_element); |
1282 | - $element= reset($wrapped_element); |
|
1282 | + $element = reset($wrapped_element); |
|
1283 | 1283 | boincwork_generate_prefs_element($form, $type, $element, $prefs['project_specific']); |
1284 | 1284 | } |
1285 | 1285 | } |
@@ -1505,7 +1505,7 @@ discard block |
||
1505 | 1505 | $names = array(); |
1506 | 1506 | foreach ($languages as $langcode => $item) { |
1507 | 1507 | $name = t($item->name); |
1508 | - $names[check_plain($langcode)] = check_plain($name . ($item->native != $name ? ' ('. $item->native .')' : '')); |
|
1508 | + $names[check_plain($langcode)] = check_plain($name.($item->native != $name ? ' ('.$item->native.')' : '')); |
|
1509 | 1509 | } |
1510 | 1510 | $form['locale'] = array( |
1511 | 1511 | '#type' => 'fieldset', |
@@ -1530,20 +1530,20 @@ discard block |
||
1530 | 1530 | // Avatar options |
1531 | 1531 | $form['gravatar'] = array( |
1532 | 1532 | '#type' => 'item', |
1533 | - '#value' => bts('If you have a <a href="@gravatar-check">valid Gravatar</a> associated with your e-mail address, it will be used for your user picture.', array('@gravatar-check' => 'http://en.gravatar.com/site/check/' . $account->mail), NULL, 'boinc:account-preferences-community'), |
|
1533 | + '#value' => bts('If you have a <a href="@gravatar-check">valid Gravatar</a> associated with your e-mail address, it will be used for your user picture.', array('@gravatar-check' => 'http://en.gravatar.com/site/check/'.$account->mail), NULL, 'boinc:account-preferences-community'), |
|
1534 | 1534 | '#description' => bts('Your Gravatar will not be shown if you upload a user picture.', array(), NULL, 'boinc:account-preferences-community'), |
1535 | 1535 | ); |
1536 | 1536 | if (user_access('disable own gravatar', $account)) { |
1537 | 1537 | $form['gravatar'] = array( |
1538 | 1538 | '#type' => 'checkbox', |
1539 | - '#title' => bts('If you have a <a href="@gravatar-check">valid Gravatar</a> associated with your e-mail address, use it for your user picture.', array('@gravatar-check' => 'http://en.gravatar.com/site/check/' . $account->mail), NULL, 'boinc:account-preferences-community'), |
|
1539 | + '#title' => bts('If you have a <a href="@gravatar-check">valid Gravatar</a> associated with your e-mail address, use it for your user picture.', array('@gravatar-check' => 'http://en.gravatar.com/site/check/'.$account->mail), NULL, 'boinc:account-preferences-community'), |
|
1540 | 1540 | '#description' => bts('Gravatar will not be shown if an avatar is uploaded.', array(), NULL, 'boinc:account-preferences-community'), |
1541 | 1541 | '#default_value' => isset($account->gravatar) ? $account->gravatar : 0, |
1542 | 1542 | '#disabled' => !empty($account->picture), |
1543 | 1543 | ); |
1544 | 1544 | } |
1545 | 1545 | $form['gravatar']['#weight'] = 15; |
1546 | - $form['gravatar']['#prefix'] = '<fieldset class="collapsible"><legend><a href="#">' . bts('Avatar settings', array(), NULL, 'boinc:account-preferences-community') . '</a></legend>'; |
|
1546 | + $form['gravatar']['#prefix'] = '<fieldset class="collapsible"><legend><a href="#">'.bts('Avatar settings', array(), NULL, 'boinc:account-preferences-community').'</a></legend>'; |
|
1547 | 1547 | // Upload an avatar (pulled from profile_node_form): |
1548 | 1548 | if (!empty($profile_form['field_image'])) { |
1549 | 1549 | $form['field_image'] = $profile_form['field_image']; |
@@ -1578,7 +1578,7 @@ discard block |
||
1578 | 1578 | ); |
1579 | 1579 | // Can't have a typical Drupal form suffix on a select box? |
1580 | 1580 | $form['forums']['comments_per_page_suffix'] = array( |
1581 | - '#value' => '<span>' . bts('comments per page', array(), NULL, 'boinc:account-preferences-community') . '</span>' |
|
1581 | + '#value' => '<span>'.bts('comments per page', array(), NULL, 'boinc:account-preferences-community').'</span>' |
|
1582 | 1582 | ); |
1583 | 1583 | $form['forums']['comments_order'] = array( |
1584 | 1584 | '#type' => 'select', |
@@ -1631,7 +1631,7 @@ discard block |
||
1631 | 1631 | '#weight' => 1002, |
1632 | 1632 | ); |
1633 | 1633 | $form['form control tabs'] = array( |
1634 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']) . '</li>', |
|
1634 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']).'</li>', |
|
1635 | 1635 | '#weight' => 1003, |
1636 | 1636 | ); |
1637 | 1637 | $form['form control tabs suffix'] = array( |
@@ -1717,10 +1717,10 @@ discard block |
||
1717 | 1717 | if ($user->language != $edit['language']) { |
1718 | 1718 | global $base_url; |
1719 | 1719 | if ($edit['language'] != language_default('language')) { |
1720 | - $form_state['redirect'] = $base_url . '/' . $edit['language'] . '/' . $_GET['q']; |
|
1720 | + $form_state['redirect'] = $base_url.'/'.$edit['language'].'/'.$_GET['q']; |
|
1721 | 1721 | } |
1722 | 1722 | else { |
1723 | - $form_state['redirect'] = $base_url . '/' . $_GET['q']; |
|
1723 | + $form_state['redirect'] = $base_url.'/'.$_GET['q']; |
|
1724 | 1724 | } |
1725 | 1725 | } |
1726 | 1726 | } |
@@ -1790,7 +1790,7 @@ discard block |
||
1790 | 1790 | // option that deals with privacy. |
1791 | 1791 | foreach ($privacy_consent_types as $ct) { |
1792 | 1792 | |
1793 | - $currstate = (check_user_consent($boincuser, $ct['shortname'])) ? 1 : 0 ; |
|
1793 | + $currstate = (check_user_consent($boincuser, $ct['shortname'])) ? 1 : 0; |
|
1794 | 1794 | // Set name to 'privacyconsent_SHORTNAME', which can be parsed |
1795 | 1795 | // later in the submit function. |
1796 | 1796 | $form['privacy']['privacyconsent_'.$ct['shortname']] = array( |
@@ -1804,7 +1804,7 @@ discard block |
||
1804 | 1804 | // Add a description with link to the question 'Do you consent to |
1805 | 1805 | // exporting your data...'. |
1806 | 1806 | $mypatt = '/Do you consent to exporting your data/'; |
1807 | - if (preg_match($mypatt, $ct['description']) ) { |
|
1807 | + if (preg_match($mypatt, $ct['description'])) { |
|
1808 | 1808 | $form['privacy']['privacyconsent_'.$ct['shortname']]['#description'] = bts('See our !privacy_policy_link for the current list of statistics exports.', |
1809 | 1809 | array( |
1810 | 1810 | '!privacy_policy_link' => l( |
@@ -1843,7 +1843,7 @@ discard block |
||
1843 | 1843 | $form['ignoreblock']['delete'][$ignored_user['iuid']] = array( |
1844 | 1844 | '#value' => l( |
1845 | 1845 | bts('delete', array(), NULL, 'boinc:ignore-user-delete-button'), |
1846 | - 'account/prefs/privacy/ignore_user/remove/'. $ignored_user['iuid'], |
|
1846 | + 'account/prefs/privacy/ignore_user/remove/'.$ignored_user['iuid'], |
|
1847 | 1847 | array() |
1848 | 1848 | ), |
1849 | 1849 | ); |
@@ -1894,7 +1894,7 @@ discard block |
||
1894 | 1894 | '#suffix' => '</li>' |
1895 | 1895 | ); |
1896 | 1896 | $form['prefs']['form control tabs'] = array( |
1897 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']) . '</li>' |
|
1897 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']).'</li>' |
|
1898 | 1898 | ); |
1899 | 1899 | $form['prefs']['form control tabs suffix'] = array( |
1900 | 1900 | '#value' => '</ul>' |
@@ -1981,7 +1981,7 @@ discard block |
||
1981 | 1981 | $privacyconsent_prefs = array_intersect_key($form_state['values'], array_flip($result)); |
1982 | 1982 | foreach ($privacyconsent_prefs as $name => $newstate) { |
1983 | 1983 | $subname = explode('_', $name)[1]; |
1984 | - $currstate = (check_user_consent($boincuser, $subname)) ? 1 : 0 ; |
|
1984 | + $currstate = (check_user_consent($boincuser, $subname)) ? 1 : 0; |
|
1985 | 1985 | list($checkct, $ctid) = check_consent_type($subname); |
1986 | 1986 | if ($checkct && ($currstate != $newstate)) { |
1987 | 1987 | consent_to_a_policy($boincuser, $ctid, $newstate, 0, 'Webform', time()); |
@@ -2047,7 +2047,7 @@ discard block |
||
2047 | 2047 | function boincwork_selectapp_form_submit($form, &$form_state) { |
2048 | 2048 | $myargs = arg(); |
2049 | 2049 | array_pop($myargs); |
2050 | - $newpath = implode('/', $myargs ) . '/' . $form['selectapp']['#value']; |
|
2050 | + $newpath = implode('/', $myargs).'/'.$form['selectapp']['#value']; |
|
2051 | 2051 | $form_state['redirect'] = $newpath; |
2052 | 2052 | } |
2053 | 2053 |