Update vor Clone
This commit is contained in:
@@ -63,6 +63,9 @@ namespace BlazorApp
|
||||
{ Name = "Dashboard", Path = "/Admin/Dashboard", Icon = "dashboard" },
|
||||
new MenuItem()
|
||||
{ Name = "Firmen", Path = "/Admin/Company/Company", Icon = "account_balance" },
|
||||
new MenuItem()
|
||||
{ Name = "Lehrer", Path = "/Admin/Teacher/Teacher", Icon = "face" },
|
||||
|
||||
new MenuItem()
|
||||
{ Name = "Schüler", Path = "/Admin/Student/Student", Icon = "accessibility" },
|
||||
new MenuItem()
|
||||
@@ -83,7 +86,7 @@ namespace BlazorApp
|
||||
new MenuItem() {Name="Berufe",Path = "Admin/Beruf/BerufList"},
|
||||
new MenuItem() {Name="Zeiten",Path = "Admin/Zeiten/ZeitenList"},
|
||||
new MenuItem() {Name="Schulhaus",Path = "Admin/Schulhaus/Schulhauslist"},
|
||||
new MenuItem() {Name="Lehrer",Path = "Admin/Lehrer"},
|
||||
new MenuItem() {Name="Lehrer",Path = "Admin/Teacher/Teacher"},
|
||||
new MenuItem() {Name="Klassen",Path = "Admin/Klassen"},
|
||||
new MenuItem() {Name="Klassentyp",Path = "Admin/Klassentyp/Klassentyplist"},
|
||||
new MenuItem() {Name="Zugehörigkeit",Path = "Admin/Zugehörigkeit"},
|
||||
|
||||
54
BlazorApp/Helper/Utils.cs
Normal file
54
BlazorApp/Helper/Utils.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
|
||||
namespace BlazorApp.Helper
|
||||
{
|
||||
public class Utils
|
||||
{
|
||||
public bool IsValidEmail(string email)
|
||||
{
|
||||
|
||||
//return false;
|
||||
|
||||
try
|
||||
{
|
||||
// Normalize the domain
|
||||
email = Regex.Replace(email, @"(@)(.+)$", DomainMapper,
|
||||
RegexOptions.None, TimeSpan.FromMilliseconds(200));
|
||||
|
||||
// Examines the domain part of the email and normalizes it.
|
||||
string DomainMapper(Match match)
|
||||
{
|
||||
// Use IdnMapping class to convert Unicode domain names.
|
||||
var idn = new IdnMapping();
|
||||
|
||||
// Pull out and process domain name (throws ArgumentException on invalid)
|
||||
string domainName = idn.GetAscii(match.Groups[2].Value);
|
||||
|
||||
return match.Groups[1].Value + domainName;
|
||||
}
|
||||
}
|
||||
catch (RegexMatchTimeoutException e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
catch (ArgumentException e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
return Regex.IsMatch(email,
|
||||
@"^[^@\s]+@[^@\s]+\.[^@\s]+$",
|
||||
RegexOptions.IgnoreCase, TimeSpan.FromMilliseconds(250));
|
||||
}
|
||||
catch (RegexMatchTimeoutException)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user