]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Clean up unused functions, add nonicks operoverride [dKingston]
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>
Thu, 22 Oct 2009 00:09:15 +0000 (00:09 +0000)
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>
Thu, 22 Oct 2009 00:09:15 +0000 (00:09 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11951 e03df62e-2008-0410-955e-edbf42e46eb7

include/inspircd.h
src/modules/m_httpd_stats.cpp
src/modules/m_nonicks.cpp
src/server.cpp

index 4198864ca5e5483579f20168473362d1d0e800a5..9156d3444d15cb1006c599b57ae2978bae09c0a3 100644 (file)
@@ -738,11 +738,6 @@ class CoreExport InspIRCd
         */
        bool SilentULine(const std::string& server);
 
-       /** Returns the subversion revision ID of this ircd
-        * @return The revision ID or an empty string
-        */
-       std::string GetRevision();
-
        /** Returns the full version string of this ircd
         * @return The version string
         */
index 8899a363ec6760d60ad13725b00b7a28e55a3b56..7e478ade4126d290a68e4c9e19e8c21e4024ecdc 100644 (file)
@@ -96,8 +96,7 @@ class ModuleHttpStats : public Module
 
                                data << "<server><name>" << ServerInstance->Config->ServerName << "</name><gecos>"
                                        << Sanitize(ServerInstance->Config->ServerDesc) << "</gecos><version>"
-                                       << Sanitize(ServerInstance->GetVersionString()) << "</version><revision>"
-                                       << Sanitize(ServerInstance->GetRevision()) << "</revision></server>";
+                                       << Sanitize(ServerInstance->GetVersionString()) << "</version></server>";
 
                                data << "<general>";
                                data << "<usercount>" << ServerInstance->Users->clientlist->size() << "</usercount>";
index 368eaa34354d736dd4edc64a90189d5b00405352..e7903acc411ebf21b8e6f0561e40e4006c72850b 100644 (file)
@@ -46,11 +46,13 @@ class NoNicks : public ModeHandler
 class ModuleNoNickChange : public Module
 {
        NoNicks nn;
+       bool override;
  public:
        ModuleNoNickChange() : nn(this)
        {
+               OnRehash(NULL);
                ServerInstance->Modes->AddMode(&nn);
-               Implementation eventlist[] = { I_OnUserPreNick, I_On005Numeric };
+               Implementation eventlist[] = { I_OnUserPreNick, I_On005Numeric, I_OnRehash };
                ServerInstance->Modules->Attach(eventlist, this, 2);
        }
 
@@ -91,6 +93,9 @@ class ModuleNoNickChange : public Module
                        if (res == MOD_RES_ALLOW)
                                continue;
 
+                       if (override && IS_OPER(user))
+                               continue;
+
                        if (!curr->GetExtBanStatus(user, 'N').check(!curr->IsModeSet('N')))
                        {
                                user->WriteNumeric(ERR_CANTCHANGENICK, "%s :Can't change nickname while on %s (+N is set)",
@@ -101,6 +106,12 @@ class ModuleNoNickChange : public Module
 
                return MOD_RES_PASSTHRU;
        }
+
+       virtual void OnRehash(User* user)
+       {
+               ConfigReader Conf;
+               override = Conf.ReadFlag("nonicks", "operoverride", "no", 0);
+       }
 };
 
 MODULE_INIT(ModuleNoNickChange)
index 8b2c9a67247874d779a4e3db38a71cf97f601cfe..57b853ebb1efdac7e616b021ddbd5efd84f430e9 100644 (file)
 #include "inspircd.h"
 #include "inspircd_version.h"
 
-
 void InspIRCd::SignalHandler(int signal)
 {
-       switch (signal)
+       if (signal == SIGHUP)
+       {
+               Rehash("Caught SIGHUP");
+       }
+       else if (signal == SIGTERM)
        {
-               case SIGHUP:
-                       Rehash("due to SIGHUP");
-                       break;
-               case SIGTERM:
-                       Exit(signal);
-                       break;
+               Exit(signal);
        }
 }
 
@@ -61,11 +59,6 @@ void RehashHandler::Call(const std::string &reason)
        }
 }
 
-void InspIRCd::RehashServer()
-{
-       this->Rehash("");
-}
-
 std::string InspIRCd::GetVersionString()
 {
        char versiondata[MAXBUF];
@@ -92,11 +85,6 @@ void InspIRCd::BuildISupport()
        Config->Update005();
 }
 
-std::string InspIRCd::GetRevision()
-{
-       return REVISION;
-}
-
 void InspIRCd::IncrementUID(int pos)
 {
        /*