diff --git a/include/config/admin_settings.inc.php b/include/config/admin_settings.inc.php index 36ff000b..539e9432 100644 --- a/include/config/admin_settings.inc.php +++ b/include/config/admin_settings.inc.php @@ -238,6 +238,20 @@ $aSettings['statistics'][] = array( 'name' => 'statistics_analytics_code', 'value' => $setting->getValue('statistics_analytics_code'), 'tooltip' => '.' ); +$aSettings['acl'][] = array( + 'display' => 'Show Stats for logged in users only', 'type' => 'select', + 'options' => array( 0 => 'No', 1 => 'Yes' ), + 'default' => 0, + 'name' => 'acl_show_stats_loggedin', 'value' => $setting->getValue('acl_show_stats_loggedin'), + 'tooltip' => 'Should statistics be visible for logged in users only.' +); +$aSettings['acl'][] = array( + 'display' => 'Show Help for logged in users only', 'type' => 'select', + 'options' => array( 0 => 'No', 1 => 'Yes' ), + 'default' => 0, + 'name' => 'acl_show_help_loggedin', 'value' => $setting->getValue('acl_show_help_loggedin'), + 'tooltip' => 'Should Help Page be visible for logged in users only.' +); $aSettings['acl'][] = array( 'display' => 'Hide news post author', 'type' => 'select', 'options' => array( 0 => 'No', 1 => 'Yes' ), diff --git a/include/pages/gettingstarted.inc.php b/include/pages/gettingstarted.inc.php index cf722e8b..cd225233 100644 --- a/include/pages/gettingstarted.inc.php +++ b/include/pages/gettingstarted.inc.php @@ -6,5 +6,13 @@ $smarty->assign("SITESTRATUMPORT", $config['gettingstarted']['stratumport']); $smarty->assign("SITECOINNAME", $config['gettingstarted']['coinname']); $smarty->assign("SITECOINURL", $config['gettingstarted']['coinurl']); -// Tempalte specifics -$smarty->assign("CONTENT", "default.tpl"); +switch($setting->getValue('acl_show_help_loggedin', 1)) { +case '0': + $smarty->assign("CONTENT", "default.tpl"); + break; +case '1': + if ($user->isAuthenticated()) { + $smarty->assign("CONTENT", "default.tpl"); + } + break; +} \ No newline at end of file diff --git a/include/pages/statistics.inc.php b/include/pages/statistics.inc.php index ac2c5089..ef55bcc5 100644 --- a/include/pages/statistics.inc.php +++ b/include/pages/statistics.inc.php @@ -17,4 +17,14 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) { $debug->append('Using cached page', 3); } -$smarty->assign("CONTENT", "default.tpl"); +switch($setting->getValue('acl_show_stats_loggedin', 1)) { +case '0': + $smarty->assign("CONTENT", "default.tpl"); + break; +case '1': + if ($user->isAuthenticated()) { + $smarty->assign("CONTENT", "default.tpl"); + } + break; +} + diff --git a/include/smarty_globals.inc.php b/include/smarty_globals.inc.php index 1aaab82c..de12ac16 100644 --- a/include/smarty_globals.inc.php +++ b/include/smarty_globals.inc.php @@ -129,6 +129,8 @@ $aGlobal['statistics']['analytics']['enabled'] = $setting->getValue('statistics_ $aGlobal['statistics']['analytics']['code'] = $setting->getValue('statistics_analytics_code'); // ACLs +$aGlobal['acl']['statistics']['loggedin'] = $setting->getValue('acl_show_stats_loggedin'); +$aGlobal['acl']['help']['loggedin'] = $setting->getValue('acl_show_help_loggedin'); $aGlobal['acl']['pool']['statistics'] = $setting->getValue('acl_pool_statistics'); $aGlobal['acl']['block']['statistics'] = $setting->getValue('acl_block_statistics'); $aGlobal['acl']['round']['statistics'] = $setting->getValue('acl_round_statistics'); diff --git a/templates/bootstrap/global/navigation.tpl b/templates/bootstrap/global/navigation.tpl index 3c5d2f73..2aae731f 100644 --- a/templates/bootstrap/global/navigation.tpl +++ b/templates/bootstrap/global/navigation.tpl @@ -64,6 +64,7 @@ {/if} + {if ($GLOBAL.acl.statistics.loggedin|default:"0" == 0 && ($smarty.session.AUTHENTICATED|default:"0" == 0 OR $smarty.session.AUTHENTICATED|default:"0" == 1)) OR ($GLOBAL.acl.statistics.loggedin|default:"0" == 1 && $smarty.session.AUTHENTICATED|default:"0" == 1)}