*/
#include "inspircd.h"
-#include "wildcard.h"
/* $ModDesc: Sets (and unsets) modes on users when they connect */
if (!IS_LOCAL(user))
return;
+ // Backup and zero out the disabled usermodes, so that we can override them here.
+ char save[64];
+ memcpy(save, ServerInstance->Config->DisabledUModes,
+ sizeof(ServerInstance->Config->DisabledUModes));
+ memset(ServerInstance->Config->DisabledUModes, 0, 64);
+
for (int j = 0; j < Conf->Enumerate("connect"); j++)
{
std::string hostn = Conf->ReadValue("connect","allow",j);
/* XXX: Fixme: does not respect port, limit, etc */
- if ((match(user->GetIPString(),hostn,true)) || (match(user->host,hostn)))
+ if ((InspIRCd::MatchCIDR(user->GetIPString(),hostn)) || (InspIRCd::Match(user->host,hostn)))
{
std::string ThisModes = Conf->ReadValue("connect","modes",j);
if (!ThisModes.empty())
break;
}
}
+
+ memcpy(ServerInstance->Config->DisabledUModes, save, 64);
}
};