]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_operlevels.cpp
m_remove, m_services_account Don't check whether nicks are u-lined, checking the...
[user/henk/code/inspircd.git] / src / modules / m_operlevels.cpp
index da506dd582e0c164cc240a68e4b24d9b483fa318..4fc4c6aef7b8f97654a53b81e2ebb92d9916a104 100644 (file)
@@ -29,17 +29,7 @@ class ModuleOperLevels : public Module
        public:
                ModuleOperLevels()
                {
-                       Implementation eventlist[] = { I_OnRehash, I_OnKill };
-                       ServerInstance->Modules->Attach(eventlist, this, 2);
-               }
-
-               virtual ~ModuleOperLevels()
-               {
-               }
-
-
-               virtual void OnRehash(User* user)
-               {
+                       ServerInstance->Modules->Attach(I_OnKill, this);
                }
 
                virtual Version GetVersion()
@@ -52,8 +42,11 @@ class ModuleOperLevels : public Module
                        // oper killing an oper?
                        if (IS_OPER(dest) && IS_OPER(source))
                        {
-                               long dest_level = atol(dest->oper->getConfig("level").c_str());
-                               long source_level = atol(source->oper->getConfig("level").c_str());
+                               std::string level = dest->oper->getConfig("level");
+                               long dest_level = atol(level.c_str());
+                               level = source->oper->getConfig("level");
+                               long source_level = atol(level.c_str());
+
                                if (dest_level > source_level)
                                {
                                        if (IS_LOCAL(source)) ServerInstance->SNO->WriteGlobalSno('a', "Oper %s (level %ld) attempted to /kill a higher oper: %s (level %ld): Reason: %s",source->nick.c_str(),source_level,dest->nick.c_str(),dest_level,reason.c_str());
@@ -64,7 +57,6 @@ class ModuleOperLevels : public Module
                        }
                        return MOD_RES_PASSTHRU;
                }
-
 };
 
 MODULE_INIT(ModuleOperLevels)