/** * 檢查設定檔中是否設定了壓縮 * * @author Pulipuli Chen <*****@*****.**> 20141210 * @return boolean 是or否 */ protected function _is_config_package_enable() { if (is_bool($this->_config_package_enable)) { return $this->_config_package_enable; } $enable = $this->config->item('output.package.enable'); if ($enable === TRUE) { $referer_host = get_referer_host(); if (in_array($referer_host, $this->config->item('output.package.disable_domains'))) { return FALSE; } } $this->_config_package_enable = $enable; return $enable; }
public function check_login_domain($show_exception = TRUE) { $user = $this->get_current_user(); if (is_null($user)) { return TRUE; } $user_domain = $user->get_domain(); if ($user_domain->get_host() != get_referer_host($show_exception)) { if ($show_exception) { handle_error('chech_login_domain_failed'); } return FALSE; } return TRUE; }
function login_require($show_exception = TRUE) { $logined = FALSE; if (isset($GLOBALS['context']) === FALSE) { $logined = FALSE; } else { $user = get_context_user(); if (isset($user)) { $domain = $user->get_domain(); $host = $domain->get_host(); if (get_referer_host(FALSE) === $host) { $logined = TRUE; } } } if ($show_exception && $logined === FALSE) { handle_error('login_require'); } return $logined; }