- remove setCompany.

This commit is contained in:
xia0ta0
2013-09-03 13:58:34 +08:00
parent 26d9adbe4d
commit cf167a5c4f
3 changed files with 1 additions and 27 deletions
+1 -1
View File
@@ -694,7 +694,7 @@ class router
elseif(isset($_COOKIE['lang']))
{
$this->clientLang = $_COOKIE['lang'];
}
}
elseif(isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))
{
if(strpos($_SERVER['HTTP_ACCEPT_LANGUAGE'], ',') === false)
-1
View File
@@ -22,7 +22,6 @@ class common extends control
parent::__construct();
$this->common->startSession();
$this->common->sendHeader();
$this->common->setCompany();
$this->common->setUser();
$this->common->loadConfigFromDB();
$this->common->loadCustomFromDB();
-25
View File
@@ -36,31 +36,6 @@ class commonModel extends model
header("Cache-control: private");
}
/**
* Set the commpany.
*
* First, search company by the http host. If not found, search by the default domain. Last, use the first as the default.
* After get the company, save it to session.
* @access public
* @return void
*/
public function setCompany()
{
$httpHost = $this->server->http_host;
if($this->session->company)
{
$this->app->company = $this->session->company;
}
else
{
$company = $this->loadModel('company')->getFirst();
if(!$company) $this->app->triggerError(sprintf($this->lang->error->companyNotFound, $httpHost), __FILE__, __LINE__, $exit = true);
$this->session->set('company', $company);
$this->app->company = $company;
}
}
/**
* Set the user info.
*