mirror of
https://github.com/anope/anope.git
synced 2026-07-04 03:03:12 +02:00
Actually made the nickserv block optional
This commit is contained in:
@@ -330,7 +330,7 @@ class InspircdIRCdMessage : public IRCdMessage
|
||||
if (na->nc->HasFlag(NI_UNCONFIRMED))
|
||||
user->SetMode(findbot(Config->NickServ), UMODE_REGISTERED);
|
||||
}
|
||||
else
|
||||
else if (nickserv)
|
||||
nickserv->Validate(user);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -288,7 +288,7 @@ class PlexusIRCdMessage : public IRCdMessage
|
||||
if (ip == "0")
|
||||
ip.clear();
|
||||
User *user = do_nick("", params[0], params[4], params[9], source, params[10], Anope::string(params[2]).is_pos_number_only() ? convertTo<time_t>(params[2]) : 0, ip, params[5], params[7], params[3]);
|
||||
if (user && user->server->IsSynced())
|
||||
if (nickserv && user && user->server->IsSynced())
|
||||
nickserv->Validate(user);
|
||||
|
||||
return true;
|
||||
@@ -663,12 +663,13 @@ class ProtoPlexus : public Module
|
||||
|
||||
void OnServerSync(Server *s)
|
||||
{
|
||||
for (Anope::insensitive_map<User *>::iterator it = UserListByNick.begin(); it != UserListByNick.end(); ++it)
|
||||
{
|
||||
User *u = it->second;
|
||||
if (u->server == s && !u->IsIdentified())
|
||||
nickserv->Validate(u);
|
||||
}
|
||||
if (nickserv)
|
||||
for (Anope::insensitive_map<User *>::iterator it = UserListByNick.begin(); it != UserListByNick.end(); ++it)
|
||||
{
|
||||
User *u = it->second;
|
||||
if (u->server == s && !u->IsIdentified())
|
||||
nickserv->Validate(u);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+25
-15
@@ -372,14 +372,6 @@ bool ValidatePort(ServerConfig *, const Anope::string &tag, const Anope::string
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ValidateGuestPrefix(ServerConfig *conf, const Anope::string &tag, const Anope::string &value, ValueItem &data)
|
||||
{
|
||||
ValidateNotEmpty(conf, tag, value, data);
|
||||
if (data.GetValue().length() > 21)
|
||||
throw ConfigException("The value for <nickserv:guestnickprefix> cannot exceed 21 characters in length!");
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ValidateBantype(ServerConfig *, const Anope::string &, const Anope::string &, ValueItem &data)
|
||||
{
|
||||
int bantype = data.GetInteger();
|
||||
@@ -388,6 +380,24 @@ bool ValidateBantype(ServerConfig *, const Anope::string &, const Anope::string
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ValidateNickServ(ServerConfig *config, const Anope::string &tag, const Anope::string &value, ValueItem &data)
|
||||
{
|
||||
if (!config->NickServ.empty())
|
||||
{
|
||||
if (value.equals_ci("releasetimeout") || value.equals_ci("accessmax") || value.equals_ci("listmax"))
|
||||
return ValidateNotZero(config, tag, value, data);
|
||||
else if (value.equals_ci("enforceruser") || value.equals_ci("enforcerhost"))
|
||||
return ValidateNotEmpty(config, tag, value, data);
|
||||
else if (value.equals_ci("guestnickprefix"))
|
||||
{
|
||||
ValidateNotEmpty(config, tag, value, data);
|
||||
if (data.GetValue().length() > 21)
|
||||
throw ConfigException("The value for <nickserv:guestnickprefix> cannot exceed 21 characters in length!");
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ValidateChanServ(ServerConfig *config, const Anope::string &tag, const Anope::string &value, ValueItem &data)
|
||||
{
|
||||
if (!config->ChanServ.empty())
|
||||
@@ -1144,14 +1154,14 @@ ConfigItems::ConfigItems(ServerConfig *conf)
|
||||
{"nickserv", "suspendexpire", "0", new ValueContainerTime(&conf->NSSuspendExpire), DT_TIME, NoValidation},
|
||||
{"nickserv", "unconfirmedexpire", "0", new ValueContainerTime(&conf->NSUnconfirmedExpire), DT_TIME, ValidateEmailReg},
|
||||
{"nickserv", "maxaliases", "0", new ValueContainerUInt(&conf->NSMaxAliases), DT_UINTEGER, NoValidation},
|
||||
{"nickserv", "accessmax", "0", new ValueContainerUInt(&conf->NSAccessMax), DT_UINTEGER, ValidateNotZero},
|
||||
{"nickserv", "enforceruser", "", new ValueContainerString(&conf->NSEnforcerUser), DT_STRING, ValidateNotEmpty},
|
||||
{"nickserv", "enforcerhost", "", new ValueContainerString(&conf->NSEnforcerHost), DT_STRING, ValidateNotEmpty},
|
||||
{"nickserv", "releasetimeout", "0", new ValueContainerTime(&conf->NSReleaseTimeout), DT_TIME, ValidateNotZero},
|
||||
{"nickserv", "accessmax", "0", new ValueContainerUInt(&conf->NSAccessMax), DT_UINTEGER, ValidateNickServ},
|
||||
{"nickserv", "enforceruser", "", new ValueContainerString(&conf->NSEnforcerUser), DT_STRING, ValidateNickServ},
|
||||
{"nickserv", "enforcerhost", "", new ValueContainerString(&conf->NSEnforcerHost), DT_STRING, ValidateNickServ},
|
||||
{"nickserv", "releasetimeout", "0", new ValueContainerTime(&conf->NSReleaseTimeout), DT_TIME, ValidateNickServ},
|
||||
{"nickserv", "allowkillimmed", "no", new ValueContainerBool(&conf->NSAllowKillImmed), DT_BOOLEAN | DT_NORELOAD, NoValidation},
|
||||
{"nickserv", "nogroupchange", "no", new ValueContainerBool(&conf->NSNoGroupChange), DT_BOOLEAN, NoValidation},
|
||||
{"nickserv", "listmax", "0", new ValueContainerUInt(&conf->NSListMax), DT_UINTEGER, ValidateNotZero},
|
||||
{"nickserv", "guestnickprefix", "", new ValueContainerString(&conf->NSGuestNickPrefix), DT_STRING, ValidateGuestPrefix},
|
||||
{"nickserv", "listmax", "0", new ValueContainerUInt(&conf->NSListMax), DT_UINTEGER, ValidateNickServ},
|
||||
{"nickserv", "guestnickprefix", "", new ValueContainerString(&conf->NSGuestNickPrefix), DT_STRING, ValidateNickServ},
|
||||
{"nickserv", "secureadmins", "no", new ValueContainerBool(&conf->NSSecureAdmins), DT_BOOLEAN, NoValidation},
|
||||
{"nickserv", "strictprivileges", "no", new ValueContainerBool(&conf->NSStrictPrivileges), DT_BOOLEAN, NoValidation},
|
||||
{"nickserv", "modeonid", "no", new ValueContainerBool(&conf->NSModeOnID), DT_BOOLEAN, NoValidation},
|
||||
@@ -1299,7 +1309,7 @@ ConfigItems::~ConfigItems()
|
||||
void ServerConfig::Read()
|
||||
{
|
||||
// These tags MUST occur and must ONLY occur once in the config file
|
||||
static const Anope::string Once[] = {"serverinfo", "networkinfo", "options", "nickserv", ""};
|
||||
static const Anope::string Once[] = {"serverinfo", "networkinfo", "options", ""};
|
||||
|
||||
this->LoadConf(services_conf);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user