function __construct() { parent::__construct(); $this->load->model("table/map_info_model", "map_info"); $this->load->helper('jsonmsg_helper'); $this->post = $this->input->post(NULL, TRUE); // returns all POST items with XSS filter }
public function __construct() { parent::__construct(); //親には書けないのでここに書く $this->model = new selfManagementModel('selfManagement'); $objMaster = new masterData(); $this->smarty->assign('arrTaskContents', $objMaster->getMasterData('mtb_task_contents')); $this->smarty->assign('arrRoutingContents', $objMaster->getMasterData('mtb_checked_routing_contents')); }
function __construct() { // 载入默认的 parent::__construct(); // if( g('c') != 'api' ) // { // // set session time // //session_set_cookie_params( c('session_time') ); // @session_start(); // } }
function __construct() { // 载入默认的 parent::__construct(); $a = g('a'); $c = g('c'); session_start(); if (!ss('uid') && $c != 'login') { header('Location: /?c=login'); exit; } }
function __construct() { // 检测语言 if (isset($_COOKIE['tt2_lang'])) { $GLOBALS['i18n'] = z(t(basename($_COOKIE['tt2_lang']))); } else { $GLOBALS['i18n'] = c('default_language'); } __('TEST'); // force to load langua array before plugin // 安装时不启用插件 if (g('c') != 'install') { // 载入插件 $plugins = c('plugins'); if (my_sql("SHOW COLUMNS FROM `plugin`")) { if ($pinfos = get_data("SELECT * FROM `plugin`")) { foreach ($pinfos as $pinfo) { if (intval($pinfo['on']) == 0) { $plugins = array_remove($pinfo['folder_name'], $plugins); } elseif (!in_array($pinfo['folder_name'], $plugins)) { $plugins[] = $pinfo['folder_name']; } } } } if (is_array($plugins)) { $plugins = array_unique($plugins); } if (isset($plugins) && is_array($plugins)) { foreach ($plugins as $plugin) { $plugin_file = c('plugin_path') . DS . basename($plugin) . DS . 'app.php'; if (file_exists($plugin_file)) { require_once $plugin_file; } } } $GLOBALS['config']['plugins'] = $plugins; } // update config for this time // 载入默认的 parent::__construct(); do_action('CTRL_ALL'); apply_filter('CTRL_' . g('c') . '_' . g('a') . '_INPUT_FILTER'); if (g('c') != 'api') { // set session time session_set_cookie_params(c('session_time')); @session_start(); } do_action('CTRL_SESSION_STARTED'); }
function __construct() { // 载入默认的 parent::__construct(); }
public function __construct(coreContext $context) { parent::__construct($context); $this->request = $context->getRequest(); $this->response = $context->getResponse(); }
function __construct() { // detect language $ipaddr = get_client_ip(); $browser = new Browser(); $bro = $browser->getBrowser(); $bro_ver = $browser->getVersion(); $platfm = $browser->getPlatform(); $lang = strtolower(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 5)); $lang = str_replace("-", "_", $lang); $sql = "SELECT * FROM ip_br_os_lang WHERE ip = '" . $ipaddr . "' AND browser = '" . $bro . "' AND browser_ver='" . $bro_ver . "' AND platform= '" . $platfm . "'"; if (strcmp($lang, "en_us") == 0) { $lang = 'us_en'; } /* * * old logic for loading language * * if( isset($_COOKIE['tt2_lang']) ) {$GLOBALS['i18n'] = z(t(basename($_COOKIE['tt2_lang'])));} else {$GLOBALS['i18n'] = c('default_language'); } */ // loading language $data = array(); if ($data = get_data($sql)) { $GLOBALS['i18n'] = $data[0]['language']; } else { $sql2 = "INSERT INTO ip_br_os_lang (ip, browser, browser_ver, platform, language) VALUES ('" . $ipaddr . "', '" . $bro . "', '" . $bro_ver . "', '" . $platfm . "', '" . $lang . "')"; run_sql($sql2); $GLOBALS['i18n'] = $lang; } __('TEST'); // force to load language array before plugin // echo "-i18n: " . $GLOBALS['i18n']."-"; // echo "-lang: " . $lang."-"; $GLOBALS['sys']['browser'] = $bro; $GLOBALS['sys']['browser_version'] = $bro_ver; $GLOBALS['sys']['platform'] = $platfm; if (isset($data[0]['language'])) { $GLOBALS['sys']['language'] = $data[0]['language']; } else { $GLOBALS['sys']['language'] = $lang; } $GLOBALS['sys']['ip'] = $ipaddr; // do not activate plugin while installing if (g('c') != 'install') { // loading plugins $plugins = c('plugins'); if (my_sql("SHOW COLUMNS FROM `plugin`")) { if ($pinfos = get_data("SELECT * FROM `plugin`")) { foreach ($pinfos as $pinfo) { if (intval($pinfo['on']) == 0) { $plugins = array_remove($pinfo['folder_name'], $plugins); } elseif (!in_array($pinfo['folder_name'], $plugins)) { $plugins[] = $pinfo['folder_name']; } } } } if (is_array($plugins)) { $plugins = array_unique($plugins); } if (isset($plugins) && is_array($plugins)) { foreach ($plugins as $plugin) { $plugin_file = c('plugin_path') . DS . basename($plugin) . DS . 'app.php'; if (file_exists($plugin_file)) { require_once $plugin_file; } } } $GLOBALS['config']['plugins'] = $plugins; } // update config for this time // loading defaults parent::__construct(); do_action('CTRL_ALL'); apply_filter('CTRL_' . g('c') . '_' . g('a') . '_INPUT_FILTER'); if (g('c') != 'api') { // set session time session_set_cookie_params(c('session_time')); @session_start(); //$sql = "SELECT language FROM `user` WHERE `id` = '" . intval(uid()) . "' LIMIT 1"; //echo $lang; // echo $GLOBALS['sys']['language']; $sql3 = "UPDATE ip_br_os_lang SET uid='" . intval(uid()) . "' WHERE ip = '" . $GLOBALS['sys']['ip'] . "' AND browser = '" . $GLOBALS['sys']['browser'] . "' AND browser_ver='" . $GLOBALS['sys']['browser_version'] . "' AND platform= '" . $GLOBALS['sys']['platform'] . "'"; run_sql($sql3); // if (isset($data[0]['language'])) // { // $sql4 ="UPDATE user SET language='".$data[0]['language']."' WHERE id='". intval(uid())."'"; // } // else // { $sql4 = "UPDATE user SET language='" . $GLOBALS['sys']['language'] . "' WHERE id='" . intval(uid()) . "'"; // } run_sql($sql4); } do_action('CTRL_SESSION_STARTED'); //echo $GLOBALS['i18n']; }
function __construct() { // 载入默认的 parent::__construct(); session_start(); }