summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorattilamolnar <am63770@gmail.com>2012-04-19 00:38:38 +0200
committerattilamolnar <am63770@gmail.com>2012-04-19 00:38:38 +0200
commit8e4d701e5a5c739004ba87f3552813c801482b9c (patch)
treec54fa17cbbe96e08b4d91500a62d93924f4301d1
parent3f5e6f3c1180cc72f520cfddf36f2ba90787b8ad (diff)
Fix issue #18 reported by @int- (remote restriction on /stats)
-rw-r--r--src/stats.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/stats.cpp b/src/stats.cpp
index 5a117b5d3..cd132afed 100644
--- a/src/stats.cpp
+++ b/src/stats.cpp
@@ -19,7 +19,11 @@ void InspIRCd::DoStats(char statschar, User* user, string_list &results)
{
std::string sn(this->Config->ServerName);
- if (!user->HasPrivPermission("servers/auspex") && Config->UserStats.find(statschar) == std::string::npos)
+ bool isPublic = Config->UserStats.find(statschar) != std::string::npos;
+ bool isRemoteOper = IS_REMOTE(user) && IS_OPER(user);
+ bool isLocalOperWithPrivs = IS_LOCAL(user) && user->HasPrivPermission("servers/auspex");
+
+ if (!isPublic && !isRemoteOper && !isLocalOperWithPrivs)
{
this->SNO->WriteToSnoMask('t',
"%s '%c' denied for %s (%s@%s)",