[FIX] Statistics Graphs ACL

Fixes #1760
This commit is contained in:
Sebastian Grewe 2014-02-15 09:27:38 +01:00
parent cc3f8abf49
commit bd561ff465
4 changed files with 23 additions and 1 deletions

View File

@ -222,6 +222,13 @@ $aSettings['acl'][] = array(
'name' => 'acl_uptime_statistics', 'value' => $setting->getValue('acl_uptime_statistics'),
'tooltip' => 'Make the uptime statistics page private (users only) or public.'
);
$aSettings['acl'][] = array(
'display' => 'Graphs', 'type' => 'select',
'options' => array( 0 => 'Private', 1 => 'Public', 2 => 'Disabled' ),
'default' => 1,
'name' => 'acl_graphs_statistics', 'value' => $setting->getValue('acl_graphs_statistics'),
'tooltip' => 'Make the graphs statistics page private (users only) or public.'
);
$aSettings['acl'][] = array(
'display' => 'Donors Page', 'type' => 'select',
'options' => array( 0 => 'Private', 1 => 'Public', 2 => 'Disabled' ),

View File

@ -13,5 +13,18 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
$debug->append('Using cached page', 3);
}
$smarty->assign("CONTENT", "default.tpl");
switch($setting->getValue('acl_graphs_statistics', 1)) {
case '0':
if ($user->isAuthenticated()) {
$smarty->assign("CONTENT", "default.tpl");
}
break;
case '1':
$smarty->assign("CONTENT", "default.tpl");
break;
case '2':
$_SESSION['POPUP'][] = array('CONTENT' => 'Page currently disabled. Please try again later.', 'TYPE' => 'errormsg');
$smarty->assign("CONTENT", "");
break;
}
?>

View File

@ -120,6 +120,7 @@ $aGlobal['acl']['block']['statistics'] = $setting->getValue('acl_block_statistic
$aGlobal['acl']['round']['statistics'] = $setting->getValue('acl_round_statistics');
$aGlobal['acl']['blockfinder']['statistics'] = $setting->getValue('acl_blockfinder_statistics');
$aGlobal['acl']['uptime']['statistics'] = $setting->getValue('acl_uptime_statistics');
$aGlobal['acl']['graphs']['statistics'] = $setting->getValue('acl_graphs_statistics');
$aGlobal['acl']['donors']['page'] = $setting->getValue('acl_donors_page');
$aGlobal['acl']['about']['page'] = $setting->getValue('acl_about_page');
$aGlobal['acl']['contactform'] = $setting->getValue('acl_contactform');

View File

@ -35,6 +35,7 @@
{acl_check icon='icon-chart' page='statistics' action='round' name='Round' acl=$GLOBAL.acl.round.statistics}
{acl_check icon='icon-search' page='statistics' action='blockfinder' name='Blockfinder' acl=$GLOBAL.acl.blockfinder.statistics}
{acl_check icon='icon-bell' page='statistics' action='uptime' name='Uptime' acl=$GLOBAL.acl.uptime.statistics}
{acl_check icon='icon-chart' page='statistics' action='graphs' name='Graphs' acl=$GLOBAL.acl.graphs.statistics}
</ul>
<h3>Help</h3>
<ul class="toggle">