本文整理汇总了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();
}
}