@@ -70,10 +70,10 @@ |
||
| 70 | 70 | $n = ($bytes - $i) > 1073741824 |
| 71 | 71 | ? 1073741824 |
| 72 | 72 | : $bytes - $i; |
| 73 | - $buf .= Sodium::randombytes_buf((int) $n); |
|
| 73 | + $buf .= Sodium::randombytes_buf((int)$n); |
|
| 74 | 74 | } |
| 75 | 75 | } else { |
| 76 | - $buf .= Sodium::randombytes_buf((int) $bytes); |
|
| 76 | + $buf .= Sodium::randombytes_buf((int)$bytes); |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | if (is_string($buf)) { |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | if ($max === $min) { |
| 81 | - return (int) $min; |
|
| 81 | + return (int)$min; |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | /** |
@@ -124,12 +124,12 @@ discard block |
||
| 124 | 124 | * type juggling |
| 125 | 125 | */ |
| 126 | 126 | while ($range > 0) { |
| 127 | - if ($bits % 8 === 0) { |
|
| 127 | + if ($bits%8 === 0) { |
|
| 128 | 128 | ++$bytes; |
| 129 | 129 | } |
| 130 | 130 | ++$bits; |
| 131 | 131 | $range >>= 1; |
| 132 | - $mask = $mask << 1 | 1; |
|
| 132 | + $mask = $mask << 1|1; |
|
| 133 | 133 | } |
| 134 | 134 | $valueShift = $min; |
| 135 | 135 | } |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | */ |
| 168 | 168 | $val &= 0; |
| 169 | 169 | for ($i = 0; $i < $bytes; ++$i) { |
| 170 | - $val |= ord($randomByteString[$i]) << ($i * 8); |
|
| 170 | + $val |= ord($randomByteString[$i]) << ($i*8); |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | /** |
@@ -185,6 +185,6 @@ discard block |
||
| 185 | 185 | */ |
| 186 | 186 | } while (!is_int($val) || $val > $max || $val < $min); |
| 187 | 187 | |
| 188 | - return (int) $val; |
|
| 188 | + return (int)$val; |
|
| 189 | 189 | } |
| 190 | 190 | } |
@@ -60,11 +60,11 @@ |
||
| 60 | 60 | && |
| 61 | 61 | $number < PHP_INT_MAX |
| 62 | 62 | ) { |
| 63 | - $number = (int) $number; |
|
| 63 | + $number = (int)$number; |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | if (is_int($number)) { |
| 67 | - return (int) $number; |
|
| 67 | + return (int)$number; |
|
| 68 | 68 | } elseif (!$fail_open) { |
| 69 | 69 | throw new TypeError( |
| 70 | 70 | 'Expected an integer.' |
@@ -34,8 +34,8 @@ discard block |
||
| 34 | 34 | $RandomCompatversion = array_map('intval', explode('.', PHP_VERSION)); |
| 35 | 35 | define( |
| 36 | 36 | 'PHP_VERSION_ID', |
| 37 | - $RandomCompatversion[0] * 10000 |
|
| 38 | - + $RandomCompatversion[1] * 100 |
|
| 37 | + $RandomCompatversion[0]*10000 |
|
| 38 | + + $RandomCompatversion[1]*100 |
|
| 39 | 39 | + $RandomCompatversion[2] |
| 40 | 40 | ); |
| 41 | 41 | $RandomCompatversion = null; |
@@ -54,9 +54,9 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | $RandomCompatDIR = dirname(__FILE__); |
| 56 | 56 | |
| 57 | -require_once $RandomCompatDIR . '/byte_safe_strings.inc'; |
|
| 58 | -require_once $RandomCompatDIR . '/cast_to_int.inc'; |
|
| 59 | -require_once $RandomCompatDIR . '/error_polyfill.inc'; |
|
| 57 | +require_once $RandomCompatDIR.'/byte_safe_strings.inc'; |
|
| 58 | +require_once $RandomCompatDIR.'/cast_to_int.inc'; |
|
| 59 | +require_once $RandomCompatDIR.'/error_polyfill.inc'; |
|
| 60 | 60 | |
| 61 | 61 | if (!is_callable('random_bytes')) { |
| 62 | 62 | /** |
@@ -76,9 +76,9 @@ discard block |
||
| 76 | 76 | if (extension_loaded('libsodium')) { |
| 77 | 77 | // See random_bytes_libsodium.php |
| 78 | 78 | if (PHP_VERSION_ID >= 50300 && is_callable('\\Sodium\\randombytes_buf')) { |
| 79 | - require_once $RandomCompatDIR . '/random_bytes_libsodium.inc'; |
|
| 79 | + require_once $RandomCompatDIR.'/random_bytes_libsodium.inc'; |
|
| 80 | 80 | } elseif (method_exists('Sodium', 'randombytes_buf')) { |
| 81 | - require_once $RandomCompatDIR . '/random_bytes_libsodium_legacy.inc'; |
|
| 81 | + require_once $RandomCompatDIR.'/random_bytes_libsodium_legacy.inc'; |
|
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | 84 | |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | // place, that is not helpful to us here. |
| 118 | 118 | |
| 119 | 119 | // See random_bytes_dev_urandom.php |
| 120 | - require_once $RandomCompatDIR . '/random_bytes_dev_urandom.inc'; |
|
| 120 | + require_once $RandomCompatDIR.'/random_bytes_dev_urandom.inc'; |
|
| 121 | 121 | } |
| 122 | 122 | // Unset variables after use |
| 123 | 123 | $RandomCompat_basedir = null; |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | extension_loaded('mcrypt') |
| 160 | 160 | ) { |
| 161 | 161 | // See random_bytes_mcrypt.php |
| 162 | - require_once $RandomCompatDIR . '/random_bytes_mcrypt.inc'; |
|
| 162 | + require_once $RandomCompatDIR.'/random_bytes_mcrypt.inc'; |
|
| 163 | 163 | } |
| 164 | 164 | $RandomCompatUrandom = null; |
| 165 | 165 | |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | $RandomCompatCOMtest = new COM('CAPICOM.Utilities.1'); |
| 185 | 185 | if (method_exists($RandomCompatCOMtest, 'GetRandom')) { |
| 186 | 186 | // See random_bytes_com_dotnet.php |
| 187 | - require_once $RandomCompatDIR . '/random_bytes_com_dotnet.inc'; |
|
| 187 | + require_once $RandomCompatDIR.'/random_bytes_com_dotnet.inc'; |
|
| 188 | 188 | } |
| 189 | 189 | } catch (com_exception $e) { |
| 190 | 190 | // Don't try to use it. |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | if (!is_callable('random_int')) { |
| 222 | - require_once $RandomCompatDIR . '/random_int.inc'; |
|
| 222 | + require_once $RandomCompatDIR.'/random_int.inc'; |
|
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | $RandomCompatDIR = null; |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | $expiration = $now + $duration; |
| 32 | 32 | $type = BoincDb::escape_string($type); |
| 33 | 33 | $ret = BoincToken::insert("(token,userid,type,create_time,expire_time) values ('$token', $userid, '$type', $now, $expiration)"); |
| 34 | - if ( !$ret ) { |
|
| 34 | + if (!$ret) { |
|
| 35 | 35 | return null; |
| 36 | 36 | } |
| 37 | 37 | return $token; |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | function is_valid_token($userid, $token, $type) { |
| 41 | 41 | $boincToken = BoincToken::lookup_valid_token($userid, $token, $type); |
| 42 | - if ( $boincToken == null ) { |
|
| 42 | + if ($boincToken == null) { |
|
| 43 | 43 | return false; |
| 44 | 44 | } |
| 45 | 45 | return true; |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | echo tra("Invalid password."); |
| 63 | 63 | } else { |
| 64 | 64 | $passwd_hash = md5($passwd.$email_addr); |
| 65 | - $database_passwd_hash = password_hash($passwd_hash , PASSWORD_DEFAULT); |
|
| 65 | + $database_passwd_hash = password_hash($passwd_hash, PASSWORD_DEFAULT); |
|
| 66 | 66 | $email_addr = BoincDb::escape_string($email_addr); |
| 67 | 67 | $user->email_addr_change_time = time(); |
| 68 | 68 | $result = $user->update( |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | } else { |
| 51 | 51 | echo tra("Email address has been reverted.")."<br /><br />".tra("You need to reset your password: ")."<a href=\"".secure_url_base()."get_passwd.php\">".secure_url_base()."get_passwd.php</a>"; |
| 52 | 52 | |
| 53 | - $database_passwd_hash = password_hash(random_string() , PASSWORD_DEFAULT); |
|
| 53 | + $database_passwd_hash = password_hash(random_string(), PASSWORD_DEFAULT); |
|
| 54 | 54 | //Change previous_email |
| 55 | 55 | $result = $tmpuser->update( |
| 56 | 56 | "email_addr=previous_email_addr, previous_email_addr='', email_addr_change_time=0, passwd_hash='$database_passwd_hash', email_validated=0" |
@@ -11,39 +11,39 @@ |
||
| 11 | 11 | BoincToken::insert("(token,userid,type,create_time, expire_time) values ('$token', 0, 'T', $now, $now+3600)"); |
| 12 | 12 | |
| 13 | 13 | $boincTokens = BoincToken::enum("userid=0"); |
| 14 | -foreach($boincTokens as $boincToken) { |
|
| 15 | - echo $boincToken->token . "\n"; |
|
| 16 | - echo $boincToken->userid . "\n"; |
|
| 17 | - echo $boincToken->type . "\n"; |
|
| 18 | - echo $boincToken->create_time . "\n"; |
|
| 19 | - echo $boincToken->expire_time . "\n"; |
|
| 14 | +foreach ($boincTokens as $boincToken) { |
|
| 15 | + echo $boincToken->token."\n"; |
|
| 16 | + echo $boincToken->userid."\n"; |
|
| 17 | + echo $boincToken->type."\n"; |
|
| 18 | + echo $boincToken->create_time."\n"; |
|
| 19 | + echo $boincToken->expire_time."\n"; |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | echo "---------------\n"; |
| 23 | 23 | $boincToken = BoincToken::lookup("userid=0"); |
| 24 | -echo $boincToken->token . "\n"; |
|
| 25 | -echo $boincToken->userid . "\n"; |
|
| 26 | -echo $boincToken->type . "\n"; |
|
| 27 | -echo $boincToken->create_time . "\n"; |
|
| 28 | -echo $boincToken->expire_time . "\n"; |
|
| 24 | +echo $boincToken->token."\n"; |
|
| 25 | +echo $boincToken->userid."\n"; |
|
| 26 | +echo $boincToken->type."\n"; |
|
| 27 | +echo $boincToken->create_time."\n"; |
|
| 28 | +echo $boincToken->expire_time."\n"; |
|
| 29 | 29 | |
| 30 | 30 | echo "---------------\n"; |
| 31 | 31 | $boincToken = BoincToken::lookup_valid_token(0, $token, 'T'); |
| 32 | -if ( $boincToken != null ) { |
|
| 32 | +if ($boincToken != null) { |
|
| 33 | 33 | echo "Found valid token\n"; |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | echo "---------------\n"; |
| 37 | 37 | $boincToken = BoincToken::lookup_valid_token(0, 'notrealtoken', 'T'); |
| 38 | -if ( $boincToken == null ) { |
|
| 38 | +if ($boincToken == null) { |
|
| 39 | 39 | echo "Successfully didn't find invalid token\n"; |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | echo "---------------\n"; |
| 43 | 43 | $user = new BoincUser(); |
| 44 | -$user->id=0; |
|
| 44 | +$user->id = 0; |
|
| 45 | 45 | $token = create_token($user->id, TOKEN_TYPE_DELETE_ACCOUNT, TOKEN_DURATION_ONE_DAY); |
| 46 | -if ( is_valid_token($user->id, $token, TOKEN_TYPE_DELETE_ACCOUNT) ) { |
|
| 46 | +if (is_valid_token($user->id, $token, TOKEN_TYPE_DELETE_ACCOUNT)) { |
|
| 47 | 47 | echo "Successfully created and validated delete account token"; |
| 48 | 48 | } |
| 49 | 49 | |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | $items['host/%/set-venue/%'] = array( |
| 134 | 134 | 'title' => 'Set host venue', |
| 135 | 135 | 'page callback' => 'boincwork_host_set_venue', |
| 136 | - 'page arguments' => array(1,3), |
|
| 136 | + 'page arguments' => array(1, 3), |
|
| 137 | 137 | 'access callback' => 'user_is_logged_in', |
| 138 | 138 | 'type' => MENU_CALLBACK, |
| 139 | 139 | ); |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | 'title' => 'Account Tasks Table', |
| 185 | 185 | 'description' => '', |
| 186 | 186 | 'page callback' => 'boincwork_account_task_table', |
| 187 | - 'page arguments' => array(2,3), |
|
| 187 | + 'page arguments' => array(2, 3), |
|
| 188 | 188 | 'access arguments' => array('access content'), |
| 189 | 189 | 'type' => MENU_CALLBACK, |
| 190 | 190 | ); |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | 'title' => 'Host Tasks Table', |
| 193 | 193 | 'description' => '', |
| 194 | 194 | 'page callback' => 'boincwork_host_task_table', |
| 195 | - 'page arguments' => array(1,3,4), |
|
| 195 | + 'page arguments' => array(1, 3, 4), |
|
| 196 | 196 | 'access arguments' => array('access content'), |
| 197 | 197 | 'type' => MENU_CALLBACK, |
| 198 | 198 | ); |
@@ -276,15 +276,15 @@ discard block |
||
| 276 | 276 | if ($vars['message']['is_blocked']) { |
| 277 | 277 | $vars['message_actions']['unignore_user'] = array( |
| 278 | 278 | 'title' => bts('Stop Ignoring User', array(), NULL, 'boinc:ignore-user-remove'), |
| 279 | - 'href' => 'account/prefs/privacy/ignore_user/remove/'. $author->uid, |
|
| 280 | - 'query' => 'destination=messages/view/' . $thread_id, |
|
| 279 | + 'href' => 'account/prefs/privacy/ignore_user/remove/'.$author->uid, |
|
| 280 | + 'query' => 'destination=messages/view/'.$thread_id, |
|
| 281 | 281 | ); |
| 282 | 282 | } |
| 283 | 283 | else { |
| 284 | 284 | $vars['message_actions']['ignore_user'] = array( |
| 285 | 285 | 'title' => bts('Ignore User', array(), NULL, 'boinc:ignore-user-add'), |
| 286 | - 'href' => 'account/prefs/privacy/ignore_user/add/'. $author->uid, |
|
| 287 | - 'query' => 'destination=messages/view/' . $thread_id, |
|
| 286 | + 'href' => 'account/prefs/privacy/ignore_user/add/'.$author->uid, |
|
| 287 | + 'query' => 'destination=messages/view/'.$thread_id, |
|
| 288 | 288 | ); |
| 289 | 289 | } |
| 290 | 290 | } |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | // Delete expired hosts in the BOINC database, host_delete table. |
| 298 | 298 | require_boinc('boinc_db'); |
| 299 | 299 | $num_deleted = BoincHostDeleted::delete_expired(); |
| 300 | - if ($num_deleted>0) { |
|
| 300 | + if ($num_deleted > 0) { |
|
| 301 | 301 | watchdog('boincwork', "Deleted ${num_deleted} hosts from host_deleted table", WATCHDOG_NOTICE); |
| 302 | 302 | } |
| 303 | 303 | } |
@@ -344,10 +344,10 @@ discard block |
||
| 344 | 344 | drupal_prepare_form('boincwork_generalprefs_form', $prefs[$pref_set], $form_state); |
| 345 | 345 | } |
| 346 | 346 | |
| 347 | - $output .= '<p>' . bts('These apply to all BOINC projects in which you participate.', array(), NULL, 'boinc:account-preferences-computing') . '<br/>'; |
|
| 348 | - $output .= bts('On computers attached to multiple projects, the most recently modified preferences will be used.', array(), NULL, 'boinc:account-preferences-computing') . '</p>'; |
|
| 349 | - $output .= '<p>' . bts('Preferences last modified: @mod_time', array('@mod_time' => pretty_time_str($prefs['generic']['prefs']['modified']['#value'])), NULL, 'boinc:account-preferences') . '</p>'; |
|
| 350 | - $output .= '<h2>' . bts('Combined preferences', array(), NULL, 'boinc:account-preferences') . ' ' . l('(' . bts('Switch View', array(), NULL, 'boinc:account-preferences') . ')', 'account/prefs/computing') . '</h2>'; |
|
| 347 | + $output .= '<p>'.bts('These apply to all BOINC projects in which you participate.', array(), NULL, 'boinc:account-preferences-computing').'<br/>'; |
|
| 348 | + $output .= bts('On computers attached to multiple projects, the most recently modified preferences will be used.', array(), NULL, 'boinc:account-preferences-computing').'</p>'; |
|
| 349 | + $output .= '<p>'.bts('Preferences last modified: @mod_time', array('@mod_time' => pretty_time_str($prefs['generic']['prefs']['modified']['#value'])), NULL, 'boinc:account-preferences').'</p>'; |
|
| 350 | + $output .= '<h2>'.bts('Combined preferences', array(), NULL, 'boinc:account-preferences').' '.l('('.bts('Switch View', array(), NULL, 'boinc:account-preferences').')', 'account/prefs/computing').'</h2>'; |
|
| 351 | 351 | |
| 352 | 352 | $output .= '<table class="preferences combined">'; |
| 353 | 353 | |
@@ -357,7 +357,7 @@ discard block |
||
| 357 | 357 | $output .= '<tr class="section-heading">'; |
| 358 | 358 | $output .= "<td>{$section['name']}</td>"; |
| 359 | 359 | foreach ($pref_sets as $pref_set) { |
| 360 | - $output .= '<td>' . $pref_set . '</td>'; |
|
| 360 | + $output .= '<td>'.$pref_set.'</td>'; |
|
| 361 | 361 | } |
| 362 | 362 | $output .= '</tr>'; |
| 363 | 363 | foreach ($section['elements'] as $name => $setting) { |
@@ -405,11 +405,11 @@ discard block |
||
| 405 | 405 | $second_pref = $special_map[$name]; |
| 406 | 406 | $second_pref_setting = $prefs[$pref_set]['prefs']['advanced'][$category][$second_pref]; |
| 407 | 407 | $second_value = isset($second_pref_setting['#options']) ? $second_pref_setting['#options'][$second_pref_setting['#default_value']] : $second_pref_setting['#default_value']; |
| 408 | - $output .= "<td>{$value} {$pref_setting['#field_suffix']} {$special_delimiter[$name]}" . |
|
| 408 | + $output .= "<td>{$value} {$pref_setting['#field_suffix']} {$special_delimiter[$name]}". |
|
| 409 | 409 | " {$second_value} {$second_pref_setting['#field_suffix']} </td>"; |
| 410 | 410 | } |
| 411 | 411 | } |
| 412 | - else { |
|
| 412 | + else { |
|
| 413 | 413 | $output .= '<td>---</td>'; |
| 414 | 414 | } |
| 415 | 415 | } |
@@ -437,12 +437,12 @@ discard block |
||
| 437 | 437 | ); |
| 438 | 438 | // Show Clear links for established preference sets |
| 439 | 439 | if ($pref_set != 'generic' AND $prefs[$pref_set]['#established']) { |
| 440 | - $output .= ' </li><li class="tab"> ' . l(bts('Clear', array(), NULL, 'boinc:form-clear'), "account/prefs/computing/clear/{$pref_set}", |
|
| 440 | + $output .= ' </li><li class="tab"> '.l(bts('Clear', array(), NULL, 'boinc:form-clear'), "account/prefs/computing/clear/{$pref_set}", |
|
| 441 | 441 | array( |
| 442 | 442 | 'query' => drupal_get_destination(), |
| 443 | 443 | 'attributes' => array( |
| 444 | - 'onclick' => 'return confirm(\'' . bts('This will remove all of your settings from the "@name" preference set. Are you sure?', |
|
| 445 | - array('@name' => ucfirst($pref_set)), NULL, 'boinc:account-computing-preferences') . '\')' |
|
| 444 | + 'onclick' => 'return confirm(\''.bts('This will remove all of your settings from the "@name" preference set. Are you sure?', |
|
| 445 | + array('@name' => ucfirst($pref_set)), NULL, 'boinc:account-computing-preferences').'\')' |
|
| 446 | 446 | ) |
| 447 | 447 | ) |
| 448 | 448 | ); |
@@ -468,8 +468,8 @@ discard block |
||
| 468 | 468 | "{$path}/work" => bts('Work', array(), NULL, 'boinc:account-preferences-location') |
| 469 | 469 | ); |
| 470 | 470 | variable_set('jump_use_js_venues-Array', 1); |
| 471 | - drupal_add_js(drupal_get_path('module', 'jump') . '/jump.js'); |
|
| 472 | - drupal_add_js(drupal_get_path('theme', 'boinc') . '/js/prefs.js', 'theme'); |
|
| 471 | + drupal_add_js(drupal_get_path('module', 'jump').'/jump.js'); |
|
| 472 | + drupal_add_js(drupal_get_path('theme', 'boinc').'/js/prefs.js', 'theme'); |
|
| 473 | 473 | |
| 474 | 474 | $output .= '<div id="venue-selector" class="simple-form-controls">'; |
| 475 | 475 | $output .= ' <div class="form-item venue">'; |
@@ -489,7 +489,7 @@ discard block |
||
| 489 | 489 | if (!$current_set['#established']) { |
| 490 | 490 | drupal_set_message(bts( |
| 491 | 491 | "No preferences found for set '@venue'. Click SAVE CHANGES below to save the following preferences to your account.", |
| 492 | - array( '@venue' => $venue, ), |
|
| 492 | + array('@venue' => $venue,), |
|
| 493 | 493 | NULL, 'boinc:account-preferences'), 'status'); |
| 494 | 494 | } |
| 495 | 495 | |
@@ -548,8 +548,8 @@ discard block |
||
| 548 | 548 | drupal_prepare_form('boincwork_projectprefs_form', $prefs[$pref_set], $form_state); |
| 549 | 549 | } |
| 550 | 550 | |
| 551 | - $output .= '<p>' . bts('Preferences last modified: @mod_time', array('@mod_time' => pretty_time_str($prefs['generic']['modified']['#value'])), NULL, 'boinc:account-preferences') . '</p>'; |
|
| 552 | - $output .= '<h2>' . bts('Combined preferences', array(), NULL, 'boinc:account-preferences') . ' ' . l('(' . bts('Switch View', array(), NULL, 'boinc:account-preferences') . ')', 'account/prefs/project') . '</h2>'; |
|
| 551 | + $output .= '<p>'.bts('Preferences last modified: @mod_time', array('@mod_time' => pretty_time_str($prefs['generic']['modified']['#value'])), NULL, 'boinc:account-preferences').'</p>'; |
|
| 552 | + $output .= '<h2>'.bts('Combined preferences', array(), NULL, 'boinc:account-preferences').' '.l('('.bts('Switch View', array(), NULL, 'boinc:account-preferences').')', 'account/prefs/project').'</h2>'; |
|
| 553 | 553 | |
| 554 | 554 | $output .= '<table class="preferences combined">'; |
| 555 | 555 | |
@@ -559,7 +559,7 @@ discard block |
||
| 559 | 559 | $output .= '<tr class="section-heading">'; |
| 560 | 560 | $output .= "<td>{$section['name']}</td>"; |
| 561 | 561 | foreach ($pref_sets as $pref_set) { |
| 562 | - $output .= '<td>' . $pref_set . '</td>'; |
|
| 562 | + $output .= '<td>'.$pref_set.'</td>'; |
|
| 563 | 563 | } |
| 564 | 564 | $output .= '</tr>'; |
| 565 | 565 | foreach ($section['elements'] as $name => $setting) { |
@@ -601,12 +601,12 @@ discard block |
||
| 601 | 601 | $output .= l($action_text, "account/prefs/project/edit/{$pref_set}"); |
| 602 | 602 | // Show Clear links for established preference sets |
| 603 | 603 | if ($pref_set != 'generic' AND $prefs[$pref_set]['#established']) { |
| 604 | - $output .= ' </li><li class="tab"> ' . l(bts('Clear', array(), NULL, 'boinc:form-clear'), "account/prefs/project/clear/{$pref_set}", |
|
| 604 | + $output .= ' </li><li class="tab"> '.l(bts('Clear', array(), NULL, 'boinc:form-clear'), "account/prefs/project/clear/{$pref_set}", |
|
| 605 | 605 | array( |
| 606 | 606 | 'query' => drupal_get_destination(), |
| 607 | 607 | 'attributes' => array( |
| 608 | - 'onclick' => 'return confirm(\'' . bts('This will remove all of your settings from the "@name" preference set. Are you sure?', |
|
| 609 | - array('@name' => ucfirst($pref_set)), NULL, 'boinc:account-preferences-project') . '\')' |
|
| 608 | + 'onclick' => 'return confirm(\''.bts('This will remove all of your settings from the "@name" preference set. Are you sure?', |
|
| 609 | + array('@name' => ucfirst($pref_set)), NULL, 'boinc:account-preferences-project').'\')' |
|
| 610 | 610 | ) |
| 611 | 611 | ) |
| 612 | 612 | ); |
@@ -622,7 +622,7 @@ discard block |
||
| 622 | 622 | // Set this preference set as the one to use for any new hosts attached |
| 623 | 623 | // to the user account |
| 624 | 624 | boincwork_set_default_venue($venue); |
| 625 | - drupal_set_message( bts('The primary preference set has been changed to "@set"', array('@set' => $venue), NULL, 'boinc:account-preferences-project') ); |
|
| 625 | + drupal_set_message(bts('The primary preference set has been changed to "@set"', array('@set' => $venue), NULL, 'boinc:account-preferences-project')); |
|
| 626 | 626 | drupal_goto('account/prefs/project/combined'); |
| 627 | 627 | break; |
| 628 | 628 | |
@@ -641,8 +641,8 @@ discard block |
||
| 641 | 641 | "{$path}/work" => bts('Work', array(), NULL, 'boinc:account-preferences-location') |
| 642 | 642 | ); |
| 643 | 643 | variable_set('jump_use_js_venues-Array', 1); |
| 644 | - drupal_add_js(drupal_get_path('module', 'jump') . '/jump.js'); |
|
| 645 | - drupal_add_js(drupal_get_path('theme', 'boinc') . '/js/prefs.js', 'theme'); |
|
| 644 | + drupal_add_js(drupal_get_path('module', 'jump').'/jump.js'); |
|
| 645 | + drupal_add_js(drupal_get_path('theme', 'boinc').'/js/prefs.js', 'theme'); |
|
| 646 | 646 | |
| 647 | 647 | $output .= '<div id="venue-selector" class="simple-form-controls">'; |
| 648 | 648 | $output .= ' <div class="form-item venue">'; |
@@ -662,7 +662,7 @@ discard block |
||
| 662 | 662 | if (!$current_set['#established']) { |
| 663 | 663 | drupal_set_message(bts( |
| 664 | 664 | "No preferences found for set '@venue'. Click SAVE CHANGES below to save the following preferences to your account.", |
| 665 | - array( '@venue' => $venue, ), |
|
| 665 | + array('@venue' => $venue,), |
|
| 666 | 666 | NULL, 'boinc:account-preferences'), 'status'); |
| 667 | 667 | } |
| 668 | 668 | |
@@ -734,7 +734,7 @@ discard block |
||
| 734 | 734 | // Edit preferences link |
| 735 | 735 | $output .= '<tr>'; |
| 736 | 736 | $output .= '<td></td>'; |
| 737 | - $output .= '<td>' . l(bts('Edit privacy preferences', array('@project' => PROJECT), NULL, 'boinc:account-preferences-privacy'), "account/prefs/privacy/edit") . '</td>'; |
|
| 737 | + $output .= '<td>'.l(bts('Edit privacy preferences', array('@project' => PROJECT), NULL, 'boinc:account-preferences-privacy'), "account/prefs/privacy/edit").'</td>'; |
|
| 738 | 738 | $output .= '</tr>'; |
| 739 | 739 | |
| 740 | 740 | $output .= '</table>'; |
@@ -769,15 +769,15 @@ discard block |
||
| 769 | 769 | switch ($type) { |
| 770 | 770 | case 'all': |
| 771 | 771 | //include_boinc('user/cert_all.php'); |
| 772 | - require_boinc(array('util','cert','user')); |
|
| 772 | + require_boinc(array('util', 'cert', 'user')); |
|
| 773 | 773 | |
| 774 | 774 | $join = date('j F Y', $boincuser->create_time); |
| 775 | 775 | $today = date('j F Y', time(0)); |
| 776 | 776 | |
| 777 | - if ($border=="no") { |
|
| 777 | + if ($border == "no") { |
|
| 778 | 778 | $border = 0; |
| 779 | 779 | } else { |
| 780 | - $border=8; |
|
| 780 | + $border = 8; |
|
| 781 | 781 | } |
| 782 | 782 | |
| 783 | 783 | $title_font = "\"Optima,ZapfChancery\""; |
@@ -821,7 +821,7 @@ discard block |
||
| 821 | 821 | <tr><th align=left>Project</th><th align=left>Cobblestones</th><th align=left>Joined</th></tr> |
| 822 | 822 | "; |
| 823 | 823 | foreach ($boincuser->projects as $p) { |
| 824 | - if ($p->total_credit<100) continue; |
|
| 824 | + if ($p->total_credit < 100) continue; |
|
| 825 | 825 | show_proj($p); |
| 826 | 826 | } |
| 827 | 827 | echo " |
@@ -840,15 +840,15 @@ discard block |
||
| 840 | 840 | case 'account': |
| 841 | 841 | default: |
| 842 | 842 | //include_boinc('user/cert1.php'); |
| 843 | - require_boinc(array('util','cert')); |
|
| 843 | + require_boinc(array('util', 'cert')); |
|
| 844 | 844 | |
| 845 | 845 | $join = date('j F Y', $boincuser->create_time); |
| 846 | 846 | $today = date('j F Y', time(0)); |
| 847 | 847 | |
| 848 | - if ($border=="no") { |
|
| 848 | + if ($border == "no") { |
|
| 849 | 849 | $border = 0; |
| 850 | 850 | } else { |
| 851 | - $border=8; |
|
| 851 | + $border = 8; |
|
| 852 | 852 | } |
| 853 | 853 | |
| 854 | 854 | $credit = credit_string($boincuser->total_credit, false); |
@@ -1064,7 +1064,7 @@ discard block |
||
| 1064 | 1064 | |
| 1065 | 1065 | // If terms of use string exists and override is true, set terms-of-use |
| 1066 | 1066 | // to Drupal varaible. |
| 1067 | - if ( (!empty($termsofuse) && ($overrideboinctou)) ) { |
|
| 1067 | + if ((!empty($termsofuse) && ($overrideboinctou))) { |
|
| 1068 | 1068 | if (!empty($xml['project_config']['terms_of_use'])) { |
| 1069 | 1069 | // Remove any existing terms of use |
| 1070 | 1070 | unset($xml['project_config']['terms_of_use']); |
@@ -1111,7 +1111,7 @@ discard block |
||
| 1111 | 1111 | * Page callback for host task table |
| 1112 | 1112 | */ |
| 1113 | 1113 | function boincwork_host_task_table($host_id = NULL, $tselect = NULL, $app_id = NULL) { |
| 1114 | - require_boinc( array('util', 'result') ); |
|
| 1114 | + require_boinc(array('util', 'result')); |
|
| 1115 | 1115 | |
| 1116 | 1116 | $title = bts('Tasks for computer @host_id', array('@host_id' => $host_id), NULL, 'boinc:host-task-table'); |
| 1117 | 1117 | drupal_set_title($title); |