本文整理汇总了PHP中LogUtil::getErrorMsgPermission方法的典型用法代码示例。如果您正苦于以下问题:PHP LogUtil::getErrorMsgPermission方法的具体用法?PHP LogUtil::getErrorMsgPermission怎么用?PHP LogUtil::getErrorMsgPermission使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LogUtil
的用法示例。
在下文中一共展示了LogUtil::getErrorMsgPermission方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: main
/**
* This method is the default function handling the main area called without defining arguments.
*
*
* @return mixed Output.
*/
public function main()
{
// parameter specifying which type of objects we are treating
$objectType = $this->request->query->filter('ot', 'collection', FILTER_SANITIZE_STRING);
$permLevel = ACCESS_OVERVIEW;
$this->throwForbiddenUnless(SecurityUtil::checkPermission($this->name . '::', '::', $permLevel), LogUtil::getErrorMsgPermission());
}
示例2: preDispatch
/**
* Ensure we are in an interactive session.
*
* @return void
*/
public function preDispatch()
{
$this->throwForbiddenUnless(\SecurityUtil::checkPermission($this->getName() . '::', '::', \ACCESS_ADMIN), \LogUtil::getErrorMsgPermission());
$session = $this->request->getSession();
$check = (bool) ($session->get('interactive_init') || $session->get('interactive_upgrade') || $session->get('interactive_remove'));
$this->throwForbiddenUnless($check, $this->__('This doesnt appear to be an interactive session.'));
}
示例3: display
/**
* display items for a day
*
* @param $args array Arguments array.
*
* @return string html string
*/
public function display($args)
{
$eid = FormUtil::getPassedValue('eid', isset($args['eid']) ? $args['eid'] : null, 'REQUEST');
$objectid = FormUtil::getPassedValue('objectid', isset($args['objectid']) ? $args['objectid'] : null, 'REQUEST');
if (!empty($objectid)) {
$eid = $objectid;
}
if (!isset($args['eid']) and !empty($eid)) {
$args['eid'] = $eid;
}
// Chek permissions
$this->throwForbiddenUnless(SecurityUtil::checkPermission('Ephemerides::', '::', ACCESS_READ), LogUtil::getErrorMsgPermission());
// check if the contents are cached.
$template = 'ephemerides_user_display.tpl';
if ($this->view->is_cached($template)) {
return $this->view->fetch($template);
}
// get items
if (isset($args['eid']) and $args['eid'] > 0) {
$items = ModUtil::apiFunc($this->name, 'user', 'getall', $args);
} else {
$items = ModUtil::apiFunc($this->name, 'user', 'gettoday', $args);
}
$this->view->assign('items', $items);
return $this->view->fetch($template);
}
示例4: initialize
public function initialize(Zikula_Form_View $view)
{
$this->pageId = FormUtil::getPassedValue('pid', isset($this->args['pid']) ? $this->args['pid'] : null);
if (!SecurityUtil::checkPermission('Content:page:', '::', ACCESS_ADD)) {
throw new Zikula_Exception_Forbidden(LogUtil::getErrorMsgPermission());
}
if (!SecurityUtil::checkPermission('Content:page:', $this->pageId . '::', ACCESS_EDIT)) {
throw new Zikula_Exception_Forbidden(LogUtil::getErrorMsgPermission());
}
$page = ModUtil::apiFunc('Content', 'Page', 'getPage', array('id' => $this->pageId, 'filter' => array('checkActive' => false), 'includeContent' => false));
if ($page === false) {
throw new Zikula_Exception_Fatal($this->__('Page not found'));
}
// Only allow subpages if edit access on parent page
if (!SecurityUtil::checkPermission('Content:page:', $page['id'] . '::', ACCESS_EDIT)) {
throw new Zikula_Exception_Forbidden(LogUtil::getErrorMsgPermission());
}
PageUtil::setVar('title', $this->__('Clone page') . ' : ' . $page['title']);
$this->view->assign('page', $page);
Content_Util::contentAddAccess($this->view, $this->pageId);
return true;
}
示例5: initialize
public function initialize(Zikula_Form_View $view)
{
if (!SecurityUtil::checkPermission('Content::', '::', ACCESS_ADMIN)) {
throw new Zikula_Exception_Forbidden(LogUtil::getErrorMsgPermission());
}
$catoptions = array( array('text' => $this->__('Use 2 category levels (1st level single, 2nd level multi selection)'), 'value' => '1'),
array('text' => $this->__('Use 2 category levels (both single selection)'), 'value' => '2'),
array('text' => $this->__('Use 1 category level'), 'value' => '3'),
array('text' => $this->__("Don't use Categories at all"), 'value' => '4') );
$this->view->assign('catoptions', $catoptions);
$this->view->assign('categoryusage', 1);
$activeoptions = array( array('text' => $this->__('New pages will be active and available in the menu'), 'value' => '1'),
array('text' => $this->__('New pages will be inactive and available in the menu'), 'value' => '2'),
array('text' => $this->__('New pages will be active and not available in the menu'), 'value' => '3'),
array('text' => $this->__('New pages will be inactive and not available in the menu'), 'value' => '4') );
$this->view->assign('activeoptions', $activeoptions);
$pageinfolocationoptions = array( array('text' => $this->__('Top of the page, left of the page title'), 'value' => 'top'),
array('text' => $this->__('Bottom of the page'), 'value' => 'bottom') );
$this->view->assign('pageinfolocationoptions', $pageinfolocationoptions);
// Assign all module vars
$this->view->assign('config', ModUtil::getVar('Content'));
return true;
}
示例6: initialize
public function initialize(Zikula_Form_View $view)
{
if (!SecurityUtil::checkPermission('Mailer::', '::', ACCESS_ADMIN)) {
throw new Zikula_Exception_Forbidden(LogUtil::getErrorMsgPermission());
}
// assign the module mail agent types
$view->assign('mailertypeItems', array(
array('value' => 1, 'text' => DataUtil::formatForDisplay($this->__("Internal PHP `mail()` function"))),
array('value' => 2, 'text' => DataUtil::formatForDisplay($this->__('Sendmail message transfer agent'))),
array('value' => 3, 'text' => DataUtil::formatForDisplay($this->__('QMail message transfer agent'))),
array('value' => 4, 'text' => DataUtil::formatForDisplay($this->__('SMTP mail transfer protocol'))),
array('value' => 5, 'text' => DataUtil::formatForDisplay($this->__('Development/debug mode (Redirect e-mails to LogUtil)')))
));
$view->assign('encodingItems', array(
array('value' => '8bit', 'text' => '8bit'),
array('value' => '7bit', 'text' => '7bit'),
array('value' => 'binary', 'text' => 'binary'),
array('value' => 'base64', 'text' => 'base64'),
array('value' => 'quoted-printable', 'text' => 'quoted-printable')
));
$view->assign('smtpsecuremethodItems', array(
array('value' => '', 'text' => 'None'),
array('value' => 'ssl', 'text' => 'SSL'),
array('value' => 'tls', 'text' => 'TLS')
));
// assign all module vars
$this->view->assign($this->getVars());
return true;
}
示例7: initialize
public function initialize(Zikula_Form_View $view)
{
$this->pageId = FormUtil::getPassedValue('pid', isset($this->args['pid']) ? $this->args['pid'] : null);
$offset = (int) FormUtil::getPassedValue('offset');
if ((bool) $this->getVar('inheritPermissions', false) === true) {
if (!ModUtil::apiFunc('Content', 'page', 'checkPermissionForPageInheritance', array('pageId' => $this->pageId, 'level' => ACCESS_EDIT))) {
throw new Zikula_Exception_Forbidden(LogUtil::getErrorMsgPermission());
}
} else {
if (!SecurityUtil::checkPermission('Content:page:', $this->pageId . '::', ACCESS_EDIT)) {
throw new Zikula_Exception_Forbidden(LogUtil::getErrorMsgPermission());
}
}
$page = ModUtil::apiFunc('Content', 'Page', 'getPage', array('id' => $this->pageId, 'editing' => false, 'filter' => array('checkActive' => false), 'enableEscape' => true, 'translate' => false, 'includeContent' => false, 'includeCategories' => false));
if ($page === false) {
return $this->view->registerError(null);
}
$versionscnt = ModUtil::apiFunc('Content', 'History', 'getPageVersionsCount', array('pageId' => $this->pageId));
$versions = ModUtil::apiFunc('Content', 'History', 'getPageVersions', array('pageId' => $this->pageId, 'offset' => $offset));
if ($versions === false) {
return $this->view->registerError(null);
}
$this->view->assign('page', $page);
$this->view->assign('versions', $versions);
Content_Util::contentAddAccess($this->view, $this->pageId);
// Assign the values for the smarty plugin to produce a pager
$this->view->assign('numitems', $versionscnt);
PageUtil::setVar('title', $this->__("Page history") . ' : ' . $page['title']);
if (!$this->view->isPostBack() && FormUtil::getPassedValue('back', 0)) {
$this->backref = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : null;
}
return true;
}
示例8: display
public function display($blockinfo)
{
// security check
$this->throwForbiddenUnless(SecurityUtil::checkPermission('Content:menublock:', "{$blockinfo['title']}::", ACCESS_READ), LogUtil::getErrorMsgPermission());
// Break out options from our content field
$vars = BlockUtil::varsFromContent($blockinfo['content']);
// --- Setting of the Defaults
if (!isset($vars['usecaching'])) {
$vars['usecaching'] = false;
}
if (!isset($vars['root'])) {
$vars['root'] = 0;
}
$this->view->setCacheId($blockinfo['bid']);
$this->view->setCaching($vars['usecaching']);
if (!$vars['usecaching'] || $vars['usecaching'] && !$this->view->is_cached('block/menu.tpl')) {
$options = array('orderBy' => 'setLeft', 'makeTree' => true, 'filter' => array());
if ($vars['root'] > 0) {
$options['filter']['superParentId'] = $vars['root'];
}
// checkInMenu, checkActive is done implicitely
$options['filter']['checkInMenu'] = true;
$pages = ModUtil::apiFunc('Content', 'Page', 'getPages', $options);
if ($pages === false) {
return false;
}
$this->view->assign('subPages', $pages);
}
$blockinfo['content'] = $this->view->fetch('block/menu.tpl');
return BlockUtil::themeBlock($blockinfo);
}
示例9: initialize
public function initialize(Zikula_Form_View $view)
{
if (!SecurityUtil::checkPermission('Content::', '::', ACCESS_ADMIN)) {
throw new Zikula_Exception_Forbidden(LogUtil::getErrorMsgPermission());
}
$catoptions = array(array('text' => $this->__('Use 2 category levels (1st level single, 2nd level multi selection)'), 'value' => '1'), array('text' => $this->__('Use 2 category levels (both single selection)'), 'value' => '2'), array('text' => $this->__('Use 1 category level'), 'value' => '3'), array('text' => $this->__("Don't use Categories at all"), 'value' => '4'));
$this->view->assign('catoptions', $catoptions);
$this->view->assign('categoryusage', 1);
$activeoptions = array(array('text' => $this->__('New pages will be active and available in the menu'), 'value' => '1'), array('text' => $this->__('New pages will be inactive and available in the menu'), 'value' => '2'), array('text' => $this->__('New pages will be active and not available in the menu'), 'value' => '3'), array('text' => $this->__('New pages will be inactive and not available in the menu'), 'value' => '4'));
$this->view->assign('activeoptions', $activeoptions);
$pageinfolocationoptions = array(array('text' => $this->__('Top of the page, left of the page title'), 'value' => 'top'), array('text' => $this->__('Bottom of the page'), 'value' => 'bottom'));
$this->view->assign('pageinfolocationoptions', $pageinfolocationoptions);
// get all module variables
$modvars = ModUtil::getVar('Content');
// Prepare list of layout options that are displayed for new pages
$layoutdisplayoptions = array();
$layoutDisplaySelection = array();
foreach ($modvars['layoutDisplay'] as $layout) {
$layoutdisplayoptions[] = array('text' => $layout['description'], 'value' => $layout['name']);
if ($layout['display']) {
$layoutDisplaySelection[] = $layout['name'];
}
}
$this->view->assign('layoutdisplayoptions', $layoutdisplayoptions);
$this->view->assign('layoutDisplaySelection', $layoutDisplaySelection);
// Assign all module vars
$this->view->assign('config', $modvars);
return true;
}
示例10: main
/**
* This method is the default function handling the admin area called without defining arguments.
*
*
* @return mixed Output.
*/
public function main()
{
// parameter specifying which type of objects we are treating
$objectType = $this->request->query->filter('ot', 'collection', FILTER_SANITIZE_STRING);
$permLevel = ACCESS_ADMIN;
$this->throwForbiddenUnless(SecurityUtil::checkPermission($this->name . '::', '::', $permLevel), LogUtil::getErrorMsgPermission());
$redirectUrl = ModUtil::url($this->name, 'admin', 'view', array('ot' => $objectType, 'lct' => 'admin'));
return $this->redirect($redirectUrl);
}
示例11: editors
public function editors()
{
$this->throwForbiddenUnless(SecurityUtil::checkPermission('Scribite::', '::', ACCESS_ADMIN), LogUtil::getErrorMsgPermission());
// check for all supported editors and generate links
$editors = ModUtil::apiFunc('Scribite', 'admin', 'getEditors', array('editorname' => "list"));
$this->view->assign('editors', $editors);
$this->view->assign('defaulteditor', ModUtil::getVar('Scribite', 'DefaultEditor'));
return $this->view->fetch('admin/editors.tpl');
}
示例12: initialize
public function initialize(Zikula_Form_View $view)
{
$this->contentId = (int) FormUtil::getPassedValue('cid', isset($this->args['cid']) ? $this->args['cid'] : -1);
$this->language = ZLanguage::getLanguageCode();
$content = ModUtil::apiFunc('Content', 'Content', 'getContent', array('id' => $this->contentId, 'language' => $this->language, 'translate' => false));
if ($content === false) {
return $this->view->registerError(null);
}
$this->contentType = ModUtil::apiFunc('Content', 'Content', 'getContentType', $content);
if ($this->contentType === false) {
return $this->view->registerError(null);
}
$this->pageId = $content['pageId'];
if ((bool) $this->getVar('inheritPermissions', false) === true) {
if (!ModUtil::apiFunc('Content', 'page', 'checkPermissionForPageInheritance', array('pageId' => $this->pageId, 'level' => ACCESS_EDIT))) {
throw new Zikula_Exception_Forbidden(LogUtil::getErrorMsgPermission());
}
} else {
if (!SecurityUtil::checkPermission('Content:page:', $this->pageId . '::', ACCESS_EDIT)) {
throw new Zikula_Exception_Forbidden(LogUtil::getErrorMsgPermission());
}
}
$page = ModUtil::apiFunc('Content', 'Page', 'getPage', array('id' => $this->pageId, 'includeContent' => false, 'filter' => array('checkActive' => false)));
if ($page === false) {
return $this->view->registerError(null);
}
if ($this->language == $page['language']) {
return $this->view->registerError(LogUtil::registerError($this->__f('Sorry, you cannot translate an item to the same language as it\'s default language ("%1$s"). Change the current site language ("%2$s") to some other language on the <a href="%3$s">localisation settings</a> page.<br /> Another way is to add, for instance, <strong>&lang=de</strong> to the url for changing the current site language to German and after that the item can be translated to German.', array($page['language'], $this->language, ModUtil::url('Settings', 'admin', 'multilingual')))));
}
$translationInfo = ModUtil::apiFunc('Content', 'Content', 'getTranslationInfo', array('contentId' => $this->contentId));
if ($translationInfo === false) {
return $this->view->registerError(null);
}
PageUtil::setVar('title', $this->__("Translate content item") . ' : ' . $page['title']);
$templates = $this->contentType['plugin']->getTranslationTemplates();
$this->view->assign('translationtemplates', $templates);
$this->view->assign('page', $page);
$this->view->assign('data', $content['data']);
$this->view->assign('isTranslatable', $content['isTranslatable']);
$this->view->assign('translated', isset($content['translated']) ? $content['translated'] : array());
$this->view->assign('translationInfo', $translationInfo);
$this->view->assign('translationStep', $this->contentId);
$this->view->assign('language', $this->language);
$this->view->assign('contentType', $this->contentType);
Content_Util::contentAddAccess($this->view, $this->pageId);
if (!$this->view->isPostBack() && FormUtil::getPassedValue('back', 0)) {
$this->backref = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : null;
}
if ($this->backref != null) {
$returnUrl = $this->backref;
} else {
$returnUrl = ModUtil::url('Content', 'admin', 'editpage', array('pid' => $this->pageId));
}
ModUtil::apiFunc('PageLock', 'user', 'pageLock', array('lockName' => "contentTranslateContent{$this->contentId}", 'returnUrl' => $returnUrl));
return true;
}
示例13: display
/**
* This method provides a item detail view.
*
* @param string $tpl Name of alternative template (to be used instead of the default template).
* @param boolean $raw Optional way to display a template instead of fetching it (required for standalone output).
*
* @return mixed Output.
*/
public function display()
{
$legacyControllerType = $this->request->query->filter('lct', 'user', FILTER_SANITIZE_STRING);
System::queryStringSetVar('type', $legacyControllerType);
$this->request->query->set('type', $legacyControllerType);
$controllerHelper = new MUVideo_Util_Controller($this->serviceManager);
// parameter specifying which type of objects we are treating
$objectType = 'movie';
$utilArgs = array('controller' => 'movie', 'action' => 'display');
$permLevel = $legacyControllerType == 'admin' ? ACCESS_ADMIN : ACCESS_READ;
$this->throwForbiddenUnless(SecurityUtil::checkPermission($this->name . ':' . ucwords($objectType) . ':', '::', $permLevel), LogUtil::getErrorMsgPermission());
$entityClass = $this->name . '_Entity_' . ucwords($objectType);
$repository = $this->entityManager->getRepository($entityClass);
$repository->setControllerArguments(array());
$idFields = ModUtil::apiFunc($this->name, 'selection', 'getIdFields', array('ot' => $objectType));
// retrieve identifier of the object we wish to view
$idValues = $controllerHelper->retrieveIdentifier($this->request, array(), $objectType, $idFields);
$hasIdentifier = $controllerHelper->isValidIdentifier($idValues);
$this->throwNotFoundUnless($hasIdentifier, $this->__('Error! Invalid identifier received.'));
$selectionArgs = array('ot' => $objectType, 'id' => $idValues);
$entity = ModUtil::apiFunc($this->name, 'selection', 'getEntity', $selectionArgs);
$this->throwNotFoundUnless($entity != null, $this->__('No such item.'));
unset($idValues);
$entity->initWorkflow();
// build ModUrl instance for display hooks; also create identifier for permission check
$currentUrlArgs = $entity->createUrlArgs();
$instanceId = $entity->createCompositeIdentifier();
$currentUrlArgs['id'] = $instanceId;
// TODO remove this
$currentUrlObject = new Zikula_ModUrl($this->name, 'movie', 'display', ZLanguage::getLanguageCode(), $currentUrlArgs);
$this->throwForbiddenUnless(SecurityUtil::checkPermission($this->name . ':' . ucwords($objectType) . ':', $instanceId . '::', $permLevel), LogUtil::getErrorMsgPermission());
$viewHelper = new MUVideo_Util_View($this->serviceManager);
$templateFile = $viewHelper->getViewTemplate($this->view, $objectType, 'display', array());
// set cache id
$component = $this->name . ':' . ucwords($objectType) . ':';
$instance = $instanceId . '::';
$accessLevel = ACCESS_READ;
if (SecurityUtil::checkPermission($component, $instance, ACCESS_COMMENT)) {
$accessLevel = ACCESS_COMMENT;
}
if (SecurityUtil::checkPermission($component, $instance, ACCESS_EDIT)) {
$accessLevel = ACCESS_EDIT;
}
$this->view->setCacheId($objectType . '|' . $instanceId . '|a' . $accessLevel);
// assign output data to view object.
$this->view->assign($objectType, $entity)->assign('currentUrlObject', $currentUrlObject)->assign($repository->getAdditionalTemplateParameters('controllerAction', $utilArgs));
// initialize
$youtubeId = '';
// we get the id from the url
$youtubeId = explode('=', $entity['urlOfYoutube']);
// assign to template
$this->view->assign('youtubeId', $youtubeId[1]);
// fetch and return the appropriate template
return $viewHelper->processTemplate($this->view, $objectType, 'display', array(), $templateFile);
}
示例14: initialize
public function initialize(Zikula_Form_View $view)
{
$this->pageId = (int) FormUtil::getPassedValue('pid', isset($this->args['pid']) ? $this->args['pid'] : -1);
if ((bool) $this->getVar('inheritPermissions', false) === true) {
if (!ModUtil::apiFunc('Content', 'page', 'checkPermissionForPageInheritance', array('pageId' => $this->pageId, 'level' => ACCESS_EDIT))) {
throw new Zikula_Exception_Forbidden(LogUtil::getErrorMsgPermission());
}
} else {
if (!SecurityUtil::checkPermission('Content:page:', $this->pageId . '::', ACCESS_EDIT)) {
throw new Zikula_Exception_Forbidden(LogUtil::getErrorMsgPermission());
}
}
$page = ModUtil::apiFunc('Content', 'Page', 'getPage', array('id' => $this->pageId, 'editing' => true, 'filter' => array('checkActive' => false), 'enableEscape' => false, 'translate' => false, 'includeContent' => true, 'includeCategories' => true));
if ($page === false) {
return $this->view->registerError(null);
}
// load the category registry util
$mainCategory = CategoryRegistryUtil::getRegisteredModuleCategory('Content', 'content_page', $this->getVar('categoryPropPrimary'), 30);
$secondCategory = CategoryRegistryUtil::getRegisteredModuleCategory('Content', 'content_page', $this->getVar('categoryPropSecondary'));
$multilingual = ModUtil::getVar(ModUtil::CONFIG_MODULE, 'multilingual');
if ($page['language'] == ZLanguage::getLanguageCode()) {
$multilingual = false;
}
PageUtil::setVar('title', $this->__("Edit page") . ' : ' . $page['title']);
$pagelayout = ModUtil::apiFunc('Content', 'Layout', 'getLayout', array('layout' => $page['layout']));
if ($pagelayout === false) {
return $this->view->registerError(null);
}
$layouts = ModUtil::apiFunc('Content', 'Layout', 'getLayouts');
if ($layouts === false) {
return $this->view->registerError(null);
}
$layoutTemplate = $page['layoutEditTemplate'];
$this->view->assign('layoutTemplate', $layoutTemplate);
$this->view->assign('mainCategory', $mainCategory);
$this->view->assign('secondCategory', $secondCategory);
$this->view->assign('page', $page);
$this->view->assign('multilingual', $multilingual);
$this->view->assign('layouts', $layouts);
$this->view->assign('pagelayout', $pagelayout);
$this->view->assign('enableVersioning', $this->getVar('enableVersioning'));
$this->view->assign('categoryUsage', $this->getVar('categoryUsage'));
Content_Util::contentAddAccess($this->view, $this->pageId);
if (!$this->view->isPostBack() && FormUtil::getPassedValue('back', 0)) {
$this->backref = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : null;
}
if ($this->backref != null) {
$returnUrl = $this->backref;
} else {
$returnUrl = ModUtil::url('Content', 'admin', 'main');
}
ModUtil::apiFunc('PageLock', 'user', 'pageLock', array('lockName' => "contentPage{$this->pageId}", 'returnUrl' => $returnUrl));
return true;
}
示例15: initialize
public function initialize(Zikula_Form_View $view)
{
if (!SecurityUtil::checkPermission('Mailer::', '::', ACCESS_ADMIN)) {
throw new Zikula_Exception_Forbidden(LogUtil::getErrorMsgPermission());
}
$msgtype = $this->getVar('html') ? 'html' : 'text';
$view->assign('msgtype', $msgtype);
// assign all module vars
$this->view->assign($this->getVars());
return true;
}