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 * ---------------------------------------------------
16 /* $ModDesc: A module which logs all oper commands to the ircd log at default loglevel. */
18 class ModuleOperLog : public Module
23 ModuleOperLog(InspIRCd* Me) : Module(Me)
28 virtual ~ModuleOperLog()
32 virtual Version GetVersion()
34 return Version(1,1,0,0,VF_VENDOR,API_VERSION);
37 void Implements(char* List)
39 List[I_OnPreCommand] = List[I_On005Numeric] = 1;
42 virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, User *user, bool validated, const std::string &original_line)
44 /* If the command doesnt appear to be valid, we dont want to mess with it. */
48 if ((IS_OPER(user)) && (IS_LOCAL(user)) && (user->HasPermission(command)))
50 Command* thiscommand = ServerInstance->Parser->GetHandler(command);
51 if ((thiscommand) && (thiscommand->flags_needed == 'o'))
54 for (int j = 0; j < pcnt; j++)
55 plist.append(std::string(" ")+std::string(parameters[j]));
57 ServerInstance->Log(DEFAULT,"OPERLOG: [%s!%s@%s] %s%s",user->nick,user->ident,user->host,command.c_str(),plist.c_str());
64 virtual void On005Numeric(std::string &output)
66 output.append(" OPERLOG");
72 MODULE_INIT(ModuleOperLog)