1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2007 InspIRCd Development Team
6 * See: http://www.inspircd.org/wiki/index.php/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
19 /* $ModDesc: A module which logs all oper commands to the ircd log at default loglevel. */
21 class ModuleOperLog : public Module
26 ModuleOperLog(InspIRCd* Me) : Module(Me)
31 virtual ~ModuleOperLog()
35 virtual Version GetVersion()
37 return Version(1,1,0,0,VF_VENDOR,API_VERSION);
40 void Implements(char* List)
42 List[I_OnPreCommand] = List[I_On005Numeric] = 1;
45 virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, bool validated, const std::string &original_line)
47 /* If the command doesnt appear to be valid, we dont want to mess with it. */
51 if ((IS_OPER(user)) && (IS_LOCAL(user)) && (user->HasPermission(command)))
53 command_t* thiscommand = ServerInstance->Parser->GetHandler(command);
54 if ((thiscommand) && (thiscommand->flags_needed = 'o'))
57 for (int j = 0; j < pcnt; j++)
58 plist.append(std::string(" ")+std::string(parameters[j]));
60 ServerInstance->Log(DEFAULT,"OPERLOG: [%s!%s@%s] %s%s",user->nick,user->ident,user->host,command.c_str(),plist.c_str());
67 virtual void On005Numeric(std::string &output)
69 output.append(" OPERLOG");
75 MODULE_INIT(ModuleOperLog)