#17691: Possible to create invalid admin account with Turkish collation

--HG--
branch : 1.x
This commit is contained in:
Andre Rodrigues
2011-04-08 14:44:32 -07:00
parent a4248217cd
commit 0073fbd1a9
5 changed files with 30 additions and 13 deletions

View File

@@ -241,11 +241,11 @@ namespace Orchard.Users.Controllers {
}
else {
// also update the Super user if this is the renamed account
if (String.Equals(Services.WorkContext.CurrentSite.SuperUser, previousName, StringComparison.OrdinalIgnoreCase)) {
if (String.Equals(Services.WorkContext.CurrentSite.SuperUser, previousName, StringComparison.Ordinal)) {
_siteService.GetSiteSettings().As<SiteSettingsPart>().SuperUser = editModel.UserName;
}
user.NormalizedUserName = editModel.UserName.ToLower();
user.NormalizedUserName = editModel.UserName.ToLowerInvariant();
}
}
@@ -272,10 +272,10 @@ namespace Orchard.Users.Controllers {
var user = Services.ContentManager.Get<IUser>(id);
if (user != null) {
if (String.Equals(Services.WorkContext.CurrentSite.SuperUser, user.UserName, StringComparison.OrdinalIgnoreCase)) {
if (String.Equals(Services.WorkContext.CurrentSite.SuperUser, user.UserName, StringComparison.Ordinal)) {
Services.Notifier.Error(T("The Super user can't be removed. Please disable this account or specify another Super user account"));
}
else if (String.Equals(Services.WorkContext.CurrentUser.UserName, user.UserName, StringComparison.OrdinalIgnoreCase)) {
else if (String.Equals(Services.WorkContext.CurrentUser.UserName, user.UserName, StringComparison.Ordinal)) {
Services.Notifier.Error(T("You can't remove your own account. Please log in with another account"));
}
else{
@@ -323,7 +323,7 @@ namespace Orchard.Users.Controllers {
var user = Services.ContentManager.Get<IUser>(id);
if (user != null) {
if (String.Equals(Services.WorkContext.CurrentUser.UserName, user.UserName, StringComparison.OrdinalIgnoreCase)) {
if (String.Equals(Services.WorkContext.CurrentUser.UserName, user.UserName, StringComparison.Ordinal)) {
Services.Notifier.Error(T("You can't disable your own account. Please log in with another account"));
}
else {