#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# SQL authentication module: Allows IRCd connections to be tied into
# a database table (for example a forum).
- # This module is in extras. Re-run configure with:
- # ./configure --enable-extras=m_sqlauth.cpp
- # and run make install, then uncomment this module to enable it.
#
-#<module name="m_sqlauth.so">
+#<module name="sqlauth">
#
#-#-#-#-#-#-#-#-#-#-#- SQLAUTH CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-#
# #
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# SQL oper module: Allows you to store oper credentials in an SQL table
- # This module is in extras. Re-run configure with:
- # ./configure --enable-extras=m_sqloper.cpp
- # and run make install, then uncomment this module to enable it.
#
-#<module name="m_sqloper.so">
+#<module name="sqloper">
#
#-#-#-#-#-#-#-#-#-#-#- SQLOPER CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-#
# #
FIRST_MOD_RESULT(OnExtBanCheck, rv, (user, this, type));
if (rv != MOD_RES_PASSTHRU)
return rv;
- for (BanList::iterator i = this->bans.begin(); i != this->bans.end(); i++)
+
+ ListModeBase* banlm = static_cast<ListModeBase*>(*ban);
+ if (!banlm)
+ return MOD_RES_PASSTHRU;
+
+ const ListModeBase::ModeList* bans = banlm->GetList(this);
+ if (bans)
{
- if (i->data.length() > 2 && i->data[0] == type && i->data[1] == ':')
+ for (ListModeBase::ModeList::const_iterator it = bans->begin(); it != bans->end(); ++it)
{
- if (it->mask[0] != type || it->mask[1] != ':')
- std::string val = i->data.substr(2);
- if (CheckBan(user, val))
++ if (it->mask.length() <= 2 || it->mask[0] != type || it->mask[1] != ':')
+ continue;
+
+ if (CheckBan(user, it->mask.substr(2)))
return MOD_RES_DENY;
}
}
{
}
- void init()
+ void On005Numeric(std::map<std::string, std::string>& tokens) CXX11_OVERRIDE
{
- ServerInstance->Modules->AddService(be);
-
- be.DoImplements(this);
- Implementation list[] = { I_OnRehash, I_On005Numeric, I_OnExtBanCheck, I_OnCheckChannelBan };
- ServerInstance->Modules->Attach(list, this, sizeof(list)/sizeof(Implementation));
+ tokens["EXCEPTS"] = "e";
}
- void On005Numeric(std::string &output)
+ ModResult OnExtBanCheck(User *user, Channel *chan, char type) CXX11_OVERRIDE
{
- output.append(" EXCEPTS=e");
- }
+ ListModeBase::ModeList* list = be.GetList(chan);
+ if (!list)
+ return MOD_RES_PASSTHRU;
- ModResult OnExtBanCheck(User *user, Channel *chan, char type)
- {
- if (chan != NULL)
+ for (ListModeBase::ModeList::iterator it = list->begin(); it != list->end(); it++)
{
- if (it->mask[0] != type || it->mask[1] != ':')
- modelist *list = be.extItem.get(chan);
-
- if (!list)
- return MOD_RES_PASSTHRU;
++ if (it->mask.length() <= 2 || it->mask[0] != type || it->mask[1] != ':')
+ continue;
- for (modelist::iterator it = list->begin(); it != list->end(); it++)
+ if (chan->CheckBan(user, it->mask.substr(2)))
{
- if (it->mask.length() <= 2 || it->mask[0] != type || it->mask[1] != ':')
- continue;
-
- if (chan->CheckBan(user, it->mask.substr(2)))
- {
- // They match an entry on the list, so let them pass this.
- return MOD_RES_ALLOW;
- }
+ // They match an entry on the list, so let them pass this.
+ return MOD_RES_ALLOW;
}
}