]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_customtitle.cpp
Should now work with ports bound to all interfaces
[user/henk/code/inspircd.git] / src / modules / m_customtitle.cpp
index e3d84e10f6eb24fad1dba8acfa000495ed75b6d6..8e87b79b47bbf97bdff86a10815cfc7358d7bd4d 100644 (file)
@@ -43,7 +43,7 @@ bool OneOfMatches(const char* host, const char* ip, const char* hostlist)
     return false;
 }
 
-       CmdResult Handle(const char** parameters, int pcnt, User* user)
+       CmdResult Handle(const char* const* parameters, int pcnt, User* user)
        {
                if (!IS_LOCAL(user))
                        return CMD_LOCALONLY;
@@ -59,11 +59,12 @@ bool OneOfMatches(const char* host, const char* ip, const char* hostlist)
                {
                        std::string name = Conf.ReadValue("title", "name", "", i);
                        std::string pass = Conf.ReadValue("title", "password", "", i);
+                       std::string hash = Conf.ReadValue("title", "hash", "", i);
                        std::string host = Conf.ReadValue("title", "host", "*@*", i);
                        std::string title = Conf.ReadValue("title", "title", "", i);
                        std::string vhost = Conf.ReadValue("title", "vhost", "", i);
 
-                       if (!strcmp(name.c_str(),parameters[0]) && !strcmp(pass.c_str(),parameters[1]) && OneOfMatches(TheHost,TheIP,host.c_str()) && !title.empty())
+                       if (!strcmp(name.c_str(),parameters[0]) && !ServerInstance->PassCompare(user, pass.c_str(), parameters[1], hash.c_str()) && OneOfMatches(TheHost,TheIP,host.c_str()) && !title.empty())
                        {
                                std::string* text;
                                user->GetExt("ctitle", text);
@@ -208,8 +209,8 @@ class ModuleCustomTitle : public Module
                        std::string* text;
                        if (!dest->GetExt("ctitle", text))
                        {
-                               std::string* text = new std::string(extdata);
-                               dest->Extend("ctitle",text);
+                               std::string* ntext = new std::string(extdata);
+                               dest->Extend("ctitle",ntext);
                        }
                }
        }
@@ -220,7 +221,7 @@ class ModuleCustomTitle : public Module
        
        virtual Version GetVersion()
        {
-               return Version(1, 1, 0, 0, VF_COMMON | VF_VENDOR, API_VERSION);
+               return Version(1, 2, 0, 0, VF_COMMON | VF_VENDOR, API_VERSION);
        }
 };