1
0
mirror of https://github.com/anope/anope.git synced 2026-07-06 11:13:13 +02:00

Allow privilege descs to be read from the config to override the defaults

This commit is contained in:
Adam
2013-04-09 14:51:39 -05:00
parent b76b2e11c8
commit b244c74479
+3 -2
View File
@@ -812,13 +812,14 @@ static bool InitPrivileges(ServerConfig *config, const Anope::string &)
static bool DoPrivileges(ServerConfig *config, const Anope::string &, const Anope::string *, ValueList &values, int *)
{
Anope::string name = values[0].GetValue();
int rank = values[1].GetInteger();
Anope::string desc = values[1].GetValue();
int rank = values[2].GetInteger();
ValueItem vi(name);
if (!ValidateNotEmpty(config, "privilege", "name", vi))
throw ConfigException("One or more values in your configuration file failed to validate. Please see your log for more information.");
PrivilegeManager::AddPrivilege(Privilege(name, "", rank));
PrivilegeManager::AddPrivilege(Privilege(name, desc, rank));
return true;
}