. * * @copyright Copyright: 2009 Chunsheng Wang * @author Chunsheng Wang * @package common * @version $Id$ * @link http://www.zentao.cn */ class common extends control { /** * 构造函数:启动会话,加载公司模块,并设置公司信息。 * * @access public * @return void */ public function __construct() { parent::__construct(); session_start(); $this->sendHeader(); $this->loadModel('company'); $this->setCompany(); $this->setUser(); } /** * 检查用户对当前的请求有没有权限。如果没有权限,则跳转到登陆界面。 * * @access public * @return void */ public function checkPriv() { $module = $this->app->getModuleName(); $method = $this->app->getMethodName(); if($module == 'user') { if($method == 'login' or $method == 'logout' or $method == 'deny') return true; } if(isset($this->app->user)) { if(!common::hasPriv($module, $method)) { $referer = helper::safe64Encode($_SERVER['HTTP_REFERER']); $denyLink = $this->createLink('user', 'deny', "module=$module&method=$method&referer=$referer"); /* Fix the bug of IE: use js locate, can't get the referer. */ if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false) { echo <<