1
0
mirror of https://github.com/anope/anope.git synced 2026-06-29 02:26:38 +02:00

Some access level fixes from Robby to more closely match the historic levels, and some code cleanup

This commit is contained in:
Adam
2012-05-26 02:15:48 -04:00
parent 38d5f20deb
commit 2cbfbc98e9
5 changed files with 59 additions and 43 deletions
+3 -10
View File
@@ -895,7 +895,7 @@ static bool DoPrivileges(ServerConfig *config, const Anope::string &, const Anop
{
Anope::string name = values[0].GetValue();
Anope::string desc = values[1].GetValue();
Anope::string rank = values[2].GetValue();
int rank = values[2].GetInteger();
ValueItem vi(name);
if (!ValidateNotEmpty(config, "privilege", "name", vi))
@@ -905,14 +905,7 @@ static bool DoPrivileges(ServerConfig *config, const Anope::string &, const Anop
if (!ValidateNotEmpty(config, "privilege", "desc", vi))
throw ConfigException("One or more values in your configuration file failed to validate. Please see your log for more information.");
int irank = 0;
try
{
irank = convertTo<int>(rank);
}
catch (const ConvertException &) { }
PrivilegeManager::AddPrivilege(Privilege(name, desc, irank));
PrivilegeManager::AddPrivilege(Privilege(name, desc, rank));
return true;
}
@@ -1353,7 +1346,7 @@ ConfigItems::ConfigItems(ServerConfig *conf)
{"privilege",
{"name", "desc", "rank", ""},
{"", "", "", ""},
{DT_STRING, DT_STRING, DT_STRING, DT_STRING},
{DT_STRING, DT_STRING, DT_INTEGER, DT_STRING},
InitPrivileges, DoPrivileges, DonePrivileges},
{"",
{""},