1

Topic: How To Manually Add Users

I want to keep our registration closed and manually add users. I saw that ver.1.2 had an extension called User Management that could help do this, however ver.1.3 does not have this ability. Can anyone give me a clue on how to add these users? I am proficient at PHP and MySQL data manipulation, perhaps I can add user directly to the DB?

Re: How To Manually Add Users

Yes, you can add a user directly to the DB.

3

Re: How To Manually Add Users

So, I have found out. What about the Salt? Should I create a random 12 character entry here? or is NULL ok?

4 (edited by User33 2008-12-04 20:49)

Re: How To Manually Add Users

This is the function used by PunBB to generate it.

function random_key($len, $readable = false, $hash = false)
{
    $key = '';

    if ($hash)
        $key = substr(sha1(uniqid(rand(), true)), 0, $len);
    else if ($readable)
    {
        $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';

        for ($i = 0; $i < $len; ++$i)
            $key .= substr($chars, (mt_rand() % strlen($chars)), 1);
    }
    else
        for ($i = 0; $i < $len; ++$i)
            $key .= chr(mt_rand(33, 126));

    return $key;
}

Just do something like

echo random_key(12);

and use that.