Browse Source

本特勒密码输入校验

master
qian 8 months ago
parent
commit
2826cdfadf
  1. 22
      SCP/default.aspx.cs

22
SCP/default.aspx.cs

@ -117,7 +117,11 @@ namespace SCP
return; return;
} }
User user = DB.Users.Where(u => u.Name == p_userName).FirstOrDefault(); User user = DB.Users.Where(u => u.Name == p_userName).FirstOrDefault();
if (!user.Enabled)
{
Alert.Show(GetResourceKey("用户未启用或已锁定,请联系管理员!"));
return;
}
if (user != null) if (user != null)
{ {
if (PasswordUtil.ComparePasswords(user.Password, p_password)) if (PasswordUtil.ComparePasswords(user.Password, p_password))
@ -190,8 +194,24 @@ namespace SCP
} }
} }
else else
{
if (ScpCache.Config.)
{
var result = SCP_ASK_CONTROLLER.Update_User_ErrorCount(p_userName, Convert.ToInt32(ScpCache.Config.));
if (!string.IsNullOrEmpty(result.Message))
{
Alert.Show(result.Message);
}
else
{
Alert.Show(GetResourceKey("用户名或密码错误!"));
}
}
else
{ {
Alert.Show(GetResourceKey("用户名或密码错误!")); Alert.Show(GetResourceKey("用户名或密码错误!"));
}
return; return;
} }
} }

Loading…
Cancel
Save