Browse Source

Update tripal/includes/tripal.registration.inc

Looks good to me.

Co-Authored-By: Lacey-Anne Sanderson <las166@mail.usask.ca>

Shawna 5 years ago
parent
commit
5f9836f358
1 changed files with 8 additions and 1 deletions
  1. 8 1
      tripal/includes/tripal.registration.inc

+ 8 - 1
tripal/includes/tripal.registration.inc

@@ -298,7 +298,14 @@ function tripal_registration_form_submit($form, &$form_state) {
   variable_set('tripal_site_registration', $registration);
 
   //Now send the updated info to the Tripal Site.
-  tripal_registration_remote_submit($registration);
+  // Only register with tripal.info if the user has not opt'd out.
+  if ($form_state['values']['disable_tripal_reporting'] == FALSE) {
+    tripal_registration_remote_submit($registration);
+    drupal_set_message(t('Registration sent to tripal.info'), 'status');
+  }
+  else {
+    drupal_set_message(t('You are not registered with tripal.info'), 'status');
+  }
 
   drupal_set_message(t('Thank you for registering. You can update your details at any time.'), 'status');
 }