Fix max tempban length option.

This commit is contained in:
KHobbits 2012-12-20 20:11:45 +00:00
parent 8f00aa5542
commit 78666ade2b

View File

@ -46,8 +46,8 @@ public class Commandtempban extends EssentialsCommand
final String time = getFinalArg(args, 1);
final long banTimestamp = Util.parseDateDiff(time, true);
final long max = ess.getSettings().getMaxTempban();
if(max != 0 && banTimestamp - GregorianCalendar.getInstance().getTimeInMillis() > max * 1000 && ess.getUser(sender).isAuthorized("essentials.tempban.unlimited"))
final long maxBanLength = ess.getSettings().getMaxTempban() * 1000;
if(maxBanLength > 0 && ((banTimestamp - GregorianCalendar.getInstance().getTimeInMillis()) > maxBanLength) && ess.getUser(sender).isAuthorized("essentials.tempban.unlimited"))
{
sender.sendMessage(_("oversizedTempban"));
throw new NoChargeException();