public void handleLoginFailures(String context, Account account) throws DALException { account.setLast_mailcheck(new Date(System.currentTimeMillis())); if (account.getLogin_failures() == null) { account.setLogin_failures(1); } else { account.setLogin_failures(account.getLogin_failures() + 1); } account.setLast_login_failure(new Date(System.currentTimeMillis())); DALDominator.updateAccountReceiveInfo(account); if (shouldSendAccountLockedNotification(account)) { notifyAccountLock(account, context); sendAccountLockedNotificationEm(account); } }
public boolean exceededMaximumLoginFailures(Account account) { return account.getLogin_failures() != null && account.getLogin_failures() > maximumLoginFailures; }
private boolean shouldSendAccountLockedNotification(Account account) { return account.getLogin_failures() != null && (account.getLogin_failures() == maximumLoginFailures + 1); }