From 2abef9282f22092a5421c66cb4d30507eb91119b Mon Sep 17 00:00:00 2001 From: special Date: Fri, 3 Nov 2006 04:02:29 +0000 Subject: [PATCH] Switched m_sqloper to use OnPostCommand instead of OnPreCommand, meaning the config tags are checked before MySQL git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5635 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/extra/m_sqloper.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/modules/extra/m_sqloper.cpp b/src/modules/extra/m_sqloper.cpp index 774dbce25..0771ab30a 100644 --- a/src/modules/extra/m_sqloper.cpp +++ b/src/modules/extra/m_sqloper.cpp @@ -62,23 +62,15 @@ public: void Implements(char* List) { - List[I_OnRequest] = List[I_OnRehash] = List[I_OnPreCommand] = 1; + List[I_OnRequest] = List[I_OnRehash] = List[I_OnPostCommand] = 1; } - virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, bool validated, const std::string &original_line) + virtual void OnPostCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, CmdResult result, const std::string &original_line) { - if (validated && (command == "OPER")) + if ((result == CMD_FAILURE) && (command == "OPER")) { - if (LookupOper(user, parameters[0], parameters[1])) - { - /* Returning true here just means the query is in progress, or on it's way to being - * in progress. Nothing about the /oper actually being successful.. - */ - return 1; - } + LookupOper(user, parameters[0], parameters[1]); } - - return 0; } bool LookupOper(userrec* user, const std::string &username, const std::string &password) -- 2.39.5