- Fixing 15873: Username is case sensitive.

--HG--
branch : dev
This commit is contained in:
Suha Can
2010-03-02 17:23:45 -08:00
parent 6cc1b9d939
commit afb9f1800e
8 changed files with 82 additions and 42 deletions

View File

@@ -7,6 +7,7 @@ using System.Web.Security;
using Orchard.Logging;
using Orchard.Mvc.ViewModels;
using Orchard.Security;
using Orchard.Users.Services;
using Orchard.Users.ViewModels;
namespace Orchard.Users.Controllers {
@@ -14,13 +15,16 @@ namespace Orchard.Users.Controllers {
public class AccountController : Controller {
private readonly IAuthenticationService _authenticationService;
private readonly IMembershipService _membershipService;
private readonly IUserService _userService;
public AccountController(
IAuthenticationService authenticationService,
IMembershipService membershipService) {
IMembershipService membershipService,
IUserService userService) {
_authenticationService = authenticationService;
_membershipService = membershipService;
_userService = userService;
Logger = NullLogger.Instance;
}
@@ -189,6 +193,10 @@ namespace Orchard.Users.Controllers {
if (String.IsNullOrEmpty(email)) {
ModelState.AddModelError("email", "You must specify an email address.");
}
string userUnicityMessage = _userService.VerifyUserUnicity(userName, email);
if (userUnicityMessage != null) {
ModelState.AddModelError("userExists", userUnicityMessage);
}
if (password == null || password.Length < MinPasswordLength) {
ModelState.AddModelError("password",
String.Format(CultureInfo.CurrentCulture,