예제 #1
0
 /**
  * 初始化
  */
 public function init()
 {
     parent::init();
     $this->lang = Tudu_Lang::getInstance()->load(array('common', 'setting'));
     $this->_access = array('skin' => $this->_user->getAccess()->isAllowed(Tudu_Access::PERM_CUSTOM_SKIN));
     $this->view->access = $this->_access;
     $this->view->LANG = $this->lang;
 }
예제 #2
0
 public function init()
 {
     parent::init();
     $this->_helper->viewRenderer->setNeverRender();
     $this->lang = Tudu_Lang::getInstance()->load(array('common', 'tudu'));
     if (!$this->_user->isLogined()) {
         return $this->json(false, $this->lang['login_timeout']);
     }
     Tudu_Dao_Manager::setDbs(array(Tudu_Dao_Manager::DB_MD => $this->multidb->getDefaultDb(), Tudu_Dao_Manager::DB_TS => $this->getTsDb()));
 }
예제 #3
0
파일: Query.php 프로젝트: bjtenao/tudu-web
 /**
  * 初始化
  */
 public function init()
 {
     parent::init();
     if (!in_array($this->_user->email, $this->_allow)) {
         $this->_redirect('http://www.tudu.com/');
         exit;
     }
     $this->_helper->viewRenderer->view->setBasePath(APPLICATION_PATH . '/modules/query/views');
     $this->_helper->viewRenderer->setViewScriptPathSpec(':module#:controller#:action.:suffix');
 }
예제 #4
0
파일: App.php 프로젝트: bjtenao/tudu-web
 /**
  * 初始化
  *
  * 检测用户登录状态
  * 检查APP用户权限
  */
 public final function init()
 {
     parent::init();
     Tudu_Dao_Manager::setDbs(array(Tudu_Dao_Manager::DB_MD => $this->multidb->getDefaultDb(), Tudu_Dao_Manager::DB_TS => $this->getTsDb()));
     $appInfo = $this->_getAppInfo();
     $actionName = $this->_request->getActionName();
     // 没有使用权限
     if ($actionName != 'disable' && (null === $appInfo || $appInfo->orgId != $this->_user->orgId)) {
         return $this->jump('./disable');
     }
     $this->_init();
 }
예제 #5
0
 /**
  * 初始化
  */
 public function init()
 {
     parent::init();
     $action = strtolower($this->_request->getActionName());
     if ($action !== 'status') {
         $this->lang = Tudu_Lang::getInstance()->load(array('common', 'email'));
         $this->view->access = array('skin' => $this->_user->getAccess()->isAllowed(Tudu_Access::PERM_CUSTOM_SKIN));
         $this->view->LANG = $this->lang;
     } else {
         $this->lang = Tudu_Lang::getInstance()->load(array('common'));
     }
     $this->_daoEmail = $this->getMdDao('Dao_Md_User_Email');
 }
예제 #6
0
 public function init()
 {
     parent::init();
     if (!$this->_user->isLogined()) {
         return $this->json(false, $this->lang['login_timeout']);
     }
     Tudu_AddressBook::getInstance()->setCache($this->cache);
     $this->lang = Tudu_Lang::getInstance()->load(array('common', 'tudu'));
     Tudu_Dao_Manager::setDbs(array(Tudu_Dao_Manager::DB_MD => $this->multidb->getDefaultDb(), Tudu_Dao_Manager::DB_TS => $this->getTsDb()));
     $resourceManager = new Tudu_Model_ResourceManager_Registry();
     $resourceManager->setResource(Tudu_Model::RESOURCE_CONFIG, $this->bootstrap->getOptions());
     Tudu_Model::setResourceManager($resourceManager);
 }
예제 #7
0
 /**
  * 初始化
  */
 public function init()
 {
     parent::init();
     $this->lang = Tudu_Lang::getInstance()->load(array('common', 'label'));
     if (!$this->_user->isLogined()) {
         $this->jump(null, array('error' => 'timeout'));
     }
     // IP或登录时间无效
     if (!empty($this->session->auth['invalid'])) {
         $this->jump('/forbid/');
     }
     $this->view->LANG = $this->lang;
 }
예제 #8
0
 public function init()
 {
     $this->_helper->viewRenderer->setNeverRender();
     parent::init();
     $this->lang = Tudu_Lang::getInstance()->load(array('common', 'tudu'));
     if (!$this->_user->isLogined()) {
         return $this->json(false, $this->lang['login_timeout']);
     }
     // IP或登录时间无效
     if (!empty($this->session->auth['invalid'])) {
         return $this->json(false, $this->lang['forbid_access']);
     }
     Tudu_Dao_Manager::setDbs(array(Tudu_Dao_Manager::DB_MD => $this->multidb->getDefaultDb(), Tudu_Dao_Manager::DB_TS => $this->getTsDb()));
     $this->manager = Tudu_Tudu_Manager::getInstance();
 }
예제 #9
0
 /**
  *
  */
 public function init()
 {
     if ($this->_request->getQuery('sid')) {
         $_COOKIE[session_name()] = $this->_request->getQuery('sid');
     }
     if ($this->_request->getQuery('email')) {
         $_COOKIE['email'] = $this->_request->getQuery('email');
         $_COOKIE['username'] = $this->_request->getQuery('email');
     }
     if ($cookies = $this->_request->getParam('cookies')) {
         if ($cookies = @unserialize($cookies)) {
             foreach ($cookies as $key => $val) {
                 $_COOKIE[$key] = $val;
             }
         }
     }
     parent::init();
     // 取消缓冲区
     $this->getFrontController()->getDispatcher()->setParam('disableOutputBuffering', true);
 }
예제 #10
0
 /**
  * 初始化
  *
  *
  * 获取APP请求的文件以及操作
  * 判断APP使用
  * 判断当前用户模块权限
  */
 public function init()
 {
     parent::init();
     if (!$this->_user->isLogined()) {
         $this->jump(null, array('error' => 'timeout'));
     }
     $tsId = self::DEFAULT_TS_ID;
     if ($this->_user) {
         $tsId = $this->_user->tsId;
     }
     // 后台用户验证信息
     /*if ($this->session->admin) {
     
                 $this->_admin   = Tudu_Admin_Admin::getInstance();
     
                 $this->_admin->setAttributes($this->session->admin);
     
                 $this->_orgId   = $this->_admin->orgId;
     
                 $tsId = $this->_admin->tsId;
             }*/
     Tudu_Dao_Manager::setDbs(array(Tudu_Dao_Manager::DB_MD => $this->multidb->getDefaultDb(), Tudu_Dao_Manager::DB_TS => $this->multidb->getDb('ts' . $tsId), Tudu_Dao_Manager::DB_APP => $this->multidb->getDb('app')));
 }
예제 #11
0
 /**
  *
  */
 public function init()
 {
     parent::init();
     $this->lang = Tudu_Lang::getInstance()->load(array('common', 'note'));
     $this->view->LANG = $this->lang;
 }
예제 #12
0
 public function init()
 {
     parent::init();
     //$this->_helper->viewRenderer->setNoRender();
     $this->getFrontController()->getDispatcher()->setParam('disableOutputBuffering', true);
 }
예제 #13
0
 public function init()
 {
     parent::init();
     $this->_helper->viewRenderer->setNoRender();
 }