示例#1
0
 public static function run($debug = FALSE)
 {
     new TSession();
     if ($_REQUEST) {
         parent::run($debug);
     }
 }
示例#2
0
 public static function run($debug = FALSE)
 {
     new TSession();
     if ($_REQUEST) {
         $class = isset($_REQUEST['class']) ? $_REQUEST['class'] : '';
         if (TSession::getValue('logged')) {
             // logged
             $programs = (array) TSession::getValue('programs');
             // programs with permission
             $programs = array_merge($programs, array('Adianti\\Base\\TStandardSeek' => TRUE, 'LoginForm' => TRUE, 'AdiantiMultiSearchService' => TRUE, 'AdiantiUploaderService' => TRUE, 'EmptyPage' => TRUE));
             // default programs
             if (isset($programs[$class])) {
                 parent::run($debug);
             } else {
                 new TMessage('error', _t('Permission denied'));
             }
         } else {
             if ($class == 'LoginForm') {
                 parent::run($debug);
             } else {
                 new TMessage('error', _t('Permission denied'), new TAction(array('LoginForm', 'onLogout')));
             }
         }
     }
 }
示例#3
0
 public static function run($debug = FALSE)
 {
     new TSession();
     $lang = TSession::getValue('language') ? TSession::getValue('language') : 'en';
     TAdiantiCoreTranslator::setLanguage($lang);
     TApplicationTranslator::setLanguage($lang);
     if ($_REQUEST) {
         $class = isset($_REQUEST['class']) ? $_REQUEST['class'] : '';
         if (!TSession::getValue('logged') and $class !== 'LoginForm') {
             echo TPage::getLoadedCSS();
             echo TPage::getLoadedJS();
             new TMessage('error', 'Not logged');
             return;
         }
         parent::run($debug);
     }
 }