email as login [message #24834] |
Mon, 16 May 2005 17:37 |
newnumbertwo
Messages: 38 Registered: June 2004
Karma: 0
|
Member |
|
|
I'd like to modify my FudForum such that users log in with their email addresses instead of login names.
The reason I'd like to do this is because I am migrating a 2000+ person mailing list into FudForum, and I used the auto account creation option to pre-register user accounts. Some of the user accounts have one or two-character usernames, which cannot login to or retrieve passwords from, FudForum. I'd also like to avoid having to deal with user requests to change their login names.
Is this possible/desirable, or can any of you suggest a better solution? I supposed I could enable users to login via their nicks, which mights solve one problem, but establishing emails as the logins would be the better, more egalitarian solution.
Any suggestions on how to do this?
thanks
w
|
|
|
Re: email as login [message #24844 is a reply to message #24834] |
Mon, 16 May 2005 21:06 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
You can modify the code inside login.php.t do check email field rather then the login field.
FUDforum Core Developer
|
|
|
|
Re: email as login [message #24858 is a reply to message #24857] |
Tue, 17 May 2005 17:09 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
I do not plan to add such a feature, login.php.t would be the main change, of course anywhere a login name is being used right now would also need to be modified to use the e-mail field instead.
Perhaps a better modification would be to change the registration form and make it store the e-mail address as the login name. This can be done by editing register.tmpl and register.php.t
FUDforum Core Developer
|
|
|
Re: email as login [message #24860 is a reply to message #24858] |
Wed, 18 May 2005 01:36 |
newnumbertwo
Messages: 38 Registered: June 2004
Karma: 0
|
Member |
|
|
OK, I'm hacking on login.php.t, and I've changed the query from:
...
FROM {SQL_TABLE_PREFIX}users WHERE login =
to
FROM {SQL_TABLE_PREFIX}users WHERE email =
problem is, i'm not sure this query is being executed. i've created a new message for this error (login_invalid_radius_email) in the thm/default/i18n/english/msg file, but my changes aren't "taking". i've stopped and restarted apache...this template message isn't being called or displayed.
what do i need to do to get fudforum to recognize changes in the login.php.t template ?
[Updated on: Wed, 18 May 2005 01:36] Report message to a moderator
|
|
|
Re: email as login [message #24861 is a reply to message #24860] |
Wed, 18 May 2005 01:52 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
After making code changes you need to rebuild the theme for them to take affect.
FUDforum Core Developer
|
|
|
|
Re: email as login [message #24863 is a reply to message #24862] |
Wed, 18 May 2005 02:32 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
Well, all you need to do is hide the login text box on the registration page and modify registeration processing code to set the value of the login to the value of the user specified e-mail field.
You may also want to increase the database storage place holder of a login to 255 chars.
FUDforum Core Developer
|
|
|
|
Re: email as login [message #24865 is a reply to message #24864] |
Wed, 18 May 2005 02:33 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
You would need to modify scripts_common.inc file for those.
FUDforum Core Developer
|
|
|
|
|
|
|
Re: email as login [message #24871 is a reply to message #24870] |
Wed, 18 May 2005 04:57 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
You need to put the line that equates email to login at the very top of the script.
FUDforum Core Developer
|
|
|
Re: email as login [message #24872 is a reply to message #24871] |
Wed, 18 May 2005 05:33 |
newnumbertwo
Messages: 38 Registered: June 2004
Karma: 0
|
Member |
|
|
OK, it works (I was able to register, confirm, login and change password)! Now, I need to modify register.php.t to change their login name if they update their email. Any pointers on where this change should go, or if it will cause any problems elsewhere (changing the login name) ? I'll assume that since register.php.t checks for the uniqueness of the email address before changing it, there wouldn't be a problem updating the login either.
Also, all other functions involving specific users (like, assigning authorship of a message) are likely based on id and not login, correct?
thanks!
|
|
|
Re: email as login [message #24883 is a reply to message #24872] |
Wed, 18 May 2005 13:48 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
Yes, all references to the user done internally are based on the record id inside the table.
FUDforum Core Developer
|
|
|
|
Re: email as login [message #24891 is a reply to message #24887] |
Wed, 18 May 2005 14:01 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
E-mail address can only be modified on the registration page.
FUDforum Core Developer
|
|
|
|
Re: email as login [message #24945 is a reply to message #24937] |
Thu, 19 May 2005 13:19 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
Updates are done internally, your only job is to assign the value of the supplied e-mail field to the login field via the line you've already shown. The forum will take care of the rest.
FUDforum Core Developer
|
|
|
|
Re: email as login [message #24953 is a reply to message #24951] |
Thu, 19 May 2005 15:59 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
Oh I see.. on user updating...
You need to edit users_reg.inc.t for that.
FUDforum Core Developer
|
|
|
Re: email as login [message #24954 is a reply to message #24953] |
Thu, 19 May 2005 16:14 |
newnumbertwo
Messages: 38 Registered: June 2004
Karma: 0
|
Member |
|
|
Cool -- I knew there was something I was missing!
Is the sync_user function the one I want to be looking at?
also, can i assume that the check that keeps the user from selecting a non-unique email will also prevent the same from happening with the login? or will i have to code up a duplicate check?
[Updated on: Thu, 19 May 2005 16:18] Report message to a moderator
|
|
|
Re: email as login [message #24965 is a reply to message #24954] |
Thu, 19 May 2005 21:21 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
That's the correct function and uniqueness checks are safe, because e-mail address already must be unique.
FUDforum Core Developer
|
|
|
|
|