set password to last name

Discussion in 'Customization & add-ons' started by justin rjrcomputing, Mar 24, 2009.

  1. justin rjrcomputing

    justin rjrcomputing New Member

    Joined:
    Oct 22, 2008
    Messages:
    2
    I am trying to set the password to the new account members last name. Security is not an issue. I submitted a ticket and was given the second line to add...but still isnt working. Amember is set to generate the password within the CP. Any ideas?

    This code is from the common.inc.php file

    function generate_password($vars=''){
    if ($vars['name_l'] != '') return $vars['name_l'];
    // a bit of configuration
    global $config;
    $vars = (array)$vars;
    $min_length=$config['pass_min_length'] < 4 ? 4 : $config['pass_min_length'];
    $max_length=$config['pass_max_length'] > 10 ? 10 : $config['pass_max_length'];
    $all_g = "aeiyo";
    $all_gn = $all_g . "1234567890";
    $all_s = "bcdfghjkmnpqrstwxz";
    /// let's go
    $pass = "";
    srand((double)microtime()*1000000);
    $length = rand($min_length, $max_length);
    for($i=0;$i<$length;$i++) {
    srand((double)microtime()*1000000);
    if ($i % 2)
    if ($i < $min_length)
    $pass .= $all_g[ rand(0, strlen($all_g) - 1) ];
    else
    $pass .= $all_gn[ rand(0, strlen($all_gn) - 1) ];
    else
    $pass .= $all_s[ rand(0, strlen($all_s) - 1) ];
    }
    return $pass;
    }
  2. miso

    miso aMember Pro Customer

    Joined:
    Aug 22, 2006
    Messages:
    543
    in theory, that should actually work...
  3. codeispoetry

    codeispoetry aMember Pro Customer

    Joined:
    Jan 12, 2009
    Messages:
    336
    Hi Justin,

    Your code doesn't look right - drop me an email codeispoetry [at] amemberincremental.com if you still need help.

    Lee
  4. mjmtaiwan

    mjmtaiwan aMember Pro Customer

    Joined:
    Aug 22, 2006
    Messages:
    45
    post the answer here please
  5. codeispoetry

    codeispoetry aMember Pro Customer

    Joined:
    Jan 12, 2009
    Messages:
    336
    Hey mjmtaiwan,

    I just saw your reply to this thread when Skippy brought it to my attention.

    I didn't receive Justin's email on the subject - he's probably found the answer himself, it's common that coders sometimes do spot it on their own :D

    Would you like to share your issues with us?

    Lee

Share This Page