public function init() { $this->manager = new Widget_Manager(); $this->oLogManager = new Log_LogsManager(); $this->oLogManager->push('ip', $this->request->getIp()); $this->oLogManager->push('addtime', time()); $this->oLogManager->push('manager_id', $this->manager->id); $this->oLogManager->push('name', $this->manager->name); $this->oLogManager->push('url', $this->request->getServer('REQUEST_URI')); $this->oLogManager->push('referer', $this->request->getReferer() ? $this->request->getReferer() : 'referer'); $this->oLogManager->push('agent', $this->request->getAgent()); $config = @(include Base_Common::$config['config_file']); $appConfig = @(include dirname(dirname(__FILE__)) . '/etc/config.php'); is_array($appConfig) && ($config = $config + $appConfig); $this->config = Base_Config::factory($config); $this->notice = Base_Notice::getInstance(); if ($this->needLogin && !$this->manager->isLogin()) { $this->response->redirect($this->manager->loginUrl); } //@todo:这里的强制修改密码最好能在登录成功的时候执行 if (!$this instanceof ModifyPwdController && !$this instanceof LoginController) { // if($this->manager->reset_password) // { // $this->response->redirect('?ctl=modify.pwd&ac=compel.repwd'); // exit; // } } }
public function __construct() { if (is_string($this->table) && $this->table != '') { $this->db = Base_Db_Hash::getInstance()->prepare($this->table); } $config = @(include Base_Common::$config['config_file']); $this->config = Base_Config::factory($config); $this->auto(); }
/** * 初始化配置,用户,检查是否需要登录才能访问 * @see Controller/Base_Controller_Action::init() */ public function init() { parent::init(); $config = @(include Base_Common::$config['config_file']); $this->config = Base_Config::factory($config); }