X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_operlog.cpp;h=062e8197906b81d8d0cf63c01f5a564d04f46c2b;hb=d54fd9b1e6b31f69332a9241b5f17330c0ad61e0;hp=a84629388b29091202ca26c999714d1375785507;hpb=433e9777236f877469549f10d7232cf16197c9ba;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_operlog.cpp b/src/modules/m_operlog.cpp index a84629388..062e81979 100644 --- a/src/modules/m_operlog.cpp +++ b/src/modules/m_operlog.cpp @@ -19,8 +19,7 @@ using namespace std; #include "users.h" #include "channels.h" #include "modules.h" -#include "helperfuncs.h" -#include "message.h" +#include "inspircd.h" #include /* $ModDesc: A module which logs all oper commands to the ircd log at default loglevel. */ @@ -28,11 +27,11 @@ using namespace std; class ModuleOperLog : public Module { private: - Server *Srv; + public: - ModuleOperLog(Server* Me) : Module::Module(Me) + ModuleOperLog(InspIRCd* Me) : Module::Module(Me) { - Srv = Me; + } virtual ~ModuleOperLog() @@ -49,20 +48,20 @@ class ModuleOperLog : public Module List[I_OnPreCommand] = List[I_On005Numeric] = 1; } - virtual int OnPreCommand(const std::string &command, char **parameters, int pcnt, userrec *user, bool validated) + virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, bool validated) { /* If the command doesnt appear to be valid, we dont want to mess with it. */ if (!validated) return 0; - if (*user->oper) + if ((*user->oper) && (IS_LOCAL(user)) && (user->HasPermission(command))) { std::string plist = ""; for (int j = 0; j < pcnt; j++) { - plist.append(" "+parameters[j]); + plist.append(std::string(" ")+std::string(parameters[j])); } - log(DEFAULT,"OPERLOG: [%s!%s@%s] %s%s",user->nick,user->ident,user->host,command.c_str(),plist.c_str()); + ServerInstance->Log(DEFAULT,"OPERLOG: [%s!%s@%s] %s%s",user->nick,user->ident,user->host,command.c_str(),plist.c_str()); } return 0; @@ -90,7 +89,7 @@ class ModuleOperLogFactory : public ModuleFactory { } - virtual Module * CreateModule(Server* Me) + virtual Module * CreateModule(InspIRCd* Me) { return new ModuleOperLog(Me); }