Browse Source

Added better handling of last attempt

CauseFX 6 năm trước cách đây
mục cha
commit
4d2aa60306
1 tập tin đã thay đổi với 6 bổ sung1 xóa
  1. 6 1
      api/functions/api-functions.php

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

@@ -203,7 +203,12 @@ function login($array)
 			// authentication failed
 			// authentication failed
 			writeLoginLog($username, 'error');
 			writeLoginLog($username, 'error');
 			writeLog('error', 'Login Function - Wrong Password', $username);
 			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) {
 	} catch (Dibi\Exception $e) {
 		return $e;
 		return $e;