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


PHP Piwik_API_Request::reloadAuthUsingTokenAuth方法代码示例

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


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

示例1: buildView

 protected function buildView()
 {
     // access control
     $idSite = Piwik_Common::getRequestVar('idSite', 1, 'int');
     Piwik_API_Request::reloadAuthUsingTokenAuth();
     if (!Piwik::isUserHasViewAccess($idSite)) {
         throw new Exception(Piwik_TranslateException('General_ExceptionPrivilegeAccessWebsite', array("'view'", $idSite)));
     }
     // collect data
     $this->parametersToModify['action'] = $this->currentControllerAction;
     $this->parametersToModify = array_merge($this->variablesDefault, $this->parametersToModify);
     $this->graphData = $this->getGraphData();
     // build view
     $view = new Piwik_View($this->dataTableTemplate);
     $view->width = $this->width;
     $view->height = $this->height;
     $view->chartDivId = $this->getUniqueIdViewDataTable() . "Chart";
     $view->graphType = $this->graphType;
     $view->data = $this->graphData;
     $view->isDataAvailable = strpos($this->graphData, '"series":[]') === false;
     $view->javascriptVariablesToSet = $this->getJavascriptVariablesToSet();
     $view->properties = $this->getViewProperties();
     $view->reportDocumentation = $this->getReportDocumentation();
     return $view;
 }
开发者ID:0h546f6f78696342756e4e59,项目名称:piwik,代码行数:25,代码来源:GenerateGraphHTML.php

示例2: buildView

 protected function buildView()
 {
     $view = new Piwik_View($this->dataTableTemplate);
     $this->uniqueIdViewDataTable = $this->getUniqueIdViewDataTable();
     $view->graphType = $this->graphType;
     $this->chartDivId = $this->uniqueIdViewDataTable . "Chart_swf";
     $this->parametersToModify['action'] = $this->currentControllerAction;
     $this->parametersToModify = array_merge($this->variablesDefault, $this->parametersToModify);
     $url = Piwik_Url::getCurrentQueryStringWithParametersModified($this->parametersToModify);
     $this->includeData = !Zend_Registry::get('config')->Debug->disable_merged_requests;
     $idSite = Piwik_Common::getRequestVar('idSite', 1, 'int');
     Piwik_API_Request::reloadAuthUsingTokenAuth();
     if (!Piwik::isUserHasViewAccess($idSite)) {
         throw new Exception(Piwik_TranslateException('General_ExceptionPrivilegeAccessWebsite', array("'view'", $idSite)));
     }
     if ($this->includeData) {
         $this->chartData = $this->getFlashData();
     } else {
         $this->chartData = null;
     }
     $view->flashParameters = $this->getFlashParameters();
     $view->urlGraphData = $url;
     $view->chartDivId = $this->chartDivId;
     $view->formEmbedId = "formEmbed" . $this->uniqueIdViewDataTable;
     $view->javascriptVariablesToSet = $this->getJavascriptVariablesToSet();
     $view->properties = $this->getViewProperties();
     return $view;
 }
开发者ID:Gninety,项目名称:Microweber,代码行数:28,代码来源:GenerateGraphHTML.php

示例3: oneClickResults

 public function oneClickResults()
 {
     Piwik_API_Request::reloadAuthUsingTokenAuth($_POST);
     Piwik::checkUserIsSuperUser();
     $view = Piwik_View::factory('update_one_click_results');
     $view->coreError = Piwik_Common::getRequestVar('error', '', 'string', $_POST);
     $view->feedbackMessages = safe_unserialize(Piwik_Common::unsanitizeInputValue(Piwik_Common::getRequestVar('messages', '', 'string', $_POST)));
     echo $view->render();
 }
开发者ID:0h546f6f78696342756e4e59,项目名称:piwik,代码行数:9,代码来源:Controller.php

示例4: iframe

	function iframe()
	{		
		Piwik_API_Request::reloadAuthUsingTokenAuth();
		$this->init();
		$controllerName = Piwik_Common::getRequestVar('moduleToWidgetize');
		$actionName = Piwik_Common::getRequestVar('actionToWidgetize');
		$parameters = array ( $fetch = true );
		$outputDataTable = Piwik_FrontController::getInstance()->fetchDispatch( $controllerName, $actionName, $parameters);
		$view = Piwik_View::factory('iframe');
		$this->setGeneralVariablesView($view);
		$view->content = $outputDataTable;
		echo $view->render();
	}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:13,代码来源:Controller.php

示例5: getLastVisitsStart

 public function getLastVisitsStart($fetch = false)
 {
     Piwik_API_Request::reloadAuthUsingTokenAuth();
     // hack, ensure we load today's visits by default
     $_GET['date'] = 'today';
     $_GET['period'] = 'day';
     $view = Piwik_View::factory('lastVisits');
     $view->idSite = $this->idSite;
     $api = new Piwik_API_Request("method=Live.getLastVisitsDetails&idSite={$this->idSite}&filter_limit=10&format=php&serialize=0&disable_generic_filters=1");
     $visitors = $api->process();
     $view->visitors = $visitors;
     return $this->render($view, $fetch);
 }
开发者ID:0h546f6f78696342756e4e59,项目名称:piwik,代码行数:13,代码来源:Controller.php

示例6: buildView

 protected function buildView()
 {
     // access control
     $idSite = Piwik_Common::getRequestVar('idSite', 1, 'int');
     Piwik_API_Request::reloadAuthUsingTokenAuth();
     if (!Piwik::isUserHasViewAccess($idSite)) {
         throw new Exception(Piwik_TranslateException('General_ExceptionPrivilegeAccessWebsite', array("'view'", $idSite)));
     }
     // collect data
     $this->parametersToModify['action'] = $this->currentControllerAction;
     $this->parametersToModify = array_merge($this->variablesDefault, $this->parametersToModify);
     $this->graphData = $this->getGraphData();
     // build view
     $view = new Piwik_View($this->dataTableTemplate);
     $view->width = $this->width;
     $view->height = $this->height;
     $view->chartDivId = $this->getUniqueIdViewDataTable() . "Chart";
     $view->graphType = $this->graphType;
     $view->data = $this->graphData;
     $view->isDataAvailable = strpos($this->graphData, '"series":[]') === false;
     $view->javascriptVariablesToSet = $this->getJavascriptVariablesToSet();
     $view->properties = $this->getViewProperties();
     $view->reportDocumentation = $this->getReportDocumentation();
     // if it's likely that the report data for this data table has been purged,
     // set whether we should display a message to that effect.
     $view->showReportDataWasPurgedMessage = $this->hasReportBeenPurged();
     $view->deleteReportsOlderThan = Piwik_GetOption('delete_reports_older_than');
     return $view;
 }
开发者ID:josl,项目名称:CGE-File-Sharing,代码行数:29,代码来源:GenerateGraphHTML.php

示例7: init

 /**
  * Must be called before dispatch()
  * - checks that directories are writable,
  * - loads the configuration file,
  * - loads the plugin,
  * - inits the DB connection,
  * - etc.
  * @throws Exception
  * @throws Exception
  * @throws bool|Exception
  * @return
  */
 function init()
 {
     static $initialized = false;
     if ($initialized) {
         return;
     }
     $initialized = true;
     try {
         Zend_Registry::set('timer', new Piwik_Timer());
         $directoriesToCheck = array('/tmp/', '/tmp/templates_c/', '/tmp/cache/', '/tmp/assets/', '/tmp/tcpdf/');
         Piwik::checkDirectoriesWritableOrDie($directoriesToCheck);
         Piwik_Common::assignCliParametersToRequest();
         Piwik_Translate::getInstance()->loadEnglishTranslation();
         $exceptionToThrow = $this->createConfigObject();
         if (Piwik_Session::isFileBasedSessions()) {
             Piwik_Session::start();
         }
         $this->handleMaintenanceMode();
         $this->handleSSLRedirection();
         $pluginsManager = Piwik_PluginsManager::getInstance();
         $pluginsToLoad = Piwik_Config::getInstance()->Plugins['Plugins'];
         $pluginsManager->loadPlugins($pluginsToLoad);
         if ($exceptionToThrow) {
             throw $exceptionToThrow;
         }
         try {
             Piwik::createDatabaseObject();
         } catch (Exception $e) {
             if (self::shouldRethrowException()) {
                 throw $e;
             }
             Piwik_PostEvent('FrontController.badConfigurationFile', $e, $info = array(), $pending = true);
             throw $e;
         }
         Piwik::createLogObject();
         // creating the access object, so that core/Updates/* can enforce Super User and use some APIs
         $this->createAccessObject();
         Piwik_PostEvent('FrontController.dispatchCoreAndPluginUpdatesScreen');
         Piwik_PluginsManager::getInstance()->installLoadedPlugins();
         Piwik::install();
         // ensure the current Piwik URL is known for later use
         if (method_exists('Piwik', 'getPiwikUrl')) {
             $host = Piwik::getPiwikUrl();
         }
         Piwik_PostEvent('FrontController.initAuthenticationObject');
         try {
             $authAdapter = Zend_Registry::get('auth');
         } catch (Exception $e) {
             throw new Exception("Authentication object cannot be found in the Registry. Maybe the Login plugin is not activated?\n\t\t\t\t\t\t\t\t\t<br />You can activate the plugin by adding:<br />\n\t\t\t\t\t\t\t\t\t<code>Plugins[] = Login</code><br />\n\t\t\t\t\t\t\t\t\tunder the <code>[Plugins]</code> section in your config/config.ini.php");
         }
         Zend_Registry::get('access')->reloadAccess($authAdapter);
         // Force the auth to use the token_auth if specified, so that embed dashboard
         // and all other non widgetized controller methods works fine
         if (($token_auth = Piwik_Common::getRequestVar('token_auth', false, 'string')) !== false) {
             Piwik_API_Request::reloadAuthUsingTokenAuth();
         }
         Piwik::raiseMemoryLimitIfNecessary();
         Piwik_Translate::getInstance()->reloadLanguage();
         $pluginsManager->postLoadPlugins();
         Piwik_PostEvent('FrontController.checkForUpdates');
     } catch (Exception $e) {
         if (self::shouldRethrowException()) {
             throw $e;
         }
         Piwik_ExitWithMessage($e->getMessage(), false, true);
     }
     //		Piwik::log('End FrontController->init() - Request: '. var_export($_REQUEST, true));
 }
开发者ID:nomoto-ubicast,项目名称:piwik,代码行数:80,代码来源:FrontController.php


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