mirror of https://github.com/BOINC/boinc.git
Drupal: Mark profiles as verified on import if already verified in BOINC
(DBOINC-136)
This commit is contained in:
parent
1d47227b9b
commit
03fb0bc2c4
|
@ -224,6 +224,7 @@ function boincuser_create_drupal_profile($account, $boinc_user) {
|
||||||
$profile_opinions = null;
|
$profile_opinions = null;
|
||||||
$profile_image = null;
|
$profile_image = null;
|
||||||
$avatar_image = null;
|
$avatar_image = null;
|
||||||
|
$profile_approved = NULL;
|
||||||
|
|
||||||
// Load the BOINC profile, if available
|
// Load the BOINC profile, if available
|
||||||
if ($boinc_user->has_profile) {
|
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";
|
$image_path = "{$image_dir}/{$boinc_user->id}_avatar.jpg";
|
||||||
$avatar_image = get_cck_image_object($image_path, 'field_image', 'profile', TRUE);
|
$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("
|
$default_input_format = db_result(db_query("
|
||||||
SELECT format FROM {filter_formats} WHERE name = '%s'", 'Rich text'));
|
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);
|
$profile_node = node_submit($profile_node);
|
||||||
node_save($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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue