summaryrefslogtreecommitdiff
path: root/modules/commands/hs_set.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-08-25 00:36:04 -0400
committerAdam <Adam@anope.org>2011-09-10 01:58:38 -0400
commitd4db2b84f250b98ec3422f2be9951f567e6dc97e (patch)
tree3c119be0fa5a5f166664858a0cea0c9344e1db7e /modules/commands/hs_set.cpp
parentbb8e04c83588b6d0595eca463170643a3bd84285 (diff)
Made the IsValidHost checks configurable
Diffstat (limited to 'modules/commands/hs_set.cpp')
-rw-r--r--modules/commands/hs_set.cpp32
1 files changed, 10 insertions, 22 deletions
diff --git a/modules/commands/hs_set.cpp b/modules/commands/hs_set.cpp
index 4711022db..44a501cc1 100644
--- a/modules/commands/hs_set.cpp
+++ b/modules/commands/hs_set.cpp
@@ -56,22 +56,16 @@ class CommandHSSet : public Command
if (!user.empty())
{
- if (user.length() > Config->UserLen)
+ if (!ircd->vident)
{
- source.Reply(HOST_SET_IDENTTOOLONG, Config->UserLen);
+ source.Reply(HOST_NO_VIDENT);
return;
}
- else if (!ircd->vident)
+ else if (!IsValidIdent(user))
{
- source.Reply(HOST_NO_VIDENT);
+ source.Reply(HOST_SET_IDENT_ERROR);
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;
- }
}
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)
+ if (!ircd->vident)
{
- source.Reply(HOST_SET_IDENTTOOLONG, Config->UserLen);
+ source.Reply(HOST_NO_VIDENT);
return;
}
- else if (!ircd->vident)
+ else if (!IsValidIdent(user))
{
- source.Reply(HOST_NO_VIDENT);
+ source.Reply(HOST_SET_IDENT_ERROR);
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;
- }
}
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;