From e1875fde75fdda60ba18fb7d12a47cf2d2bda089 Mon Sep 17 00:00:00 2001 From: lukejelse04 Date: Sun, 3 Oct 2021 22:37:17 +0100 Subject: [PATCH] Update FormAuthenticator.cs --- .../FormAuthenticator/FormAuthenticator.cs | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Controllers/FormAuthenticator/FormAuthenticator.cs b/Controllers/FormAuthenticator/FormAuthenticator.cs index b7bef3c..7038e8e 100644 --- a/Controllers/FormAuthenticator/FormAuthenticator.cs +++ b/Controllers/FormAuthenticator/FormAuthenticator.cs @@ -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; + } + } } \ No newline at end of file