]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/extra/m_sqlauth.cpp
Update this to use the new oper call
[user/henk/code/inspircd.git] / src / modules / extra / m_sqlauth.cpp
index 98b0227e5ad3157927e4dac3ace89fdab33c6bc3..ec0b544aa898909d8c6cb4be8762d5a867cdec09 100644 (file)
@@ -52,6 +52,8 @@ public:
                        throw ModuleException("Can't find an SQL provider module. Please load one before attempting to load m_sqlauth.");
 
                OnRehash(NULL,"");
+               Implementation eventlist[] = { I_OnUserDisconnect, I_OnCheckReady, I_OnRequest, I_OnRehash, I_OnUserRegister };
+               ServerInstance->Modules->Attach(eventlist, this, 5);
        }
 
        virtual ~ModuleSQLAuth()
@@ -60,10 +62,6 @@ public:
                ServerInstance->Modules->DoneWithInterface("SQLutils");
        }
 
-       void Implements(char* List)
-       {
-               List[I_OnUserDisconnect] = List[I_OnCheckReady] = List[I_OnRequest] = List[I_OnRehash] = List[I_OnUserRegister] = 1;
-       }
 
        virtual void OnRehash(User* user, const std::string &parameter)
        {
@@ -104,7 +102,8 @@ public:
 
        bool CheckCredentials(User* user)
        {
-               SQLrequest req = SQLreq(this, SQLprovider, databaseid, "SELECT ? FROM ? WHERE ? = '?' AND ? = ?'?')", userfield, usertable, userfield, user->nick, passfield, encryption, user->password);
+               SQLrequest req = SQLrequest(this, SQLprovider, databaseid, SQLquery("SELECT ? FROM ? WHERE ? = '?' AND ? = ?'?')") % userfield % usertable % userfield % user->nick %
+                               passfield % encryption % user->password);
                        
                if(req.Send())
                {