]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_sasl.cpp
Fix TBAN not working if the banner is owner/protected
[user/henk/code/inspircd.git] / src / modules / m_sasl.cpp
index add530ff1a665263727fc98338cefcd9bd183318..8f48d1da9369752ac928ac7e537354504f78e582 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2010 InspIRCd Development Team
  * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
@@ -26,7 +26,6 @@ enum SaslResult { SASL_OK, SASL_FAIL, SASL_ABORT };
 class SaslAuthenticator
 {
  private:
-       InspIRCd *ServerInstance;
        std::string agent;
        User *user;
        SaslState state;
@@ -185,7 +184,7 @@ class CommandSASL : public Command
        SimpleExtItem<SaslAuthenticator>& authExt;
        CommandSASL(Module* Creator, SimpleExtItem<SaslAuthenticator>& ext) : Command(Creator, "SASL", 2), authExt(ext)
        {
-               this->disabled = true; // should not be called by users
+               this->flags_needed = FLAG_SERVERONLY; // should not be called by users
        }
 
        CmdResult Handle(const std::vector<std::string>& parameters, User *user)
@@ -229,10 +228,9 @@ class ModuleSASL : public Module
                Implementation eventlist[] = { I_OnEvent, I_OnUserRegister };
                ServerInstance->Modules->Attach(eventlist, this, 2);
 
-               ServerInstance->AddCommand(&auth);
-               ServerInstance->AddCommand(&sasl);
+               ServiceProvider* providelist[] = { &auth, &sasl, &authExt };
+               ServerInstance->Modules->AddServices(providelist, 3);
 
-               ServerInstance->Extensions.Register(&authExt);
                if (!ServerInstance->Modules->Find("m_services_account.so") || !ServerInstance->Modules->Find("m_cap.so"))
                        ServerInstance->Logs->Log("m_sasl", DEFAULT, "WARNING: m_services_account.so and m_cap.so are not loaded! m_sasl.so will NOT function correctly until these two modules are loaded!");
        }
@@ -249,10 +247,6 @@ class ModuleSASL : public Module
                return MOD_RES_PASSTHRU;
        }
 
-       ~ModuleSASL()
-       {
-       }
-
        Version GetVersion()
        {
                return Version("Provides support for IRC Authentication Layer (aka: atheme SASL) via AUTHENTICATE.",VF_VENDOR);