From 3dff222840314019f72d45d271ad46535f017e38 Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 28 Jan 2006 19:34:35 +0000 Subject: TESTME: Fix to this to make it work with newer OnPreCommand event (a parameter was added since this was written and it no longer fitted the virtual method of the base class) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2949 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/extra/m_sqloper.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/modules/extra') diff --git a/src/modules/extra/m_sqloper.cpp b/src/modules/extra/m_sqloper.cpp index 6451b0ed4..04092e789 100644 --- a/src/modules/extra/m_sqloper.cpp +++ b/src/modules/extra/m_sqloper.cpp @@ -37,6 +37,11 @@ using namespace std; /* $ModDesc: Allows storage of oper credentials in an SQL table */ +/* Required for the FOREACH_MOD alias (OnOper event) */ +extern int MODCOUNT; +extern std::vector modules; +extern std::vector factory; + Server *Srv; class ModuleSQLOper : public Module @@ -75,9 +80,9 @@ class ModuleSQLOper : public Module List[I_OnRehash] = List[I_OnPreCommand] = 1; } - virtual int OnPreCommand(std::string command, char **parameters, int pcnt, userrec *user) + virtual int OnPreCommand(std::string command, char **parameters, int pcnt, userrec *user, bool validated) { - if (command == "OPER") + if ((command == "OPER") && (validated)) { if (LookupOper(parameters[0],parameters[1],user)) return 1; @@ -162,9 +167,7 @@ class ModuleSQLOper : public Module { strcat(user->modes,"o"); WriteServ(user->fd,"MODE %s :+o",user->nick); - Module* Logger = Srv->FindModule("m_sqllog.so"); - if (Logger) - Logger->OnOper(user,rowresult->GetField("type")); + FOREACH_MOD(I_OnOper,OnOper(user,rowresult->GetField("type"))); AddOper(user); log(DEFAULT,"OPER: %s!%s@%s opered as type: %s",user->nick,user->ident,user->host,rowresult->GetField("type").c_str()); } -- cgit v1.2.3