]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_cgiirc.cpp
Fix iteration of oper blocks by SSLINFO
[user/henk/code/inspircd.git] / src / modules / m_cgiirc.cpp
index 5f8cfeca7414871d135cd6caf13c0d5ebb0666af..996ba7199a17ca4204fa7dcb1b613fb496edb9c4 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2010 InspIRCd Development Team
  * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
@@ -103,16 +103,16 @@ class CGIResolver : public Resolver
 {
        std::string typ;
        int theirfd;
-       User* them;
+       LocalUser* them;
        bool notify;
  public:
-       CGIResolver(Module* me, bool NotifyOpers, const std::string &source, bool forward, User* u, int userfd, const std::string &type, bool &cached)
+       CGIResolver(Module* me, bool NotifyOpers, const std::string &source, bool forward, LocalUser* u, int userfd, const std::string &type, bool &cached)
                : Resolver(source, forward ? DNS_QUERY_A : DNS_QUERY_PTR4, cached, me), typ(type), theirfd(userfd), them(u), notify(NotifyOpers) { }
 
        virtual void OnLookupComplete(const std::string &result, unsigned int ttl, bool cached)
        {
                /* Check the user still exists */
-               if ((them) && (them == ServerInstance->SE->GetRef(theirfd)))
+               if ((them) && (&them->eh == ServerInstance->SE->GetRef(theirfd)))
                {
                        if (notify)
                                ServerInstance->SNO->WriteGlobalSno('a', "Connecting user %s detected as using CGI:IRC (%s), changing real host to %s from %s", them->nick.c_str(), them->host.c_str(), result.c_str(), typ.c_str());
@@ -129,7 +129,7 @@ class CGIResolver : public Resolver
 
        virtual void OnError(ResolverError e, const std::string &errormessage)
        {
-               if ((them) && (them == ServerInstance->SE->GetRef(theirfd)))
+               if ((them) && (&them->eh == ServerInstance->SE->GetRef(theirfd)))
                {
                        if (notify)
                                ServerInstance->SNO->WriteToSnoMask('a', "Connecting user %s detected as using CGI:IRC (%s), but their host can't be resolved from their %s!", them->nick.c_str(), them->host.c_str(), typ.c_str());
@@ -155,8 +155,8 @@ public:
                ServerInstance->Extensions.Register(&cmd.webirc_hostname);
                ServerInstance->Extensions.Register(&cmd.webirc_ip);
 
-               Implementation eventlist[] = { I_OnRehash, I_OnUserRegister, I_OnSyncUser, I_OnDecodeMetaData, I_OnUserDisconnect, I_OnUserConnect };
-               ServerInstance->Modules->Attach(eventlist, this, 6);
+               Implementation eventlist[] = { I_OnRehash, I_OnUserRegister, I_OnDecodeMetaData, I_OnUserDisconnect, I_OnUserConnect };
+               ServerInstance->Modules->Attach(eventlist, this, 5);
        }
 
 
@@ -272,6 +272,7 @@ public:
                        cmd.webirc_ip.unset(user);
                        ServerInstance->Users->AddLocalClone(user);
                        ServerInstance->Users->AddGlobalClone(user);
+                       user->SetClass();
                        user->CheckClass();
                        user->CheckLines(true);
                }
@@ -292,6 +293,7 @@ public:
                        valid = user->SetClientIP(user->password.c_str());
                        ServerInstance->Users->AddLocalClone(user);
                        ServerInstance->Users->AddGlobalClone(user);
+                       user->SetClass();
                        user->CheckClass();
 
                        if (valid)
@@ -350,6 +352,7 @@ public:
                user->SetClientIP(newipstr);
                ServerInstance->Users->AddLocalClone(user);
                ServerInstance->Users->AddGlobalClone(user);
+               user->SetClass();
                user->CheckClass();
                user->host = newipstr;
                user->dhost = newipstr;