Fix IP range checking and check ids too

Until now, the IP range checking was not working. Banned and muted users could simply get a new dynamic IP to go back on the same account to keep their miss behaviour. With this fix, all IPs within the same range are found.
Also added utility to check userid on bans.