@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | 'type' => MENU_CALLBACK |
190 | 190 | ); |
191 | 191 | $items['account_finish.php'] = array( |
192 | - 'title' => 'Welcome to ' . variable_get('site_name', 'Drupal-BOINC'), |
|
192 | + 'title' => 'Welcome to '.variable_get('site_name', 'Drupal-BOINC'), |
|
193 | 193 | 'description' => 'RPC for after a user has created an account.', |
194 | 194 | 'page callback' => 'boincuser_account_finish', |
195 | 195 | 'access callback' => TRUE, |
@@ -249,8 +249,8 @@ discard block |
||
249 | 249 | // termsofuse is enabled, by having text in the termsofuse variable. |
250 | 250 | $existinguser_tou = variable_get('boinc_weboptions_existinguser_tou', FALSE); |
251 | 251 | $termsofuse = variable_get('boinc_weboptions_termsofuse', ''); |
252 | - if ( (!empty($termsofuse)) and ($user->uid) ) { |
|
253 | - if ( !boincuser_check_termsofuse($user) and ($existinguser_tou) ) { |
|
252 | + if ((!empty($termsofuse)) and ($user->uid)) { |
|
253 | + if (!boincuser_check_termsofuse($user) and ($existinguser_tou)) { |
|
254 | 254 | |
255 | 255 | // Admins are exempt, otherwise the admin may not be able to |
256 | 256 | // access the site! |
@@ -264,14 +264,14 @@ discard block |
||
264 | 264 | 'user/termsofuse', |
265 | 265 | 'logout', |
266 | 266 | 'account/info/edit', |
267 | - 'user/' . $user->uid . '/edit', |
|
268 | - 'user/' . $user->uid . '/recoveremail/*', |
|
267 | + 'user/'.$user->uid.'/edit', |
|
268 | + 'user/'.$user->uid.'/recoveremail/*', |
|
269 | 269 | 'recover_email.php', |
270 | 270 | ); |
271 | 271 | if (module_exists('boincuser_delete')) { |
272 | - $paths0[] = 'user/' . $user->uid . '/delete'; |
|
273 | - $paths0[] = 'user/' . $user->uid . '/deleteconfirm/*'; |
|
274 | - $paths0[] = 'user/' . $user->uid . '/odeleteconfirm/*'; |
|
272 | + $paths0[] = 'user/'.$user->uid.'/delete'; |
|
273 | + $paths0[] = 'user/'.$user->uid.'/deleteconfirm/*'; |
|
274 | + $paths0[] = 'user/'.$user->uid.'/odeleteconfirm/*'; |
|
275 | 275 | } |
276 | 276 | |
277 | 277 | // Paths added by the admin |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | } |
283 | 283 | |
284 | 284 | // paths to ignore |
285 | - $paths_to_ignore = array_unique( array_merge($paths0, $paths2) ); |
|
285 | + $paths_to_ignore = array_unique(array_merge($paths0, $paths2)); |
|
286 | 286 | |
287 | 287 | if (!_boincuser_ignore_paths($path, $paths_to_ignore)) { |
288 | 288 | drupal_goto('user/termsofuse'); |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | require_boinc('password_compat/password'); |
305 | 305 | // Handle BOINC integration for users with UID > 1 (skip anonymous and admin) |
306 | 306 | if (isset($account->uid) && ($account->uid > 1)) { |
307 | - switch($op) { |
|
307 | + switch ($op) { |
|
308 | 308 | case 'load': |
309 | 309 | // User loading; insert BOINC data into the user object |
310 | 310 | $drupal_user = db_fetch_object(db_query(" |
@@ -334,11 +334,11 @@ discard block |
||
334 | 334 | )); |
335 | 335 | $account->boincuser_name = $boinc_user->name; |
336 | 336 | $account->boincuser_account_key = $boinc_user->authenticator; |
337 | - $account->boincuser_weak_auth = md5($boinc_user->authenticator . $boinc_user->passwd_hash); |
|
337 | + $account->boincuser_weak_auth = md5($boinc_user->authenticator.$boinc_user->passwd_hash); |
|
338 | 338 | $account->boincuser_total_credit = round($boinc_user->total_credit); |
339 | 339 | $account->boincuser_expavg_credit = round($boinc_user->expavg_credit); |
340 | 340 | $account->boincuser_expavg_time = round($boinc_user->expavg_time); |
341 | - $account->boincuser_cpid = md5($boinc_user->cross_project_id . $account->mail); |
|
341 | + $account->boincuser_cpid = md5($boinc_user->cross_project_id.$account->mail); |
|
342 | 342 | $account->boincuser_default_pref_set = $boinc_user->venue; |
343 | 343 | $account->boincteam_id = $boinc_user->teamid; |
344 | 344 | $account->boincuser_previous_email_addr = $boinc_user->previous_email_addr; |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | |
508 | 508 | // Set password hash appropriately |
509 | 509 | $passwd = ($edit['pass']) ? $edit['pass'] : $edit['current_pass']; |
510 | - $passwd_hash = password_hash( md5($passwd.$lower_email_addr), PASSWORD_DEFAULT ); |
|
510 | + $passwd_hash = password_hash(md5($passwd.$lower_email_addr), PASSWORD_DEFAULT); |
|
511 | 511 | // Algorithm for changing email and/or password |
512 | 512 | if ($changing_email) { |
513 | 513 | // locally store current email to set as previous email |
@@ -595,8 +595,8 @@ discard block |
||
595 | 595 | } |
596 | 596 | |
597 | 597 | // Check if user has agreed to terms of use. |
598 | - if ( (!empty($termsofuse)) and ($account->uid) and |
|
599 | - (!boincuser_check_termsofuse($account)) and ($existinguser_tou) ) { |
|
598 | + if ((!empty($termsofuse)) and ($account->uid) and |
|
599 | + (!boincuser_check_termsofuse($account)) and ($existinguser_tou)) { |
|
600 | 600 | |
601 | 601 | // Admins are exempted. |
602 | 602 | $administrator_role = array_search('administrator', user_roles(true)); |
@@ -610,9 +610,9 @@ discard block |
||
610 | 610 | $query_for_destination = ''; |
611 | 611 | $prevdest = $_REQUEST['destination']; |
612 | 612 | if ($prevdest) { |
613 | - $query_for_destination = '?destination=' . $prevdest; |
|
613 | + $query_for_destination = '?destination='.$prevdest; |
|
614 | 614 | } |
615 | - $_REQUEST['destination'] = $path_for_destination . $query_for_destination; |
|
615 | + $_REQUEST['destination'] = $path_for_destination.$query_for_destination; |
|
616 | 616 | |
617 | 617 | } |
618 | 618 | } |
@@ -645,7 +645,7 @@ discard block |
||
645 | 645 | // In Drupal 7, these operation cases will all exist as their own hooks, |
646 | 646 | // so let's approximate that here so that this function can simply be removed |
647 | 647 | // upon migration to 7 |
648 | - switch($op) { |
|
648 | + switch ($op) { |
|
649 | 649 | case 'update': |
650 | 650 | boincuser_node_update($node); |
651 | 651 | } |
@@ -656,7 +656,7 @@ discard block |
||
656 | 656 | * is updated (forward compatible to Drupal 7) |
657 | 657 | */ |
658 | 658 | function boincuser_node_update($node) { |
659 | - switch($node->type) { |
|
659 | + switch ($node->type) { |
|
660 | 660 | case 'profile': |
661 | 661 | // Update the BOINC database directly |
662 | 662 | $account = user_load($node->uid); |
@@ -778,7 +778,7 @@ discard block |
||
778 | 778 | } |
779 | 779 | |
780 | 780 | $form['cancel'] = array( |
781 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $cancel_dest) . '</li>', |
|
781 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $cancel_dest).'</li>', |
|
782 | 782 | '#weight' => 1004, |
783 | 783 | ); |
784 | 784 | $form['form control tabs suffix'] = array( |
@@ -811,7 +811,7 @@ discard block |
||
811 | 811 | $form['buttons']['preview_changes']['#suffix'] = '</li>'; |
812 | 812 | $form['buttons']['preview_changes']['#weight'] = 1004; |
813 | 813 | $form['buttons']['cancel'] = array( |
814 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "node/{$form['nid']['#value']}") . '</li>', |
|
814 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "node/{$form['nid']['#value']}").'</li>', |
|
815 | 815 | '#weight' => 1005, |
816 | 816 | ); |
817 | 817 | $form['buttons']['delete']['#prefix'] = '<li class="tab">'; |
@@ -843,7 +843,7 @@ discard block |
||
843 | 843 | $form['actions']['submit']['#suffix'] = '</li>'; |
844 | 844 | $form['actions']['submit']['#weight'] = 1002; |
845 | 845 | $form['actions']['cancel'] = array( |
846 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "node/{$form['nid']['#value']}") . '</li>', |
|
846 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "node/{$form['nid']['#value']}").'</li>', |
|
847 | 847 | '#weight' => 1005, |
848 | 848 | ); |
849 | 849 | $form['actions']['form control tabs suffix'] = array( |
@@ -870,7 +870,7 @@ discard block |
||
870 | 870 | $form['privatemsg']['preview']['#suffix'] = '</li>'; |
871 | 871 | $form['privatemsg']['preview']['#weight'] = 1003; |
872 | 872 | $form['privatemsg']['cancel'] = array( |
873 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']) . '</li>', |
|
873 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']).'</li>', |
|
874 | 874 | '#weight' => 1004, |
875 | 875 | ); |
876 | 876 | $form['privatemsg']['form control tabs suffix'] = array( |
@@ -958,11 +958,11 @@ discard block |
||
958 | 958 | // Set special message if user has not agreed to TOU |
959 | 959 | $existinguser_tou = variable_get('boinc_weboptions_existinguser_tou', FALSE); |
960 | 960 | $termsofuse = variable_get('boinc_weboptions_termsofuse', ''); |
961 | - if ( (!boincuser_check_termsofuse($account)) and ($existinguser_tou) and (!empty($termsofuse)) and (!user_access('administer users')) ) { |
|
961 | + if ((!boincuser_check_termsofuse($account)) and ($existinguser_tou) and (!empty($termsofuse)) and (!user_access('administer users'))) { |
|
962 | 962 | drupal_set_message( |
963 | 963 | bts('INFO: You have not agreed to the terms of use for @project. You may use this form to change your email address and/or password. Please note: you may not delete your account within seven (7) days of changing your email address.', |
964 | 964 | array( |
965 | - '@project' => variable_get('site_name','Drupal-BOINC'), |
|
965 | + '@project' => variable_get('site_name', 'Drupal-BOINC'), |
|
966 | 966 | ), NULL, 'boinc:account-credentials-change') |
967 | 967 | , 'info'); |
968 | 968 | } |
@@ -1027,36 +1027,36 @@ discard block |
||
1027 | 1027 | $form['account']['boincuser_id'] = array( |
1028 | 1028 | '#value' => ' |
1029 | 1029 | <div class="form-item"> |
1030 | - <label>' . bts('BOINC user ID', array(), NULL, 'boinc:account-credentials-change') . '</label> |
|
1031 | - <span>' . $account->boincuser_id . '</span> |
|
1030 | + <label>' . bts('BOINC user ID', array(), NULL, 'boinc:account-credentials-change').'</label> |
|
1031 | + <span>' . $account->boincuser_id.'</span> |
|
1032 | 1032 | </div>', |
1033 | 1033 | ); |
1034 | 1034 | $form['account']['user_id'] = array( |
1035 | 1035 | '#value' => ' |
1036 | 1036 | <div class="form-item"> |
1037 | - <label>' . bts('Drupal user ID', array(), NULL, 'boinc:account-credentials-change') . '</label> |
|
1038 | - <span>' . $account->uid . '</span> |
|
1037 | + <label>' . bts('Drupal user ID', array(), NULL, 'boinc:account-credentials-change').'</label> |
|
1038 | + <span>' . $account->uid.'</span> |
|
1039 | 1039 | </div>', |
1040 | 1040 | ); |
1041 | 1041 | $form['account']['account_key'] = array( |
1042 | 1042 | '#value' => ' |
1043 | 1043 | <div class="form-item"> |
1044 | - <label>' . bts('Account key', array(), NULL, 'boinc:account-credentials-change') . '</label> |
|
1045 | - <span>' . $account->boincuser_account_key . '</span> |
|
1044 | + <label>' . bts('Account key', array(), NULL, 'boinc:account-credentials-change').'</label> |
|
1045 | + <span>' . $account->boincuser_account_key.'</span> |
|
1046 | 1046 | </div>', |
1047 | 1047 | ); |
1048 | 1048 | $form['account']['weak_account_key'] = array( |
1049 | 1049 | '#value' => ' |
1050 | 1050 | <div class="form-item"> |
1051 | - <label>' . bts('Weak account key', array(), NULL, 'boinc:account-credentials-change') . '</label> |
|
1052 | - <span>' . "{$account->boincuser_id}_{$account->boincuser_weak_auth}" . '</span> |
|
1051 | + <label>' . bts('Weak account key', array(), NULL, 'boinc:account-credentials-change').'</label> |
|
1052 | + <span>' . "{$account->boincuser_id}_{$account->boincuser_weak_auth}".'</span> |
|
1053 | 1053 | </div>', |
1054 | 1054 | ); |
1055 | 1055 | $form['account']['cpid'] = array( |
1056 | 1056 | '#value' => ' |
1057 | 1057 | <div class="form-item"> |
1058 | - <label>' . bts('Cross-project ID', array(), NULL, 'boinc:account-credentials-change') . '</label> |
|
1059 | - <span>' . $account->boincuser_cpid . '</span> |
|
1058 | + <label>' . bts('Cross-project ID', array(), NULL, 'boinc:account-credentials-change').'</label> |
|
1059 | + <span>' . $account->boincuser_cpid.'</span> |
|
1060 | 1060 | </div>', |
1061 | 1061 | ); |
1062 | 1062 | |
@@ -1074,7 +1074,7 @@ discard block |
||
1074 | 1074 | $form['submit']['#suffix'] = '</li>'; |
1075 | 1075 | $form['submit']['#weight'] = 1002; |
1076 | 1076 | $form['cancel'] = array( |
1077 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']) . '</li>', |
|
1077 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']).'</li>', |
|
1078 | 1078 | '#weight' => 1003, |
1079 | 1079 | ); |
1080 | 1080 | if (isset($form['delete']) AND is_array($form['delete'])) { |
@@ -1170,7 +1170,7 @@ discard block |
||
1170 | 1170 | $form['buttons']['preview_changes']['#suffix'] = '</li>'; |
1171 | 1171 | $form['buttons']['preview_changes']['#weight'] = 1004; |
1172 | 1172 | $form['buttons']['cancel'] = array( |
1173 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']) . '</li>', |
|
1173 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']).'</li>', |
|
1174 | 1174 | '#weight' => 1005, |
1175 | 1175 | ); |
1176 | 1176 | $form['buttons']['delete']['#prefix'] = '<li class="tab">'; |
@@ -1219,11 +1219,11 @@ discard block |
||
1219 | 1219 | // Set name temporarily to dummy value to beat validation |
1220 | 1220 | $form['name'] = array( |
1221 | 1221 | '#type' => 'hidden', |
1222 | - '#value' => rand() . '.' . time() |
|
1222 | + '#value' => rand().'.'.time() |
|
1223 | 1223 | ); |
1224 | 1224 | |
1225 | 1225 | // Add JS for submit button disabling |
1226 | - drupal_add_js(drupal_get_path('module', 'boincuser') . '/boincuser.js'); |
|
1226 | + drupal_add_js(drupal_get_path('module', 'boincuser').'/boincuser.js'); |
|
1227 | 1227 | |
1228 | 1228 | // Terms of use section |
1229 | 1229 | $termsofuse = variable_get('boinc_weboptions_termsofuse', ''); |
@@ -1239,7 +1239,7 @@ discard block |
||
1239 | 1239 | |
1240 | 1240 | $form['termsofuse']['title1'] = array( |
1241 | 1241 | '#weight' => -12, |
1242 | - '#value' => '<h2>' . bts(variable_get('boinc_weboptions_registrationtitle', 'Please read and acknowledge our terms of use'), array(), NULL, 'project:user-register' ) . '</h2>', |
|
1242 | + '#value' => '<h2>'.bts(variable_get('boinc_weboptions_registrationtitle', 'Please read and acknowledge our terms of use'), array(), NULL, 'project:user-register').'</h2>', |
|
1243 | 1243 | '#prefix' => '<div id="register-title1">', |
1244 | 1244 | '#suffix' => '</div>', |
1245 | 1245 | ); |
@@ -1262,7 +1262,7 @@ discard block |
||
1262 | 1262 | |
1263 | 1263 | $form['title2'] = array( |
1264 | 1264 | '#weight' => -6, |
1265 | - '#value' => '<h2>' . bts(variable_get('boinc_weboptions_registrationtitle2', 'Fill in your name, email, and choose a secure passphrase.'), array(), NULL, 'project:user-register') . '</h2>', |
|
1265 | + '#value' => '<h2>'.bts(variable_get('boinc_weboptions_registrationtitle2', 'Fill in your name, email, and choose a secure passphrase.'), array(), NULL, 'project:user-register').'</h2>', |
|
1266 | 1266 | '#prefix' => '<div id="register-title2">', |
1267 | 1267 | '#suffix' => '</div>', |
1268 | 1268 | ); |
@@ -1326,7 +1326,7 @@ discard block |
||
1326 | 1326 | $form['buttons']['submit']['#suffix'] = '</li>'; |
1327 | 1327 | $form['buttons']['submit']['#weight'] = 1002; |
1328 | 1328 | $form['buttons']['cancel'] = array( |
1329 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), 'user/login') . '</li>', |
|
1329 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), 'user/login').'</li>', |
|
1330 | 1330 | '#weight' => 1005, |
1331 | 1331 | ); |
1332 | 1332 | $form['buttons']['form control tabs suffix'] = array( |
@@ -1408,7 +1408,7 @@ discard block |
||
1408 | 1408 | */ |
1409 | 1409 | function boincuser_token_list($type = 'all') { |
1410 | 1410 | if ($type == 'user' || $type == 'all') { |
1411 | - $tokens['user']['display-name'] = t("The user's name that should be displayed"); |
|
1411 | + $tokens['user']['display-name'] = t("The user's name that should be displayed"); |
|
1412 | 1412 | return $tokens; |
1413 | 1413 | } |
1414 | 1414 | } |
@@ -1420,9 +1420,9 @@ discard block |
||
1420 | 1420 | if ($view->args) { |
1421 | 1421 | $account_id = $view->args[0]; |
1422 | 1422 | } |
1423 | - if ($view->name=="user_activity") { |
|
1423 | + if ($view->name == "user_activity") { |
|
1424 | 1424 | // Run the following custom query for the user_activity view |
1425 | - $view->build_info['query']= " |
|
1425 | + $view->build_info['query'] = " |
|
1426 | 1426 | SELECT node_revisions.vid AS vid, |
1427 | 1427 | node.nid AS node_nid, |
1428 | 1428 | node.uid AS users_node_uid, |
@@ -1462,13 +1462,13 @@ discard block |
||
1462 | 1462 | // Delete expired users in the BOINC database, user_delete table. |
1463 | 1463 | require_boinc('boinc_db'); |
1464 | 1464 | $num_deleted = BoincUserDeleted::delete_expired(); |
1465 | - if ($num_deleted>0) { |
|
1465 | + if ($num_deleted > 0) { |
|
1466 | 1466 | watchdog('boincuser', "Deleted ${num_deleted} users from user_deleted table", WATCHDOG_NOTICE); |
1467 | 1467 | } |
1468 | 1468 | |
1469 | 1469 | // Delete expired tokens from token table |
1470 | 1470 | $tokens_deleted = BoincToken::delete_expired(); |
1471 | - if ($tokens_deleted>0) { |
|
1471 | + if ($tokens_deleted > 0) { |
|
1472 | 1472 | watchdog('boincuser', "Deleted ${tokens_deleted} tokens from token table", WATCHDOG_NOTICE); |
1473 | 1473 | } |
1474 | 1474 | } |
@@ -1553,38 +1553,38 @@ discard block |
||
1553 | 1553 | case 'boinc': |
1554 | 1554 | $output .= '<ol>'; |
1555 | 1555 | if ($registration_enabled) { |
1556 | - $output .= '<li>' . bts('First !create_an_account here at @sitename.', |
|
1556 | + $output .= '<li>'.bts('First !create_an_account here at @sitename.', |
|
1557 | 1557 | array( |
1558 | 1558 | '!create_an_account' => l(bts('create an account', array(), NULL, 'boinc:join-page'), 'user/registration'), |
1559 | 1559 | '@sitename' => $site_name, |
1560 | - ), NULL, 'boinc:join-page') . '</li>'; |
|
1560 | + ), NULL, 'boinc:join-page').'</li>'; |
|
1561 | 1561 | } |
1562 | - $output .= ' <li>' . bts("Install BOINC on this device if not already present.", array(), NULL, 'boinc:join-page') . '</li>'; |
|
1563 | - $output .= ' <li>' . bts("Select <i>Tools / Add Project</i>. Choose @sitename from the list, or enter @siteurl.", |
|
1562 | + $output .= ' <li>'.bts("Install BOINC on this device if not already present.", array(), NULL, 'boinc:join-page').'</li>'; |
|
1563 | + $output .= ' <li>'.bts("Select <i>Tools / Add Project</i>. Choose @sitename from the list, or enter @siteurl.", |
|
1564 | 1564 | array( |
1565 | 1565 | '@sitename' => $site_name, |
1566 | 1566 | '@siteurl' => $base_url, |
1567 | - ), NULL, 'boinc:join-page') . '</li>'; |
|
1567 | + ), NULL, 'boinc:join-page').'</li>'; |
|
1568 | 1568 | if ($registration_enabled) { |
1569 | - $output .= '<li>' . bts("If you're running a command-line or pre-5.0 version of BOINC, use <b>!boinccmd</b> to add the project.", |
|
1569 | + $output .= '<li>'.bts("If you're running a command-line or pre-5.0 version of BOINC, use <b>!boinccmd</b> to add the project.", |
|
1570 | 1570 | array( |
1571 | 1571 | '!boinccmd' => l('boinccmd --project_attach', 'http://boinc.berkeley.edu/wiki/Boinccmd_tool'), |
1572 | - ), NULL, 'boinc:join-page') . '</li>'; |
|
1572 | + ), NULL, 'boinc:join-page').'</li>'; |
|
1573 | 1573 | } |
1574 | 1574 | else { |
1575 | - $output .= '<li>' . bts("If you're running a command-line version of BOINC, |
|
1575 | + $output .= '<li>'.bts("If you're running a command-line version of BOINC, |
|
1576 | 1576 | please follow the <b>!instructionslink</b> to first <i>create an account</i>, and then <i>attach</i> to this project. Use the same project URL as above.", |
1577 | 1577 | array( |
1578 | 1578 | '!instructionslink' => l('instructions', 'http://boinc.berkeley.edu/wiki/Boinccmd_tool'), |
1579 | - ), NULL, 'boinc:join-page') . '</li>'; |
|
1579 | + ), NULL, 'boinc:join-page').'</li>'; |
|
1580 | 1580 | } |
1581 | - $output .= '<li>' . bts("If you're running a pre-5.0 version of BOINC, please |
|
1581 | + $output .= '<li>'.bts("If you're running a pre-5.0 version of BOINC, please |
|
1582 | 1582 | upgrade to a more recent version of BOINC to create an account |
1583 | 1583 | at @this_project.", |
1584 | 1584 | array( |
1585 | 1585 | '@this_project' => $site_name, |
1586 | - ), NULL, 'boinc:join-page') . '</li>'; |
|
1587 | - $output .= '</ol>'; |
|
1586 | + ), NULL, 'boinc:join-page').'</li>'; |
|
1587 | + $output .= '</ol>'; |
|
1588 | 1588 | break; |
1589 | 1589 | case 'new': |
1590 | 1590 | default: |
@@ -1596,37 +1596,37 @@ discard block |
||
1596 | 1596 | // $ruleslink = drupal_lookup_path('source', $ruleslinkB); |
1597 | 1597 | //} |
1598 | 1598 | |
1599 | - $ruleslink = drupal_lookup_path('source', variable_get('boinc_weboptions_rulespolicies', '') ); |
|
1599 | + $ruleslink = drupal_lookup_path('source', variable_get('boinc_weboptions_rulespolicies', '')); |
|
1600 | 1600 | |
1601 | 1601 | // Join page output |
1602 | 1602 | $output .= '<ol>'; |
1603 | 1603 | if ($registration_enabled) { |
1604 | - $output .= '<li>' . bts('First !create_an_account here at @sitename.', |
|
1604 | + $output .= '<li>'.bts('First !create_an_account here at @sitename.', |
|
1605 | 1605 | array( |
1606 | 1606 | '!create_an_account' => l(bts('create an account', array(), NULL, 'boinc:join-page'), 'user/registration'), |
1607 | 1607 | '@sitename' => $site_name, |
1608 | - ), NULL, 'boinc:join-page') . '</li>'; |
|
1608 | + ), NULL, 'boinc:join-page').'</li>'; |
|
1609 | 1609 | } |
1610 | - else if ( menu_valid_path(array('link_path' => $ruleslink)) ) { |
|
1611 | - $output .= ' <li>' . bts("Read our !rules_and_policies.", array( |
|
1610 | + else if (menu_valid_path(array('link_path' => $ruleslink))) { |
|
1611 | + $output .= ' <li>'.bts("Read our !rules_and_policies.", array( |
|
1612 | 1612 | '!rules_and_policies' => l(bts('Rules and Policies', array(), NULL, 'boinc:join-page'), $ruleslink), |
1613 | - ), NULL, 'boinc:join-page') . '</li>'; |
|
1613 | + ), NULL, 'boinc:join-page').'</li>'; |
|
1614 | 1614 | } |
1615 | - $output .= ' <li>' . bts('Download the BOINC desktop software.', array(), NULL, 'boinc:join-page'); |
|
1615 | + $output .= ' <li>'.bts('Download the BOINC desktop software.', array(), NULL, 'boinc:join-page'); |
|
1616 | 1616 | $output .= ' <p>'; |
1617 | 1617 | $output .= ' <a class="button" href="http://boinc.berkeley.edu/download.php">Download</a>'; |
1618 | 1618 | $output .= ' </p>'; |
1619 | - $output .= ' ' . bts("For Android devices, visit !fdroid_link or download !apk_link directly.", array( |
|
1619 | + $output .= ' '.bts("For Android devices, visit !fdroid_link or download !apk_link directly.", array( |
|
1620 | 1620 | '!fdroid_link' => '<a href="https://f-droid.org/en/packages/edu.berkeley.boinc">F-Droid</a>', |
1621 | 1621 | '!apk_link' => '<a href="https://boinc.berkeley.edu/download_all.php">BOINC for Android</a>', |
1622 | 1622 | ), NULL, 'boinc:join-page'); |
1623 | 1623 | $output .= ' </li>'; |
1624 | - $output .= ' <li>' . bts('Run the installer.', array(), NULL, 'boinc:join-page') . '</li>'; |
|
1625 | - $output .= ' <li>' . bts('Choose @sitename from the list, or enter @siteurl.', array( |
|
1624 | + $output .= ' <li>'.bts('Run the installer.', array(), NULL, 'boinc:join-page').'</li>'; |
|
1625 | + $output .= ' <li>'.bts('Choose @sitename from the list, or enter @siteurl.', array( |
|
1626 | 1626 | '@sitename' => $site_name, |
1627 | 1627 | '@siteurl' => $base_url, |
1628 | - ), NULL, 'boinc:join-page') . '</li>'; |
|
1629 | - $output .= '</ol>'; |
|
1628 | + ), NULL, 'boinc:join-page').'</li>'; |
|
1629 | + $output .= '</ol>'; |
|
1630 | 1630 | } |
1631 | 1631 | $output .= '</div>'; |
1632 | 1632 | return $output; |
@@ -1639,7 +1639,7 @@ discard block |
||
1639 | 1639 | global $user; |
1640 | 1640 | $site_name = variable_get('site_name', 'Drupal-BOINC'); |
1641 | 1641 | // get the front page message from database; this is set in the admin interface under BOINC Other |
1642 | - $site_message = variable_get('boinc_other_frontpage',''); |
|
1642 | + $site_message = variable_get('boinc_other_frontpage', ''); |
|
1643 | 1643 | |
1644 | 1644 | // Determine the user of the day |
1645 | 1645 | $current_uotd = db_fetch_object(db_query(" |
@@ -1661,30 +1661,30 @@ discard block |
||
1661 | 1661 | $output .= ($user->uid) ? bts('Welcome back!', array(), NULL, 'boinc:front-page') : ($site_name ? bts('What is @this_project?', array('@this_project' => $site_name)) : bts('Welcome!', array(), NULL, 'boinc:front-page')); |
1662 | 1662 | $output .= '</h2>'; |
1663 | 1663 | $output .= '<div class="boinc-overview balance-height-front">'; |
1664 | - $output .= ' <div>' . bts($site_message, array(), NULL, "project:front page") . ' ' . l(bts('Learn more', array(), NULL, 'boinc:front-page'), 'about') . '</div>'; |
|
1664 | + $output .= ' <div>'.bts($site_message, array(), NULL, "project:front page").' '.l(bts('Learn more', array(), NULL, 'boinc:front-page'), 'about').'</div>'; |
|
1665 | 1665 | if ($user->uid) { |
1666 | - $output .= ' <div>' . l(bts('View account', array(), NULL, 'boinc:front-page'), 'dashboard', array('attributes' => array('class' => 'join button'))) . '</div>'; |
|
1666 | + $output .= ' <div>'.l(bts('View account', array(), NULL, 'boinc:front-page'), 'dashboard', array('attributes' => array('class' => 'join button'))).'</div>'; |
|
1667 | 1667 | } |
1668 | 1668 | else { |
1669 | - $output .= ' <div>' . l(bts('Join now', array(), NULL, 'boinc:front-page'), 'join', array('attributes' => array('class' => 'join button'))) . '</div>'; |
|
1669 | + $output .= ' <div>'.l(bts('Join now', array(), NULL, 'boinc:front-page'), 'join', array('attributes' => array('class' => 'join button'))).'</div>'; |
|
1670 | 1670 | } |
1671 | 1671 | $output .= '</div>'; |
1672 | 1672 | $output .= '<div class="boinc-overview-details">'; |
1673 | 1673 | $output .= ' <div class="detail-container">'; |
1674 | - $output .= ' <a class="user-of-the-day" href="account/' . $uotd->uid . '">'; |
|
1674 | + $output .= ' <a class="user-of-the-day" href="account/'.$uotd->uid.'">'; |
|
1675 | 1675 | $output .= ' <div class="picture">'; |
1676 | 1676 | $output .= theme('imagefield_image', $uotd_image['image'], $uotd_image['alt'], |
1677 | 1677 | $uotd_image['alt'], array(), FALSE); |
1678 | 1678 | $output .= ' </div>'; |
1679 | - $output .= ' <div class="text">' . bts('User of the day', array(), NULL, 'boinc:front-page') . '</div>'; |
|
1680 | - $output .= ' <div class="detail">' . $uotd->boincuser_name . '</div>'; |
|
1679 | + $output .= ' <div class="text">'.bts('User of the day', array(), NULL, 'boinc:front-page').'</div>'; |
|
1680 | + $output .= ' <div class="detail">'.$uotd->boincuser_name.'</div>'; |
|
1681 | 1681 | $output .= ' </a>'; |
1682 | 1682 | $output .= ' <div class="volunteers">'; |
1683 | - $output .= ' <div class="text">' . bts('Over 500,000 volunteers and counting.', array(), NULL, 'boinc:front-page') . '</div>'; |
|
1683 | + $output .= ' <div class="text">'.bts('Over 500,000 volunteers and counting.', array(), NULL, 'boinc:front-page').'</div>'; |
|
1684 | 1684 | $output .= ' <div class="platforms">'; |
1685 | - $output .= ' <div class="detail platform windows">' . bts('Windows', array(), NULL, 'boinc:front-page') . '</div>'; |
|
1686 | - $output .= ' <div class="detail platform mac">' . bts('Mac', array(), NULL, 'boinc:front-page') . '</div>'; |
|
1687 | - $output .= ' <div class="detail platform linux">' . bts('Linux', array(), NULL, 'boinc:front-page') . '</div>'; |
|
1685 | + $output .= ' <div class="detail platform windows">'.bts('Windows', array(), NULL, 'boinc:front-page').'</div>'; |
|
1686 | + $output .= ' <div class="detail platform mac">'.bts('Mac', array(), NULL, 'boinc:front-page').'</div>'; |
|
1687 | + $output .= ' <div class="detail platform linux">'.bts('Linux', array(), NULL, 'boinc:front-page').'</div>'; |
|
1688 | 1688 | $output .= ' </div>'; |
1689 | 1689 | $output .= ' </div>'; |
1690 | 1690 | $output .= ' </div>'; |
@@ -1715,7 +1715,7 @@ discard block |
||
1715 | 1715 | $enablethisRPC = variable_get('boinc_weboptions_enableaccountcreateRPC', TRUE); |
1716 | 1716 | if (!$enablethisRPC) { |
1717 | 1717 | $mess = bts('Account creation is done through our Web site. Please register at @url', array( |
1718 | - '@url' => $base_url . '/user/registration', |
|
1718 | + '@url' => $base_url.'/user/registration', |
|
1719 | 1719 | ), |
1720 | 1720 | NULL, 'boinc:create_account'); |
1721 | 1721 | xml_error(-208, $mess); |
@@ -1747,8 +1747,8 @@ discard block |
||
1747 | 1747 | $boinc_user = BoincUser::lookup_email_addr($params['email_addr']); |
1748 | 1748 | if ($boinc_user) { |
1749 | 1749 | // Return authenticator for existing users |
1750 | - if ( ($params['passwd_hash'] == $boinc_user->passwd_hash) or |
|
1751 | - password_verify($params['passwd_hash'], $boinc_user->passwd_hash) ) { |
|
1750 | + if (($params['passwd_hash'] == $boinc_user->passwd_hash) or |
|
1751 | + password_verify($params['passwd_hash'], $boinc_user->passwd_hash)) { |
|
1752 | 1752 | $output = array('authenticator' => $boinc_user->authenticator); |
1753 | 1753 | } |
1754 | 1754 | else { |
@@ -1804,7 +1804,7 @@ discard block |
||
1804 | 1804 | // Ensure there is a authentication token before continuing |
1805 | 1805 | if (empty($authtoken)) { |
1806 | 1806 | drupal_not_found(); |
1807 | - return ; |
|
1807 | + return; |
|
1808 | 1808 | } |
1809 | 1809 | |
1810 | 1810 | if (strlen($authtoken) != 32) { |
@@ -1826,8 +1826,8 @@ discard block |
||
1826 | 1826 | } |
1827 | 1827 | |
1828 | 1828 | // Lookup path to custom account finish page |
1829 | - $customaccountfinishpath = drupal_lookup_path('source', variable_get('boinc_weboptions_accountfinish', '') ); |
|
1830 | - if ( menu_valid_path(array('link_path' => $customaccountfinishpath)) ) { |
|
1829 | + $customaccountfinishpath = drupal_lookup_path('source', variable_get('boinc_weboptions_accountfinish', '')); |
|
1830 | + if (menu_valid_path(array('link_path' => $customaccountfinishpath))) { |
|
1831 | 1831 | $node = menu_get_object('node', 1, $customaccountfinishpath); |
1832 | 1832 | if ($node) { |
1833 | 1833 | return node_page_view($node); |
@@ -1836,12 +1836,12 @@ discard block |
||
1836 | 1836 | |
1837 | 1837 | // open links in new window |
1838 | 1838 | $options = array( |
1839 | - 'attributes' => array( 'target' => '_blank' ), |
|
1839 | + 'attributes' => array('target' => '_blank'), |
|
1840 | 1840 | ); |
1841 | 1841 | |
1842 | 1842 | // Check moderation page exists |
1843 | - $moderationpath = drupal_lookup_path('source', variable_get('boinc_weboptions_moderationpage', '') ); |
|
1844 | - if ( menu_valid_path(array('link_path' => $moderationpath)) ) { |
|
1843 | + $moderationpath = drupal_lookup_path('source', variable_get('boinc_weboptions_moderationpage', '')); |
|
1844 | + if (menu_valid_path(array('link_path' => $moderationpath))) { |
|
1845 | 1845 | $modsentence = bts('Please note: user profiles are subject to !moderation.', array('!moderation' => l(bts('moderation', array(), NULL, 'boinc:account-finish'), $moderationpath, $options)), NULL, 'boinc:account-finish'); |
1846 | 1846 | } else { |
1847 | 1847 | $modsentence = bts('Please note: user profiles are subject to moderation.', array(), NULL, 'boinc:account-finish'); |
@@ -1849,11 +1849,11 @@ discard block |
||
1849 | 1849 | |
1850 | 1850 | $username = $user->boincuser_name; |
1851 | 1851 | $site_name = variable_get('site_name', 'Drupal-BOINC'); |
1852 | - $output = "<p>" . bts('Thank you @user_name for joining @site_name. Your account has been created. Your BOINC client should start working on assigned tasks soon, without any additional action or configuration. Please visit the links below for more information and additional options. (Links will open in a new window.)', |
|
1852 | + $output = "<p>".bts('Thank you @user_name for joining @site_name. Your account has been created. Your BOINC client should start working on assigned tasks soon, without any additional action or configuration. Please visit the links below for more information and additional options. (Links will open in a new window.)', |
|
1853 | 1853 | array( |
1854 | 1854 | '@user_name' => $username, |
1855 | 1855 | '@site_name' => $site_name, |
1856 | - ), NULL, 'boinc:account-finish') . "</p>"; |
|
1856 | + ), NULL, 'boinc:account-finish')."</p>"; |
|
1857 | 1857 | |
1858 | 1858 | $links = array( |
1859 | 1859 | array( |
@@ -1919,7 +1919,7 @@ discard block |
||
1919 | 1919 | ); |
1920 | 1920 | |
1921 | 1921 | //List of links |
1922 | - $output .= theme_item_list($links, $title = NULL, $type='ul'); |
|
1922 | + $output .= theme_item_list($links, $title = NULL, $type = 'ul'); |
|
1923 | 1923 | |
1924 | 1924 | return $output; |
1925 | 1925 | } |
@@ -2036,7 +2036,7 @@ discard block |
||
2036 | 2036 | global $base_url; |
2037 | 2037 | global $base_path; |
2038 | 2038 | $site_name = variable_get('site_name', 'Drupal-BOINC'); |
2039 | - $site_url = $base_url . $base_path; |
|
2039 | + $site_url = $base_url.$base_path; |
|
2040 | 2040 | $moderator = user_load($user->uid); |
2041 | 2041 | $profile->moderate = 0; |
2042 | 2042 | $profile->status = 0; |
@@ -2097,7 +2097,7 @@ discard block |
||
2097 | 2097 | global $base_url; |
2098 | 2098 | global $base_path; |
2099 | 2099 | $site_name = variable_get('site_name', 'Drupal-BOINC'); |
2100 | - $site_url = $base_url . $base_path; |
|
2100 | + $site_url = $base_url.$base_path; |
|
2101 | 2101 | $moderator = user_load($user->uid); |
2102 | 2102 | $settings = array( |
2103 | 2103 | 'from' => '', |
@@ -2201,25 +2201,25 @@ discard block |
||
2201 | 2201 | if (!$projects) return bts('no projects...', array(), NULL, 'boinc:account-dashboard'); |
2202 | 2202 | |
2203 | 2203 | $output = ''; |
2204 | - $output .= '<table class="user-projects">' . "\n"; |
|
2205 | - $output .= '<thead>' . "\n"; |
|
2206 | - $output .= ' <tr>' . "\n"; |
|
2207 | - $output .= ' <th>' . bts('Name', array(), NULL, 'boinc:project-name:-1:ignoreoverwrite') . '</th>' . "\n"; |
|
2208 | - $output .= ' <th class="numeric">' . bts('Avg credit', array(), NULL, 'boinc:account-dashboard') . '</th>' . "\n"; |
|
2209 | - $output .= ' <th class="numeric">' . bts('Total credit', array(), NULL, 'boinc:user-or-team-total-credits') . '</th>' . "\n"; |
|
2210 | - $output .= ' </tr>' . "\n"; |
|
2211 | - $output .= '</thead>' . "\n"; |
|
2212 | - $output .= '<tbody>' . "\n"; |
|
2204 | + $output .= '<table class="user-projects">'."\n"; |
|
2205 | + $output .= '<thead>'."\n"; |
|
2206 | + $output .= ' <tr>'."\n"; |
|
2207 | + $output .= ' <th>'.bts('Name', array(), NULL, 'boinc:project-name:-1:ignoreoverwrite').'</th>'."\n"; |
|
2208 | + $output .= ' <th class="numeric">'.bts('Avg credit', array(), NULL, 'boinc:account-dashboard').'</th>'."\n"; |
|
2209 | + $output .= ' <th class="numeric">'.bts('Total credit', array(), NULL, 'boinc:user-or-team-total-credits').'</th>'."\n"; |
|
2210 | + $output .= ' </tr>'."\n"; |
|
2211 | + $output .= '</thead>'."\n"; |
|
2212 | + $output .= '<tbody>'."\n"; |
|
2213 | 2213 | foreach ($projects AS $project) { |
2214 | - $url = rtrim($project->url, '/') . '/show_user.php?userid=' . $project->id; |
|
2215 | - $output .= ' <tr>' . "\n"; |
|
2216 | - $output .= ' <td>' . l($project->name, $url) . '</td>' . "\n"; |
|
2217 | - $output .= ' <td class="numeric">' . boincwork_format_stats((float) $project->expavg_credit) . '</td>' . "\n"; |
|
2218 | - $output .= ' <td class="numeric">' . boincwork_format_stats((float) $project->total_credit) . '</td>' . "\n"; |
|
2219 | - $output .= ' </tr>' . "\n"; |
|
2214 | + $url = rtrim($project->url, '/').'/show_user.php?userid='.$project->id; |
|
2215 | + $output .= ' <tr>'."\n"; |
|
2216 | + $output .= ' <td>'.l($project->name, $url).'</td>'."\n"; |
|
2217 | + $output .= ' <td class="numeric">'.boincwork_format_stats((float)$project->expavg_credit).'</td>'."\n"; |
|
2218 | + $output .= ' <td class="numeric">'.boincwork_format_stats((float)$project->total_credit).'</td>'."\n"; |
|
2219 | + $output .= ' </tr>'."\n"; |
|
2220 | 2220 | } |
2221 | - $output .= '</tbody>' . "\n"; |
|
2222 | - $output .= '</table>' . "\n"; |
|
2221 | + $output .= '</tbody>'."\n"; |
|
2222 | + $output .= '</table>'."\n"; |
|
2223 | 2223 | $more_link = ($account) ? "user/{$account->uid}/stats" : 'account/stats'; |
2224 | 2224 | //$output .= "<div class=\"more-link\"><a href=\"{$more_link}\">More stats</a></div>" . "\n"; |
2225 | 2225 | return $output; |
@@ -2239,8 +2239,8 @@ discard block |
||
2239 | 2239 | 'cpid' => $cpid |
2240 | 2240 | ); |
2241 | 2241 | $args = array(); |
2242 | - foreach ($get as $arg => $value) $args[] = "{$arg}=" . rawurlencode($value); |
|
2243 | - $query = '?' . implode('&', $args); |
|
2242 | + foreach ($get as $arg => $value) $args[] = "{$arg}=".rawurlencode($value); |
|
2243 | + $query = '?'.implode('&', $args); |
|
2244 | 2244 | |
2245 | 2245 | // Load XML from RPC |
2246 | 2246 | $target_url = "http://{$stats_server}/{$stats_rpc}{$query}"; |
@@ -2312,12 +2312,12 @@ discard block |
||
2312 | 2312 | $output .= '<ul class="tab-list">'; |
2313 | 2313 | $count = 0; |
2314 | 2314 | foreach ($links as $key => $link) { |
2315 | - $output .= '<li class="' . (($count == 0) ? 'first primary ' : '') . 'tab">'; |
|
2315 | + $output .= '<li class="'.(($count == 0) ? 'first primary ' : '').'tab">'; |
|
2316 | 2316 | $output .= l($link['title'], $link['href'], array('query' => drupal_get_destination())); |
2317 | 2317 | $output .= '</li>'; |
2318 | 2318 | $count++; |
2319 | 2319 | } |
2320 | - $output .= '<li class="' . (($count) ? '' : 'first ') . 'last tab">' . flag_create_link('abuse_user_meta', $account->uid) . '</li>'; |
|
2320 | + $output .= '<li class="'.(($count) ? '' : 'first ').'last tab">'.flag_create_link('abuse_user_meta', $account->uid).'</li>'; |
|
2321 | 2321 | $output .= '</ul>'; |
2322 | 2322 | } |
2323 | 2323 | return $output; |
@@ -2358,7 +2358,7 @@ discard block |
||
2358 | 2358 | function boincuser_apachesolr_index_documents_alter(array &$documents, $entity, $entity_type, $env_id) { |
2359 | 2359 | |
2360 | 2360 | foreach ($documents as $document) { |
2361 | - if ( $document->entity_type=='node' AND $document->bundle=='profile' ) { |
|
2361 | + if ($document->entity_type == 'node' AND $document->bundle == 'profile') { |
|
2362 | 2362 | // Node information. |
2363 | 2363 | $nid = $document->entity_id; |
2364 | 2364 | $node = node_load($nid); |
@@ -2408,11 +2408,11 @@ discard block |
||
2408 | 2408 | // privatemsg module. We need to convert them back to spaces for the |
2409 | 2409 | // check below. |
2410 | 2410 | $boincname = preg_replace("/\\xc2\\xa0/", " ", $boincname); |
2411 | - if ($drupalid>0) { |
|
2411 | + if ($drupalid > 0) { |
|
2412 | 2412 | if ($recipient = user_load(array('uid' => $drupalid))) { |
2413 | 2413 | // Double-check that the loaded user matches both boincuser_id |
2414 | 2414 | // and boincuser_name. |
2415 | - if ( ($boincid == $recipient->boincuser_id) AND ($boincname == $recipient->boincuser_name) ) { |
|
2415 | + if (($boincid == $recipient->boincuser_id) AND ($boincname == $recipient->boincuser_name)) { |
|
2416 | 2416 | return $recipient; |
2417 | 2417 | } |
2418 | 2418 | } |