diff options
-rw-r--r-- | src/modules/m_cgiirc.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp index de9cec8cd..4d0edcb23 100644 --- a/src/modules/m_cgiirc.cpp +++ b/src/modules/m_cgiirc.cpp @@ -161,21 +161,21 @@ class CommandWebIRC : public SplitCommand if (user->registered == REG_ALL || realhost.get(user)) return CMD_FAILURE; - irc::sockets::sockaddrs ipaddr; - if (!irc::sockets::aptosa(parameters[3], user->client_sa.port(), ipaddr)) - { - user->CommandFloodPenalty += 5000; - WriteLog("Connecting user %s (%s) tried to use WEBIRC but gave an invalid IP address.", - user->uuid.c_str(), user->GetIPString().c_str()); - return CMD_FAILURE; - } - for (std::vector<WebIRCHost>::const_iterator iter = hosts.begin(); iter != hosts.end(); ++iter) { // If we don't match the host then skip to the next host. if (!iter->Matches(user, parameters[0])) continue; + irc::sockets::sockaddrs ipaddr; + if (!irc::sockets::aptosa(parameters[3], user->client_sa.port(), ipaddr)) + { + user->CommandFloodPenalty += 5000; + WriteLog("Connecting user %s (%s) tried to use WEBIRC but gave an invalid IP address.", + user->uuid.c_str(), user->GetIPString().c_str()); + return CMD_FAILURE; + } + // The user matched a WebIRC block! gateway.set(user, parameters[1]); realhost.set(user, user->GetRealHost()); |