* remove the myrouter.class.php.

This commit is contained in:
wangchunsheng
2010-01-21 08:05:48 +00:00
parent bc66fdc3d4
commit 7ccb3c2c1f
4 changed files with 17 additions and 61 deletions

View File

@@ -299,13 +299,16 @@ EOT;
{
if(isset($_SESSION['company']) and $_SESSION['company']->pms == $_SERVER['HTTP_HOST'])
{
$this->app->setSessionCompany($_SESSION['company']);
$this->app->company = $_SESSION['company'];
}
else
{
$company = $this->company->getByDomain();
if(!$company) $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;
}
$company = $this->company->getByDomain();
if(!$company) $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->setSessionCompany($company);
}
/**
@@ -318,17 +321,16 @@ EOT;
{
if(isset($_SESSION['user']))
{
$this->app->setSessionUser($_SESSION['user']);
$this->app->user = $_SESSION['user'];
}
elseif($this->app->company->guest)
{
$user = new stdClass();
$user->account = 'guest';
$user->realname = 'guest';
$this->loadModel('user');
$user->rights = $this->user->authorize('guest');
$user = new stdClass();
$user->account = 'guest';
$user->realname = 'guest';
$user->rights = $this->loadModel('user')->authorize('guest');
$_SESSION['user'] = $user;
$this->app->setSessionUser($_SESSION['user']);
$this->app->user = $_SESSION['user'];
}
}

View File

@@ -280,7 +280,7 @@ class user extends control
{
$user->rights = $this->user->authorize($_POST['account']);
$_SESSION['user'] = $user;
$this->app->setSessionUser($user);
$this->app->user = $_SESSION['user'];
/* POST<53><54><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>referer<65><72>Ϣ<EFBFBD><CFA2><EFBFBD>ҷ<EFBFBD>user/login.html, <20><>user/deny.html<6D><6C><EFBFBD><EFBFBD><EFBFBD>Ұ<EFBFBD><D2B0><EFBFBD><EFBFBD><EFBFBD>ǰϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
if(isset($_POST['referer']) and

View File

@@ -31,10 +31,9 @@ include '../../../framework/router.class.php';
include '../../../framework/control.class.php';
include '../../../framework/model.class.php';
include '../../../framework/helper.class.php';
include './myrouter.class.php';
/* ʵ<><CAB5><EFBFBD><EFBFBD>·<EFBFBD>ɶ<EFBFBD><C9B6>󣬼<EFBFBD><F3A3ACBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ã<EFBFBD><C3A3><EFBFBD><EFBFBD>ӵ<EFBFBD><D3B5><EFBFBD><EFBFBD>ݿ⡣*/
$app = router::createApp('pms', '', 'myRouter');
$app = router::createApp('pms');
$config = $app->loadConfig('common');
/* <20><><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7>Ѿ<EFBFBD><D1BE><EFBFBD>װ<EFBFBD><D7B0>*/

View File

@@ -1,45 +0,0 @@
<?php
/**
* The router class file of ZenTaoMS.
*
* ZenTaoMS is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* ZenTaoMS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
*
* @copyright Copyright: 2009 Chunsheng Wang
* @author Chunsheng Wang <wwccss@263.net>
* @package ZenTaoMS
* @version $Id$
* @link http://www.zentao.cn
*/
/**
* 从router类中继承增加了若干和pms应用相关的方法。
*
* @package ZenTaoMS
*/
class myRouter extends router
{
private $configCached = false;
private $langCached = false;
/* 设置会话期间的company信息。*/
public function setSessionCompany($company)
{
$this->company = $company;
}
/* 设置会话期间的用户信息。*/
public function setSessionUser($user)
{
$this->user = $user;
}
}