Skip to content

Commit 62e01bd

Browse files
committed
settings to hide help page and pool stats from users that are not logged in
1 parent 9e970f1 commit 62e01bd

File tree

6 files changed

+41
-3
lines changed

6 files changed

+41
-3
lines changed

include/config/admin_settings.inc.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,20 @@
238238
'name' => 'statistics_analytics_code', 'value' => $setting->getValue('statistics_analytics_code'),
239239
'tooltip' => '.'
240240
);
241+
$aSettings['acl'][] = array(
242+
'display' => 'Show Stats for logged in users only', 'type' => 'select',
243+
'options' => array( 0 => 'No', 1 => 'Yes' ),
244+
'default' => 0,
245+
'name' => 'acl_show_stats_loggedin', 'value' => $setting->getValue('acl_show_stats_loggedin'),
246+
'tooltip' => 'Should statistics be visible for logged in users only.'
247+
);
248+
$aSettings['acl'][] = array(
249+
'display' => 'Show Help for logged in users only', 'type' => 'select',
250+
'options' => array( 0 => 'No', 1 => 'Yes' ),
251+
'default' => 0,
252+
'name' => 'acl_show_help_loggedin', 'value' => $setting->getValue('acl_show_help_loggedin'),
253+
'tooltip' => 'Should Help Page be visible for logged in users only.'
254+
);
241255
$aSettings['acl'][] = array(
242256
'display' => 'Hide news post author', 'type' => 'select',
243257
'options' => array( 0 => 'No', 1 => 'Yes' ),

include/pages/gettingstarted.inc.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,13 @@
66
$smarty->assign("SITECOINNAME", $config['gettingstarted']['coinname']);
77
$smarty->assign("SITECOINURL", $config['gettingstarted']['coinurl']);
88

9-
// Tempalte specifics
10-
$smarty->assign("CONTENT", "default.tpl");
9+
switch($setting->getValue('acl_show_help_loggedin', 1)) {
10+
case '0':
11+
$smarty->assign("CONTENT", "default.tpl");
12+
break;
13+
case '1':
14+
if ($user->isAuthenticated()) {
15+
$smarty->assign("CONTENT", "default.tpl");
16+
}
17+
break;
18+
}

include/pages/statistics.inc.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,14 @@
1717
$debug->append('Using cached page', 3);
1818
}
1919

20-
$smarty->assign("CONTENT", "default.tpl");
20+
switch($setting->getValue('acl_show_stats_loggedin', 1)) {
21+
case '0':
22+
$smarty->assign("CONTENT", "default.tpl");
23+
break;
24+
case '1':
25+
if ($user->isAuthenticated()) {
26+
$smarty->assign("CONTENT", "default.tpl");
27+
}
28+
break;
29+
}
30+

include/smarty_globals.inc.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@
129129
$aGlobal['statistics']['analytics']['code'] = $setting->getValue('statistics_analytics_code');
130130

131131
// ACLs
132+
$aGlobal['acl']['statistics']['loggedin'] = $setting->getValue('acl_show_stats_loggedin');
133+
$aGlobal['acl']['help']['loggedin'] = $setting->getValue('acl_show_help_loggedin');
132134
$aGlobal['acl']['pool']['statistics'] = $setting->getValue('acl_pool_statistics');
133135
$aGlobal['acl']['block']['statistics'] = $setting->getValue('acl_block_statistics');
134136
$aGlobal['acl']['round']['statistics'] = $setting->getValue('acl_round_statistics');

templates/bootstrap/global/navigation.tpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
<!-- /.nav-second-level -->
6565
</li>
6666
{/if}
67+
{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)}
6768
<li {if $smarty.get.page|default:"0" eq "statistics"}class="active"{/if}>
6869
<a href="#"><i class="fa fa-bar-chart-o fa-fw"></i> Statistics<span class="fa arrow"></span></a>
6970
<ul class="nav nav-second-level">
@@ -77,6 +78,8 @@
7778
</ul>
7879
<!-- /.nav-second-level -->
7980
</li>
81+
{/if}
82+
{if ($GLOBAL.acl.help.loggedin|default:"0" == 0 && ($smarty.session.AUTHENTICATED|default:"0" == 0 OR $smarty.session.AUTHENTICATED|default:"0" == 1)) OR ($GLOBAL.acl.help.loggedin|default:"0" == 1 && $smarty.session.AUTHENTICATED|default:"0" == 1)}
8083
<li {if $smarty.get.page|default:"0" eq "gettingstarted" || $smarty.get.page|default:"0" eq "about"}class="active"{/if}>
8184
<a href="#"><i class="fa fa-question fa-fw"></i> Help<span class="fa arrow"></span></a>
8285
<ul class="nav nav-second-level">
@@ -87,6 +90,7 @@
8790
</ul>
8891
<!-- /.nav-second-level -->
8992
</li>
93+
{/if}
9094
<li {if $smarty.get.page|default:"0" eq "register" || $smarty.get.page|default:"0" eq "login" || $smarty.get.page|default:"0" eq "logout" || $smarty.get.page|default:"0" eq "tac" || $smarty.get.page|default:"0" eq "contactform"}class="active"{/if}>
9195
<a href="#"><i class="fa fa-tasks fa-fw"></i> Other<span class="fa arrow"></span></a>
9296
<ul class="nav nav-second-level">

templates/bootstrap/start/default.tpl

Whitespace-only changes.

0 commit comments

Comments
 (0)