本文整理汇总了PHP中Piwik::checkUserHasSomeAdminAccess方法的典型用法代码示例。如果您正苦于以下问题:PHP Piwik::checkUserHasSomeAdminAccess方法的具体用法?PHP Piwik::checkUserHasSomeAdminAccess怎么用?PHP Piwik::checkUserHasSomeAdminAccess使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik
的用法示例。
在下文中一共展示了Piwik::checkUserHasSomeAdminAccess方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generalSettings
public function generalSettings()
{
Piwik::checkUserHasSomeAdminAccess();
$view = Piwik_View::factory('generalSettings');
if (Piwik::isUserIsSuperUser()) {
$enableBrowserTriggerArchiving = Piwik_ArchiveProcessing::isBrowserTriggerArchivingEnabled();
$todayArchiveTimeToLive = Piwik_ArchiveProcessing::getTodayArchiveTimeToLive();
$showWarningCron = false;
if (!$enableBrowserTriggerArchiving && $todayArchiveTimeToLive < 3600) {
$showWarningCron = true;
}
$view->showWarningCron = $showWarningCron;
$view->todayArchiveTimeToLive = $todayArchiveTimeToLive;
$view->enableBrowserTriggerArchiving = $enableBrowserTriggerArchiving;
$view->language = Piwik_LanguagesManager::getLanguageCodeForCurrentUser();
if (!Zend_Registry::get('config')->isFileWritable()) {
$view->configFileNotWritable = true;
}
$view->mail = Zend_Registry::get('config')->mail->toArray();
}
$this->setBasicVariablesView($view);
$view->topMenu = Piwik_GetTopMenu();
$view->menu = Piwik_GetAdminMenu();
echo $view->render();
}
示例2: generalSettings
public function generalSettings()
{
Piwik::checkUserHasSomeAdminAccess();
$view = Piwik_View::factory('generalSettings');
if (Piwik::isUserIsSuperUser()) {
$enableBrowserTriggerArchiving = Piwik_ArchiveProcessing::isBrowserTriggerArchivingEnabled();
$todayArchiveTimeToLive = Piwik_ArchiveProcessing::getTodayArchiveTimeToLive();
$showWarningCron = false;
if (!$enableBrowserTriggerArchiving && $todayArchiveTimeToLive < 3600) {
$showWarningCron = true;
}
$view->showWarningCron = $showWarningCron;
$view->todayArchiveTimeToLive = $todayArchiveTimeToLive;
$view->enableBrowserTriggerArchiving = $enableBrowserTriggerArchiving;
if (!Piwik_Config::getInstance()->isFileWritable()) {
$view->configFileNotWritable = true;
}
$view->mail = Piwik_Config::getInstance()->mail;
$view->branding = Piwik_Config::getInstance()->branding;
$directoryWritable = is_writable(PIWIK_DOCUMENT_ROOT . '/themes/');
$logoFilesWriteable = is_writeable(PIWIK_DOCUMENT_ROOT . '/themes/logo.png') && is_writeable(PIWIK_DOCUMENT_ROOT . '/themes/logo-header.png');
$view->logosWriteable = ($logoFilesWriteable || $directoryWritable) && ini_get('file_uploads') == 1;
}
$view->language = Piwik_LanguagesManager::getLanguageCodeForCurrentUser();
$this->setBasicVariablesView($view);
$view->topMenu = Piwik_GetTopMenu();
$view->menu = Piwik_GetAdminMenu();
echo $view->render();
}
示例3: privacySettings
public function privacySettings()
{
Piwik::checkUserHasSomeAdminAccess();
$view = Piwik_View::factory('privacySettings');
if (Piwik::isUserIsSuperUser()) {
$deleteLogs = array();
$view->deleteLogs = $this->getDeleteLogsInfo();
$view->anonymizeIP = $this->getAnonymizeIPInfo();
}
$view->language = Piwik_LanguagesManager::getLanguageCodeForCurrentUser();
if (!Zend_Registry::get('config')->isFileWritable()) {
$view->configFileNotWritable = true;
}
$this->setBasicVariablesView($view);
$view->menu = Piwik_GetAdminMenu();
echo $view->render();
}
示例4: index
public function index()
{
Piwik::checkUserHasSomeAdminAccess();
$idSite = Piwik_Common::getRequestVar('idSite', 1, 'int');
$period = Piwik_Common::getRequestVar('period', 'day', 'string');
$date = Piwik_Common::getRequestVar('date', 'today', 'string');
$_GET['token_auth'] = Piwik::getCurrentUserTokenAuth();
$reports = Piwik_API_API::getInstance()->getReportMetadata($idSite, $period, $date);
$plot = array();
foreach ($reports as $report) {
if (!empty($report['imageGraphUrl'])) {
$plot[] = array($report['category'] . ' › ' . $report['name'], Piwik::getPiwikUrl() . $report['imageGraphUrl']);
}
}
$view = Piwik_View::factory('index');
$view->titleAndUrls = $plot;
echo $view->render();
}
示例5: getUsersLogin
/**
* Returns the list of all the users login
*
* @return array the list of all the users login
*/
public function getUsersLogin()
{
Piwik::checkUserHasSomeAdminAccess();
$db = Zend_Registry::get('db');
$users = $db->fetchAll("SELECT login \n\t\t\t\t\t\t\t\tFROM " . Piwik_Common::prefixTable("user") . " \n\t\t\t\t\t\t\t\tORDER BY login ASC");
$return = array();
foreach ($users as $login) {
$return[] = $login['login'];
}
return $return;
}
示例6: getDefaultCurrency
/**
* Returns the default currency that will be set when creating a website through the API.
*
* @return string Currency ID eg. 'USD'
*/
public function getDefaultCurrency()
{
Piwik::checkUserHasSomeAdminAccess();
$defaultCurrency = Piwik_GetOption(self::OPTION_DEFAULT_CURRENCY);
if($defaultCurrency)
{
return $defaultCurrency;
}
return 'USD';
}
示例7: userEmailExists
/**
* Returns true if user with given email (userEmail) is known in the database
*
* @return bool true if the user is known
*/
public function userEmailExists($userEmail)
{
Piwik::checkUserHasSomeAdminAccess();
$count = Piwik_FetchOne("SELECT count(*) \n\t\t\t\t\t\t\t\t\t\t\t\t\tFROM " . Piwik::prefixTable("user") . " \n\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE email = ?", $userEmail);
return $count != 0;
}
示例8: getWebsiteIdsToInvalidate
/**
* Returns array of idSites to force re-process next time archive.php runs
*
* @ignore
* @return mixed
*/
public static function getWebsiteIdsToInvalidate()
{
Piwik::checkUserHasSomeAdminAccess();
$invalidatedIdSites = Piwik_GetOption(self::OPTION_INVALIDATED_IDSITES);
if ($invalidatedIdSites && ($invalidatedIdSites = unserialize($invalidatedIdSites)) && count($invalidatedIdSites)) {
return $invalidatedIdSites;
}
return array();
}