Restrict statistics access to admins and moderators
This commit is contained in:
parent
33e1780e89
commit
143decc3bb
3 changed files with 27 additions and 0 deletions
|
@ -323,6 +323,13 @@ function template_info_center()
|
|||
if (empty($context['info_center']))
|
||||
return;
|
||||
|
||||
// Do not display the info center if the user is not a moderator or an admin.
|
||||
if (
|
||||
! $context['user']['is_admin'] &&
|
||||
! $context['user']['is_mod']
|
||||
)
|
||||
return;
|
||||
|
||||
// Here's where the "Info Center" starts...
|
||||
echo '
|
||||
<div class="roundframe" id="info_center">
|
||||
|
|
|
@ -17,6 +17,16 @@ function template_main()
|
|||
{
|
||||
global $context, $settings, $txt, $scripturl, $modSettings;
|
||||
|
||||
// Only admins and moderators are allowed to see the forum statistics.
|
||||
if (
|
||||
! $context['user']['is_admin'] &&
|
||||
! $context['user']['is_mod']
|
||||
) {
|
||||
echo '
|
||||
<p><strong>Vous n’êtes pas autorisé à accéder aux statistiques du forum.</strong></p>';
|
||||
return;
|
||||
}
|
||||
|
||||
echo '
|
||||
<div id="statistics" class="main_section">
|
||||
<div class="cat_bar">
|
||||
|
|
|
@ -17,6 +17,16 @@ function template_main()
|
|||
{
|
||||
global $context, $settings, $scripturl, $txt;
|
||||
|
||||
// Only admins and moderators are allowed to see the list of online members.
|
||||
if (
|
||||
! $context['user']['is_admin'] &&
|
||||
! $context['user']['is_mod']
|
||||
) {
|
||||
echo '
|
||||
<p><strong>Vous n’êtes pas autorisé à accéder à la liste des membres actuellement en ligne.</strong></p>';
|
||||
return;
|
||||
}
|
||||
|
||||
// Display the table header and linktree.
|
||||
echo '
|
||||
<div class="main_section" id="whos_online">
|
||||
|
|
Loading…
Reference in a new issue