DrKefir
  •  DrKefir
  • 54.2% (Neutral)
  • YAF Forumling Topic Starter
2011-10-06T22:18:32Z
Version 1.9.5.5. (bin)
When requiresUniqueEmail="true" and a second user creates an acount with an allready taken e-mail address, YafMembershipProvider.CreateUser throws an error.
The error is probably correctly thrown by method YafMembershipProvider.GetUserNameByEmail but CreateUser should anyways return null and MembershipCreateStatus.DuplicateEmail for the status.

solution
try - catch @ this.GetUserNameByEmail, or better yet call a private method to verify if email is taken, sort of....

if (this.RequiresUniqueEmail && EmailExists(email))
{
status = MembershipCreateStatus.DuplicateEmail;
return null;
}


[ProviderException: Too many Usernames returned for that email address.]
YAF.Providers.Utils.ExceptionReporter.ThrowProvider(String providerSection, String tag) +50
YAF.Providers.Membership.YafMembershipProvider.GetUserNameByEmail(String email) +119
YAF.Providers.Membership.YafMembershipProvider.CreateUser(String us
Sponsor

About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button

Project Twitter Updates

Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved