Hi,

I've use this: http://punbb.informer.com/forums/topic/ … nal-login/

And its work fine for me, but... first login give me an error:

Fatal error: Call to a member function escape() on a non-object in /home/website/public_html/forum/include/functions.php on line 1358

After refreshing site F5, i'm logged. What i did wrong ?

My CODE:

define("FORUM_ROOT" , site_path."forum/");
    
                        include site_path.'forum/include/common.php';
            
                        $forumUser = $this->sqlRow("*" , "forum_users" , "WHERE login='".$login."'");
                        
                        $user_id = $login;
                        $form_password = $forumUser['password'];
                        $salt = $forumUser['salt'];   
                        $form_password_hash = $form_password;
                        $expire = ($save_pass) ? time() + 1209600 : time() + $forum_config['o_timeout_visit'];
                        forum_setcookie($cookie_name, base64_encode($user_id.'|'.$form_password_hash.'|'.$expire.'|'.sha1($salt.$form_password_hash.forum_hash($expire, $salt))), $expire);

Ps. I'm trying to include mysql.php, and start new class instance but it's no use sad Please help !!

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

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 !!