I know this is not in the scope of this module but maybe I'll find some help here because it seems a similiar task somehow.
I would like to force my imported users to not only change their password but also to set their email address (as I have a user database without email addresses).
It almost works out of the box, as email a manditory field users have to fill it out, too when being forced to change their passwords. But they are free to enter non-existent email adresses.
I can make sure the email only gets saved to the profile when confirmed by a link sent to the address using email_confirm module. But still, if an email doen't get confirmed the account is activated.
Is it possible to combine the requirement of password change with clicking the activation link sent by email_confirm to actviate an user account?
Thanks for any input on this,
Daniel
Comments
Comment #1
daniel wentsch commentedOkay, by looking at Force Password Change I managed writing a little module that simply checks for $user->mail on hook_init.
It basically does what I want it to, only some error messages I need to get rid of.
Comment #2
tobiberlinHi klickreflex,
I would need something like you have descibed above. I import many users and some of them has no email addresses - they will be informed about their login datas by post. As you cannot import users without email addresses I will create "ghost addresses" for those users. By giving a specific role to them I would like to force them to define a new email address - otherwise they could use the website with those automatically created ghost addresses. Do you have any idea how this could be done?
Best,
Tobias
Comment #3
daniel wentsch commentedI got around the very same task by importing users without email adress really without adding a (fake) email address.
To be able to do this I had to hack the user_import module to make the email field optional. Just comment out line 454:
if (!$email) form_set_error('email', t('One column of the csv file must be set as the email address.'));Then I wrote a little module that checks if the user has an email and, if not, redirects to the profile edit page.
Comment #4
jaypan