summaryrefslogtreecommitdiff
path: root/src/modules/extra
diff options
context:
space:
mode:
authorom <om@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-23 03:16:09 +0000
committerom <om@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-23 03:16:09 +0000
commite09d69dc5399f5207da9512f2d2750ff4df394be (patch)
treec71b670e63e738546db2e70e6ed94b909e4f0617 /src/modules/extra
parente68d257ccd7a54fd3e92285ba604b7c35943c72a (diff)
Tidyups, optimisations and make the log messages make sense...
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4522 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/extra')
-rw-r--r--src/modules/extra/m_sqloper.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/modules/extra/m_sqloper.cpp b/src/modules/extra/m_sqloper.cpp
index e103a1f4b..bab467a35 100644
--- a/src/modules/extra/m_sqloper.cpp
+++ b/src/modules/extra/m_sqloper.cpp
@@ -210,27 +210,28 @@ public:
return NULL;
}
- bool OperUser(userrec* user, const std::string &username, const std::string &password, const std::string &hostname, const std::string &type)
+ bool OperUser(userrec* user, const std::string &username, const std::string &password, const std::string &pattern, const std::string &type)
{
ConfigReader Conf;
for (int j = 0; j < Conf.Enumerate("type"); j++)
{
- std::string TypeName = Conf.ReadValue("type","name",j);
+ std::string tname = Conf.ReadValue("type","name",j);
- Srv->Log(DEBUG,"Scanning opertype: "+TypeName);
+ log(DEBUG, "Scanning opertype: %s", tname.c_str());
- std::string pattern = std::string(user->ident) + "@" + std::string(user->host);
+ std::string hostname(user->ident);
+ hostname.append("@").append(user->host);
- if((TypeName == type) && OneOfMatches(pattern.c_str(), hostname.c_str()))
+ if((tname == type) && OneOfMatches(hostname.c_str(), pattern.c_str()))
{
- /* found this oper's opertype */
- Srv->Log(DEBUG,"Host and type match: "+TypeName+" "+type);
+ /* Opertype and host match, looks like this is it. */
+ log(DEBUG, "Host (%s matched %s) and type (%s)", pattern.c_str(), hostname.c_str(), type.c_str());
- std::string HostName = Conf.ReadValue("type","host",j);
+ std::string operhost = Conf.ReadValue("type", "host", j);
- if(HostName.size())
- Srv->ChangeHost(user, HostName);
+ if(operhost.size())
+ Srv->ChangeHost(user, operhost);
strlcpy(user->oper, type.c_str(), NICKMAX-1);