Admin auth functionally complete

This commit is contained in:
2012-12-31 14:49:41 -05:00
parent 8739251066
commit 2ec2a752cd
30 changed files with 260 additions and 79 deletions
+2 -2
View File
@@ -136,11 +136,11 @@ namespace MileageTraker.Web.DAL
}
if (!user.IsApproved)
{
return false;
throw new UserAccountDisabledException();
}
if (user.IsLockedOut)
{
return false;
throw new UserLockedOutException();
}
var hashedPassword = user.Password;
var verificationSucceeded = (hashedPassword != null && Crypto.VerifyHashedPassword(hashedPassword, password));
+2
View File
@@ -475,6 +475,8 @@ namespace MileageTraker.Web.DAL
var user = GetUser(userId);
user.Password = Crypto.HashPassword(password);
user.LastPasswordChangedDate = DateTime.Now;
user.IsLockedOut = false;
user.PasswordFailuresSinceLastSuccess = 0;
UpdateUser(user);
}
+8
View File
@@ -0,0 +1,8 @@
using System;
namespace MileageTraker.Web.DAL
{
public class UserAccountDisabledException : Exception
{
}
}
+8
View File
@@ -0,0 +1,8 @@
using System;
namespace MileageTraker.Web.DAL
{
public class UserLockedOutException : Exception
{
}
}