The MU forums have moved to WordPress.org

Use email address as username (23 posts)

  1. modifiedcontent
    Member
    Posted 15 years ago #

    I want to eliminate the concept of "usernames" - like "viperman89" or "gigglygirl" etc. - from my site.

    Members should be able to log in with just their email address and password and be identified on the site with their real first and/or last name.

    Is there any way to achieve that? Which files should I hack? Is there a plugin that does this?

  2. tdjcbe
    Member
    Posted 15 years ago #

    How would you know what blog url to create then?

    edit: A quick google (use the title of this thread but add in wordpress) shows a number of discussions on the topic with many of them boiling down to concerns about privacy or concerns about spam. One thread suggested adding in the email address to the dropdown code within the your profile page that allows users to choose what name to display. That may be something to look at.

  3. modifiedcontent
    Member
    Posted 15 years ago #

    Put bluntly, concerns about privacy is none of Wordpress' business. Wordpress shouldn't make that decision for me. My site is not a porn forum. I don't want anonymous users.

    The spam argument also sounds silly to me. Plenty serious websites, like most major newspapers, use sign up/login with just email address + password.

    One thread suggested adding in the email address to the dropdown code within the your profile page that allows users to choose what name to display.

    Why would anyone want to do display the email address?!

    Again, my goal is to eliminate the concept of the username from register/login, allow users to register/login with just email + password.

    In the site real first and/or last names would be displayed instead of an anonymous bs username.

    Blog name should be a seperate field somewhere, when you sign up for a blog, not necessarily when you just register as a member.

  4. andrea_r
    Moderator
    Posted 15 years ago #

    "Members should be able to log in with just their email address and password and be identified on the site with their real first and/or last name."

    I'm not sure how you woudl get them to login via an email address, but you CAN change what is displayed across the site via the template. If they fill in their profile info with First & Last names, and you edit the templates to use this, that'll do it.

  5. tdjcbe
    Member
    Posted 15 years ago #

    I never said it was wordpress' concern, I just was mentioning what the previous discussions on the topic boiled down to. I would have copied and pasted links to show them but I wasn't feeling too well yesterday.

  6. modifiedcontent
    Member
    Posted 15 years ago #

    I'm not sure how you woudl get them to login via an email address, but you CAN change what is displayed across the site via the template. If they fill in their profile info with First & Last names, and you edit the templates to use this, that'll do it.

    But that's not what I'm asking! Aarrgghh!!

    I really try to be nice and patient on the Wordpress forum, but everytime time I ask something that goes just a little bit outside default Wordpress, I get these off-topic answers explaining how Wordpress does things.

    Sign-up/log-in with just email address and password is not that unusual. It happens all over the web.

    I just was mentioning what the previous discussions on the topic boiled down to.

    Those discussions were similarly led off track then. Or were not about this topic in the first place.

    Again, the goal:

    Eliminate the concept of the "username", because it's too anonymous and gives members one more thing they have to remember.

    Allow members to register/login with just their email address + password. If they forget their password, they can retrieve it by email address.

    Of course (!) the email address should NEVER be displayed in the site instead of a username. For display the real name, first and/or last, should be used.

    How could I approach this? Which files should I focus on?

    I've started a blunt-force approach; replace user_login with user_email, see what happens and what I have to clean up. I'll report back on any progress...

  7. andrea_r
    Moderator
    Posted 15 years ago #

    "For display the real name, first and/or last, should be used.

    How could I approach this? Which files should I focus on?"

    That's the part I thought I was answering. :)

    Edit: If the gola is to make it easier for users and eliminate one more login, have you considered integrating something like OPenID?

    I know it's frustrating - it's no that we don't get what you're trying to do. It's just probably going to be a large amount of custom coding and some hacking.

  8. modifiedcontent
    Member
    Posted 15 years ago #

    The blunt-force approach, replacing 'user_login' with 'user_email', works surprisingly well. Login with email address is immediately accepted.

    To sign up a new user without filling in a username you have to remove some lines from wpmu_functions.php

    Buddypress seems to consistently use the full name from the display_name field in mysql, so that makes life a lot easier. Does Wordpress MU do that the same way by default?

    The main problem now is that user_login, now renamed to user_email, is used for the blog name. So for that process I need to replace user_email with a new field called user_blogname or something like that.

    Which bits of code are involved in creating the member blog + URL? Trying to figure out and will report back...

    have you considered integrating something like OPenID

    No. I want full control over the member registration. Eventually I want to add a payment system, levels of membership, connect it with other services in my sites, etc.

  9. andrea_r
    Moderator
    Posted 15 years ago #

    "The blunt-force approach, replacing 'user_login' with 'user_email', works surprisingly well. Login with email address is immediately accepted.

    To sign up a new user without filling in a username you have to remove some lines from wpmu_functions.php"

    Really? Cool! I'm gonna have to remember this...

    "Buddypress seems to consistently use the full name from the display_name field in mysql, so that makes life a lot easier. Does Wordpress MU do that the same way by default?"

    Nope. I think BP does that thru the template files. because display_name is used for public-facing information, ie; anything spewed out by the template files.

  10. modifiedcontent
    Member
    Posted 15 years ago #

    Replacing 'user_login' with 'user_email' also causes this error when trying to access wp-admin:

    Redirect Loop

    Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

    The browser has stopped trying to retrieve the requested item. The site is redirecting the request in a way that will never complete.

    * Have you disabled or blocked cookies required by this site?
    * NOTE: If accepting the site's cookies does not resolve the problem, it is likely a server configuration issue and not your computer.

    ??

  11. modifiedcontent
    Member
    Posted 15 years ago #

    The 'Redirect Loop' problem only happens when logged in as an administrator.

    ??

  12. modifiedcontent
    Member
    Posted 15 years ago #

    I've "solved" the 'Redirect Loop' problem as follows:

    1. restored unmodified version
    2. upgraded a member to administrator
    3. reuploaded the modified code
    4. logged in as administrator-member
    5. deleted the original administrator

    I got rid of the exposed email addresses in the members URLs by restoring the original mu-plugins folder, including the Buddypress plugins.

    The "blog name" is still taken from the user_login field. Next I'll have to rename that field to user_blogname and figure out how to generate it from display_name...

  13. modifiedcontent
    Member
    Posted 15 years ago #

    It's a mess. Reverted everything back to original, starting over. :-(

    Boiled down:

    Whenever the script queries the database for 'user_login', I want it to ask for 'user_email' instead - expect when it wants to form the member URL.

    Where are those queries? How can I search/replace them?

    What is the least intrusive way to achieve this?

  14. DeannaS
    Member
    Posted 15 years ago #

    I haven't looked into this at all, but wouldn't it be easier to just make the user_login the email address?

    You could hook into this function:
    do_action( 'signup_extra_fields', $errors );

    And add some JS to hide the user_login field, and add some js to duplicate the user_email field value to the user_login field...

    The one issue is the validation routine, but there is a filter that you might be able to use to override that...

    return apply_filters('wpmu_validate_user_signup', $result);

    Of course, then you'd still need to figure out how to deal with the blog name... But, this might be a start anyway.

  15. modifiedcontent
    Member
    Posted 15 years ago #

    Thanks DeannaS, that sounds like the kind of solution I'm looking for.

    Unfortunately I'm no real programmer, certainly not javascript. I can search/replace, copy/paste, mess things up, not really code from scratch.

    Could this be turned into a plugin? If anyone can do it, I'm willing to pay - within limits...

    Contact me here if you can do it. (The site is slow as hell, one of many reasons I want to move it over to Buddypress.)

  16. modifiedcontent
    Member
    Posted 15 years ago #

    Anyone?

  17. modifiedcontent
    Member
    Posted 15 years ago #

    Beau Lebens actually wrote a cool little plugin for this that actually seems to work!!

    You still have to enter a username during registration. Activation emails still instruct the new member to log in with that username, where they in fact now have to use their email address.

    So you have to make some edits to the forms and email messages, but that's no problem. The cool thing about this plugin is that it seems to take care of the tricky stuff in an unobstrusive way.

    Happy! :-)

    Doing further testing...

  18. modifiedcontent
    Member
    Posted 15 years ago #

    Using the plugin the display_name field in mysql suddenly takes the user_login instead of the real name. :-(

    How can I make sure that display_name field takes the full name from the signup form?

    And is there a way to add seperate first name and last name fields to the form and take the display_name from them?

  19. modifiedcontent
    Member
    Posted 15 years ago #

    After a fresh reinstall of Wordpress MU+Buddypress I don't think Beau Lebens' excellent plugin is to blame for the full name not showing up in display_name. That seems to be default behavior. Or is there a way to get the full name into display_name?

    Now trying to edit the activation emails in wpmu-functions.php, but can't figure out how to include the new member's full name ('Hello John Doe' instead of the very ugly 'Hello User').

    Full name is stored in wp_bp_xprofile_data, connected to wp_bp_xprofile_fields. I have no clue how to retrieve that data.

  20. Brayne
    Member
    Posted 14 years ago #

    In case anyone needs this... This worked in a php file in the mu-plugins dir.

    //###########

    function my_email_login($user, $pass) {
    	global $wpdb;
    	if (is_email($user)) {
    		$found = $wpdb->get_var($wpdb->prepare("SELECT user_login FROM $wpdb->users WHERE user_email = '%s'", $user));
    		$user = $found ? $found : $user;
    	} else {
    	    $user = 1;
    	}
    	return;
    }
    add_action('wp_authenticate', 'my_email_login', 10, 2);
  21. Brayne
    Member
    Posted 14 years ago #

    Update w/WPMU2.9.1.1

    $user = 1;

    needs to be

    $username = 1;

    This turns off the error flag for an empty username field.

  22. pcasa
    Member
    Posted 14 years ago #

    Anyone been able to get this work with Facebook Connect? Can edit profile email and password, but if user originally registered with Facebook Connect, then edited their email and password they can't login.

    If they try to login in it just loops back to the login page with no errors.

    Please Help...

  23. callumalden
    Member
    Posted 14 years ago #

    furthering pcasa's query... is there anyway to replace / add an alternative way of signing up on WPMU (as contributor or user) using Facebook Connect. i don't mean 'logging in' (this is possible). signing up.

    hmm.

About this Topic

  • Started 15 years ago by modifiedcontent
  • Latest reply from callumalden