From 03fb0bc2c4288b3a17c28428a8900d475db4aed9 Mon Sep 17 00:00:00 2001 From: Tristan Olive Date: Mon, 19 Oct 2015 15:26:47 -0400 Subject: [PATCH] Drupal: Mark profiles as verified on import if already verified in BOINC (DBOINC-136) --- .../boinc/modules/boincuser/includes/boincuser.forms.inc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drupal/sites/default/boinc/modules/boincuser/includes/boincuser.forms.inc b/drupal/sites/default/boinc/modules/boincuser/includes/boincuser.forms.inc index e93321c1c2..59eb4d8611 100644 --- a/drupal/sites/default/boinc/modules/boincuser/includes/boincuser.forms.inc +++ b/drupal/sites/default/boinc/modules/boincuser/includes/boincuser.forms.inc @@ -224,6 +224,7 @@ function boincuser_create_drupal_profile($account, $boinc_user) { $profile_opinions = null; $profile_image = null; $avatar_image = null; + $profile_approved = NULL; // Load the BOINC profile, if available if ($boinc_user->has_profile) { @@ -243,6 +244,7 @@ function boincuser_create_drupal_profile($account, $boinc_user) { $image_path = "{$image_dir}/{$boinc_user->id}_avatar.jpg"; $avatar_image = get_cck_image_object($image_path, 'field_image', 'profile', TRUE); } + $profile_approved = $boinc_profile->verification ? TRUE : FALSE; } $default_input_format = db_result(db_query(" SELECT format FROM {filter_formats} WHERE name = '%s'", 'Rich text')); @@ -274,6 +276,12 @@ function boincuser_create_drupal_profile($account, $boinc_user) { $profile_node = node_submit($profile_node); node_save($profile_node); + // Mark profile as approved if it has already been vetted somehow + if ($profile_approved) { + $profile_node->moderate = 0; + node_save($profile_node); + } + return; }