From 8d09c6e54f480a462dc6e730e188318aa765f6e9 Mon Sep 17 00:00:00 2001 From: wangchunsheng Date: Tue, 26 Jan 2010 03:13:55 +0000 Subject: [PATCH] - remove the default domain setting from main config file. --- trunk/config/config.php | 2 +- trunk/module/common/control.php | 2 +- trunk/module/install/control.php | 1 + trunk/module/install/view/step3.html.php | 21 +++++++++++---------- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/trunk/config/config.php b/trunk/config/config.php index 7ab12605c9..55b41cd275 100644 --- a/trunk/config/config.php +++ b/trunk/config/config.php @@ -44,7 +44,6 @@ $config->default->lang = 'zh-cn'; // 默 $config->default->theme = 'default'; // 默认的主题。 $config->default->module = 'index'; // 默认的模块。当请求中没有指定模块时,加载该模块。 $config->default->method = 'index'; // 默认的方法。当请求中没有指定方法或者指定的方法不存在时,调用该方法。 -$config->default->domain = 'pms.easysoft.com'; // 默认的域名,当请求中的域名没有对应的记录时,使用此默认域名对应的公司信息。 $config->file->dangers = 'php,jsp,py,rb,asp,'; // 不允许上传的文件类型列表。 $config->file->maxSize = 1024 * 1024; // 允许上传的文件大小,单位为字节。 @@ -57,6 +56,7 @@ $config->db->encoding = 'UTF8'; // /* 包含自定义配置文件。*/ $myConfig = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'my.php'; if(file_exists($myConfig)) include $myConfig; +if(!isset($config->db->prefix)) $config->db->prefix = 'zt_'; /* 数据表的定义。*/ define('TABLE_ACTION', $config->db->prefix . 'action'); diff --git a/trunk/module/common/control.php b/trunk/module/common/control.php index 422e55e192..a574aeb1d5 100644 --- a/trunk/module/common/control.php +++ b/trunk/module/common/control.php @@ -304,7 +304,7 @@ EOT; else { $company = $this->company->getByDomain(); - if(!$company) $company = $this->company->getByDomain($this->config->default->domain); + if(!$company and isset($this->config->default->domain)) $company = $this->company->getByDomain($this->config->default->domain); if(!$company) $this->app->error(sprintf($this->lang->error->companyNotFound, $_SERVER['HTTP_HOST']), __FILE__, __LINE__, $exit = true); $_SESSION['company'] = $company; $this->app->company = $company; diff --git a/trunk/module/install/control.php b/trunk/module/install/control.php index 8535c5c7cb..de90ab9ea8 100644 --- a/trunk/module/install/control.php +++ b/trunk/module/install/control.php @@ -74,6 +74,7 @@ class install extends control $this->view = (object)$_POST; $this->view->lang = $this->lang; $this->view->config = $this->config; + $this->view->domain = $this->server->HTTP_HOST; $this->view->header->title = $this->lang->install->saveConfig; $this->display(); } diff --git a/trunk/module/install/view/step3.html.php b/trunk/module/install/view/step3.html.php index 9e453e9ec2..3a0e75f45a 100644 --- a/trunk/module/install/view/step3.html.php +++ b/trunk/module/install/view/step3.html.php @@ -27,16 +27,17 @@ if(!isset($error)) { $configContent = <<installed = true; //鏍囧織鏄惁宸茬粡瀹夎銆 -\$config->debug = true; //鏄惁鎵撳紑debug鍔熻兘銆 -\$config->webRoot = '$webRoot'; //web缃戠珯鐨勬牴鐩綍銆 -\$config->requestType = '$requestType'; //濡備綍鑾峰彇褰撳墠璇锋眰鐨勪俊鎭紝鍙夊硷細PATH_INFO|GET -\$config->db->host = '$dbHost'; //mysql涓绘満銆 -\$config->db->port = '$dbPort'; //mysql涓绘満绔彛鍙枫 -\$config->db->name = '$dbName'; //鏁版嵁搴撳悕绉般 -\$config->db->user = '$dbUser'; //鏁版嵁搴撶敤鎴峰悕銆 -\$config->db->password = '$dbPassword'; //瀵嗙爜銆 -\$config->db->prefix = '$dbPrefix'; //琛ㄥ墠缂銆 +\$config->installed = true; //鏍囧織鏄惁宸茬粡瀹夎銆 +\$config->debug = true; //鏄惁鎵撳紑debug鍔熻兘銆傝繍琛屾病鏈夐棶棰樹箣鍚庯紝鍙互灏嗗叾鏀逛负false銆 +\$config->requestType = '$requestType'; //濡備綍鑾峰彇褰撳墠璇锋眰鐨勪俊鎭紝鍙夊硷細PATH_INFO|GET銆 +\$config->db->host = '$dbHost'; //mysql涓绘満銆 +\$config->db->port = '$dbPort'; //mysql涓绘満绔彛鍙枫 +\$config->db->name = '$dbName'; //鏁版嵁搴撳悕绉般 +\$config->db->user = '$dbUser'; //鏁版嵁搴撶敤鎴峰悕銆 +\$config->db->password = '$dbPassword'; //瀵嗙爜銆 +\$config->db->prefix = '$dbPrefix'; //琛ㄥ墠缂銆 +\$config->webRoot = '{$this->post->webRoot}'; //web缃戠珯鐨勬牴鐩綍銆傚鏋滃悗闈ms鐨勭洰褰曟湁鍙樺寲锛岄渶瑕佷慨鏀规閫夐」銆 +\$config->default->domain = '$domain'; //榛樿鍩熷悕銆 EOT; } ?>