diff --git a/fastphp/Fastphp.php b/fastphp/Fastphp.php index 9342aae..d700dd4 100644 --- a/fastphp/Fastphp.php +++ b/fastphp/Fastphp.php @@ -139,7 +139,11 @@ class Fastphp global $is_script; $formal_origin = $this->config['formal_origin']; //跨域访问的时候才会存在此字段 $origin = isset($_SERVER['HTTP_ORIGIN']) ? $_SERVER['HTTP_ORIGIN'] : ''; - if ((!in_array($origin, $formal_origin) && !$is_script) || $_SERVER['LOGNAME'] == 'wyk') { + $name = ''; + if(isset($_SERVER['LOGNAME'])){ + $name = $_SERVER['LOGNAME']; + } + if ((!in_array($origin, $formal_origin) && !$is_script) || $_SERVER['LOGNAME'] == $name) { define('DB_HOST', $this->config['db']['host']); define('DB_PORT', $this->config['db']['port']); define('DB_NAME', $this->config['db']['dbname']);