]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
TESTME: Fix to this to make it work with newer OnPreCommand event (a parameter was...
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sat, 28 Jan 2006 19:34:35 +0000 (19:34 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sat, 28 Jan 2006 19:34:35 +0000 (19:34 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2949 e03df62e-2008-0410-955e-edbf42e46eb7

src/modules/extra/m_sqloper.cpp

index 6451b0ed4d5c21ced35365e0790f37f9a287ab5e..04092e789f8768872e9bc6b8ff80169e0113fec0 100644 (file)
@@ -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());
                                                        }