diff --git a/channel.js b/channel.js index 79611d7f..226848f3 100644 --- a/channel.js +++ b/channel.js @@ -417,8 +417,12 @@ Channel.prototype.sendRankStuff = function(user) { if(Rank.hasPermission(user, "seenlogins")) { var ents = []; for(var ip in this.logins) { + var disp = ip; + if(user.rank < Rank.Siteadmin) { + disp = "(Masked)"; + } ents.push({ - ip: ip, + ip: disp, name: this.logins[ip].join(",") }); } diff --git a/chatcommand.js b/chatcommand.js index ba651a15..c99b6ecd 100644 --- a/chatcommand.js +++ b/chatcommand.js @@ -87,6 +87,27 @@ function handleBan(chan, user, args) { chan.kick(kickee, "(banned) " + reason); chan.banIP(user, kickee); } + else if(!kickee && chan.getRank(args[0]) < user.rank) { + for(var ip in chan.logins) { + console.log(ip, chan.logins[ip]); + if(chan.logins[ip].join("").indexOf(args[0]) != -1) { + for(var i = 0; i < chan.logins[ip].length; i++) { + if(chan.getRank(chan.logins[ip][i]) >= user.rank) { + return; + } + } + if(args.length >= 2 && args[1] == "range") { + var parts = ip.split("."); + ip = parts[0] + "." + parts[1] + "." + parts[2]; + } + chan.logger.log("*** " + user.name + " banned " + ip); + chan.banIP(user, { + ip: ip, + name: args[0] + }); + } + } + } } } diff --git a/package.json b/package.json index bd7432c2..c3445db1 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "author": "Calvin Montgomery", "name": "CyTube", "description": "Online media synchronizer and chat", - "version": "1.5.0", + "version": "1.5.1", "repository": { "url": "http://github.com/calzoneman/sync" }, diff --git a/server.js b/server.js index 7eeae982..c67c721f 100644 --- a/server.js +++ b/server.js @@ -9,7 +9,7 @@ The above copyright notice and this permission notice shall be included in all c THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -const VERSION = "1.5.0"; +const VERSION = "1.5.1"; var fs = require("fs"); var Logger = require("./logger.js"); diff --git a/www/assets/js/functions.js b/www/assets/js/functions.js index bbba3eae..179bc090 100644 --- a/www/assets/js/functions.js +++ b/www/assets/js/functions.js @@ -613,7 +613,6 @@ function updateBanlist(entries) { } function updateSeenLogins(entries) { - console.log(entries); var tbl = $("#loginlog table"); if(tbl.children().length > 1) { $(tbl.children()[1]).remove(); @@ -630,19 +629,17 @@ function updateSeenLogins(entries) { var ip = $("