library/Garp/Auth.php
public function createToken($input) {
        $config = $this->getConfigValues();
        $salt   = $config['salt'];

        $token  = '';
        $token .= !empty($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
        $token .= md5($input);
        $token .= md5($salt);

        /**
         * Embed an outline of the User table columns in the token. That way, whenever the
         * database changes, all current cookies are made invalid and users have to generate a
         * new cookie afresh by logging in.
         * This ensures the user cookies always contains all the columns.
         */
        $columns = '';
        try {
            $userModel = new Model_User();
            $columns = $userModel->info(Zend_Db_Table_Abstract::COLS);
            $columns = implode('.', $columns);
        } catch (Zend_Db_Adapter_Exception $e) {
            Garp_ErrorHandler::handlePrematureException($e);
        }

        $token .= $columns;
        $token = md5($token);

        return $token;
    }
public function createToken($input) {
        $config = $this->getConfigValues();
        $salt   = $config['salt'];

        $token  = '';
        $token .= !empty($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
        $token .= md5($input);
        $token .= md5($salt);

        /**
         * Embed an outline of the User table columns in the token. That way, whenever the
         * database changes, all current cookies are made invalid and users have to generate a
         * new cookie afresh by logging in.
         * This ensures the user cookies always contains all the columns.
         */
        $columns = '';
        try {
            $userModel = new Model_User();
            $columns = $userModel->info(Zend_Db_Table_Abstract::COLS);
            $columns = implode('.', $columns);
        } catch (Zend_Db_Adapter_Exception $e) {
            Garp_ErrorHandler::handlePrematureException($e);
        }

        $token .= $columns;
        $token = md5($token);

        return $token;
    }
public function createToken ( $ input ) { $ config = $ this -> getConfigValues ( ) ; $ salt = $ config [ 'salt' ] ; $ token = '' ; $ token .= ! empty ( $ _SERVER [ 'HTTP_USER_AGENT' ] ) ? $ _SERVER [ 'HTTP_USER_AGENT' ] : '' ; $ token .= md5 ( $ input ) ; $ token .= md5 ( $ salt ) ; /**
         * Embed an outline of the User table columns in the token. That way, whenever the
         * database changes, all current cookies are made invalid and users have to generate a
         * new cookie afresh by logging in.
         * This ensures the user cookies always contains all the columns.
         */ $ columns = '' ; try { $ userModel = new Model_User ( ) ; $ columns = $ userModel -> info ( Zend_Db_Table_Abstract :: COLS ) ; $ columns = implode ( '.' , $ columns ) ; } catch ( Zend_Db_Adapter_Exception $ e ) { Garp_ErrorHandler :: handlePrematureException ( $ e ) ; } $ token .= $ columns ; $ token = md5 ( $ token ) ; return $ token ; }
Create a unique token for the currently logged in user.
@param String $input Serialized user data
@return String
Create a unique token for the currently logged in user .