|
@ -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; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|