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


PHP Piwik::isUserHasSomeViewAccess方法代码示例

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


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

示例1: __construct

 /**
  * Constructor.
  *
  * @param string $name The setting's persisted name.
  * @param string $title The setting's display name.
  * @param null|string $userLogin The user this setting applies to. Will default to the current user login.
  */
 public function __construct($name, $title, $userLogin = null)
 {
     parent::__construct($name, $title);
     $this->setUserLogin($userLogin);
     $this->writableByCurrentUser = Piwik::isUserHasSomeViewAccess();
     $this->readableByCurrentUser = Piwik::isUserHasSomeViewAccess();
 }
开发者ID:josl,项目名称:CGE-File-Sharing,代码行数:14,代码来源:UserSetting.php

示例2: isWritableByCurrentUser

 /**
  * Returns `true` if this setting can be displayed for the current user, `false` if otherwise.
  *
  * @return bool
  */
 public function isWritableByCurrentUser()
 {
     if (isset($this->hasReadAndWritePermission)) {
         return $this->hasReadAndWritePermission;
     }
     $this->hasReadAndWritePermission = Piwik::isUserHasSomeViewAccess();
     return $this->hasReadAndWritePermission;
 }
开发者ID:bossrabbit,项目名称:piwik,代码行数:13,代码来源:UserSetting.php

示例3: isWritableByCurrentUser

 /**
  * Returns `true` if this setting can be displayed for the current user, `false` if otherwise.
  *
  * @return bool
  */
 public function isWritableByCurrentUser()
 {
     if (isset($this->hasWritePermission)) {
         return $this->hasWritePermission;
     }
     // performance improvement, do not detect this in __construct otherwise likely rather "big" query to DB.
     $this->hasWritePermission = Piwik::isUserHasSomeViewAccess();
     return $this->hasWritePermission;
 }
开发者ID:piwik,项目名称:piwik,代码行数:14,代码来源:UserSetting.php

示例4: setBasicVariablesView

 /**
  * Assigns a set of generally useful variables to a {@link Piwik\View} instance.
  * 
  * The following variables assigned:
  * 
  * **enableMeasurePiwikForSiteId** - The value of the `[Debug] enable_measure_piwik_usage_in_idsite`
  *                                     INI config option.
  * **isSuperUser** - True if the current user is the Super User, false if otherwise.
  * **hasSomeAdminAccess** - True if the current user has admin access to at least one site,
  *                          false if otherwise.
  * **isCustomLogo** - The value of the `branding_use_custom_logo` option.
  * **logoHeader** - The header logo URL to use.
  * **logoLarge** - The large logo URL to use.
  * **logoSVG** - The SVG logo URL to use.
  * **hasSVGLogo** - True if there is a SVG logo, false if otherwise.
  * **enableFrames** - The value of the `[General] enable_framed_pages` INI config option. If
  *                    true, {@link Piwik\View::setXFrameOptions()} is called on the view.
  * 
  * Also calls {@link setHostValidationVariablesView()}.
  *
  * @param View $view
  * @api
  */
 protected function setBasicVariablesView($view)
 {
     $view->clientSideConfig = PiwikConfig::getInstance()->getClientSideOptions();
     $view->enableMeasurePiwikForSiteId = PiwikConfig::getInstance()->Debug['enable_measure_piwik_usage_in_idsite'];
     $view->isSuperUser = Access::getInstance()->hasSuperUserAccess();
     $view->hasSomeAdminAccess = Piwik::isUserHasSomeAdminAccess();
     $view->hasSomeViewAccess = Piwik::isUserHasSomeViewAccess();
     $view->isUserIsAnonymous = Piwik::isUserIsAnonymous();
     $view->hasSuperUserAccess = Piwik::hasUserSuperUserAccess();
     $this->addCustomLogoInfo($view);
     $view->logoHeader = \Piwik\Plugins\API\API::getInstance()->getHeaderLogoUrl();
     $view->logoLarge = \Piwik\Plugins\API\API::getInstance()->getLogoUrl();
     $view->logoSVG = \Piwik\Plugins\API\API::getInstance()->getSVGLogoUrl();
     $view->hasSVGLogo = \Piwik\Plugins\API\API::getInstance()->hasSVGLogo();
     $view->superUserEmails = implode(',', Piwik::getAllSuperUserAccessEmailAddresses());
     $general = PiwikConfig::getInstance()->General;
     $view->enableFrames = $general['enable_framed_pages'] || isset($general['enable_framed_logins']) && $general['enable_framed_logins'];
     if (!$view->enableFrames) {
         $view->setXFrameOptions('sameorigin');
     }
     self::setHostValidationVariablesView($view);
 }
开发者ID:brienomatty,项目名称:elmsln,代码行数:45,代码来源:Controller.php

示例5: configureAdminMenu

 public function configureAdminMenu(MenuAdmin $menu)
 {
     $menu->add('CoreAdminHome_MenuManage', 'UsersManager_MenuUsers', array('module' => 'UsersManager', 'action' => 'index'), Piwik::isUserHasSomeAdminAccess(), $order = 2);
     $menu->add('CoreAdminHome_MenuManage', 'UsersManager_MenuUserSettings', array('module' => 'UsersManager', 'action' => 'userSettings'), Piwik::isUserHasSomeViewAccess(), $order = 3);
 }
开发者ID:brienomatty,项目名称:elmsln,代码行数:5,代码来源:Menu.php

示例6: __construct

 /**
  * Constructor.
  *
  * @param string $name The persisted name of the setting.
  * @param string $title The display name of the setting.
  */
 public function __construct($name, $title)
 {
     parent::__construct($name, $title);
     $this->writableByCurrentUser = Piwik::isUserHasSomeAdminAccess();
     $this->readableByCurrentUser = Piwik::isUserHasSomeViewAccess();
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:12,代码来源:MeasurableSetting.php

示例7: __construct

 /**
  * Constructor.
  * 
  * @param string $name The setting's persisted name.
  * @param string $title The setting's display name.
  * @param null|string $userLogin The user this setting applies to. Will default to the current user login.
  */
 public function __construct($name, $title, $userLogin = null)
 {
     parent::__construct($name, $title);
     $this->setUserLogin($userLogin);
     $this->displayedForCurrentUser = Piwik::isUserHasSomeViewAccess();
 }
开发者ID:KiwiJuicer,项目名称:handball-dachau,代码行数:13,代码来源:UserSetting.php

示例8: addMenu

 /**
  * Add admin menu items
  */
 function addMenu()
 {
     MenuAdmin::getInstance()->add('CoreAdminHome_MenuManage', 'UsersManager_MenuUsers', array('module' => 'UsersManager', 'action' => 'index'), Piwik::isUserHasSomeAdminAccess(), $order = 2);
     MenuAdmin::getInstance()->add('CoreAdminHome_MenuManage', 'UsersManager_MenuUserSettings', array('module' => 'UsersManager', 'action' => 'userSettings'), Piwik::isUserHasSomeViewAccess(), $order = 3);
 }
开发者ID:KiwiJuicer,项目名称:handball-dachau,代码行数:8,代码来源:UsersManager.php


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