Exemple #1
0
 public static function getInstance()
 {
     if (null === self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }
 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;
         //			}
     }
 }