]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/extra/m_sqloper.cpp
Allow freeform queries. Allow $nick, $host, $ip, $pass, $md5pass and $sha256pass...
[user/henk/code/inspircd.git] / src / modules / extra / m_sqloper.cpp
index 0b10ac467ffda3fba7c019a0c6c01d8aea410957..2ed9d2b55f4bc0914502015497124cd2e692a94f 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
  * See: http://www.inspircd.org/wiki/index.php/Credits
  *
  * This program is free but copyrighted software; see
@@ -68,7 +68,7 @@ public:
                databaseid = Conf.ReadValue("sqloper", "dbid", 0); /* Database ID of a database configured for the service provider module */
        }
 
-       virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, User *user, bool validated, const std::string &original_line)
+       virtual int OnPreCommand(const std::string &command, const char* const* parameters, int pcnt, User *user, bool validated, const std::string &original_line)
        {
                if ((validated) && (command == "OPER"))
                {
@@ -128,12 +128,12 @@ public:
                }
                else
                {
-                       ServerInstance->Log(SPARSE, "WARNING: Couldn't find SQL provider module. NOBODY will be able to oper up unless their o:line is statically configured");
+                       ServerInstance->Logs->Log("m_sqloper",SPARSE, "WARNING: Couldn't find SQL provider module. NOBODY will be able to oper up unless their o:line is statically configured");
                        return false;
                }
        }
        
-       virtual char* OnRequest(Request* request)
+       virtual const char* OnRequest(Request* request)
        {
                if (strcmp(SQLRESID, request->GetId()) == 0)
                {
@@ -235,7 +235,7 @@ public:
                }
                else
                {
-                       ServerInstance->Log(DEBUG, "BUG: WHAT?! Why do we have no OPER command?!");
+                       ServerInstance->Logs->Log("m_sqloper",DEBUG, "BUG: WHAT?! Why do we have no OPER command?!");
                }
        }
 
@@ -259,10 +259,10 @@ public:
                                        user->ChangeDisplayedHost(operhost.c_str());
 
                                ServerInstance->SNO->WriteToSnoMask('o',"%s (%s@%s) is now an IRC operator of type %s", user->nick, user->ident, user->host, type.c_str());
-                               user->WriteServ("381 %s :You are now %s %s",user->nick, strchr("aeiouAEIOU", type[0]) ? "an" : "a", irc::Spacify(type.c_str()));
+                               user->WriteNumeric(381, "%s :You are now %s %s",user->nick, strchr("aeiouAEIOU", type[0]) ? "an" : "a", irc::Spacify(type.c_str()));
 
                                if (!user->modes[UM_OPERATOR])
-                                       user->Oper(type);
+                                       user->Oper(type, tname);
 
                                return true;
                        }
@@ -273,7 +273,7 @@ public:
 
        virtual Version GetVersion()
        {
-               return Version(1,1,1,0,VF_VENDOR,API_VERSION);
+               return Version(1,2,1,0,VF_VENDOR,API_VERSION);
        }
        
 };