本文整理汇总了PHP中Piwik\Piwik::hasUserSuperUserAccess方法的典型用法代码示例。如果您正苦于以下问题:PHP Piwik::hasUserSuperUserAccess方法的具体用法?PHP Piwik::hasUserSuperUserAccess怎么用?PHP Piwik::hasUserSuperUserAccess使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik\Piwik
的用法示例。
在下文中一共展示了Piwik::hasUserSuperUserAccess方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: configure
public static function configure(WidgetConfig $config)
{
$config->setCategoryId('About Piwik');
$config->setName('CoreHome_SystemSummaryWidget');
$config->setOrder(15);
$config->setIsEnabled(Piwik::hasUserSuperUserAccess());
}
示例2: getAllInterfaceString
/**
* Returns a HTML page containing help for all the successfully loaded APIs.
* For each module it will return a mini help with the method names, parameters to give,
* links to get the result in Xml/Csv/etc
*
* @param bool $outputExampleUrls
* @param string $prefixUrls
* @return string
*/
public function getAllInterfaceString($outputExampleUrls = true, $prefixUrls = '')
{
if (!empty($prefixUrls)) {
$prefixUrls = 'http://demo.piwik.org/';
}
$str = $toc = '';
foreach (Proxy::getInstance()->getMetadata() as $class => $info) {
$moduleName = Proxy::getInstance()->getModuleNameFromClassName($class);
$rClass = new ReflectionClass($class);
if (!Piwik::hasUserSuperUserAccess() && $this->checkIfClassCommentContainsHideAnnotation($rClass)) {
continue;
}
if ($this->checkIfCommentContainsInternalAnnotation($rClass)) {
continue;
}
$toDisplay = $this->prepareModulesAndMethods($info, $moduleName);
foreach ($toDisplay as $moduleName => $methods) {
foreach ($methods as $index => $method) {
$reflectionMethod = new \ReflectionMethod($class, $method);
if ($this->checkIfCommentContainsInternalAnnotation($reflectionMethod)) {
unset($toDisplay[$moduleName][$index]);
}
}
if (empty($toDisplay[$moduleName])) {
unset($toDisplay[$moduleName]);
}
}
foreach ($toDisplay as $moduleName => $methods) {
$toc .= $this->prepareModuleToDisplay($moduleName);
$str .= $this->prepareMethodToDisplay($moduleName, $info, $methods, $class, $outputExampleUrls, $prefixUrls);
}
}
$str = "<div piwik-content-block content-title='Quick access to APIs' id='topApiRef' name='topApiRef'>\n\t\t\t\t{$toc}</div>\n\t\t\t\t{$str}";
return $str;
}
示例3: init
public function init()
{
$__languages = array('bg', 'cz', 'de', 'en', 'es', 'fr', 'hu', 'id', 'it', 'ja', 'nl', 'pl', 'pt', 'ro', 'ru', 'sr', 'tr', 'uk', 'zh');
if (isset($_SERVER['REQUEST_URI']) && $_SERVER['REQUEST_URI'] !== '') {
$realPath =& $_SERVER['REQUEST_URI'];
} elseif (isset($_SERVER['SCRIPT_NAME']) && $_SERVER['SCRIPT_NAME'] !== '') {
$realPath =& $_SERVER['SCRIPT_NAME'];
} else {
exit(LANG_UNKNOWN_DIR);
}
/** First of all, check if we are inside Piwik */
$dirName = dirname($realPath);
if ($dirName === '/') {
$dirName = '';
}
define('CLICKHEAT_PATH', $dirName . '/plugins/ClickHeat/libs/');
define('CLICKHEAT_INDEX_PATH', 'index.php?module=ClickHeat&');
define('CLICKHEAT_ROOT', PIWIK_INCLUDE_PATH . '/plugins/ClickHeat/libs/');
define('CLICKHEAT_CONFIG', PIWIK_INCLUDE_PATH . '/plugins/ClickHeat/clickheat.php');
define('IS_PIWIK_MODULE', true);
if (Piwik::hasUserSuperUserAccess()) {
define('CLICKHEAT_ADMIN', true);
} else {
define('CLICKHEAT_ADMIN', false);
}
define('CLICKHEAT_LANGUAGE', Translate::getLanguageToLoad());
require_once CLICKHEAT_CONFIG;
/** Specific definitions */
$clickheatConf['__screenSizes'] = array(0, 640, 800, 1024, 1280, 1440, 1600, 1800);
$clickheatConf['__browsersList'] = array('all' => '', 'firefox' => 'Firefox', 'chrome' => 'Google Chrome', 'msie' => 'Internet Explorer', 'safari' => 'Safari', 'opera' => 'Opera', 'kmeleon' => 'K-meleon', 'unknown' => '');
self::conf($clickheatConf);
}
示例4: configure
public static function configure(WidgetConfig $config)
{
$config->setCategoryId('About Piwik');
$config->setName('Installation_SystemCheck');
$config->setOrder(16);
$config->setIsEnabled(Piwik::hasUserSuperUserAccess());
}
示例5: configureAdminMenu
public function configureAdminMenu(MenuAdmin $menu)
{
$hasSuperUserAcess = Piwik::hasUserSuperUserAccess();
$isAnonymous = Piwik::isUserIsAnonymous();
$isMarketplaceEnabled = CorePluginsAdmin::isMarketplaceEnabled();
$pluginsUpdateMessage = '';
$themesUpdateMessage = '';
if ($hasSuperUserAcess && $isMarketplaceEnabled) {
$marketplace = new Marketplace();
$pluginsHavingUpdate = $marketplace->getPluginsHavingUpdate($themesOnly = false);
$themesHavingUpdate = $marketplace->getPluginsHavingUpdate($themesOnly = true);
if (!empty($pluginsHavingUpdate)) {
$pluginsUpdateMessage = sprintf(' (%d)', count($pluginsHavingUpdate));
}
if (!empty($themesHavingUpdate)) {
$themesUpdateMessage = sprintf(' (%d)', count($themesHavingUpdate));
}
}
if (!$isAnonymous) {
$menu->addPlatformItem(null, "", $order = 7);
}
if ($hasSuperUserAcess) {
$menu->addPlatformItem(Piwik::translate('General_Plugins') . $pluginsUpdateMessage, $this->urlForAction('plugins', array('activated' => '')), $order = 1);
$menu->addPlatformItem(Piwik::translate('CorePluginsAdmin_Themes') . $themesUpdateMessage, $this->urlForAction('themes', array('activated' => '')), $order = 3);
}
if ($this->isAllowedToSeeMarketPlace()) {
$menu->addPlatformItem('CorePluginsAdmin_Marketplace', $this->urlForAction('extend', array('activated' => '')), $order = 5);
}
}
示例6: configureAdminMenu
public function configureAdminMenu(MenuAdmin $menu)
{
$hasSuperUserAcess = Piwik::hasUserSuperUserAccess();
$isAnonymous = Piwik::isUserIsAnonymous();
$isMarketplaceEnabled = CorePluginsAdmin::isMarketplaceEnabled();
$pluginsUpdateMessage = '';
$themesUpdateMessage = '';
if ($hasSuperUserAcess && $isMarketplaceEnabled) {
$marketplace = new Marketplace();
$pluginsHavingUpdate = $marketplace->getPluginsHavingUpdate($themesOnly = false);
$themesHavingUpdate = $marketplace->getPluginsHavingUpdate($themesOnly = true);
if (!empty($pluginsHavingUpdate)) {
$pluginsUpdateMessage = sprintf(' (%d)', count($pluginsHavingUpdate));
}
if (!empty($themesHavingUpdate)) {
$themesUpdateMessage = sprintf(' (%d)', count($themesHavingUpdate));
}
}
$menu->add('CorePluginsAdmin_MenuPlatform', null, "", !$isAnonymous, $order = 7);
$menu->add('CorePluginsAdmin_MenuPlatform', Piwik::translate('General_Plugins') . $pluginsUpdateMessage, array('module' => 'CorePluginsAdmin', 'action' => 'plugins', 'activated' => ''), $hasSuperUserAcess, $order = 1);
$menu->add('CorePluginsAdmin_MenuPlatform', Piwik::translate('CorePluginsAdmin_Themes') . $themesUpdateMessage, array('module' => 'CorePluginsAdmin', 'action' => 'themes', 'activated' => ''), $hasSuperUserAcess, $order = 3);
if ($isMarketplaceEnabled) {
$menu->add('CorePluginsAdmin_MenuPlatform', 'CorePluginsAdmin_Marketplace', array('module' => 'CorePluginsAdmin', 'action' => 'extend', 'activated' => ''), !$isAnonymous, $order = 5);
}
}
示例7: index
public function index()
{
Piwik::checkUserIsNotAnonymous();
$view = new View('@MobileMessaging/index');
$view->isSuperUser = Piwik::hasUserSuperUserAccess();
$mobileMessagingAPI = API::getInstance();
$view->delegatedManagement = $mobileMessagingAPI->getDelegatedManagement();
$view->credentialSupplied = $mobileMessagingAPI->areSMSAPICredentialProvided();
$view->accountManagedByCurrentUser = $view->isSuperUser || $view->delegatedManagement;
$view->strHelpAddPhone = Piwik::translate('MobileMessaging_Settings_PhoneNumbers_HelpAdd', array(Piwik::translate('General_Settings'), Piwik::translate('MobileMessaging_SettingsMenu')));
if ($view->credentialSupplied && $view->accountManagedByCurrentUser) {
$view->provider = $mobileMessagingAPI->getSMSProvider();
$view->creditLeft = $mobileMessagingAPI->getCreditLeft();
}
$view->smsProviders = SMSProvider::$availableSMSProviders;
// construct the list of countries from the lang files
$countries = array();
foreach (Common::getCountriesList() as $countryCode => $continentCode) {
if (isset(CountryCallingCodes::$countryCallingCodes[$countryCode])) {
$countries[$countryCode] = array('countryName' => \Piwik\Plugins\UserCountry\countryTranslate($countryCode), 'countryCallingCode' => CountryCallingCodes::$countryCallingCodes[$countryCode]);
}
}
$view->countries = $countries;
$view->defaultCountry = Common::getCountry(LanguagesManager::getLanguageCodeForCurrentUser(), true, IP::getIpFromHeader());
$view->phoneNumbers = $mobileMessagingAPI->getPhoneNumbers();
$this->setBasicVariablesView($view);
return $view->render();
}
示例8: setManageVariables
private function setManageVariables(View $view)
{
$view->isSuperUser = Piwik::hasUserSuperUserAccess();
$mobileMessagingAPI = API::getInstance();
$view->delegatedManagement = $mobileMessagingAPI->getDelegatedManagement();
$view->credentialSupplied = $mobileMessagingAPI->areSMSAPICredentialProvided();
$view->accountManagedByCurrentUser = $view->isSuperUser || $view->delegatedManagement;
$view->strHelpAddPhone = $this->translator->translate('MobileMessaging_Settings_PhoneNumbers_HelpAdd', array($this->translator->translate('General_Settings'), $this->translator->translate('MobileMessaging_SettingsMenu')));
$view->creditLeft = 0;
$view->provider = '';
if ($view->credentialSupplied && $view->accountManagedByCurrentUser) {
$view->provider = $mobileMessagingAPI->getSMSProvider();
$view->creditLeft = $mobileMessagingAPI->getCreditLeft();
}
$providers = array();
foreach (SMSProvider::findAvailableSmsProviders() as $provider) {
$providers[$provider->getId()] = $provider->getDescription();
}
$view->smsProviders = $providers;
// construct the list of countries from the lang files
$countries = array();
foreach ($this->regionDataProvider->getCountryList() as $countryCode => $continentCode) {
if (isset(CountryCallingCodes::$countryCallingCodes[$countryCode])) {
$countries[$countryCode] = array('countryName' => \Piwik\Plugins\UserCountry\countryTranslate($countryCode), 'countryCallingCode' => CountryCallingCodes::$countryCallingCodes[$countryCode]);
}
}
$view->countries = $countries;
$view->defaultCountry = Common::getCountry(LanguagesManager::getLanguageCodeForCurrentUser(), true, IP::getIpFromHeader());
$view->phoneNumbers = $mobileMessagingAPI->getPhoneNumbers();
$this->setBasicVariablesView($view);
}
示例9: getDefaultLayout
public function getDefaultLayout()
{
$defaultLayout = $this->getLayoutForUser('', 1);
if (empty($defaultLayout)) {
if (Piwik::hasUserSuperUserAccess()) {
$topWidget = '{"uniqueId":"widgetCoreHomegetDonateForm",' . '"parameters":{"module":"CoreHome","action":"getDonateForm"}},';
} else {
$topWidget = '{"uniqueId":"widgetCoreHomegetPromoVideo",' . '"parameters":{"module":"CoreHome","action":"getPromoVideo"}},';
}
$defaultLayout = '[
[
{"uniqueId":"widgetVisitsSummarygetEvolutionGraphcolumnsArray","parameters":{"module":"VisitsSummary","action":"getEvolutionGraph","columns":"nb_visits"}},
{"uniqueId":"widgetLivewidget","parameters":{"module":"Live","action":"widget"}},
{"uniqueId":"widgetVisitorInterestgetNumberOfVisitsPerVisitDuration","parameters":{"module":"VisitorInterest","action":"getNumberOfVisitsPerVisitDuration"}}
],
[
' . $topWidget . '
{"uniqueId":"widgetReferrersgetKeywords","parameters":{"module":"Referrers","action":"getKeywords"}},
{"uniqueId":"widgetReferrersgetWebsites","parameters":{"module":"Referrers","action":"getWebsites"}}
],
[
{"uniqueId":"widgetUserCountryMapvisitorMap","parameters":{"module":"UserCountryMap","action":"visitorMap"}},
{"uniqueId":"widgetUserSettingsgetBrowser","parameters":{"module":"UserSettings","action":"getBrowser"}},
{"uniqueId":"widgetReferrersgetSearchEngines","parameters":{"module":"Referrers","action":"getSearchEngines"}},
{"uniqueId":"widgetVisitTimegetVisitInformationPerServerTime","parameters":{"module":"VisitTime","action":"getVisitInformationPerServerTime"}},
{"uniqueId":"widgetExampleRssWidgetrssPiwik","parameters":{"module":"ExampleRssWidget","action":"rssPiwik"}}
]
]';
}
$defaultLayout = $this->removeDisabledPluginFromLayout($defaultLayout);
return $defaultLayout;
}
示例10: getDonateForm
/**
* Renders and echo's the in-app donate form w/ slider.
*/
public function getDonateForm()
{
$view = new View('@CoreHome/getDonateForm');
if (Common::getRequestVar('widget', false) && Piwik::hasUserSuperUserAccess()) {
$view->footerMessage = $this->translator->translate('CoreHome_OnlyForSuperUserAccess');
}
return $view->render();
}
示例11: render
public function render()
{
$footerMessage = null;
if (Common::getRequestVar('widget', false) && Piwik::hasUserSuperUserAccess()) {
$footerMessage = $this->translator->translate('CoreHome_OnlyForSuperUserAccess');
}
return $this->renderTemplate('getDonateForm', array('footerMessage' => $footerMessage));
}
示例12: configureAdminMenu
public function configureAdminMenu(MenuAdmin $menu)
{
if (Piwik::isUserHasSomeAdminAccess()) {
$menu->addManageItem('UsersManager_MenuUsers', $this->urlForAction('index'), $order = 2);
}
if (Piwik::hasUserSuperUserAccess() && API::getInstance()->getSitesAccessFromUser('anonymous')) {
$menu->addSettingsItem('UsersManager_AnonymousUser', $this->urlForAction('anonymousSettings'), $order = 20);
}
}
示例13: isWritableByCurrentUser
/**
* Returns `true` if this setting is writable for the current user, `false` if otherwise. In case it returns
* writable for the current user it will be visible in the Plugin settings UI.
*
* @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::hasUserSuperUserAccess();
return $this->hasWritePermission;
}
示例14: init
protected function init()
{
$this->title = Piwik::translate('CoreAdminHome_UpdateSettings');
$isWritable = Piwik::hasUserSuperUserAccess() && CoreAdminController::isGeneralSettingsAdminEnabled();
$this->releaseChannel = $this->createReleaseChannel();
$this->releaseChannel->setIsWritableByCurrentUser($isWritable);
$isWritable = $isWritable && PluginUpdateCommunication::canBeEnabled();
$this->sendPluginUpdateEmail = $this->createSendPluginUpdateEmail();
$this->sendPluginUpdateEmail->setIsWritableByCurrentUser($isWritable);
}
示例15: configureTopMenu
public function configureTopMenu(MenuTop $menu)
{
if (Piwik::isUserHasSomeAdminAccess()) {
$url = $this->urlForModuleAction('SitesManager', 'index');
if (Piwik::hasUserSuperUserAccess()) {
$url = $this->urlForAction('generalSettings');
}
$menu->addItem('CoreAdminHome_Administration', null, $url, 10);
}
}