]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_cgiirc.cpp
Make User:: nick/ident/dhost/fullname and some other things std::string instead of...
[user/henk/code/inspircd.git] / src / modules / m_cgiirc.cpp
index 3f7e27418a34bdbd025d8094d55f7107a4095baf..51f74f31b3b42c66c7abd60620e85ab1262ccae5 100644 (file)
@@ -61,7 +61,7 @@ class CommandWebirc : public Command
                        this->source = "m_cgiirc.so";
                        this->syntax = "password client hostname ip";
                }
-               CmdResult Handle(const char* const* parameters, int pcnt, User *user)
+               CmdResult Handle(const std::vector<std::string> &parameters, User *user)
                {
                        if(user->registered == REG_ALL)
                                return CMD_FAILURE;
@@ -75,7 +75,7 @@ class CommandWebirc : public Command
                                                user->Extend("cgiirc_realhost", new std::string(user->host));
                                                user->Extend("cgiirc_realip", new std::string(user->GetIPString()));
                                                if (notify)
-                                                       ServerInstance->SNO->WriteToSnoMask('A', "Connecting user %s detected as using CGI:IRC (%s), changing real host to %s from %s", user->nick, user->host, parameters[2], user->host);
+                                                       ServerInstance->SNO->WriteToSnoMask('A', "Connecting user %s detected as using CGI:IRC (%s), changing real host to %s from %s", user->nick, user->host, parameters[2].c_str(), user->host);
                                                user->Extend("cgiirc_webirc_hostname", new std::string(parameters[2]));
                                                user->Extend("cgiirc_webirc_ip", new std::string(parameters[3]));
                                                return CMD_LOCALONLY;
@@ -114,6 +114,7 @@ class CGIResolver : public Resolver
                        strlcpy(them->dhost, result.c_str(), 63);
                        strlcpy(them->ident, "~cgiirc", 8);
                        them->InvalidateCache();
+                       them->CheckLines();
                }
        }
 
@@ -157,6 +158,7 @@ public:
        virtual void OnRehash(User* user, const std::string &parameter)
        {
                ConfigReader Conf(ServerInstance);
+               Hosts.clear();
                
                NotifyOpers = Conf.ReadFlag("cgiirc", "opernotice", 0); // If we send an oper notice when a CGI:IRC has their host changed.
                
@@ -266,20 +268,24 @@ public:
                                if(iter->type == PASS)
                                {
                                        CheckPass(user); // We do nothing if it fails so...
+                                       user->CheckLines();
                                }
                                else if(iter->type == PASSFIRST && !CheckPass(user))
                                {
                                        // If the password lookup failed, try the ident
                                        CheckIdent(user);       // If this fails too, do nothing
+                                       user->CheckLines();
                                }
                                else if(iter->type == IDENT)
                                {
                                        CheckIdent(user); // Nothing on failure.
+                                       user->CheckLines();
                                }
                                else if(iter->type == IDENTFIRST && !CheckIdent(user))
                                {
                                        // If the ident lookup fails, try the password.
                                        CheckPass(user);
+                                       user->CheckLines();
                                }
                                else if(iter->type == WEBIRC)
                                {
@@ -322,6 +328,7 @@ public:
                        ServerInstance->Users->AddLocalClone(user);
                        ServerInstance->Users->AddGlobalClone(user);
                        user->CheckClass();
+                       user->CheckLines();
                }
        }
 
@@ -369,7 +376,7 @@ public:
                                catch (...)
                                {
                                        if (NotifyOpers)
-                                               ServerInstance->SNO->WriteToSnoMask('A', "Connecting user %s detected as using CGI:IRC (%s), but i could not resolve their hostname!", user->nick, user->host);
+                                               ServerInstance->SNO->WriteToSnoMask('A', "Connecting user %s detected as using CGI:IRC (%s), but I could not resolve their hostname!", user->nick, user->host);
                                }
                        }
                        
@@ -434,7 +441,7 @@ public:
                        user->InvalidateCache();
 
                        if(NotifyOpers)
-                                ServerInstance->SNO->WriteToSnoMask('A', "Connecting user %s detected as using CGI:IRC (%s), but i could not resolve their hostname!", user->nick, user->host);
+                                ServerInstance->SNO->WriteToSnoMask('A', "Connecting user %s detected as using CGI:IRC (%s), but I could not resolve their hostname!", user->nick, user->host);
                }
                /*strlcpy(user->host, newip, 16);
                strlcpy(user->dhost, newip, 16);
@@ -519,7 +526,7 @@ public:
         
        virtual Version GetVersion()
        {
-               return Version(1,1,0,0,VF_VENDOR,API_VERSION);
+               return Version(1,2,0,0,VF_VENDOR,API_VERSION);
        }
        
 };