From 8e7e59aa487e07ca63964379cc4c64189dbeef56 Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 26 Jul 2007 19:45:50 +0000 Subject: Set defaults for an enum git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7583 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_cgiirc.cpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'src') 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 : "" )); } } -- cgit v1.2.3