Removing "_" in aMember signup user name?

Discussion in 'Integration' started by jb, Oct 11, 2011.

  1. jb

    jb New Member

    Joined:
    Aug 29, 2006
    Messages:
    3
    I have tried the plug in from Jrox/Jam and it does not pass the "password."

    The plug in you furnished me, does not pass the "password."

    This is something I can live with tell I can get someone to write a fix.

    However, during my testing I found out that when you use the "_" in a user name in aMember, Jrox/Jam will eliminate it.

    For example: ryanb_wku in aMember become ryanbwku in Jrox/Jam.

    Also, I found that if you don't use at least 7 characters in the user name Jrox/Jam will add something to the end.

    Figured out how to solve the 7 character problem.

    But, and now to my question, don't know who to keep people from using the "_" when the create their user name in aMember.

    Is it possible to keep people from using the "_" during sign up?

    Jim
  2. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    JAM generates its own password- i had emailed them about this, but they wouldnt allow the amember pw to be sent, and insist on their own password generating algorithm.


    David
  3. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Jim,
    Sure possible.
    Edit /amember/member.inc.php and change this function:
    PHP:
    function getLoginRegex(){
        global 
    $config;
        return 
    $config['login_disallow_spaces'] ?.
            
    '/^[0-9a-zA-Z_]+$/D' :
            
    '/^[0-9a-zA-Z_][0-9a-zA-Z_ ]+[0-9a-zA-Z_]$/D';
    }
    to

    PHP:
    function getLoginRegex(){
        global 
    $config;
        return 
    $config['login_disallow_spaces'] ?.
            
    '/^[0-9a-zA-Z]+$/D' :
            
    '/^[0-9a-zA-Z][0-9a-zA-Z ]+[0-9a-zA-Z]$/D';
    }
  4. jb

    jb New Member

    Joined:
    Aug 29, 2006
    Messages:
    3
    Thanks for the help.

    Did find some errors in your response.

    The "function" to correct is not in members.inc.php, it is common.inc.php at line 1891.

    And the code you furnished is a little off. Using your code causes an error when trying to open signup.php.

    You have to omit the space after the next to last "Z":

    You suggested:
    What worked:
    A couple of other questions:

    How do I remove:

    from the "Choose login name" on signup.php?

    And, when you attempt to put a space or underline in the user name it shows an error. But it tells you you can use spaces, which is incorrect. Can this be changed?

    But, all in all, you helped me do what I needed to get done.

    Thanks so much.

    Jim
  5. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279

Share This Page