Skip to:
Content
Pages
Categories
Search
Top
Bottom

Capital letters in Usernames

  • When a user wants to register to my community, he can only use lower case letters in his name. Many users use the same names in other communities or boards, and want to use them also in my community. How can I enable this to my users that they can use capital letters in their usernames?

Viewing 12 replies - 1 through 12 (of 12 total)
  • This is a WordPress limitation, which treats user registration in the same way.

    I do not understand this, because my username I have as a admin, hast a capital letter. Also here in this Forum I have a capital letter in my Username “Tolden”. Why does it work here and not in my WordPress. How do I get it to work?

    Perhaps there’s a misunderstanding. WordPress/BuddyPress stores several different variations of the user’s name. When you said “username”, I associated that with the user’s log-in name. The display names, like mine here, “Paul Gibbs”, are set in BuddyPress’ member profiles.


    techguy
    Participant

    @crashutah

    @Tolden
    Check out this Trac ticket on the subject: https://trac.buddypress.org/ticket/2207

    @techguy: Thanks for your link. I first tried the entry “preg_match( “/[a-zA-Z0-9]+/”, $user_name, $maybe );” in the file bp-core-signup.php, but it did not work. Then I opened the file functions.php! The content of the file was only:
    So I tried to delete this and replace with code of r-a-y, but the effect was that the code was shown over the header graphic. Then I tried to enter the code before the closing “?>”, but I get the same message, that only lowercase letters are allowed. I am using the plugin “bp-xtra-signup”. Is that plugin the problem or am I doing something wrong?


    stephane
    Participant

    @stephanefromfrance

    @Tolden : the same for me


    techguy
    Participant

    @crashutah

    @Tolden and @stephenefromfrance
    Your functions.php file should contain the folowing:
    `<?php
    //Deals with uppercase username signup problems…maybe
    function my_sanitize_user( $username, $raw_username, $strict ) {
    $username = $raw_username;
    $username = wp_strip_all_tags( $username );
    $username = remove_accents( $username );
    // Kill octets
    $username = preg_replace( ‘|%([a-fA-F0-9][a-fA-F0-9])|’, ”, $username );
    $username = preg_replace( ‘/&.+?;/’, ”, $username ); // Kill entities

    // If strict, reduce to ASCII for max portability.
    if ( $strict )
    $username = preg_replace( ‘|[^a-z0-9 _.-@]|i’, ”, $username );

    // Consolidate contiguous whitespace
    $username = preg_replace( ‘|s+|’, ‘ ‘, $username );

    return $username;
    }
    add_filter( ‘sanitize_user’, ‘my_sanitize_user’, 100, 3 );

    ?>`

    At least that’s what mine has and it works fine.

    I’m also using this plugin to notify users if this would be a problem for them also: http://buddydev.com/buddypress/creating-a-buddypress-wordpress-username-availability-checker-for-your-site/ Although, I think I modified the script so it would only warn for certain use cases. I also did just realize that it doesn’t work for IE. Haven’t had a chance to see why yet. So, it’s good that I have both.

    Still the same with the message for the lowercase letters. Also the Header graphic has been replaced to its default header and not the header from the installed style…

    No more ideas?


    stephane
    Participant

    @stephanefromfrance

    The same for me…

    Same problem here. Still cannot get past lower case requirement even after adding snippet above to functions.php. Aside from obvious fat-finger/typo issues to look out for, are there other things we should be careful of when adding the snippet above –e.g. template definitions sections etc?

    Thanks!


    techguy
    Participant

    @crashutah

    It’s still working for me. Although, the extra plugin makes it kind of a non-issue too.

    The only other thing to look for is make sure that no other plugin is hooking onto “sanitize_user”

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Capital letters in Usernames’ is closed to new replies.
Skip to toolbar