Exemplo n.º 1
0
  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);
    }
  }
Exemplo n.º 2
0
 public boolean exceededMaximumLoginFailures(Account account) {
   return account.getLogin_failures() != null
       && account.getLogin_failures() > maximumLoginFailures;
 }
Exemplo n.º 3
0
 private boolean shouldSendAccountLockedNotification(Account account) {
   return account.getLogin_failures() != null
       && (account.getLogin_failures() == maximumLoginFailures + 1);
 }