Topic: Auto create new account within external script

Hi,

How can i create new account from my external script ? I would like to create within new function (adding to mysql new user).
I don't know how to hash password and salt. Maybe it will be great if someone will give me functions name for this actions.

Thanks a lot !!

2 (edited by djmassive 2010-03-17 10:30)

Re: Auto create new account within external script

I think i found solution:

<?php 
include "forum/include/functions.php";
include "forum/include/utf8/utf8.php";
include "forum/include/utf8/trim.php";

$password1 = forum_trim("mypass");
$salt = random_key(12);

echo "Salt: ".mysql_escape_string($salt)."<br/>";
echo "Pass: ".mysql_escape_string(forum_hash($password1,$salt));

?>

After update table with return of salt and pass, login process succesfully

Re: Auto create new account within external script

There is the add_user() function in functions.php, line 1665. I think it's better to use this function.