summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-01-28 19:34:35 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-01-28 19:34:35 +0000
commit3dff222840314019f72d45d271ad46535f017e38 (patch)
tree82e499592f8bb56c099f61e203da6579cfbff030 /src/modules
parent708934c17133995af766c10035813a43d9c1c6ca (diff)
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
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/extra/m_sqloper.cpp13
1 files changed, 8 insertions, 5 deletions
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<Module*> modules;
+extern std::vector<ircd_module*> 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());
}