Convert CMS to user_tickets

Proximity

IDK?
Feb 13, 2014
673
56
Hello I am trying to convert my cms (Edited wCMS) from auth_ticket to user_tickets

here is the sso part of class.core

Code:
                    case "client":
                    $users->createSSO($_SESSION['user']['id']);
                    $users->updateUser($_SESSION['user']['id'], 'ip_last', $_SERVER['REMOTE_ADDR']);
                    $template->setParams('sso', $users->getInfo($_SESSION['user']['id'], 'auth_ticket'));
                    break;


And the class.users

Code:
        final public function turnOn($k) {   
            $j = $this->getID($k);
            $u = $this->getUsername($k);
            $this->createSSO($j);
            $_SESSION['user']['id'] = $j;   
            $_SESSION['user']['username'] = $u;   
            unset($j);
        }

        /*-------------------------------Create SSO client_key-------------------------------------*/ 

        final public function createSSO($k) {        
            $sessionKey = ''.rand(9,999).'/'.substr(sha1(time()).'/'.rand(9,9999999).'/'.rand(9,9999999).'/'.rand(9,9999999),0,33);       
            $this->updateUser($k, 'auth_ticket', $sessionKey);       
            unset($sessionKey);
        }      

        /*-------------------------------Adding/Updating/Deleting users-------------------------------------*/ 

        final public function addUser($username, $password, $email, $motto, $credits, $pixels, $currency, $figure, $gender) {        
            global $engine;                                

            $sessionKey = ''.rand(9,999).'/'.substr(sha1(time()).'/'.rand(9,9999999).'/'.rand(9,9999999).'/'.rand(9,9999999),0,33);
            $engine->query("INSERT INTO users (username, password, mail, motto, credits, cms_currency, activity_points, look, gender, ip_last, ip_reg, last_online, account_created, auth_ticket) VALUES('" . $username . "', '" . $password . "', '" . $email . "', '" . $motto . "', '" . $credits . "', '10', '" . $pixels . "', '" . $figure . "', '" . $gender . "', '" . $_SERVER['REMOTE_ADDR'] . "', '" . $_SERVER['REMOTE_ADDR'] . "', '" . time() . "', '" . time() . "', '" . $sessionKey . "')");    
            $gUser = mysql_fetch_assoc(mysql_query("SELECT id FROM users WHERE username = '".$username."'"));
            $engine->query("INSERT INTO user_info (user_id,reg_timestamp,login_timestamp) VALUES('" . $gUser['id'] . "', '" . time() . "', '" . time() . "')"); 
            unset($sessionKey);                         
        }
Help would be great.
 

Users who are viewing this thread

Top