mirror of
https://github.com/anope/anope.git
synced 2026-07-08 15:23:12 +02:00
Made the IsValidHost checks configurable
This commit is contained in:
@@ -69,8 +69,8 @@ class CommandBSBot : public Command
|
||||
return;
|
||||
}
|
||||
|
||||
/* Check the host is valid re RFC 2812 */
|
||||
if (!isValidHost(host, 3))
|
||||
/* Check the host is valid */
|
||||
if (!IsValidHost(host))
|
||||
{
|
||||
source.Reply(_("Bot Hosts may only contain valid host characters."));
|
||||
return;
|
||||
@@ -186,7 +186,7 @@ class CommandBSBot : public Command
|
||||
return;
|
||||
}
|
||||
|
||||
if (!host.empty() && !isValidHost(host, 3))
|
||||
if (!host.empty() && !IsValidHost(host))
|
||||
{
|
||||
source.Reply(_("Bot Hosts may only contain valid host characters."));
|
||||
return;
|
||||
|
||||
@@ -99,7 +99,7 @@ class CommandHSRequest : public Command
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isValidHost(host, 3))
|
||||
if (!IsValidHost(host))
|
||||
{
|
||||
source.Reply(HOST_SET_ERROR);
|
||||
return;
|
||||
|
||||
+14
-26
@@ -56,22 +56,16 @@ class CommandHSSet : public Command
|
||||
|
||||
if (!user.empty())
|
||||
{
|
||||
if (user.length() > Config->UserLen)
|
||||
{
|
||||
source.Reply(HOST_SET_IDENTTOOLONG, Config->UserLen);
|
||||
return;
|
||||
}
|
||||
else if (!ircd->vident)
|
||||
if (!ircd->vident)
|
||||
{
|
||||
source.Reply(HOST_NO_VIDENT);
|
||||
return;
|
||||
}
|
||||
for (Anope::string::iterator s = user.begin(), s_end = user.end(); s != s_end; ++s)
|
||||
if (!isvalidchar(*s))
|
||||
{
|
||||
source.Reply(HOST_SET_IDENT_ERROR);
|
||||
return;
|
||||
}
|
||||
else if (!IsValidIdent(user))
|
||||
{
|
||||
source.Reply(HOST_SET_IDENT_ERROR);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (host.length() > Config->HostLen)
|
||||
@@ -80,7 +74,7 @@ class CommandHSSet : public Command
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isValidHost(host, 3))
|
||||
if (!IsValidHost(host))
|
||||
{
|
||||
source.Reply(HOST_SET_ERROR);
|
||||
return;
|
||||
@@ -163,22 +157,16 @@ class CommandHSSetAll : public Command
|
||||
|
||||
if (!user.empty())
|
||||
{
|
||||
if (user.length() > Config->UserLen)
|
||||
{
|
||||
source.Reply(HOST_SET_IDENTTOOLONG, Config->UserLen);
|
||||
return;
|
||||
}
|
||||
else if (!ircd->vident)
|
||||
if (!ircd->vident)
|
||||
{
|
||||
source.Reply(HOST_NO_VIDENT);
|
||||
return;
|
||||
}
|
||||
for (Anope::string::iterator s = user.begin(), s_end = user.end(); s != s_end; ++s)
|
||||
if (!isvalidchar(*s))
|
||||
{
|
||||
source.Reply(HOST_SET_IDENT_ERROR);
|
||||
return;
|
||||
}
|
||||
else if (!IsValidIdent(user))
|
||||
{
|
||||
source.Reply(HOST_SET_IDENT_ERROR);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (host.length() > Config->HostLen)
|
||||
@@ -187,7 +175,7 @@ class CommandHSSetAll : public Command
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isValidHost(host, 3))
|
||||
if (!IsValidHost(host))
|
||||
{
|
||||
source.Reply(HOST_SET_ERROR);
|
||||
return;
|
||||
|
||||
@@ -29,7 +29,7 @@ class CommandOSJupe : public Command
|
||||
const Anope::string &reason = params.size() > 1 ? params[1] : "";
|
||||
Server *server = Server::Find(jserver);
|
||||
|
||||
if (!isValidHost(jserver, 3))
|
||||
if (!IsValidHost(jserver) || jserver.find('.') == Anope::string::npos)
|
||||
source.Reply(_("Please use a valid server name when juping"));
|
||||
else if (server && (server == Me || server == Me->GetLinks().front()))
|
||||
source.Reply(_("You can not jupe your services server or your uplink server."));
|
||||
|
||||
Reference in New Issue
Block a user