1 (edited by djmassive 2010-03-22 14:55)

Topic: Autologin with external script using cookies

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