From 4e97eb5f2e4cfa70a87c9ee6f3b63d4541bc05a9 Mon Sep 17 00:00:00 2001 From: daniel-Jones Date: Sun, 3 Dec 2017 22:04:32 +1030 Subject: removed kick test function, added ip restriction to /wallops --- miniircd | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/miniircd b/miniircd index f2e5694..6121632 100755 --- a/miniircd +++ b/miniircd @@ -510,14 +510,18 @@ class Client(object): else: self.reply("442 %s :You're not on that channel" % channelname) + + iplist = {'127.0.0.1'} + def wallops_handler(): - if len(arguments) < 1: - self.reply_461("WALLOPS") - return - message = arguments[0] - for client in server.clients.values(): - client.message(":%s NOTICE %s :Global notice: %s" - % (self.prefix, client.nickname, message)) + if self.host in iplist: + if len(arguments) < 1: + self.reply_461("WALLOPS") + return + message = arguments[0] + for client in server.clients.values(): + client.message(":%s NOTICE %s :Global notice: %s" + % (self.prefix, client.nickname, message)) def who_handler(): if len(arguments) < 1: @@ -554,7 +558,6 @@ class Client(object): self.reply("401 %s %s :No such nick" % (self.nickname, username)) - iplist = '127.0.0.1' def kill_handler(): if len(arguments) < 1: return @@ -568,17 +571,6 @@ class Client(object): quitmsg = arguments[1] user.disconnect("killed: " + quitmsg) - def kick_handler(): - if len(arguments) < 2: - return - username = arguments[0] - channel = arguments[1] - user = server.get_client(username) - if user and channel in user.channels and self.host in iplist: - kickmsg = "%s was kicked from %s by %s" % (user.nickname, channel, self.nickname) - print("kick requested of '%s@%s'" % (user.nickname, user.host)) - server.remove_member_from_channel(user, channel) - handler_table = { "AWAY": away_handler, "ISON": ison_handler, @@ -600,7 +592,6 @@ class Client(object): "WHO": who_handler, "WHOIS": whois_handler, "KILL": kill_handler, - #"KICK": kick_handler, } server = self.server valid_channel_re = self.__valid_channelname_regexp -- cgit v1.2.3