diff options
-rw-r--r-- | docs/modules.conf.example | 4 | ||||
-rw-r--r-- | src/modules/m_jumpserver.cpp | 9 | ||||
-rw-r--r-- | src/modules/m_lockserv.cpp | 12 |
3 files changed, 14 insertions, 11 deletions
diff --git a/docs/modules.conf.example b/docs/modules.conf.example index 1bd91c293..0358703b7 100644 --- a/docs/modules.conf.example +++ b/docs/modules.conf.example @@ -953,6 +953,8 @@ # Jump Server module: Adds support for the RPL_REDIR numeric # This module is oper-only. # To use, JUMPSERVER must be in one of your oper class blocks. +# If your server is redirecting new clients and you get disconnected, +# do a REHASH from shell to open up again. #<module name="m_jumpserver.so"> #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# @@ -1038,7 +1040,7 @@ # These commands require OPER status and that the LOCKSERV UNLOCKSERV # # are specified in a <class> tag that the oper is part of. This is so # # you can control who has access to this possible dangerous command. # -# If your server is locked and you got disconnected, do a REHASH from # +# If your server is locked and you get disconnected, do a REHASH from # # shell to open up again. # # This module is oper-only. diff --git a/src/modules/m_jumpserver.cpp b/src/modules/m_jumpserver.cpp index 56e45d77e..416b25dd3 100644 --- a/src/modules/m_jumpserver.cpp +++ b/src/modules/m_jumpserver.cpp @@ -138,8 +138,8 @@ class ModuleJumpServer : public Module ModuleJumpServer() : js(this) { ServerInstance->AddCommand(&js); - Implementation eventlist[] = { I_OnUserRegister }; - ServerInstance->Modules->Attach(eventlist, this, 1); + Implementation eventlist[] = { I_OnUserRegister, I_OnRehash }; + ServerInstance->Modules->Attach(eventlist, this, 2); } virtual ~ModuleJumpServer() @@ -158,6 +158,11 @@ class ModuleJumpServer : public Module return MOD_RES_PASSTHRU; } + virtual void OnRehash(User* user) + { + // Emergency way to unlock + if (!user) js.redirect_new_users = false; + } virtual Version GetVersion() { diff --git a/src/modules/m_lockserv.cpp b/src/modules/m_lockserv.cpp index 6e92cfd40..7f1ae0bd5 100644 --- a/src/modules/m_lockserv.cpp +++ b/src/modules/m_lockserv.cpp @@ -68,15 +68,10 @@ private: CommandLockserv lockcommand; CommandUnlockserv unlockcommand; - virtual void ResetLocked() - { - locked = false; - } - public: ModuleLockserv() : lockcommand(this, locked), unlockcommand(this, locked) { - ResetLocked(); + locked = false; ServerInstance->AddCommand(&lockcommand); ServerInstance->AddCommand(&unlockcommand); Implementation eventlist[] = { I_OnUserRegister, I_OnRehash, I_OnCheckReady }; @@ -90,7 +85,8 @@ public: virtual void OnRehash(User* user) { - ResetLocked(); + // Emergency way to unlock + if (!user) locked = false; } virtual ModResult OnUserRegister(LocalUser* user) @@ -110,7 +106,7 @@ public: virtual Version GetVersion() { - return Version("Allows locking of the server to stop all incoming connections till unlocked again", VF_VENDOR); + return Version("Allows locking of the server to stop all incoming connections until unlocked again", VF_VENDOR); } }; |