Kaynağa Gözat

Added better handling of last attempt

CauseFX 6 yıl önce
ebeveyn
işleme
4d2aa60306
1 değiştirilmiş dosya ile 6 ekleme ve 1 silme
  1. 6 1
      api/functions/api-functions.php

+ 6 - 1
api/functions/api-functions.php

@@ -203,7 +203,12 @@ function login($array)
 			// authentication failed
 			writeLoginLog($username, 'error');
 			writeLog('error', 'Login Function - Wrong Password', $username);
-			return 'mismatch';
+			if($loginAttempts >= $GLOBALS['loginAttempts']){
+				coookieSeconds('set', 'lockout', $GLOBALS['loginLockout'], $GLOBALS['loginLockout']);
+				return 'lockout';
+			}else{
+				return 'mismatch';
+			}
 		}
 	} catch (Dibi\Exception $e) {
 		return $e;