当前位置: 首页>>代码示例>>PHP>>正文


PHP Vtiger_Functions::throwNoPermittedException方法代码示例

本文整理汇总了PHP中Vtiger_Functions::throwNoPermittedException方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Functions::throwNoPermittedException方法的具体用法?PHP Vtiger_Functions::throwNoPermittedException怎么用?PHP Vtiger_Functions::throwNoPermittedException使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Vtiger_Functions的用法示例。


在下文中一共展示了Vtiger_Functions::throwNoPermittedException方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: process


//.........这里部分代码省略.........
         vglobal('app_strings', $moduleLanguageStrings['languageStrings']);
     }
     $view = $request->get('view');
     $action = $request->get('action');
     $response = false;
     try {
         if ($this->isInstalled() === false && $module != 'Install') {
             header('Location:install/Install.php');
             exit;
         }
         if (empty($module)) {
             if ($this->hasLogin()) {
                 $defaultModule = vglobal('default_module');
                 if (!empty($defaultModule) && $defaultModule != 'Home') {
                     $module = $defaultModule;
                     $qualifiedModuleName = $defaultModule;
                     $view = 'List';
                     if ($module == 'Calendar') {
                         // To load MyCalendar instead of list view for calendar
                         //TODO: see if it has to enhanced and get the default view from module model
                         $view = 'Calendar';
                     }
                 } else {
                     $module = 'Home';
                     $qualifiedModuleName = 'Home';
                     $view = 'DashBoard';
                 }
             } else {
                 $module = 'Users';
                 $qualifiedModuleName = 'Settings:Users';
                 $view = 'Login';
             }
             $request->set('module', $module);
             $request->set('view', $view);
         }
         if (!empty($action)) {
             $componentType = 'Action';
             $componentName = $action;
         } else {
             $componentType = 'View';
             if (empty($view)) {
                 $view = 'Index';
             }
             $componentName = $view;
         }
         $handlerClass = Vtiger_Loader::getComponentClassName($componentType, $componentName, $qualifiedModuleName);
         $handler = new $handlerClass();
         if ($handler) {
             vglobal('currentModule', $module);
             $csrfProtection = vglobal('csrfProtection');
             if ($csrfProtection) {
                 // Ensure handler validates the request
                 $handler->validateRequest($request);
             }
             if ($handler->loginRequired()) {
                 $this->checkLogin($request);
             }
             //TODO : Need to review the design as there can potential security threat
             $skipList = array('Users', 'Home', 'CustomView', 'Import', 'Export', 'Inventory', 'Vtiger', 'Migration', 'Install');
             if (!in_array($module, $skipList) && stripos($qualifiedModuleName, 'Settings') === false) {
                 $this->triggerCheckPermission($handler, $request);
             }
             // Every settings page handler should implement this method
             if (stripos($qualifiedModuleName, 'Settings') === 0 || $module == 'Users') {
                 $handler->checkPermission($request);
             }
             $notPermittedModules = array('ModComments', 'Integration', 'DashBoard');
             if (in_array($module, $notPermittedModules) && $view == 'List') {
                 header('Location:index.php?module=Home&view=DashBoard');
             }
             $this->triggerPreProcess($handler, $request);
             $response = $handler->process($request);
             $this->triggerPostProcess($handler, $request);
         } else {
             throw new AppException(vtranslate('LBL_HANDLER_NOT_FOUND'));
         }
     } catch (AppException $e) {
         $log->error($e->getMessage() . ' => ' . $e->getFile() . ':' . $e->getLine());
         Vtiger_Functions::throwNewException($e->getMessage(), false);
         if (SysDebug::get('DISPLAY_DEBUG_BACKTRACE')) {
             exit('<pre>' . $e->getTraceAsString() . '</pre>');
         }
     } catch (NoPermittedException $e) {
         //No permissions for the record
         $log->error($e->getMessage() . ' => ' . $e->getFile() . ':' . $e->getLine());
         Vtiger_Functions::throwNoPermittedException($e->getMessage(), false);
         if (SysDebug::get('DISPLAY_DEBUG_BACKTRACE')) {
             exit('<pre>' . $e->getTraceAsString() . '</pre>');
         }
     } catch (Exception $e) {
         $log->error($e->getMessage() . ' => ' . $e->getFile() . ':' . $e->getLine());
         Vtiger_Functions::throwNewException($e->getMessage(), false);
         if (SysDebug::get('DISPLAY_DEBUG_BACKTRACE')) {
             exit('<pre>' . $e->getTraceAsString() . '</pre>');
         }
     }
     if ($response) {
         $response->emit();
     }
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:101,代码来源:WebUI.php


注:本文中的Vtiger_Functions::throwNoPermittedException方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。