If an imported user has not either logged into their account for the first time, or had user 1 edit and save their account, roles with the 'access user profiles' permission will not be able to view the imported user's profile. By setting the 'access' value in the user table, the profile can be viewed.
function MY_MODULE_uif_post_create($account, $user_data, $form_state) {
$update['access'] = time();
$updated = user_save($account, $update);
}
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | uif-allow_access_post_create-1338364-4.patch | 714 bytes | adammalone |
Comments
Comment #1
dwightaspinwall commentedI'm not familiar with the "view user profiles" permission. What module implements it and which version of Drupal?
Comment #2
agileware commentedMy bad, that should be the 'access user profiles' permission.
Comment #3
dwightaspinwall commentedOk, so core profile module. Here's what user_save() does:
So is the proposal that all users created by uif get access set as well (and not just those created by users with 'administer users' perm)? I guess that makes sense.
Comment #4
adammaloneI took a look at the code and this looked like the right way of altering the module to include this.
Comment #5
dwightaspinwall commentedFixed in 6.x-1.5 / 7.x-1.0-beta8 Thanks!
Comment #6
dwightaspinwall commentedComment #6.0
dwightaspinwall commentedCorrection