本文整理汇总了PHP中Piwik::isUserIsAnonymous方法的典型用法代码示例。如果您正苦于以下问题:PHP Piwik::isUserIsAnonymous方法的具体用法?PHP Piwik::isUserIsAnonymous怎么用?PHP Piwik::isUserIsAnonymous使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik
的用法示例。
在下文中一共展示了Piwik::isUserIsAnonymous方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addMenus
public function addMenus()
{
Piwik_AddMenu('Dashboard_Dashboard', '', array('module' => 'Dashboard', 'action' => 'embeddedIndex', 'idDashboard' => 1), true, 5);
if (!Piwik::isUserIsAnonymous()) {
$login = Piwik::getCurrentUserLogin();
$dashboards = self::getAllDashboards($login);
if (count($dashboards) > 1) {
$pos = 0;
foreach ($dashboards as $dashboard) {
Piwik_AddMenu('Dashboard_Dashboard', $dashboard['name'], array('module' => 'Dashboard', 'action' => 'embeddedIndex', 'idDashboard' => $dashboard['iddashboard']), true, $pos);
$pos++;
}
}
}
}
示例2: index
public function index()
{
$view = Piwik_View::factory('index');
$this->setGeneralVariablesView($view);
$view->countWebsites = count(Piwik_SitesManager_API::getInstance()->getSitesIdWithAtLeastViewAccess());
// get report types
$reportTypes = Piwik_PDFReports_API::getReportTypes();
$view->reportTypes = $reportTypes;
$view->defaultReportType = self::DEFAULT_REPORT_TYPE;
$view->defaultReportFormat = Piwik_PDFReports::DEFAULT_REPORT_FORMAT;
$reportsByCategoryByType = array();
$reportFormatsByReportType = array();
$allowMultipleReportsByReportType = array();
foreach ($reportTypes as $reportType => $reportTypeIcon) {
// get report formats
$reportFormatsByReportType[$reportType] = Piwik_PDFReports_API::getReportFormats($reportType);
$allowMultipleReportsByReportType[$reportType] = Piwik_PDFReports_API::allowMultipleReports($reportType);
// get report metadata
$reportsByCategory = array();
$availableReportMetadata = Piwik_PDFReports_API::getReportMetadata($this->idSite, $reportType);
foreach ($availableReportMetadata as $reportMetadata) {
$reportsByCategory[$reportMetadata['category']][] = $reportMetadata;
}
$reportsByCategoryByType[$reportType] = $reportsByCategory;
}
$view->reportsByCategoryByReportType = $reportsByCategoryByType;
$view->reportFormatsByReportType = $reportFormatsByReportType;
$view->allowMultipleReportsByReportType = $allowMultipleReportsByReportType;
$reports = array();
$reportsById = array();
if (!Piwik::isUserIsAnonymous()) {
$reports = Piwik_PDFReports_API::getInstance()->getReports($this->idSite, $period = false, $idReport = false, $ifSuperUserReturnOnlySuperUserReports = true);
foreach ($reports as &$report) {
$report['recipients'] = Piwik_PDFReports_API::getReportRecipients($report);
$reportsById[$report['idreport']] = $report;
}
}
$view->reports = $reports;
$view->reportsJSON = Piwik_Common::json_encode($reportsById);
$view->downloadOutputType = Piwik_PDFReports_API::OUTPUT_INLINE;
$periods = array_merge(array('never' => Piwik_Translate('General_Never')), Piwik_PDFReports::getPeriodToFrequency());
// Do not display date range in selector
unset($periods['range']);
$view->periods = $periods;
$view->defaultPeriod = Piwik_PDFReports::DEFAULT_PERIOD;
$view->language = Piwik_LanguagesManager::getLanguageCodeForCurrentUser();
echo $view->render();
}
示例3: isSegmentationEnabled
/**
* Returns true if Segmentation is allowed for this user
*
* @return bool
*/
public static function isSegmentationEnabled()
{
return !Piwik::isUserIsAnonymous() || Zend_Registry::get('config')->General->anonymous_user_enable_use_segments_API;
}
示例4: cleanVisitorDetails
/**
* Removes fields that are not meant to be displayed (md5 config hash)
* Or that the user should only access if he is super user or admin (cookie, IP)
*
* @return void
*/
private function cleanVisitorDetails( &$visitorDetails, $idSite )
{
$toUnset = array('config_id');
if(Piwik::isUserIsAnonymous())
{
$toUnset[] = 'idvisitor';
$toUnset[] = 'location_ip';
}
foreach($toUnset as $keyName)
{
if(isset($visitorDetails[$keyName]))
{
unset($visitorDetails[$keyName]);
}
}
}
示例5: getLayout
/**
* Get the dashboard layout for the current user (anonymous or loggued user)
*
* @return string $layout
*/
protected function getLayout()
{
$idDashboard = Piwik_Common::getRequestVar('idDashboard', 1, 'int' );
if(Piwik::isUserIsAnonymous())
{
$session = new Piwik_Session_Namespace("Piwik_Dashboard");
if(!isset($session->dashboardLayout))
{
return false;
}
$layout = $session->dashboardLayout;
}
else
{
$layout = $this->getLayoutForUser(Piwik::getCurrentUserLogin(),$idDashboard);
}
// layout was JSON.stringified
$layout = html_entity_decode($layout);
$layout = str_replace("\\\"", "\"", $layout);
// compatibility with the old layout format
if(!empty($layout)
&& strstr($layout, '[[') == false) {
$layout = "'$layout'";
}
$layout = $this->removeDisabledPluginFromLayout($layout);
return $layout;
}
示例6: getLayout
/**
* Get the dashboard layout for the current user (anonymous or loggued user)
*
* @param int $idDashboard
* @return string $layout
*/
protected function getLayout($idDashboard)
{
if (Piwik::isUserIsAnonymous()) {
$session = new Piwik_Session_Namespace("Piwik_Dashboard");
if (!isset($session->dashboardLayout)) {
return $this->getDefaultLayout();
}
$layout = $session->dashboardLayout;
} else {
$layout = $this->getLayoutForUser(Piwik::getCurrentUserLogin(), $idDashboard);
}
if (!empty($layout)) {
$layout = $this->removeDisabledPluginFromLayout($layout);
}
if ($layout === false) {
$layout = $this->getDefaultLayout();
}
return $layout;
}
示例7: isSegmentationEnabled
/**
* Returns true if Segmentation is allowed for this user
*
* @return bool
*/
public static function isSegmentationEnabled()
{
return !Piwik::isUserIsAnonymous() || Piwik_Config::getInstance()->General['anonymous_user_enable_use_segments_API'];
}
示例8: getLayout
/**
* Get the dashboard layout for the current user (anonymous or loggued user)
*
* @return string $layout
*/
protected function getLayout()
{
// Currently not used
$idDashboard = Piwik_Common::getRequestVar('idDashboard', 1, 'int');
if (Piwik::isUserIsAnonymous()) {
$session = new Piwik_Session_Namespace("Piwik_Dashboard");
if (!isset($session->dashboardLayout)) {
return $this->getDefaultLayout();
}
$layout = $session->dashboardLayout;
} else {
$layout = $this->getLayoutForUser(Piwik::getCurrentUserLogin(), $idDashboard);
}
if (!empty($layout)) {
// layout was JSON.stringified
$layout = html_entity_decode($layout);
$layout = str_replace("\\\"", "\"", $layout);
$layout = $this->removeDisabledPluginFromLayout($layout);
}
return $layout;
}
示例9: template_reportParametersPDFReports
/**
* @param Piwik_Event_Notification $notification notification object
*/
public static function template_reportParametersPDFReports($notification)
{
if (Piwik::isUserIsAnonymous()) {
return;
}
$out =& $notification->getNotificationObject();
$view = Piwik_View::factory('ReportParameters');
$view->reportType = self::MOBILE_TYPE;
$view->phoneNumbers = Piwik_MobileMessaging_API::getInstance()->getActivatedPhoneNumbers();
$out .= $view->render();
}