diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-07-26 19:45:50 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-07-26 19:45:50 +0000 |
commit | 8e7e59aa487e07ca63964379cc4c64189dbeef56 (patch) | |
tree | 3ca0cf70432bced632d3ddc66f2375957232e1b2 | |
parent | 7ea099f8d1274e709a8a201a4a0e446135fbb5c5 (diff) |
Set defaults for an enum
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7583 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | src/modules/m_cgiirc.cpp | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp index 290f55d22..d82705d81 100644 --- a/src/modules/m_cgiirc.cpp +++ b/src/modules/m_cgiirc.cpp @@ -23,7 +23,7 @@ /* $ModDesc: Change user's hosts connecting from known CGI:IRC hosts */ -enum CGItype { PASS, IDENT, PASSFIRST, IDENTFIRST, WEBIRC }; +enum CGItype { INVALID, PASS, IDENT, PASSFIRST, IDENTFIRST, WEBIRC }; /** Holds a CGI site's details @@ -162,19 +162,26 @@ public: if(hostmask.length()) { - if(type == "webirc" && !password.length()) { + if (type == "webirc" && !password.length()) { ServerInstance->Log(DEFAULT, "m_cgiirc: Missing password in config: %s", hostmask.c_str()); - } else { - CGItype cgitype; - if(type == "pass") + } + else + { + CGItype cgitype = INVALID; + if (type == "pass") cgitype = PASS; - else if(type == "ident") + else if (type == "ident") cgitype = IDENT; - else if(type == "passfirst") + else if (type == "passfirst") cgitype = PASSFIRST; - else if(type == "webirc") { + else if (type == "webirc") + { cgitype = WEBIRC; } + + if (cgitype == INVALID) + cgitype = PASS; + Hosts.push_back(CGIhost(hostmask,cgitype, password.length() ? password : "" )); } } |