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 5062 time(s), 3 post(s) 3/14/2012 12:11:49 PMby rule128
rule128

rule128

3/14/2012 12:11:49 PM
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
This content has not been rated yet. 
265 Reputation 29 Total posts
khorvat

khorvat

3/14/2012 1:03:40 PM
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
This content has not been rated yet. 
15993 Reputation 2214 Total posts
rule128

rule128

4/13/2012 8:17:36 AM
Thanks

That did the trick
This content has not been rated yet. 
265 Reputation 29 Total posts