Drupal: Changed create account to set show_hosts to false.

Also added help text to Privacy form.

https://dev.gridrepublic.org/browse/DBOINCP-430
This commit is contained in:
Shawn Kwang 2018-04-02 12:56:19 -05:00
parent a9dac7ee5e
commit 7b1c077f5c
2 changed files with 5 additions and 0 deletions

View File

@ -1450,6 +1450,10 @@ function boincuser_create_account() {
if (!$reference) { if (!$reference) {
xml_error(-1, 'error connecting BOINC account to Drupal'); xml_error(-1, 'error connecting BOINC account to Drupal');
} }
// Disable show_hosts flag, set to TRUE by default
db_set_active('boinc_rw');
db_query("UPDATE {user} SET show_hosts=0 WHERE id='%d'", $boinc_user->id);
db_set_active('default');
} }
else { else {
// Delete the drupal user just created. // Delete the drupal user just created.

View File

@ -1719,6 +1719,7 @@ function boincwork_privacyprefs_form(&$form_state) {
); );
$form['privacy']['show_hosts'] = array( $form['privacy']['show_hosts'] = array(
'#title' => bts('Should @project show your computers on its web site?', array('@project' => variable_get('site_name', 'Drupal-BOINC')), NULL, 'boinc:account-preferences-privacy'), '#title' => bts('Should @project show your computers on its web site?', array('@project' => variable_get('site_name', 'Drupal-BOINC')), NULL, 'boinc:account-preferences-privacy'),
'#description' => bts('At times, you may be asked to enable this option in order to receive help from the forums. Advanced users may need to be able to inspect your computers\' information in order to help diagnose any problems.', array(), NULL, 'boinc:account-preferences-privacy'),
'#type' => 'radios', '#type' => 'radios',
'#options' => $form['boolean_options']['#value'], '#options' => $form['boolean_options']['#value'],
'#attributes' => array('class' => 'fancy'), '#attributes' => array('class' => 'fancy'),