summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authormichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>2013-06-18 15:03:50 +0000
committermichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>2013-06-18 15:03:50 +0000
commit2ad584693f5db99429463fc1d5afc7cc5cff311f (patch)
treed6c5673d346205be87acfbaf66db1a111ed96cab /modules
parentbcf78d8ab4be9d9ce410f273cbc4490f72ced846 (diff)
- Added general::stats_u_oper_only configuration option
git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/branches/8.1.x@2268 82007160-df01-0410-b94d-b575c5fd34c7
Diffstat (limited to 'modules')
-rw-r--r--modules/m_info.c6
-rw-r--r--modules/m_stats.c18
2 files changed, 18 insertions, 6 deletions
diff --git a/modules/m_info.c b/modules/m_info.c
index 111920c..0f0dff6 100644
--- a/modules/m_info.c
+++ b/modules/m_info.c
@@ -397,6 +397,12 @@ static const struct InfoStruct info_table[] =
"STATS P is only shown to operators"
},
{
+ "stats_u_oper_only",
+ OUTPUT_BOOLEAN_YN,
+ &ConfigFileEntry.stats_u_oper_only,
+ "STATS u is only shown to operators"
+ },
+ {
"stats_i_oper_only",
OUTPUT_BOOLEAN2,
&ConfigFileEntry.stats_i_oper_only,
diff --git a/modules/m_stats.c b/modules/m_stats.c
index 28e4342..e7c99cc 100644
--- a/modules/m_stats.c
+++ b/modules/m_stats.c
@@ -1236,14 +1236,20 @@ stats_tstats(struct Client *source_p, int parc, char *parv[])
static void
stats_uptime(struct Client *source_p, int parc, char *parv[])
{
- time_t now = CurrentTime - me.localClient->since;
+ if (!HasUMode(source_p, UMODE_OPER) && ConfigFileEntry.stats_P_oper_only)
+ sendto_one(source_p, form_str(ERR_NOPRIVILEGES),
+ from, to);
+ else
+ {
+ time_t now = CurrentTime - me.localClient->since;
- sendto_one(source_p, form_str(RPL_STATSUPTIME), from, to,
- now / 86400, (now / 3600) % 24, (now / 60) % 60, now % 60);
+ sendto_one(source_p, form_str(RPL_STATSUPTIME), from, to,
+ now / 86400, (now / 3600) % 24, (now / 60) % 60, now % 60);
- if (!ConfigServerHide.disable_remote_commands || HasUMode(source_p, UMODE_OPER))
- sendto_one(source_p, form_str(RPL_STATSCONN), from, to,
- Count.max_loc_con, Count.max_loc_cli, Count.totalrestartcount);
+ if (!ConfigServerHide.disable_remote_commands || HasUMode(source_p, UMODE_OPER))
+ sendto_one(source_p, form_str(RPL_STATSCONN), from, to,
+ Count.max_loc_con, Count.max_loc_cli, Count.totalrestartcount);
+ }
}
static void