flags |= FLAG_NO_INC;
if (tag->getBool("noexec", false))
flags |= FLAG_NO_EXEC;
+
if (!ParseFile(ServerInstance->Config->Paths.PrependConfig(name), flags, mandatorytag))
throw CoreException("Included");
}
+ else if (tag->readString("directory", name))
+ {
+ if (tag->getBool("noinclude", false))
+ flags |= FLAG_NO_INC;
+ if (tag->getBool("noexec", false))
+ flags |= FLAG_NO_EXEC;
+
+ const std::string includedir = ServerInstance->Config->Paths.PrependConfig(name);
+ std::vector<std::string> files;
+ if (!FileSystem::GetFileList(includedir, files, "*.conf"))
+ throw CoreException("Unable to read directory for include: " + includedir);
+
+ std::sort(files.begin(), files.end());
+ for (std::vector<std::string>::const_iterator iter = files.begin(); iter != files.end(); ++iter)
+ {
+ const std::string path = includedir + '/' + *iter;
+ if (!ParseFile(path, flags, mandatorytag))
+ throw CoreException("Included");
+ }
+ }
else if (tag->readString("executable", name))
{
if (flags & FLAG_NO_EXEC)
flags |= FLAG_NO_INC;
if (tag->getBool("noexec", true))
flags |= FLAG_NO_EXEC;
+
if (!ParseFile(name, flags, mandatorytag, true))
throw CoreException("Included");
}
if (!readString(key, duration))
return def;
- if (!InspIRCd::IsValidDuration(duration))
+ unsigned long ret;
+ if (!InspIRCd::Duration(duration, ret))
{
ServerInstance->Logs->Log("CONFIG", LOG_DEFAULT, "Value of <" + tag + ":" + key + "> at " + getTagLocation() +
" is not a duration; value set to " + ConvToStr(def) + ".");
return def;
}
- unsigned long ret = InspIRCd::Duration(duration);
CheckRange(tag, key, ret, def, min, max);
return ret;
}