protected static function factory($class) { if (!self::$instance) { self::$instance = new $class(); } return self::$instance; }
public static function destroy() { $security_token = self::get_security_token(); $security_token_key = moojon_config::get('security_token_key'); moojon_session::set($security_token_key, null); moojon_cookie::set($security_token_key, null); moojon_request::set(moojon_config::get('security_identity_key'), null); moojon_request::set(moojon_config::get('security_password_key'), null); }
protected static final function get_security_token($key = null) { if (!$key) { $key = moojon_config::get('security_token_key'); } if (moojon_cookie::has($key)) { return moojon_cookie::get($key); } elseif (moojon_session::has($key)) { return moojon_session::get($key); } else { return false; } }
protected function __construct() { $flash_key = moojon_config::get('flash_key'); if (!($data = moojon_session::get_or_null($flash_key))) { $data = array(); } if (!is_array($data)) { $data = array($data); } moojon_session::set($flash_key, array()); $this->data = $data; }