private void setFalseLogin ( final DateTime _logintry , final int _count ) throws EFapsException { if ( _count > 0 ) { final DateTime now = new DateTime ( DateTimeUtil . getCurrentTimeFromDB ( ) . getTime ( ) ) ; final SystemConfiguration kernelConfig = EFapsSystemConfiguration . get ( ) ; final int minutes = kernelConfig . getAttributeValueAsInteger ( KernelSettings . LOGIN_TIME_RETRY ) ; final int maxtries = kernelConfig . getAttributeValueAsInteger ( KernelSettings . LOGIN_MAX_TRIES ) ; final int count = _count + 1 ; if ( minutes > 0 && _logintry . minusMinutes ( minutes ) . isBefore ( now ) ) { updateFalseLoginDB ( 1 ) ; } else { updateFalseLoginDB ( count ) ; } if ( maxtries > 0 && count > maxtries && getStatus ( ) ) { setStatusInDB ( false ) ; } } else { updateFalseLoginDB ( 1 ) ; } }
Method that sets the time and the number of failed logins .