blob: b3af41c7308173b7c7eb11da2557f3ec1fd1d5ab (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
<?php
/**
* Piwik - Open source web analytics
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
* @version
*
* @package Piwik_AdminHome
*
*/
require_once "API/Request.php";
/**
*
* @package Piwik_AdminHome
*/
class Piwik_AdminHome_Controller extends Piwik_Controller
{
function getDefaultAction()
{
return 'redirectToIndex';
}
function redirectToIndex()
{
header("Location:index.php?module=AdminHome&action=showInContext&moduleToLoad=PluginsAdmin");
}
public function showInContext()
{
$controllerName = Piwik_Common::getRequestVar('moduleToLoad');
$actionName = Piwik_Common::getRequestVar('actionToLoad', 'index');
$view = $this->getDefaultIndexView();
$view->basicHtmlView = true;
$view->content = Piwik_FrontController::getInstance()->fetchDispatch( $controllerName, $actionName );
echo $view->render();
}
protected function getDefaultIndexView()
{
$view = new Piwik_View('AdminHome/templates/index.tpl');
$view->menu = Piwik_GetAdminMenu();
$view->menuJson = json_encode($view->menu);
$view->userLogin = Piwik::getCurrentUserLogin();
$view->sites = Piwik_SitesManager_API::getSitesWithAtLeastViewAccess();
$view->url = Piwik_Url::getCurrentUrl();
$view->basicHtmlView = false;
$view->content = '';
return $view;
}
public function index()
{
Piwik::checkUserIsSuperUser();
$view = $this->getDefaultIndexView();
echo $view->render();
}
}
|