@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | function get_platform() { |
56 | 56 | global $user_agent; |
57 | 57 | if (strstr($user_agent, 'Windows')) { |
58 | - if (strstr($user_agent, 'Win64')||strstr($user_agent, 'WOW64')) { |
|
58 | + if (strstr($user_agent, 'Win64') || strstr($user_agent, 'WOW64')) { |
|
59 | 59 | return 'windows_x86_64'; |
60 | 60 | } else { |
61 | 61 | return 'windows_intelx86'; |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | $token, |
131 | 131 | $user->id, |
132 | 132 | (string)$v->filename, |
133 | - $green?"btn-success":"btn-info", |
|
133 | + $green ? "btn-success" : "btn-info", |
|
134 | 134 | (string)$v->platform, |
135 | 135 | (string)$v->size_mb, |
136 | 136 | (string)$v->version_num |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | |
140 | 140 | function download_button_vbox($v, $project_id, $token, $user) { |
141 | 141 | // if no vbox version exists for platform, don't show vbox button |
142 | - if(!$v->vbox_filename) { |
|
142 | + if (!$v->vbox_filename) { |
|
143 | 143 | return; |
144 | 144 | } |
145 | 145 | return sprintf( |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | $action = get_str("action", true); |
357 | 357 | $dev = get_str("dev", true); |
358 | 358 | |
359 | -$user_agent = get_str("user_agent", true); // for debugging |
|
359 | +$user_agent = get_str("user_agent", true); // for debugging |
|
360 | 360 | if (!$user_agent) { |
361 | 361 | $user_agent = $_SERVER['HTTP_USER_AGENT']; |
362 | 362 | } |
@@ -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( |
@@ -1829,7 +1829,7 @@ discard block |
||
1829 | 1829 | $form['ignoreblock']['delete'][$ignored_user['iuid']] = array( |
1830 | 1830 | '#value' => l( |
1831 | 1831 | bts('delete', array(), NULL, 'boinc:ignore-user-delete-button'), |
1832 | - 'account/prefs/privacy/ignore_user/remove/'. $ignored_user['iuid'], |
|
1832 | + 'account/prefs/privacy/ignore_user/remove/'.$ignored_user['iuid'], |
|
1833 | 1833 | array() |
1834 | 1834 | ), |
1835 | 1835 | ); |
@@ -1880,7 +1880,7 @@ discard block |
||
1880 | 1880 | '#suffix' => '</li>' |
1881 | 1881 | ); |
1882 | 1882 | $form['prefs']['form control tabs'] = array( |
1883 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']) . '</li>' |
|
1883 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']).'</li>' |
|
1884 | 1884 | ); |
1885 | 1885 | $form['prefs']['form control tabs suffix'] = array( |
1886 | 1886 | '#value' => '</ul>' |
@@ -1967,7 +1967,7 @@ discard block |
||
1967 | 1967 | $privacyconsent_prefs = array_intersect_key($form_state['values'], array_flip($result)); |
1968 | 1968 | foreach ($privacyconsent_prefs as $name => $newstate) { |
1969 | 1969 | $subname = explode('_', $name)[1]; |
1970 | - $currstate = (check_user_consent($boincuser, $subname)) ? 1 : 0 ; |
|
1970 | + $currstate = (check_user_consent($boincuser, $subname)) ? 1 : 0; |
|
1971 | 1971 | list($checkct, $ctid) = check_consent_type($subname); |
1972 | 1972 | if ($checkct && ($currstate != $newstate)) { |
1973 | 1973 | consent_to_a_policy($boincuser, $ctid, $newstate, 0, 'Webform', time()); |
@@ -2033,7 +2033,7 @@ discard block |
||
2033 | 2033 | function boincwork_selectapp_form_submit($form, &$form_state) { |
2034 | 2034 | $myargs = arg(); |
2035 | 2035 | array_pop($myargs); |
2036 | - $newpath = implode('/', $myargs ) . '/' . $form['selectapp']['#value']; |
|
2036 | + $newpath = implode('/', $myargs).'/'.$form['selectapp']['#value']; |
|
2037 | 2037 | $form_state['redirect'] = $newpath; |
2038 | 2038 | } |
2039 | 2039 |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | $apps = BoincApp::enum(""); |
156 | 156 | foreach ($apps as $app) { |
157 | 157 | if (in_array($app->id, $show_only) |
158 | - || ( in_array("all", $show_only) |
|
158 | + || (in_array("all", $show_only) |
|
159 | 159 | && (!$app->deprecated || $show_deprecated) |
160 | 160 | )) { |
161 | 161 | |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | <b>Results for <tt>$app->name</tt>:</b> |
164 | 164 | <ul> |
165 | 165 | "; |
166 | - for ($i=0; $i<2; $i++) { |
|
166 | + for ($i = 0; $i < 2; $i++) { |
|
167 | 167 | if ($i) { |
168 | 168 | $secs = 7*86400; |
169 | 169 | $period = " 7 days"; |
@@ -220,5 +220,5 @@ discard block |
||
220 | 220 | |
221 | 221 | admin_page_tail(); |
222 | 222 | |
223 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
223 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
224 | 224 | ?> |
@@ -60,7 +60,7 @@ |
||
60 | 60 | } |
61 | 61 | |
62 | 62 | } catch (Exception $e) { |
63 | - echo 'Caught exception during account ownership key generation: ', $e->getMessage(), "\n"; |
|
63 | + echo 'Caught exception during account ownership key generation: ', $e->getMessage(), "\n"; |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | } else { |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | |
27 | 27 | // send an email, using PHPMailer or not. |
28 | 28 | // |
29 | -function send_email($user, $subject, $body, $body_html=null, $email_addr=null) { |
|
29 | +function send_email($user, $subject, $body, $body_html = null, $email_addr = null) { |
|
30 | 30 | if (function_exists("make_php_mailer")) { |
31 | 31 | if (file_exists("../inc/PHPMailer/src/PHPMailer.php") && file_exists("../inc/PHPMailer/src/SMTP.php")) { |
32 | 32 | require_once("../inc/PHPMailer/src/PHPMailer.php"); |
@@ -58,11 +58,11 @@ discard block |
||
58 | 58 | return true; |
59 | 59 | } |
60 | 60 | } else { |
61 | - $headers =""; |
|
61 | + $headers = ""; |
|
62 | 62 | if (defined('EMAIL_FROM') && defined('EMAIL_FROM_NAME')) { |
63 | 63 | $headers = "From: ".EMAIL_FROM_NAME." <".EMAIL_FROM.">"; |
64 | 64 | } else if (defined('EMAIL_FROM')) { |
65 | - $headers = "From: ". EMAIL_FROM; |
|
65 | + $headers = "From: ".EMAIL_FROM; |
|
66 | 66 | } |
67 | 67 | if (!$email_addr) { |
68 | 68 | $email_addr = $user->email_addr; |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $body = "<html><body>\n"; |
72 | 72 | $body .= $body_html; |
73 | 73 | $body .= "\n</body></html>\n"; |
74 | - $headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n"; |
|
74 | + $headers .= 'Content-type: text/html; charset=UTF-8'."\r\n"; |
|
75 | 75 | } |
76 | 76 | return mail($email_addr, $subject, $body, $headers); |
77 | 77 | } |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | if (defined("USE_STOPFORUMSPAM") && USE_STOPFORUMSPAM && array_key_exists('REMOTE_ADDR', $_SERVER)) { |
147 | 147 | $ip = $_SERVER['REMOTE_ADDR']; |
148 | 148 | // For obviously private IPs check just the email against SFS, otherwise check both IP and email |
149 | - if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) { |
|
149 | + if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE|FILTER_FLAG_NO_RES_RANGE)) { |
|
150 | 150 | $x = @file_get_contents("https://www.stopforumspam.com/api?ip=".$ip."&email=".$addr); |
151 | 151 | } else { |
152 | 152 | $x = @file_get_contents("https://www.stopforumspam.com/api?email=".$addr); |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | } |
158 | 158 | $pattern = '/^([^@]+)@([^@\.]+)\.([^@]{2,})$/'; |
159 | 159 | $match = preg_match($pattern, $addr); |
160 | - return (bool) $match; |
|
160 | + return (bool)$match; |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | function send_confirm_delete_email($user) { |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | return md5($key.'oogabooga'); |
186 | 186 | } |
187 | 187 | |
188 | -function opt_out_url($user, $page="opt_out.php") { |
|
188 | +function opt_out_url($user, $page = "opt_out.php") { |
|
189 | 189 | return sprintf("%s%s?code=%s&userid=%d", |
190 | 190 | secure_url_base(), |
191 | 191 | $page, |
@@ -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,17 +21,17 @@ discard block |
||
21 | 21 | include_once("../inc/boinc_db.inc"); |
22 | 22 | include_once("../inc/util.inc"); |
23 | 23 | |
24 | -define('CONSENT_TYPE_ENROLL','ENROLL'); |
|
24 | +define('CONSENT_TYPE_ENROLL', 'ENROLL'); |
|
25 | 25 | |
26 | 26 | function consent_to_a_policy($user, $consent_type_id, $consent_flag, $consent_not_required, $source, $ctime = 0) { |
27 | 27 | $mys = BoincDb::escape_string($source); |
28 | - if ($ctime==0) { |
|
28 | + if ($ctime == 0) { |
|
29 | 29 | $mytime = $user->create_time; |
30 | 30 | } else { |
31 | 31 | $mytime = $ctime; |
32 | 32 | } |
33 | 33 | return BoincConsent::insert( |
34 | - "(userid, consent_type_id, consent_time, consent_flag, consent_not_required, source) " . |
|
34 | + "(userid, consent_type_id, consent_time, consent_flag, consent_not_required, source) ". |
|
35 | 35 | "values($user->id, $consent_type_id, $mytime, $consent_flag, $consent_not_required, '$mys')" |
36 | 36 | ); |
37 | 37 | |
@@ -55,9 +55,9 @@ discard block |
||
55 | 55 | // if checkenabled=TRUE, if the consent_type is enabled/available for |
56 | 56 | // use. The integer is the consent_type_id- the id from consent_type |
57 | 57 | // table. If the boolean is FALSE, the integer returned is -1. |
58 | -function check_consent_type($name, $checkenabled=TRUE) { |
|
58 | +function check_consent_type($name, $checkenabled = TRUE) { |
|
59 | 59 | $ct = BoincConsentType::lookup("shortname = '{$name}'"); |
60 | - if ($ct and ( !$checkenabled or ($ct->enabled)) ) { |
|
60 | + if ($ct and (!$checkenabled or ($ct->enabled))) { |
|
61 | 61 | return array(TRUE, $ct->id); |
62 | 62 | } |
63 | 63 | return array(FALSE, -1); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | function intercept_login($user, $perm, $in_next_url = "") { |
70 | 70 | list($checkct, $ctid) = check_consent_type(CONSENT_TYPE_ENROLL); |
71 | 71 | $config = get_config(); |
72 | - if ( parse_bool($config, "enable_login_mustagree_termsofuse") and $checkct and check_termsofuse() and (!check_user_consent($user, CONSENT_TYPE_ENROLL))) { |
|
72 | + if (parse_bool($config, "enable_login_mustagree_termsofuse") and $checkct and check_termsofuse() and (!check_user_consent($user, CONSENT_TYPE_ENROLL))) { |
|
73 | 73 | // sent user to terms-of-use Web form after login |
74 | 74 | $mytoken = create_token($user->id, TOKEN_TYPE_LOGIN_INTERCEPT, TOKEN_DURATION_TWO_HOURS); |
75 | 75 | send_cookie('logintoken', $mytoken, false); |