Page 1 of 1

ASP.Net Membership Provider Issue - requiresUniqueEmail

Posted: Sat 27 Dec 2008 23:58
by mrlami
The requiresUniqueEmail option when set to true (as in below) does not seem to work. The provider keeps creating accounts with duplicate emails even when this option it set to true in the web.config file.

Code: Select all

requiresUniqueEmail="true"
Is this a bug, or is this option just not allowed with DevArt's PostgreSQL Memberhip provider?

Posted: Mon 29 Dec 2008 08:47
by Shalex
Thank you for the bug report, the issue is being investigated now. We will notify you about the results.

Posted: Thu 01 Jan 2009 17:48
by mrlami
Thought I'll post a workaround I used for this. It cost an extra hit to the database, but I don't think it's overkill.

Use below code before calling Membership.CreateUser to check if a duplicate email exists pending the time this bug is fixed.

Code: Select all

public static bool CheckUserEmail(string useremail)
{
    string sql = "SELECT email FROM aspnet_membership WHERE email='" + useremail + "';";

    using (PgSqlConnection connection = ConnectionManager.GetConnection())
    {
        using (PgSqlCommand command = new PgSqlCommand(sql, connection))
        {
            command.CommandType = CommandType.Text;

            try
            {
                string rec = command.ExecuteScalar().ToString();

                if (rec == useremail)
                    return true;
                else
                    return false;
            }
            catch (Exception ex)
            {
                return false;
                throw ex;
            }
        }
    }
}

Posted: Sat 28 Mar 2009 02:36
by mrlami
@Shalex...

has this bug been fixed?

Posted: Mon 30 Mar 2009 11:33
by Shalex
The requiresUniqueEmail functionality is not implemented yet. We cannot provide any timeframe now.

Posted: Thu 09 Jul 2009 08:10
by AndreyR
We have added support for the requiresUniqueEmail functionality. It will be available in the next build of dotConnects.

Posted: Fri 17 Jul 2009 17:22
by mrlami
Andrey is it available in 4.55?

Posted: Mon 20 Jul 2009 07:16
by AndreyR
Yes, it is.