MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

Several users with same mail (Closed) (Mono Support )

Viewed 9926 time(s), 3 post(s) 14.03.2012 12:11:49by rule128
rule128

rule128

14.03.2012 12:11:49
Hello

I can register several(distinct) users with the same email address.
I see that in SecurityUtility.cs the code
errorMessage = String.Empty;
MembershipCreateStatus createStatus;
membershipUser = Membership.CreateUser(userName, password, email, null, null, isApproved, userId, out createStatus);
switch (createStatus)
{
case MembershipCreateStatus.Success:
try
{
if (customAction != null)
{
customAction(membershipUser);
}
}
catch (Exception ex)
{
log.Error(ex);
Membership.DeleteUser(userName);
throw;
}
break;
case MembershipCreateStatus.DuplicateUserName:
errorMessage = ErrorMessages.Membership_DuplicateUserName;
break;
case MembershipCreateStatus.DuplicateEmail:
errorMessage = ErrorMessages.Membership_DuplicateEmail;
break;
case MembershipCreateStatus.InvalidPassword:
errorMessage = GetInvalidPasswordMessage();
break;
default:
throw new ApplicationException(String.Format("{0} [{1}]", ErrorMessages.Membership_Create_UnknownError, createStatus));
}

If I use the same email address twice I do not hit the MembershipCreateStatus.DuplicateEmail, it goes on the success path.

Please help.

Regards
Dieser Inhalt wurde noch nicht bewertet. 
265 Reputation 29 Total posts
khorvat

khorvat

14.03.2012 13:03:40
Hi,

you need to enable unique e-mails in the ASP.NET membership configuration, your configuration should be similar to this
<add connectionStringName="LocalSqlServer" ... requiresUniqueEmail="true" ... name="AspNetSqlMembershipProvider" type="MonoSoftware.MonoX.MonoXMembershipProvider, MonoX"/>

Regards
Dieser Inhalt wurde noch nicht bewertet. 
15993 Reputation 2214 Total posts
rule128

rule128

13.04.2012 08:17:36
Thanks

That did the trick
Dieser Inhalt wurde noch nicht bewertet. 
265 Reputation 29 Total posts