Jump to content

session->login($u,$p); what can the $u be?


benbyf
 Share

Recommended Posts

6 minutes ago, benbyf said:

quick question, can the $username in login() be email OR username, or anything else?

Two options:

https://processwire.com/talk/topic/1716-integrating-a-member-visitor-login-form/?page=4#comment-89599

https://processwire.com/talk/topic/1716-integrating-a-member-visitor-login-form/?page=4#comment-89616

You should read about the pros and cons of each.

  • Like 1
Link to comment
Share on other sites

2 hours ago, benbyf said:

Strangely, I only asked as when login in with login() on my site it already allows either, which i thought was strange.

Something sounds wrong there - are you sure you don't have something else that is handling the email to username check? I don't see anything in the login method to handle an email: https://github.com/processwire/processwire/blob/35df716082b779de0e53a3fcf7996403c49c9f8a/wire/core/Session.php#L704 and it doesn't work for me.

Link to comment
Share on other sites

1 minute ago, benbyf said:

@adrian so i'm right in saying if the name is stored as e.g. yourname-web.com

then both yourname-web.com and yourname@web.com log me in.

That makes sense for sure. When I sent you those other links, I assumed that the usernames would be different to the email address.

  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...
On 1/13/2017 at 2:42 PM, benbyf said:

ok, well something to bare in mind and maybe something that needs remedying or not. @ryan?

Would be nice to know, if you can use this as a feature :-) It would make a custom front-end login with email easier (if you make sure email-address updates are reflected to the username as well).

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...