Update FormAuthenticator.cs

This commit is contained in:
lukejelse04 2021-10-03 22:37:17 +01:00 committed by luke-else
parent 9a4f81ae1b
commit dd72219fe2

View File

@ -19,6 +19,32 @@ namespace EFB.Controllers.FormAuthenticator
return false;
}
public static bool ValidateEndpoint(string Endpoint){
//If it contains http & :// it can be either https or http
if (Endpoint.Contains("http") && Endpoint.Contains("://") && Endpoint.Length > 7)
{
return true;
}
return false;
}
public static bool ValidateICAOCode(string ICAO){
if (ICAO.Length == 4)
{
//If the value contains a Number, then the value will return false
return !ICAO.Any(x => char.IsDigit(x));
}
return false;
}
public static bool ValidateCruiseAlt(int CruiseAlt){
if (CruiseAlt > 0 && CruiseAlt < 50000)
{
return true;
}
return false;
}
}
}