Has anyone set up an ability for users to login using their email address instead of their username?
I'm hoping its something easy, but I'd like to hear if anyone else ahs done it.
Thanks,
sophistry
Login by email
9 posts
• Page 1 of 1
Login by emailHas anyone set up an ability for users to login using their email address instead of their username?
I'm hoping its something easy, but I'd like to hear if anyone else ahs done it. Thanks, sophistry
Why not just use the email field as the username column.
E.g. if your users table has an email_address column, you would have something like the following in your conf.ini file:
-Steve
I ended up trying this, and it somewhat seems to work, but I'm trying to juggle some code and configurations to get authentication and permissions to act nice together, so I haven't had time to really check to make sure its working. I'd bet it would work, though.
I was trying to add some snippets to my Users.php under the appropriate table to make sure you couldn't create an account with a duplicate email address, and I'm trying to overcome some hurdles in that department. There's a host of information on this (and the weblite) site, so I've been sifting through those. I always go back to the Web Auction source code for ideas, and am usually pleased with results, but I'm mostly just an armchair coder, so I'm trying to piece it all together. Thanks again, Steve sophistry
If you make the email_address field unique in mysql, that should effectively prevent people from registering with a duplicate email address. Also, can't remember if this is built in (if it isn't it should be), but Xataface should check to make sure the username is unique when the user registers. So if you set the email column as your username column, xataface should take care of this.... if not, then this is a bug that needs to be fixed. -Steve
Good point, I wasn't even thinking of that. I just changed the email field to unique, that should take care of any issues. That might free me up to take out a number of things I had in the Users.php - which probably caused the registration problems. I'm still having an issue setting up permissions so Anonymous users have read_only access, logged in users can add/edit their own records in a 'favorites' table, and make sure registering users can't change their role. I think it's coming together, but just when I think I've got it ... anonymous users seem to have the ability to change anything. I'm going to look into it now, but if I have issues I'll come back and maybe find some more info on it.
Thanks
This does work, I just have to write something into .. Users.php maybe .. to give an error when trying to register an email that already exists in the table.
Otherwise, what file contains the information on the login page? I need to change Username: to Email:
Hi Sophistry,
You go into xataface/xataface/templates/ and you copy the file Dataface_Login_Prompt.html into %yourapplication%/templates/ . May be you'll have to create this directory. Then you edit this file and replace username by email. Jean
Sorry this one got lost in the mix. You are indeed working with the correct template. Have you successfully customized a xataface template before? (e.g. copied a template from the dataface templates folder into the application's templates folder). The reason I ask is to rule out the possibility that your custom template is in the wrong place or something. -Steve
9 posts
• Page 1 of 1
Who is onlineUsers browsing this forum: No registered users and 20 guests |