protected boolean ircCommandAttempt(String host, String[] command) { int lvl = 0; String adminName = ""; synchronized (this.syncAdmins) { for (final IRCAdmin admin : this.admins) { if ((admin != null) && (admin.getHostname().equals(host))) { lvl = admin.getAccessLevel(); adminName = admin.getUsername(); } } } if (command[0].charAt(0) == this.commandPrefix) { command[0] = command[0].substring(1); } if ((lvl == 0) || ((lvl == 2) && (!command[0].equalsIgnoreCase("kick")) && (!command[0].equalsIgnoreCase("ban")))) { return false; } final String commands = Canary.glueString(command, 0, " "); Canary.getServer().consoleCommand(commands); this.log.log( Level.INFO, "[IRCanary] IRC admin " + adminName + "(" + host + ") used command: " + commands); return true; }
protected boolean authenticate(String sender, String name, String pass, String host) { boolean success = false; synchronized (this.syncAdmins) { for (final IRCAdmin admin : this.admins) { if ((admin != null) && (admin.getUsername().equalsIgnoreCase(name)) && (admin.auth(pass, host))) { this.log.log( Level.INFO, "[IRCanary] IRC admin " + admin.getUsername() + " logged in (" + host + ")"); success = true; } else { this.log.log( Level.INFO, "[IRCanary] IRC admin failed login. user[" + name + "] pass[" + pass + "] nick[" + sender + "] host[" + host + "]"); } } } return success; }