From 8e4d701e5a5c739004ba87f3552813c801482b9c Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Thu, 19 Apr 2012 00:38:38 +0200 Subject: Fix issue #18 reported by @int- (remote restriction on /stats) --- src/stats.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/stats.cpp') 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)", -- cgit v1.2.3