1ShoppingCart and Amember - change generated username

Discussion in 'Integration' started by menspsy, Dec 3, 2010.

  1. menspsy

    menspsy New Member

    Joined:
    Aug 4, 2010
    Messages:
    24
    I love the new integration of Amember and 1SC - the ability to create an account when product purchase is initiated from 1SC. Great job Amember!

    My question is, what part of a code needs to be changed (I assume in api.php) so that the username generated is not their "firstname_lastname" ? Actually I found out that it generates the username based on a first name, and if that is already taken in the system then it's a firstname_lastname. Correct?

    I would prefer firstname followed by a random number. Can you tell me what and where needs to be modified for this little change?
    Thanks!
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    You need to change /amember/common.inc.php function generate_login
    change this:
    PHP:
        $fn strtolower(preg_replace('/[^\w\d_]/'''$vars['name_f']));
        
    $ln strtolower(preg_replace('/[^\w\d_]/'''$vars['name_l']));
    to
    PHP:
        $fn strtolower(preg_replace('/[^\w\d_]/'''$vars['name_f']));
        
    $ln '';
  3. menspsy

    menspsy New Member

    Joined:
    Aug 4, 2010
    Messages:
    24
    Perfect. Thank you very much!

Share This Page