]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_jumpserver.cpp
Use loopCall to protect OnUserKick rather than the triggerevents hack
[user/henk/code/inspircd.git] / src / modules / m_jumpserver.cpp
index 535edb641052f9ad0ca1007b2058846d96372829..2fb509af195c80c0662397e6d174451f70252961 100644 (file)
@@ -3,7 +3,7 @@
  *       +------------------------------------+
  *
  *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
+ * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
  *            the file COPYING for details.
@@ -27,10 +27,10 @@ class CommandJumpserver : public Command
        std::string reason;
        int port;
 
-       CommandJumpserver (InspIRCd* Instance) : Command(Instance, "JUMPSERVER", "o", 0)
+       CommandJumpserver (InspIRCd* Instance) : Command(Instance, "JUMPSERVER", "o", 0, 4)
        {
                this->source = "m_jumpserver.so";
-               syntax = "[<server> <port> <+/-a> :<reason>]";
+               syntax = "[<server> <port> <+/-an> <reason>]";
                redirect_to.clear();
                reason.clear();
                port = 0;
@@ -80,9 +80,19 @@ class CommandJumpserver : public Command
                                        case 'n':
                                                redirect_new_users = direction;
                                        break;
+                                       default:
+                                               user->WriteServ("NOTICE %s :*** Invalid JUMPSERVER flag: %c", user->nick.c_str(), *n);
+                                               return CMD_FAILURE;
+                                       break;
                                }
                        }
 
+                       if (!atoi(parameters[1].c_str()))
+                       {
+                               user->WriteServ("NOTICE %s :*** Invalid port number", user->nick.c_str());
+                               return CMD_FAILURE;
+                       }
+
                        if (redirect_all_immediately)
                        {
                                /* Redirect everyone but the oper sending the command */