@@ -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); |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | } |
188 | 188 | |
189 | 189 | if (!is_null($teamid)) { |
190 | - if ($teamid==0) { |
|
190 | + if ($teamid == 0) { |
|
191 | 191 | user_quit_team($user); |
192 | 192 | } else { |
193 | 193 | $team = BoincTeam::lookup_id_nocache($teamid); |
@@ -240,15 +240,15 @@ discard block |
||
240 | 240 | // table. If one or more of these consent_xyz parameters are NOT |
241 | 241 | // present, the RPC will still return 'success', even though the |
242 | 242 | // consent table is not updated. |
243 | -if ( (isset($consent_name) and isset($consent_flag) and isset($consent_not_required) and isset($consent_source)) ) { |
|
243 | +if ((isset($consent_name) and isset($consent_flag) and isset($consent_not_required) and isset($consent_source))) { |
|
244 | 244 | list($checkct, $ctid) = check_consent_type($consent_name); |
245 | 245 | if ($checkct) { |
246 | 246 | |
247 | 247 | // Check to see if latest consent of this name is already |
248 | 248 | // given. |
249 | - $cr= BoincConsent::lookup("userid={$user->id} AND consent_type_id='${ctid}' ORDER BY consent_time DESC LIMIT 1"); |
|
250 | - if ( (($cr) and ($cr->consent_flag!=$consent_flag)) or |
|
251 | - (!$cr) ) { |
|
249 | + $cr = BoincConsent::lookup("userid={$user->id} AND consent_type_id='${ctid}' ORDER BY consent_time DESC LIMIT 1"); |
|
250 | + if ((($cr) and ($cr->consent_flag != $consent_flag)) or |
|
251 | + (!$cr)) { |
|
252 | 252 | |
253 | 253 | $rc = consent_to_a_policy($user, $ctid, $consent_flag, $consent_not_required, $consent_source, time()); |
254 | 254 | if (!$rc) { |
@@ -53,7 +53,7 @@ |
||
53 | 53 | // Toggles the enable flag |
54 | 54 | function mct_toggle_field($field) { |
55 | 55 | $ctid = post_int("consent_type_id"); |
56 | - $toggle = post_str("toggle" . $field); |
|
56 | + $toggle = post_str("toggle".$field); |
|
57 | 57 | if ($toggle == "Click to Enable") { |
58 | 58 | $state = 1; |
59 | 59 | $action = "Enabled"; |
@@ -82,7 +82,7 @@ |
||
82 | 82 | |
83 | 83 | page_head(tra("Account Deleted")); |
84 | 84 | |
85 | - echo "<p>".tra("Your account has been deleted. If you want to contribute to %1 in the future you will need to create a new account.",PROJECT)."</p>"; |
|
85 | + echo "<p>".tra("Your account has been deleted. If you want to contribute to %1 in the future you will need to create a new account.", PROJECT)."</p>"; |
|
86 | 86 | |
87 | 87 | page_tail(); |
88 | 88 | } |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | start_table(); |
28 | 28 | echo " |
29 | 29 | <tr><td>" |
30 | - . tra("Leader boards for %1",PROJECT).": |
|
30 | + . tra("Leader boards for %1", PROJECT).": |
|
31 | 31 | <ul> |
32 | 32 | <li><a href=\"top_users.php\">" . tra("Participants")."</a> |
33 | 33 | "; |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | if (!DISABLE_TEAMS) { |
39 | 39 | echo " |
40 | - <li><a href=\"top_teams.php\">" . tra("Teams"). "</a> |
|
40 | + <li><a href=\"top_teams.php\">" . tra("Teams")."</a> |
|
41 | 41 | "; |
42 | 42 | if ($credit_by_app) { |
43 | 43 | echo "<ul><li><a href=per_app_list.php?is_team=1>Per application</a></ul>\n"; |
@@ -22,14 +22,14 @@ |
||
22 | 22 | require_once("../inc/util.inc"); |
23 | 23 | require_once("../inc/cache.inc"); |
24 | 24 | |
25 | -$min_credit = .1; // only count hosts with this much RAC |
|
25 | +$min_credit = .1; // only count hosts with this much RAC |
|
26 | 26 | $total_rac = 0; |
27 | 27 | |
28 | 28 | define("CACHE_PERIOD", 7*86400); |
29 | 29 | |
30 | 30 | function show_type($type, $stats) { |
31 | 31 | global $total_rac; |
32 | - $pct = $total_rac?number_format(100*$stats->rac/$total_rac, 4):0; |
|
32 | + $pct = $total_rac ?number_format(100*$stats->rac/$total_rac, 4) : 0; |
|
33 | 33 | row_array(array($type, $stats->nhosts, "$pct %")); |
34 | 34 | } |
35 | 35 |
@@ -9,11 +9,11 @@ discard block |
||
9 | 9 | * Helper functions |
10 | 10 | */ |
11 | 11 | function _boincuser_delete_goto_admindelete($form, &$form_state) { |
12 | - drupal_goto('/admin/boinc/user_delete/' . $form['#uid']); |
|
12 | + drupal_goto('/admin/boinc/user_delete/'.$form['#uid']); |
|
13 | 13 | } |
14 | 14 | |
15 | 15 | function _boincuser_delete_cancel($form, &$form_state) { |
16 | - drupal_goto('/user/' . $form['#uid'] . '/edit'); |
|
16 | + drupal_goto('/user/'.$form['#uid'].'/edit'); |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | /** |
@@ -24,9 +24,9 @@ discard block |
||
24 | 24 | return form_set_error('current_pass', bts('Authentication is required when requesting account deletion.', array(), NULL, 'boinc:delete-user-account')); |
25 | 25 | } |
26 | 26 | |
27 | - $given_hash = md5($current_pass . $boinc_user->email_addr); |
|
27 | + $given_hash = md5($current_pass.$boinc_user->email_addr); |
|
28 | 28 | |
29 | - if ( (!password_verify($given_hash, $boinc_user->passwd_hash)) and ($given_hash != $boinc_user->passwd_hash) ) { |
|
29 | + if ((!password_verify($given_hash, $boinc_user->passwd_hash)) and ($given_hash != $boinc_user->passwd_hash)) { |
|
30 | 30 | return form_set_error('current_pass', bts('Password entered is not valid. Please verify that it is correct.', array(), NULL, 'boinc:delete-user-account')); |
31 | 31 | } |
32 | 32 | |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | /** |
41 | 41 | * Delete the user function. |
42 | 42 | */ |
43 | -function _boincuser_delete_deleteuser($account, $action=NULL) { |
|
43 | +function _boincuser_delete_deleteuser($account, $action = NULL) { |
|
44 | 44 | require_boinc('user_util'); |
45 | 45 | require_boinc('delete_account'); |
46 | 46 | |
@@ -74,11 +74,11 @@ discard block |
||
74 | 74 | // * erase signature |
75 | 75 | $myarray = array( |
76 | 76 | 'status' => 0, |
77 | - 'name' => 'deleted_' . time() . '_' . random_string(), |
|
78 | - 'mail' => 'deleted_' . time() . '_' . random_string(), |
|
79 | - 'pass' => 'deleted_' . time() . '_' . random_string(), |
|
77 | + 'name' => 'deleted_'.time().'_'.random_string(), |
|
78 | + 'mail' => 'deleted_'.time().'_'.random_string(), |
|
79 | + 'pass' => 'deleted_'.time().'_'.random_string(), |
|
80 | 80 | 'signature' => '', |
81 | - 'init' => 'deleted_' . time() . '_' . random_string(), |
|
81 | + 'init' => 'deleted_'.time().'_'.random_string(), |
|
82 | 82 | ); |
83 | 83 | user_save($account, $myarray); |
84 | 84 | break; |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | |
131 | 131 | if (!empty($mids)) { |
132 | 132 | // Delete recipient entries in {pm_index} of the messages the user wrote. |
133 | - db_query('DELETE FROM {pm_index} WHERE mid IN (' . db_placeholders($mids) . ')', $mids); |
|
133 | + db_query('DELETE FROM {pm_index} WHERE mid IN ('.db_placeholders($mids).')', $mids); |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | // Delete recipient entries of that user. |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $form['#uid'] = $uid; |
66 | 66 | |
67 | 67 | $form['account']['help'] = array( |
68 | - '#value' => "<p>" . t("This form will delete this user <strong>without any email notification</strong> sent to the user. Be very careful in deleting users using this form. Once you select the delete type, check the checkbox, enter your password, and click submit, the user's account will be deleted. This will occur <strong>immediately</strong>. There is no 'undo'!") . "</p><p>" . t("You are deleting the following user, link opens in new window:") . "</p>", |
|
68 | + '#value' => "<p>".t("This form will delete this user <strong>without any email notification</strong> sent to the user. Be very careful in deleting users using this form. Once you select the delete type, check the checkbox, enter your password, and click submit, the user's account will be deleted. This will occur <strong>immediately</strong>. There is no 'undo'!")."</p><p>".t("You are deleting the following user, link opens in new window:")."</p>", |
|
69 | 69 | '#weight' => -1, |
70 | 70 | '#prefix' => "<div id='delete-instructions'>", |
71 | 71 | '#suffix' => "</div>", |
@@ -76,16 +76,16 @@ discard block |
||
76 | 76 | drupal_set_title($account->boincuser_name); |
77 | 77 | |
78 | 78 | $form['account']['boincuser_name'] = array( |
79 | - '#value' => t('<li>BOINC username (public displayname): ') . l("{$account->boincuser_name}", "account/{$account->uid}", array('attributes' => array('target' => '_blank'))), |
|
79 | + '#value' => t('<li>BOINC username (public displayname): ').l("{$account->boincuser_name}", "account/{$account->uid}", array('attributes' => array('target' => '_blank'))), |
|
80 | 80 | ); |
81 | 81 | $form['account']['boincuser_id'] = array( |
82 | - '#value' => t('<li>BOINC user ID: ') . $account->boincuser_id, |
|
82 | + '#value' => t('<li>BOINC user ID: ').$account->boincuser_id, |
|
83 | 83 | ); |
84 | 84 | $form['account']['drupal_name'] = array( |
85 | - '#value' => t('<li>Drupal username (internal): ') . $account->name, |
|
85 | + '#value' => t('<li>Drupal username (internal): ').$account->name, |
|
86 | 86 | ); |
87 | 87 | $form['account']['user_id'] = array( |
88 | - '#value' => t('<li>Drupal user ID: ') . $account->uid, |
|
88 | + '#value' => t('<li>Drupal user ID: ').$account->uid, |
|
89 | 89 | ); |
90 | 90 | |
91 | 91 | $form['account']['user_delete_action'] = array( |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | form_set_error('user_delete_action', t('Please select an action to perform using the radio buttons.')); |
149 | 149 | } |
150 | 150 | |
151 | - if ( ($form_state['values']['user_delete_action'] != 'soft_obfuscate') and ($form_state['values']['user_delete_action'] != 'hard_wipe') ) { |
|
151 | + if (($form_state['values']['user_delete_action'] != 'soft_obfuscate') and ($form_state['values']['user_delete_action'] != 'hard_wipe')) { |
|
152 | 152 | form_set_error('user_delete_action', t('User Delete action not a predefined value, unknown error in radio buttons.')); |
153 | 153 | } |
154 | 154 |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | '#default_value' => $default['boinc_server_status_url'], |
121 | 121 | '#description' => t('An absolute URL or path relative to the site base to the server status page (e.g. %full_url or just %relative_url).', |
122 | 122 | array( |
123 | - '%full_url' => $base_url . '/server_status.php', |
|
123 | + '%full_url' => $base_url.'/server_status.php', |
|
124 | 124 | '%relative_url' => 'server_status.php', |
125 | 125 | ) |
126 | 126 | ), |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | '#default_value' => $default['boinc_app_list_url'], |
132 | 132 | '#description' => t('An absolute URL or path relative to the site base to the applications page (e.g. %full_url or just %relative_url).', |
133 | 133 | array( |
134 | - '%full_url' => $base_url . '/apps.php', |
|
134 | + '%full_url' => $base_url.'/apps.php', |
|
135 | 135 | '%relative_url' => 'apps.php', |
136 | 136 | ) |
137 | 137 | ), |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | '#type' => 'checkbox', |
355 | 355 | '#title' => t('Enable create_account.php RPC'), |
356 | 356 | '#default_value' => $default['boinc_weboptions_enableaccountcreateRPC'], |
357 | - '#description' => t('If checked, users will be able to create an account remotely using the create_account.php RPC. This option is independent of the user regsitration option found in ') . l(t('User management -> User settings'), '/admin/user/settings') . '. If enabled, user <b>may not be able to see and agree to the terms-of-use</b> to your site\'s privacy and data retention policies!', |
|
357 | + '#description' => t('If checked, users will be able to create an account remotely using the create_account.php RPC. This option is independent of the user regsitration option found in ').l(t('User management -> User settings'), '/admin/user/settings').'. If enabled, user <b>may not be able to see and agree to the terms-of-use</b> to your site\'s privacy and data retention policies!', |
|
358 | 358 | ); |
359 | 359 | |
360 | 360 | $form['boinc_weboptions_registrationtitle'] = array( |
@@ -409,32 +409,32 @@ discard block |
||
409 | 409 | '#rows' => 8, |
410 | 410 | '#description' => t('A list of Drupal URLs/paths to ignore for Terms of Use (ToU). If the option above \'Are existing users forced to agree to the Terms of Use?\' is activated, then some paths need to be ignored when checking if a user has agreed to the ToU. A good example is the logout path, "logout", or else users will not be able to logout! |
411 | 411 | <p>There is a default list of paths that must be ignored or else the site will not function. They are not included in this box. Here you may provide additional paths to be ignored, for example the privacy policy page may be accessible so that users may read it before agreeing to the site\'s ToU. |
412 | -<p>Paths should be entered one per line. All paths should be <em>lower-case</em> and should not include a leading \'/\'. Example: account/info/edit will allow the user to visit ' . $base_url . '/account/info/edit without first agreeing to the ToU. Regexp are allowed. Example: account/* will allow the user to visit any path starting with ' . $base_url . '/account/.'), |
|
412 | +<p>Paths should be entered one per line. All paths should be <em>lower-case</em> and should not include a leading \'/\'. Example: account/info/edit will allow the user to visit ' . $base_url.'/account/info/edit without first agreeing to the ToU. Regexp are allowed. Example: account/* will allow the user to visit any path starting with '.$base_url.'/account/.'), |
|
413 | 413 | ); |
414 | 414 | |
415 | 415 | $form['pathtitle'] = array( |
416 | 416 | '#value' => '<h3>Path Options</h3>', |
417 | 417 | ); |
418 | 418 | |
419 | - $form['boinc_weboptions_accountfinish'] = array ( |
|
419 | + $form['boinc_weboptions_accountfinish'] = array( |
|
420 | 420 | '#type' => 'textfield', |
421 | 421 | '#title' => t('Path to a custom account_finish.php page, should be a path to a node'), |
422 | 422 | '#description' => t('Provide a path to a node which will serve as your site\'s landing page for users create an account using the BOINC client manager. They will be directed to this page after the account is created. If blank, a default account_finish page will be used.<br>Examples: account_finish, content/welcome, node/123'), |
423 | 423 | '#default_value' => $default['boinc_weboptions_accountfinish'], |
424 | 424 | ); |
425 | - $form['boinc_weboptions_moderationpage'] = array ( |
|
425 | + $form['boinc_weboptions_moderationpage'] = array( |
|
426 | 426 | '#type' => 'textfield', |
427 | 427 | '#title' => t('Path to the site\'s content moderation info page, should be a path to a node'), |
428 | 428 | '#description' => t('Provide a path to a node which will serve as your site\'s page for account/content moderation information. This will be used on the default account_finish page. If blank, no link to a moderation page will be provided. If a path is provided to the custom account_finish.php page (above), this field will be ignored.<br>Examples: moderation, content/moderation, node/456'), |
429 | 429 | '#default_value' => $default['boinc_weboptions_moderationpage'], |
430 | 430 | ); |
431 | - $form['boinc_weboptions_rulespolicies'] = array ( |
|
431 | + $form['boinc_weboptions_rulespolicies'] = array( |
|
432 | 432 | '#type' => 'textfield', |
433 | 433 | '#title' => t('Path to the site\'s rule and policies page, should be a path to a node'), |
434 | 434 | '#description' => t('Provide a path to a node which will serve as your site\'s rules and policies page. This will be used on the Join page shown to new users. If blank, no link to a rules and policies page will be provided.<br>Examples: rules-and-policies, node/789'), |
435 | 435 | '#default_value' => $default['boinc_weboptions_rulespolicies'], |
436 | 436 | ); |
437 | - $form['boinc_other_frontpage'] = array ( |
|
437 | + $form['boinc_other_frontpage'] = array( |
|
438 | 438 | '#type' => 'textarea', |
439 | 439 | '#title' => bts('Message for site\'s Home Page', array(), NULL, 'boinc:admin-boinc-other-options'), |
440 | 440 | '#default_value' => $default['boinc_other_frontpage'], |
@@ -447,7 +447,7 @@ discard block |
||
447 | 447 | '#value' => '<h3>Other Options</h3>', |
448 | 448 | ); |
449 | 449 | |
450 | - $form['boinc_weboptions_blacklisted_usernames'] = array ( |
|
450 | + $form['boinc_weboptions_blacklisted_usernames'] = array( |
|
451 | 451 | '#type' => 'textarea', |
452 | 452 | '#title' => t('BOINC username blacklist'), |
453 | 453 | '#default_value' => $default['boinc_weboptions_blacklisted_usernames'], |
@@ -466,17 +466,17 @@ discard block |
||
466 | 466 | $values = $form_state['values']; |
467 | 467 | |
468 | 468 | $accountfinish = $values['boinc_weboptions_accountfinish']; |
469 | - if ( ($accountfinish) AND (!drupal_lookup_path('source', $accountfinish)) ) { |
|
469 | + if (($accountfinish) AND (!drupal_lookup_path('source', $accountfinish))) { |
|
470 | 470 | form_set_error('boinc weboptions_accountfinish', t('Path to custom account finish page not found. Please provide a valid path, or leave blank to unset.')); |
471 | 471 | } |
472 | 472 | |
473 | 473 | $moderationpage = $values['boinc_weboptions_moderationpage']; |
474 | - if ( ($moderationpage) AND (!drupal_lookup_path('source', $moderationpage)) ) { |
|
474 | + if (($moderationpage) AND (!drupal_lookup_path('source', $moderationpage))) { |
|
475 | 475 | form_set_error('boinc weboptions_moderationpage', t('Path to moderation page not found. Please provide a valid path, or leave blank to unset.')); |
476 | 476 | } |
477 | 477 | |
478 | 478 | $rulespolicies = $values['boinc_weboptions_rulespolicies']; |
479 | - if ( ($rulespolicies) AND (!drupal_lookup_path('source', $rulespolicies)) ) { |
|
479 | + if (($rulespolicies) AND (!drupal_lookup_path('source', $rulespolicies))) { |
|
480 | 480 | form_set_error('boinc weboptions_rulespolicies', t('Path to rules and policies page not found. Please provide a valid path, or leave blank to unset.')); |
481 | 481 | } |
482 | 482 | } |
@@ -485,5 +485,5 @@ discard block |
||
485 | 485 | * Submit BOINC other form |
486 | 486 | */ |
487 | 487 | function boincuser_admin_weboptions_submit($form, &$form_state) { |
488 | - drupal_set_message( bts("Status: Drupa-BOINC Web site options have been updated", array(), NULL, 'boinc:admin-boinc-website-options') ); |
|
488 | + drupal_set_message(bts("Status: Drupa-BOINC Web site options have been updated", array(), NULL, 'boinc:admin-boinc-website-options')); |
|
489 | 489 | } |