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


PHP jAcl2::check方法代码示例

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


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

示例1: onmasteradminGetMenuContent

 /**
  *
  */
 function onmasteradminGetMenuContent($event)
 {
     $plugin = $GLOBALS['gJCoord']->getPlugin('auth', false);
     if ($plugin && $plugin->config['driver'] == 'Db' && jAcl2::check('auth.users.list')) {
         $event->add(new masterAdminMenuItem('users', jLocale::get('jauthdb_admin~auth.adminmenu.item.list'), jUrl::get('jauthdb_admin~default:index'), 10, 'system'));
     }
 }
开发者ID:alienpham,项目名称:helenekling,代码行数:10,代码来源:jauthdb_admin.listener.php

示例2: setFromIniNode

 public function setFromIniNode($node_key, $node)
 {
     $this->id = substr($node_key, 5);
     if (!empty($node['type'])) {
         if (in_array($node['type'], self::$allowed_types)) {
             $this->type = $node['type'];
         } else {
             throw new jException('jPref~admin.type.not.allowed', array($node['type'], implode(',', self::$allowed_types)));
         }
     }
     if (!empty($node['locale'])) {
         $this->locale = $node['locale'];
     }
     if (!empty($node['group'])) {
         $this->group = $node['group'];
     }
     $this->_readable = empty($node['read_acl_subject']) || jAcl2::check($node['read_acl_subject']);
     $this->_writable = empty($node['write_acl_subject']) || jAcl2::check($node['write_acl_subject']);
     if (!empty($node['default_value'])) {
         $this->default_value = $node['default_value'];
     }
     if ($this->type == 'boolean') {
         if ($this->default_value == 'true' || $this->default_value == '1') {
             $this->default_value = true;
         } else {
             if ($this->default_value == 'false' || isset($node['default_value']) && $node['default_value'] == '') {
                 $this->default_value = false;
             }
         }
     }
 }
开发者ID:havefnubb,项目名称:havefnubb,代码行数:31,代码来源:jPrefItem.class.php

示例3: index

 /**
  * Displays a list of project for a given repository.
  *
  * @param string $repository. Name of the repository.
  * @return Html page with a list of projects.
  */
 function index()
 {
     if ($this->param('theme')) {
         jApp::config()->theme = $this->param('theme');
     }
     $rep = $this->getResponse('html');
     // Get lizmap services
     $services = lizmap::getServices();
     // only maps
     if ($services->onlyMaps) {
         $repository = lizmap::getRepository($services->defaultRepository);
         if ($repository && jAcl2::check('lizmap.repositories.view', $repository->getKey())) {
             $project = lizmap::getProject($repository->getKey() . '~' . $services->defaultProject);
             if ($project) {
                 // test redirection to an other controller
                 $items = jEvent::notify('mainviewGetMaps')->getResponse();
                 foreach ($items as $item) {
                     if ($item->parentId == $repository->getKey() && $item->id == $services->defaultProject) {
                         $rep = $this->getResponse('redirectUrl');
                         $rep->url = $item->url;
                         return $rep;
                     }
                 }
                 // redirection to default controller
                 $rep = $this->getResponse('redirect');
                 $rep->action = 'view~map:index';
                 return $rep;
             }
         }
     }
     // Get repository data
     $repository = $this->param('repository');
     $repositoryList = array();
     if ($repository) {
         if (!jAcl2::check('lizmap.repositories.view', $repository)) {
             $rep = $this->getResponse('redirect');
             $rep->action = 'view~default:index';
             jMessage::add(jLocale::get('view~default.repository.access.denied'), 'error');
             return $rep;
         }
     }
     $title = jLocale::get("view~default.repository.list.title");
     $rep->body->assign('repositoryLabel', $title);
     $rep->body->assign('isConnected', jAuth::isConnected());
     $rep->body->assign('user', jAuth::getUserSession());
     if ($services->allowUserAccountRequests) {
         $rep->body->assign('allowUserAccountRequests', True);
     }
     if ($repository) {
         $lrep = lizmap::getRepository($repository);
         $title .= ' - ' . $lrep->getData('label');
     }
     $rep->title = $title;
     $rep->body->assignZone('MAIN', 'main_view', array('repository' => $repository));
     $rep->addJSCode("\n      \$(window).load(function() {\n        \$('.liz-project-img').parent().mouseenter(function(){\n          var self = \$(this);\n          self.find('.liz-project-desc').slideDown();\n          self.css('cursor','pointer');\n        }).mouseleave(function(){\n          var self = \$(this);\n          self.find('.liz-project-desc').hide();\n        }).click(function(){\n          var self = \$(this);\n          window.location = self.parent().find('a.liz-project-view').attr('href');\n          return false;\n        });\n      });\n      ");
     // Js hack to normalize the height of the project thumbnails to avoid line breaks with long project titles
     $bp = jApp::config()->urlengine['basePath'];
     $rep->addJSLink($bp . 'js/view.js');
     return $rep;
 }
开发者ID:jonniedeb,项目名称:lizmap-web-client,代码行数:66,代码来源:default.classic.php

示例4: _prepareTpl

 /**
  * function to manage data before assigning to the template of its zone
  */
 protected function _prepareTpl()
 {
     jClasses::inc('havefnubb~hfnuMenuItem');
     $admin = jAcl2::check('hfnu.admin.index');
     $menu = array();
     $items = jEvent::notify('hfnuGetMenuContent', array('admin' => $admin))->getResponse();
     foreach ($items as $item) {
         if ($item->parentId) {
             if (!isset($menu[$item->parentId])) {
                 $menu[$item->parentId] = new hfnuMenuItem($item->parentId, '', '');
             }
             $menu[$item->parentId]->childItems[] = $item;
         } else {
             if (isset($menu[$item->id])) {
                 $menu[$item->id]->copyFrom($item);
             } else {
                 $menu[$item->id] = $item;
             }
         }
     }
     usort($menu, "hfnuItemSort");
     foreach ($menu as $topitem) {
         usort($topitem->childItems, "hfnuItemSort");
     }
     $this->_tpl->assign('menuitems', $menu);
     $this->_tpl->assign('selectedMenuItem', $this->param('selectedMenuItem', ''));
 }
开发者ID:havefnubb,项目名称:havefnubb,代码行数:30,代码来源:menu.zone.php

示例5: read_rss

 /**
  * display the RSS of the forum
  */
 public function read_rss()
 {
     $ftitle = jUrl::escape($this->param('ftitle'), true);
     $id_forum = (int) $this->param('id_forum');
     if (!jAcl2::check('hfnu.posts.list', 'forum' . $id_forum)) {
         $rep = $this->getResponse('redirect');
         $rep->action = 'default:index';
         return $rep;
     }
     if ($id_forum == 0) {
         $rep = $this->getResponse('redirect');
         $rep->action = 'default:index';
         return $rep;
     }
     $forum = jClasses::getService('havefnubb~hfnuforum')->getForum($id_forum);
     if (jUrl::escape($forum->forum_name, true) != $ftitle) {
         $rep = $this->getResponse('redirect');
         $rep->action = jApp::config()->urlengine['notfoundAct'];
         return $rep;
     }
     jApp::coord()->getPlugin('history')->change('label', htmlentities($forum->forum_name, ENT_COMPAT, 'UTF-8'));
     $feed_reader = new jFeedReader();
     $feed_reader->setCacheDir(jApp::varPath('feeds'));
     $feed_reader->setTimeout(2);
     $feed_reader->setUserAgent('HaveFnuBB - http://www.havefnubb.org/');
     $feed = $feed_reader->parse($forum->forum_url);
     $rep = $this->getResponse('html');
     $tpl = new jTpl();
     $tpl->assign('feed', $feed);
     $tpl->assign('forum', $forum);
     $rep->title = $forum->forum_name;
     $rep->body->assign('MAIN', $tpl->fetch('havefnubb~forum_rss.view'));
     return $rep;
 }
开发者ID:havefnubb,项目名称:havefnubb,代码行数:37,代码来源:forum.classic.php

示例6: index

 /**
  *
  */
 function index()
 {
     $rep = $this->getResponse('html');
     $tpl = new jTpl();
     $gid = array(0);
     $o = new StdClass();
     $o->id_aclgrp = '0';
     $o->name = jLocale::get('jacl2_admin~acl2.anonymous.group.name');
     $o->grouptype = 0;
     $groups = array($o);
     $grouprights = array(0 => false);
     foreach (jAcl2DbUserGroup::getGroupList() as $grp) {
         $gid[] = $grp->id_aclgrp;
         $groups[] = $grp;
         $grouprights[$grp->id_aclgrp] = false;
     }
     $rights = array();
     $p = jAcl2Db::getProfil();
     $rs = jDao::get('jelix~jacl2subject', $p)->findAllSubject();
     foreach ($rs as $rec) {
         $rights[$rec->id_aclsbj] = $grouprights;
     }
     $rs = jDao::get('jelix~jacl2rights', $p)->getRightsByGroups($gid);
     foreach ($rs as $rec) {
         $rights[$rec->id_aclsbj][$rec->id_aclgrp] = true;
     }
     $tpl->assign(compact('groups', 'rights'));
     if (jAcl2::check('acl.group.modify')) {
         $rep->body->assign('MAIN', $tpl->fetch('groups_right'));
     } else {
         $rep->body->assign('MAIN', $tpl->fetch('groups_right_view'));
     }
     return $rep;
 }
开发者ID:alienpham,项目名称:helenekling,代码行数:37,代码来源:groups.classic.php

示例7: beforeAction

 /**
  * @param  array  $params   plugin parameters for the current action
  * @return null or jSelectorAct  if action should change
  */
 public function beforeAction($params)
 {
     $selector = null;
     $aclok = true;
     if (isset($params['jacl2.right'])) {
         $aclok = jAcl2::check($params['jacl2.right']);
     } elseif (isset($params['jacl2.rights.and'])) {
         $aclok = true;
         foreach ($params['jacl2.rights.and'] as $right) {
             if (!jAcl2::check($right)) {
                 $aclok = false;
                 break;
             }
         }
     } elseif (isset($params['jacl2.rights.or'])) {
         $aclok = false;
         foreach ($params['jacl2.rights.or'] as $right) {
             if (jAcl2::check($right)) {
                 $aclok = true;
                 break;
             }
         }
     }
     if (!$aclok) {
         if ($this->config['on_error'] == 1 || !$GLOBALS['gJCoord']->request->isAllowedResponse('jResponseRedirect')) {
             throw new jException($this->config['error_message']);
         } else {
             $selector = new jSelectorAct($this->config['on_error_action']);
         }
     }
     return $selector;
 }
开发者ID:alienpham,项目名称:helenekling,代码行数:36,代码来源:jacl2.coord.php

示例8: onmasteradminGetMenuContent

 function onmasteradminGetMenuContent($event)
 {
     if (jAcl2::check('activeusers.configuration')) {
         $item = new masterAdminMenuItem('activeusers', jLocale::get('activeusers_admin~main.masteradmin.menu.item'), jUrl::get('activeusers_admin~default:index'), 120, 'system');
         $event->add($item);
     }
 }
开发者ID:havefnubb,项目名称:havefnubb,代码行数:7,代码来源:activeusersadmin.listener.php

示例9: index

 /**
  * 
  */
 function index()
 {
     $id = $this->param('id');
     if ($id === null) {
         $rep = $this->getResponse('redirect');
         $rep->action = 'master_admin~default:index';
         return $rep;
     }
     $rep = $this->getResponse('html');
     // we're using a form to display a record, to have the portunity to have
     // labels with each values.
     $form = jForms::create($this->form, $id);
     $form->initFromDao($this->dao, $id, $this->dbProfile);
     $tpl = new jTpl();
     $tpl->assign('id', $id);
     $tpl->assign('form', $form);
     $tpl->assign('personalview', true);
     $tpl->assign('otherInfo', jEvent::notify('jauthdbAdminGetViewInfo', array('form' => $form, 'tpl' => $tpl))->getResponse());
     $form->deactivate('password');
     $form->deactivate('password_confirm');
     $tpl->assign('canUpdate', jAcl2::check('auth.user.modify'));
     $tpl->assign('canChangePass', jAcl2::check('auth.user.change.password'));
     $rep->body->assign('MAIN', $tpl->fetch('user_view'));
     return $rep;
 }
开发者ID:alienpham,项目名称:helenekling,代码行数:28,代码来源:user.classic.php

示例10: onmasteradminGetMenuContent

 /**
  *
  */
 function onmasteradminGetMenuContent($event)
 {
     if (jAcl2::check('auth.users.list')) {
         $item = new masterAdminMenuItem('pref', jLocale::get('jpref_admin~admin.item.title'), jUrl::get('jpref_admin~prefs:index'), 50, 'system');
         $item->icon = jApp::config()->urlengine['jelixWWWPath'] . 'design/images/cog.png';
         $event->add($item);
     }
 }
开发者ID:havefnubb,项目名称:havefnubb,代码行数:11,代码来源:jpref_admin.listener.php

示例11: onmasteradminGetMenuContent

 /**
  *
  */
 function onmasteradminGetMenuContent($event)
 {
     if (jAcl2::check('acl.user.view')) {
         $event->add(new masterAdminMenuItem('usersrights', jLocale::get('jacl2db_admin~acl2.menu.item.rights'), jUrl::get('jacl2db_admin~users:index'), 30, 'system'));
     }
     if (jAcl2::check('acl.group.view')) {
         $event->add(new masterAdminMenuItem('usersgroups', jLocale::get('jacl2db_admin~acl2.menu.item.groups'), jUrl::get('jacl2db_admin~groups:index'), 20, 'system'));
     }
 }
开发者ID:alienpham,项目名称:helenekling,代码行数:12,代码来源:jacl2db_admin.listener.php

示例12: onmasteradminGetMenuContent

 function onmasteradminGetMenuContent($event)
 {
     $chemin = jApp::config()->urlengine['basePath'] . 'hfnu/admin/';
     if (jAcl2::check('modulesinfo.access')) {
         $item = new masterAdminMenuItem('modulesinfo', jLocale::get('modulesinfo~modulesinfo.masteradmin.menu.item'), jUrl::get('modulesinfo~default:index'), 202, 'system');
         $item->icon = $chemin . 'images/modules_list.png';
         $event->add($item);
     }
 }
开发者ID:havefnubb,项目名称:havefnubb,代码行数:9,代码来源:modulesinfo.listener.php

示例13: onmasteradminGetMenuContent

 /**
  *
  */
 function onmasteradminGetMenuContent($event)
 {
     $plugin = $GLOBALS['gJCoord']->getPlugin('auth', false);
     if ($plugin && $plugin->config['driver'] == 'Db' && jAcl2::check('auth.users.list')) {
         $item = new masterAdminMenuItem('users', jLocale::get('jauthdb_admin~auth.adminmenu.item.list'), jUrl::get('jauthdb_admin~default:index'), 10, 'system');
         $item->icon = $GLOBALS['gJConfig']->urlengine['jelixWWWPath'] . 'design/images/user.png';
         $event->add($item);
     }
 }
开发者ID:Calmacil,项目名称:ffdvh,代码行数:12,代码来源:jauthdb_admin.listener.php

示例14: onmasteradminGetMenuContent

 function onmasteradminGetMenuContent($event)
 {
     $chemin = jApp::config()->urlengine['basePath'] . 'hfnu/admin/';
     if (jAcl2::check('jelixcache.access')) {
         $item = new masterAdminMenuItem('jelixcache', jLocale::get('jelixcache~jelixcache.masteradmin.menu.item'), jUrl::get('jelixcache~default:index'), 100, 'system');
         $item->icon = $chemin . 'images/clear_cache.png';
         $event->add($item);
     }
 }
开发者ID:havefnubb,项目名称:havefnubb,代码行数:9,代码来源:jelixcache.listener.php

示例15: onmasteradminGetMenuContent

 /**
  * the menu item
  * @param object $event
  * @return void
  */
 function onmasteradminGetMenuContent($event)
 {
     $chemin = jApp::config()->urlengine['basePath'] . 'hfnu/admin/';
     if (jAcl2::check('hfnu.admin.contact')) {
         $event->add(new masterAdminMenuItem('hfnucontact', 'Contact', '', 40));
         $item = new masterAdminMenuItem('contact', jLocale::get('hfnucontact~contact.contact'), jUrl::get('hfnucontact~admin:index'), 100, 'hfnucontact');
         $item->icon = $chemin . 'images/contact.png';
         $event->add($item);
     }
 }
开发者ID:havefnubb,项目名称:havefnubb,代码行数:15,代码来源:hfnuadmincontactmenu.listener.php


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