FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » How To » email as login
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
email as login [message #24834] Mon, 16 May 2005 17:37 Go to next message
newnumbertwo is currently offline  newnumbertwo   United States
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 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
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 #24857 is a reply to message #24844] Tue, 17 May 2005 16:57 Go to previous messageGo to next message
newnumbertwo is currently offline  newnumbertwo   United States
Messages: 38
Registered: June 2004
Karma: 0
Member
I appreciate the pointer. While i'm sure, given time, i could figure this out myself, if you could be a little more specific about where these changes need to be made, that would be great.

Also, I know this isn't the correct topic, but maybe this could be a future feature for FUDForum? Being able to select whether users use a login name or email address for login?

Am I correct to assume that making the change in login.php.t would be the only change I would need to make to enable users to login with their password and email address? What about the mail password feature? Should that be changed to replace their login with their email (I know that it seems obvious that people would realize they couldn't recevie their reset password if the email was different, but many users are dense) ?

thanks,

w

Re: email as login [message #24858 is a reply to message #24857] Tue, 17 May 2005 17:09 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
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 Go to previous messageGo to next message
newnumbertwo is currently offline  newnumbertwo   United States
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 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
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 #24862 is a reply to message #24861] Wed, 18 May 2005 02:27 Go to previous messageGo to next message
newnumbertwo is currently offline  newnumbertwo   United States
Messages: 38
Registered: June 2004
Karma: 0
Member
thanks...

my change does indeed allow the user to login with their email address, but i think that your suggestion to store the email address as login name is a better solution.

however, wouldn't this also require an update of the login name whenever the user changed their email address ? would i remove the login field from the registration form and move the email field to the top? any other changes i would want to consider?
Re: email as login [message #24863 is a reply to message #24862] Wed, 18 May 2005 02:32 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
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 #24864 is a reply to message #24862] Wed, 18 May 2005 02:32 Go to previous messageGo to next message
newnumbertwo is currently offline  newnumbertwo   United States
Messages: 38
Registered: June 2004
Karma: 0
Member
also, since we've integrated mailing lists with our forums, and auto-create accounts from mailing list posts, would making the changes to register.php.t handle these account creations as well, or would i need to modify maillist.php too ?
Re: email as login [message #24865 is a reply to message #24864] Wed, 18 May 2005 02:33 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
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 #24867 is a reply to message #24865] Wed, 18 May 2005 03:00 Go to previous messageGo to next message
newnumbertwo is currently offline  newnumbertwo   United States
Messages: 38
Registered: June 2004
Karma: 0
Member
so, in scripts_common.inc, i would want to change:

$login = empty($from_name) ? $from_email : $from_name;

to

$login = $from_email;

?

(thanks so much for your help -- really, really useful info)
Re: email as login [message #24868 is a reply to message #24867] Wed, 18 May 2005 03:19 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
yes

FUDforum Core Developer
Re: email as login [message #24869 is a reply to message #24868] Wed, 18 May 2005 04:35 Go to previous messageGo to next message
newnumbertwo is currently offline  newnumbertwo   United States
Messages: 38
Registered: June 2004
Karma: 0
Member
OK, got scripts_common.inc modified, and new user accounts from mailing list posts are being created with the email address and not the From: name. That code was pretty easy to grok; however I'm having a much harder time figuring out what to change in register.php.t.

I modified the register.tmpl to remove the Login line and put the email address first (so that the user can enter their email and then tab to the first password field).

Hate to be so dense about it, but could you be a bit more specific about what needs to change in register.php.t to set the email as the login? I'm looking for an "INSERT" SQL statement, but since I can't find one, I'm a bit stumped.

Help?
Re: email as login [message #24870 is a reply to message #24869] Wed, 18 May 2005 04:44 Go to previous messageGo to next message
newnumbertwo is currently offline  newnumbertwo   United States
Messages: 38
Registered: June 2004
Karma: 0
Member
Would the solution be to simply set $_POST['reg_login'] = $_POST['reg_email'] right before the $_POST['reg_login'] = trim(sanitize_login($_POST['reg_login'])); and possibly put the $_POST['reg_email'] checks beforehand ?
Re: email as login [message #24871 is a reply to message #24870] Wed, 18 May 2005 04:57 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
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 Go to previous messageGo to next message
newnumbertwo is currently offline  newnumbertwo   United States
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 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
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 #24887 is a reply to message #24883] Wed, 18 May 2005 13:54 Go to previous messageGo to next message
newnumbertwo is currently offline  newnumbertwo   United States
Messages: 38
Registered: June 2004
Karma: 0
Member
I still need to update the login when the user updates their email...where does the email updating occur when it's requested? Is this also in register.php.t, or is it in emailconf.php.t ?

I think my conversion to using email as a login will be complete once I get this final task sorted.

Thanks for all your help. I will be sure and write up a summary of actions needed should anyone else need to make this change. There's a lot of other steps that need to be undertaken besides the ones mentioned in this thread so far.
Re: email as login [message #24891 is a reply to message #24887] Wed, 18 May 2005 14:01 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
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 #24937 is a reply to message #24891] Thu, 19 May 2005 03:56 Go to previous messageGo to next message
newnumbertwo is currently offline  newnumbertwo   United States
Messages: 38
Registered: June 2004
Karma: 0
Member
you'll have to pardon me, but i still cannot grok the sequence of events that leads to a users email getting updated. does the email change take place around the block preceded by the comment /* SUBMITTION CODE */ ? if not, could you please explain the how an email gets updated so i can hack the login update as well?

(oh how i wish mysql 4 had triggers)
Re: email as login [message #24945 is a reply to message #24937] Thu, 19 May 2005 13:19 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
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 #24951 is a reply to message #24945] Thu, 19 May 2005 15:22 Go to previous messageGo to next message
newnumbertwo is currently offline  newnumbertwo   United States
Messages: 38
Registered: June 2004
Karma: 0
Member
perhaps i am misunderstanding you, but the login update is not currently happening -- i can change the value of the email column, but this does not update the value of the login. having the two out of sync could cause a lot of confusion.

are you saying that i need to say, provide a form field for the login value as well ?
Re: email as login [message #24953 is a reply to message #24951] Thu, 19 May 2005 15:59 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
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 Go to previous messageGo to next message
newnumbertwo is currently offline  newnumbertwo   United States
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 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
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
Re: email as login [message #25263 is a reply to message #24834] Thu, 02 June 2005 21:43 Go to previous messageGo to next message
newnumbertwo is currently offline  newnumbertwo   United States
Messages: 38
Registered: June 2004
Karma: 0
Member
One thing I've noticed since updating the fud26_users table to update login names with email addresses, is that the "Find User" functionality still seems to be keyed on the old login names. This makes finding users to say, work with in the group manager, extremely difficult.

Any pointers on where to go to fix this? I'd like to "Find User" according to their new login name (email), not their old one.

Thanks, as always.
Re: email as login [message #25264 is a reply to message #25263] Thu, 02 June 2005 23:21 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
You need to edit finduser.php.t code.

FUDforum Core Developer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Mailing List Mangager Seperate Forum for each mailing list?? Why
Next Topic: FUDForum very slow. Bad consistency check
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 10 17:17:13 GMT 2024

Total time taken to generate the page: 0.02564 seconds