Drupal: Mark profiles as verified on import if already verified in BOINC

(DBOINC-136)
This commit is contained in:
Tristan Olive 2015-10-19 15:26:47 -04:00
parent 1d47227b9b
commit 03fb0bc2c4
1 changed files with 8 additions and 0 deletions

View File

@ -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;
}