aboutsummaryrefslogtreecommitdiff
path: root/src/DevHive.Web/Attributes
diff options
context:
space:
mode:
authortranstrike <transtrike@gmail.com>2021-02-13 16:20:18 +0200
committertranstrike <transtrike@gmail.com>2021-02-13 16:20:18 +0200
commit98e17766b203734a1817eed94338e2d25f4395f7 (patch)
tree1266385a56cba56fd55c7faf661dd844bbdf5705 /src/DevHive.Web/Attributes
parent1ab34accfda22ee3ce5c7700e3b97ff3e932d649 (diff)
downloadDevHive-98e17766b203734a1817eed94338e2d25f4395f7.tar
DevHive-98e17766b203734a1817eed94338e2d25f4395f7.tar.gz
DevHive-98e17766b203734a1817eed94338e2d25f4395f7.zip
Project Restructure P.1
Diffstat (limited to 'src/DevHive.Web/Attributes')
-rw-r--r--src/DevHive.Web/Attributes/GoodPasswordModelValidation.cs24
-rw-r--r--src/DevHive.Web/Attributes/OnlyLettersModelValidation.cs20
2 files changed, 0 insertions, 44 deletions
diff --git a/src/DevHive.Web/Attributes/GoodPasswordModelValidation.cs b/src/DevHive.Web/Attributes/GoodPasswordModelValidation.cs
deleted file mode 100644
index 7d6a1ea..0000000
--- a/src/DevHive.Web/Attributes/GoodPasswordModelValidation.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using System;
-using System.ComponentModel.DataAnnotations;
-
-namespace DevHive.Web.Attributes
-{
- public class GoodPassword : ValidationAttribute
- {
- public override bool IsValid(object value)
- {
- var stringValue = (string)value;
-
- for (int i = 0; i < stringValue.Length; i++)
- {
- if (Char.IsDigit(stringValue[i]))
- {
- base.ErrorMessage = "Password must be atleast 5 characters long!";
- return stringValue.Length >= 5;
- }
- }
- base.ErrorMessage = "Password must contain atleast 1 digit!";
- return false;
- }
- }
-}
diff --git a/src/DevHive.Web/Attributes/OnlyLettersModelValidation.cs b/src/DevHive.Web/Attributes/OnlyLettersModelValidation.cs
deleted file mode 100644
index 07afee9..0000000
--- a/src/DevHive.Web/Attributes/OnlyLettersModelValidation.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-using System.ComponentModel.DataAnnotations;
-
-namespace DevHive.Web.Attributes
-{
- public class OnlyLetters : ValidationAttribute
- {
- public override bool IsValid(object value)
- {
- var stringValue = (string)value;
-
- foreach (char ch in stringValue)
- {
- if (!Char.IsLetter(ch))
- return false;
- }
- return true;
- }
- }
-}