X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fstats.cpp;h=e5ea94b9cc229a3fcfa2dd8abfd3b0471f3fa707;hb=98a932f819e2f55dc3fafb160d55a1aa57a3d5cf;hp=9c177c7803c1977de79fdfa996e21253e70865fe;hpb=39cf323606a311b3b7f59a9c9f39a21d42520c24;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/stats.cpp b/src/stats.cpp index 9c177c780..e5ea94b9c 100644 --- a/src/stats.cpp +++ b/src/stats.cpp @@ -1,16 +1,22 @@ -/* +------------------------------------+ - * | Inspire Internet Relay Chat Daemon | - * +------------------------------------+ +/* + * InspIRCd -- Internet Relay Chat Daemon * - * InspIRCd: (C) 2002-2010 InspIRCd Development Team - * See: http://wiki.inspircd.org/Credits + * Copyright (C) 2009-2010 Daniel De Graaf * - * This program is free but copyrighted software; see - * the file COPYING for details. + * This file is part of InspIRCd. InspIRCd is free software: you can + * redistribute it and/or modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation, version 2. * - * --------------------------------------------------- + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ + #include "inspircd.h" #include "xline.h" #include "commands/cmd_whowas.h" @@ -19,7 +25,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)", @@ -41,7 +51,7 @@ void InspIRCd::DoStats(char statschar, User* user, string_list &results) switch (statschar) { - /* stats p (show listening ports and registered clients on each) */ + /* stats p (show listening ports) */ case 'p': { for (size_t i = 0; i < this->ports.size(); i++) @@ -301,7 +311,7 @@ void InspIRCd::DoStats(char statschar, User* user, string_list &results) } break; - /* stats L (show user I/O stats with IP addresses) */ + /* stats L (show user I/O stats with IP addresses) */ case 'L': results.push_back(sn+" 211 "+user->nick+" :nick[ident@ip] sendq cmds_out bytes_out cmds_in bytes_in time_open"); for (std::vector::iterator n = this->Users->local_users.begin(); n != this->Users->local_users.end(); n++)