diff options
-rw-r--r-- | docs/inspircd.conf.example | 16 | ||||
-rw-r--r-- | src/configparser.cpp | 9 | ||||
-rw-r--r-- | src/users.cpp | 4 |
3 files changed, 25 insertions, 4 deletions
diff --git a/docs/inspircd.conf.example b/docs/inspircd.conf.example index 5a5a6c7c5..43afc22f0 100644 --- a/docs/inspircd.conf.example +++ b/docs/inspircd.conf.example @@ -20,7 +20,6 @@ # This is an example of the config file for InspIRCd. # # Change the options to suit your network # # # -# $Id$ # # # ____ _ _____ _ _ ____ _ _ _ # # | _ \ ___ __ _ __| | |_ _| |__ (_)___ | __ )(_) |_| | # @@ -214,7 +213,14 @@ # and allow tags at the top, progressively more general, followed # # by a <connect allow="*" (should you wish to have one). # # # -# # +# Connect blocks are searched twice for each user - once when the TCP # +# connection is accepted, and once when the user completes their # +# registration. Most of the information (hostname, ident response, # +# password, SSL when using STARTTLS, etc) is only available during # +# the second search, so if you are trying to make a closed server, # +# you will probably need a connect block just for user registration. # +# This can be done by using <connect registered="no"> # + <connect # deny: Will not let people connect if they have specified host/IP. deny="69.254.*"> @@ -279,9 +285,13 @@ # block have a valid ident response, use SSL, or have authenticated. # Requires m_ident, m_sslinfo, or m_services_account respectively. requiressl="on" + # NOTE: For requireaccount, you must complete the signon prior to full + # connection. Currently, this is only possible by using SASL + # authentication; passforward and PRIVMSG NickServ happen after + # your final connect block has been found. # Alternate MOTD file for this connect class. The contents of this file are - # specified using <files secretmotd="filename"> or <execfiles ...> + # specified using <files secretmotd="filename"> or <execfiles ...> motd="secretmotd" # port: What port this user is allowed to connect on. (optional) diff --git a/src/configparser.cpp b/src/configparser.cpp index 558c49117..4a0c9b58d 100644 --- a/src/configparser.cpp +++ b/src/configparser.cpp @@ -429,7 +429,14 @@ bool ConfigTag::getBool(const std::string &key, bool def) if(!readString(key, result)) return def; - return (result == "yes" || result == "true" || result == "1" || result == "on"); + if (result == "yes" || result == "true" || result == "1" || result == "on") + return true; + if (result == "no" || result == "false" || result == "0" || result == "off") + return false; + + ServerInstance->Logs->Log("CONFIG",DEFAULT, "Value of <" + tag + ":" + key + "> at " + getTagLocation() + + " is not valid, ignoring"); + return def; } std::string ConfigTag::getTagLocation() diff --git a/src/users.cpp b/src/users.cpp index c01b5d1b2..62bf0f543 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -1646,6 +1646,10 @@ void LocalUser::SetClass(const std::string &explicit_name) continue; } + bool regdone = (registered != REG_NONE); + if (c->config->getBool("registered", regdone) != regdone) + continue; + /* we stop at the first class that meets ALL critera. */ found = c; break; |