Skip to content

Commit

Permalink
Warning is now shown on General Settings page to warn user
Browse files Browse the repository at this point in the history
when tracking is disabled via record_statistics = 0.

fixes #3551
  • Loading branch information
halfdan committed Feb 6, 2013
1 parent 7a75ea3 commit 84a2e9e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions lang/en.php
Expand Up @@ -270,6 +270,7 @@
'General_YearlyReports' => 'Yearly reports',
'General_RangeReports' => 'Custom date ranges',
'General_ConfigFileIsNotWritable' => 'The Piwik configuration file %s is not writable, some of your changes might not be saved. %s Please change permissions of the config file to make it writable.',
'General_StatisticsAreNotRecorded' => 'Piwik Visitor Tracking is currently disabled! Re-enable tracking by setting record_statistics = 1 in your config/config.ini.php file.',
'General_ExceptionDatabaseVersion' => 'Your %1$s version is %2$s but Piwik requires at least %3$s.',
'General_ExceptionIncompatibleClientServerVersions' => 'Your %1$s client version is %2$s which is incompatible with server version %3$s.',
'General_ExceptionMissingFile' => 'Missing file: %s',
Expand Down
11 changes: 8 additions & 3 deletions plugins/CoreAdminHome/Controller.php
Expand Up @@ -27,7 +27,7 @@ public function generalSettings()
{
Piwik::checkUserHasSomeAdminAccess();
$view = Piwik_View::factory('generalSettings');

if(Piwik::isUserIsSuperUser())
{
$enableBrowserTriggerArchiving = Piwik_ArchiveProcessing::isBrowserTriggerArchivingEnabled();
Expand All @@ -46,14 +46,19 @@ public function generalSettings()
{
$view->configFileNotWritable = true;
}

$statsEnabled = Piwik_Config::getInstance()->Tracker['record_statistics'];
if($statsEnabled == "0"){
$view->statisticsNotRecorded = 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;

$trustedHosts = array();
if (isset(Piwik_Config::getInstance()->General['trusted_hosts']))
{
Expand Down
7 changes: 6 additions & 1 deletion plugins/CoreAdminHome/templates/header.tpl
Expand Up @@ -17,7 +17,6 @@
{include file="CoreHome/templates/iframe_buster_header.tpl"}
</head>
<body>

{include file="CoreHome/templates/iframe_buster_body.tpl"}
<div id="root">
{if !isset($showTopMenu) || $showTopMenu}
Expand Down Expand Up @@ -52,6 +51,12 @@
</div>
{/if}

{if !empty($statisticsNotRecorded)}
<div class="ajaxSuccess" style="display:inline-block">
{'General_StatisticsAreNotRecorded'|translate}
</div>
{/if}

<div class="ui-confirm" id="alert">
<h2></h2>
<input role="no" type="button" value="{'General_Ok'|translate}" />
Expand Down

0 comments on commit 84a2e9e

Please sign in to comment.