summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Burchell <viroteck@viroteck.net>2012-04-18 23:45:12 -0700
committerRobin Burchell <viroteck@viroteck.net>2012-04-18 23:45:12 -0700
commit0b8cc8b535c6f8ad039fcae20452e799197b1c75 (patch)
treec54fa17cbbe96e08b4d91500a62d93924f4301d1
parent3f5e6f3c1180cc72f520cfddf36f2ba90787b8ad (diff)
parent8e4d701e5a5c739004ba87f3552813c801482b9c (diff)
Merge pull request #83 from attilamolnar/insp20+remotestatsfix
[2.0] 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)",