Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PgMembershipProvider.cs #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/NauckIT.PostgreSQLProvider/PgMembershipProvider.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright � 2006 - 2013 Nauck IT KG http://www.nauck-it.de
// Copyright � 2006 - 2013 Nauck IT KG http://www.nauck-it.de
//
// Author:
// Daniel Nauck <d.nauck(at)nauck-it.de>
Expand Down Expand Up @@ -1155,9 +1155,13 @@ public override bool UnlockUser(string userName)
/// </summary>
public override void UpdateUser(MembershipUser user)
{
// validate duplicate email address, see issue #29
if (RequiresUniqueEmail && !string.IsNullOrEmpty(GetUserNameByEmail(user.Email)))
throw new ProviderException("Duplicate E-mail address. The E-mail supplied is invalid.");
// validate duplicate email address sking itself, see issue #29
if (RequiresUniqueEmail)
{
string userName = GetUserNameByEmail(user.Email);
if (!string.IsNullOrEmpty(userName) && !userName.Equals(user.UserName, StringComparison.InvariantCultureIgnoreCase))
throw new ProviderException("The e-mail address that you entered is already in use. Please enter a different e-mail address.");
}

using (NpgsqlConnection dbConn = new NpgsqlConnection(m_connectionString))
{
Expand Down