diff options
-rw-r--r-- | src/modules/account.h | 27 | ||||
-rw-r--r-- | src/modules/m_sasl.cpp | 6 | ||||
-rw-r--r-- | src/modules/m_services_account.cpp | 10 |
3 files changed, 43 insertions, 0 deletions
diff --git a/src/modules/account.h b/src/modules/account.h new file mode 100644 index 000000000..833fe7aee --- /dev/null +++ b/src/modules/account.h @@ -0,0 +1,27 @@ +/* +------------------------------------+ + * | Inspire Internet Relay Chat Daemon | + * +------------------------------------+ + * + * InspIRCd: (C) 2002-2008 InspIRCd Development Team + * See: http://www.inspircd.org/wiki/index.php/Credits + * + * This program is free but copyrighted software; see + * the file COPYING for details. + * + * --------------------------------------------------- + */ + +#ifndef __ACCOUNT_H__ +#define __ACCOUNT_H__ + +#include <map> +#include <string> + +class AccountData +{ + public: + User* user; + std::string account; +}; + +#endif diff --git a/src/modules/m_sasl.cpp b/src/modules/m_sasl.cpp index fc4a75fe3..87d87d978 100644 --- a/src/modules/m_sasl.cpp +++ b/src/modules/m_sasl.cpp @@ -13,6 +13,7 @@ #include "inspircd.h" #include "m_cap.h" +#include "account.h" /* $ModDesc: Provides support for atheme SASL via AUTHENTICATE. */ @@ -83,6 +84,11 @@ class ModuleSASL : public Module target->WriteServ("AUTHENTICATE %s", line.c_str()); } } + else if (ev->GetEventID() == "account_login") + { + AccountData* ac = (AccountData*)ev->GetData(); + ac->user->WriteServ("903 %s :SASL authentication successful", ac->user->nick); + } } }; diff --git a/src/modules/m_services_account.cpp b/src/modules/m_services_account.cpp index fe7f52f22..4bb6f9268 100644 --- a/src/modules/m_services_account.cpp +++ b/src/modules/m_services_account.cpp @@ -12,6 +12,7 @@ */ #include "inspircd.h" +#include "account.h" /* $ModDesc: Povides support for ircu-style services accounts, including chmode +R, etc. */ @@ -304,6 +305,15 @@ class ModuleServicesAccount : public Module // remove any accidental leading/trailing spaces trim(*text); dest->Extend("accountname", text); + + if (IS_LOCAL(dest)) + dest->WriteServ("900 %s %s %s :You are now logged in as %s", dest->nick, dest->GetFullHost(), text->c_str(), text->c_str()); + + AccountData ac; + ac.user = dest; + ac.account = *text; + Event n((char*)&ac, this, "account_login"); + n.Send(ServerInstance); } } } |