diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-01-15 20:45:09 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-01-15 20:45:09 +0000 |
commit | f8cde1e7abd9024fb62310fef541af7c67ea8e63 (patch) | |
tree | 9290f39a486e0459542dc1f231224ea26ab89832 /src | |
parent | d920a2506f430ac466d2e9e33a4810c7dd92534d (diff) |
Made <disabled> non-manditory, added check for when singular tags arent defined at all
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2808 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/inspircd_io.cpp | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/src/inspircd_io.cpp b/src/inspircd_io.cpp index b71fc2f1e..3716057af 100644 --- a/src/inspircd_io.cpp +++ b/src/inspircd_io.cpp @@ -96,7 +96,8 @@ bool ServerConfig::DelIOHook(int port) bool ServerConfig::CheckOnce(char* tag, bool bail, userrec* user) { - if (ConfValueEnum(tag,&Config->config_f) > 1) + int count = ConfValueEnum(tag,&Config->config_f); + if (count > 1) { if (bail) { @@ -118,6 +119,28 @@ bool ServerConfig::CheckOnce(char* tag, bool bail, userrec* user) } return false; } + if (count < 1) + { + if (bail) + { + printf("There were errors in your configuration:\nYou have not defined a <%s> tag, this is required.",tag); + Exit(0); + } + else + { + if (user) + { + WriteServ(user->fd,"There were errors in your configuration:"); + WriteServ(user->fd,"You have not defined a <%s> tag, this is required.",tag); + } + else + { + WriteOpers("There were errors in the configuration file:"); + WriteOpers("You have not defined a <%s> tag, this is required.",tag); + } + } + return false; + } return true; } @@ -167,8 +190,7 @@ void ServerConfig::Read(bool bail, userrec* user) */ if (!CheckOnce("server",bail,user) || !CheckOnce("admin",bail,user) || !CheckOnce("files",bail,user) || !CheckOnce("power",bail,user) || !CheckOnce("options",bail,user) - || !CheckOnce("dns",bail,user) || !CheckOnce("options",bail,user) - || !CheckOnce("disabled",bail,user) || !CheckOnce("pid",bail,user)) + || !CheckOnce("dns",bail,user) || !CheckOnce("pid",bail,user)) { return; } |