Thule - 0.9.6
  • Welcome
  • Introduction
  • - MVC(Model-View-Controller)
    - Architecture of Framework
    - Flow Chart of Application
    - Services In One Server
    - Developing Guide
    - Features
  • Installation
  • Getting Started
  • - Direct Access HTTP
    - Router Access HTTP
    - Router Direct Access HTTP
    - Reserved Function
    - Convention
    - Bootstrap
    - Pack Javascript , CSS
  • Basic Modules
  • - Model
    - View
    - Controller
  • Libraries
  • - Router
    - Config
    - Response
    - Request
    - Database
    - Query
    - Cache
    - Debug
    - Log
    - Unit Test
    - Registry
    - Profile
  • Helper
  • - Auth
    - Calendar
    - Date
    - Error page
    - Email
    - Form
    - GeoIP
    - Google
    - Html Element
    - Html
    - Http
    - I18n
    - Image
    - Json
    - Jquery
    - Login
    - Layout
    - Locale
    - PHP to Javascript
    - Paging
    - Payflow
    - Soap
    - Text
    - Table
    - Uri
    - Upload
    - Validation
  • Plugins
  • - Smarty Template Engine
  • History
  • Home > Login

    Login helper is very useful when you should make a login and check the login status.
    And islogin function is designed by being registered to reserved function, so just called one time in a session.

    /**
    * Check the login , just one time for one session.
    *
    * @param database handle $hconn
    * @param Auh ojbect $authObject
    * @param string $value
    * @return BOOL
    */
    public function islogin($hconn,$authObject,$value) {
        if($this->isReserved(__METHOD__)) {
            return $this->_islogin;
        }
        /* You should code below following your business logic. */
        //$data=$this->getLoginDataFromDatabase($hconn,$value);
        // $cookie is cookie name and $data must be cookie value.
        //$this->_islogin=$authObject->is_coookie($cookie,$data);
        $this->_islogin=TRUE; // sample
        $this->registerReserved(__METHOD__);
    }
    /**
    * get data from database for compare with cookie data.
    *
    * @param database handle $hconn
    * @param string $value
    * @return string
    */
    private function getLoginDataFromDatabase($hconn,$value) {
        /* put your business logic code */
        /*
        $peer= new Peer($hconn);
        return $peer->query("select memeber_id from db_thule.tb_member where member_id='.$value.'") ;
        */
        return $value;
    }