From 8830c2848b10755096eab2f46fd4bfd08f731a53 Mon Sep 17 00:00:00 2001 From: w00t Date: Mon, 15 Oct 2007 22:33:18 +0000 Subject: Move oper classes and types stuff from users to configreader. It may need to go in a class, I'm not going to investigate that now. Also make HasPermission() a bit easier to read via same changes I did in command_parse, but the strtok/strdup stuff really really has to go somehow I think.. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8215 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/configreader.cpp | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) (limited to 'src/configreader.cpp') diff --git a/src/configreader.cpp b/src/configreader.cpp index 776793405..98092f57e 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -1777,3 +1777,74 @@ bool ValueItem::GetBool() { return (GetInteger() || v == "yes" || v == "true"); } + + + + +/* + * XXX should this be in a class? -- w00t + */ +bool InitTypes(ServerConfig* conf, const char* tag) +{ + if (conf->opertypes.size()) + { + for (opertype_t::iterator n = conf->opertypes.begin(); n != conf->opertypes.end(); n++) + { + if (n->second) + delete[] n->second; + } + } + + conf->opertypes.clear(); + return true; +} + +/* + * XXX should this be in a class? -- w00t + */ +bool InitClasses(ServerConfig* conf, const char* tag) +{ + if (conf->operclass.size()) + { + for (operclass_t::iterator n = conf->operclass.begin(); n != conf->operclass.end(); n++) + { + if (n->second) + delete[] n->second; + } + } + + conf->operclass.clear(); + return true; +} + +/* + * XXX should this be in a class? -- w00t + */ +bool DoType(ServerConfig* conf, const char* tag, char** entries, ValueList &values, int* types) +{ + const char* TypeName = values[0].GetString(); + const char* Classes = values[1].GetString(); + + conf->opertypes[TypeName] = strnewdup(Classes); + return true; +} + +/* + * XXX should this be in a class? -- w00t + */ +bool DoClass(ServerConfig* conf, const char* tag, char** entries, ValueList &values, int* types) +{ + const char* ClassName = values[0].GetString(); + const char* CommandList = values[1].GetString(); + + conf->operclass[ClassName] = strnewdup(CommandList); + return true; +} + +/* + * XXX should this be in a class? -- w00t + */ +bool DoneClassesAndTypes(ServerConfig* conf, const char* tag) +{ + return true; +} -- cgit v1.3.1-10-gc9f91