ASP.Net Membership Provider Issue - requiresUniqueEmail

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply

Do you host your production PosgreSQL database on a windows machine?

Poll ended at Mon 02 Mar 2009 23:58

 
Total votes: 0

mrlami
Posts: 13
Joined: Sat 27 Dec 2008 23:50

ASP.Net Membership Provider Issue - requiresUniqueEmail

Post by mrlami » Sat 27 Dec 2008 23:58

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?

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Mon 29 Dec 2008 08:47

Thank you for the bug report, the issue is being investigated now. We will notify you about the results.

mrlami
Posts: 13
Joined: Sat 27 Dec 2008 23:50

Post by mrlami » Thu 01 Jan 2009 17:48

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;
            }
        }
    }
}

mrlami
Posts: 13
Joined: Sat 27 Dec 2008 23:50

Post by mrlami » Sat 28 Mar 2009 02:36

@Shalex...

has this bug been fixed?

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Mon 30 Mar 2009 11:33

The requiresUniqueEmail functionality is not implemented yet. We cannot provide any timeframe now.

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Thu 09 Jul 2009 08:10

We have added support for the requiresUniqueEmail functionality. It will be available in the next build of dotConnects.

mrlami
Posts: 13
Joined: Sat 27 Dec 2008 23:50

Post by mrlami » Fri 17 Jul 2009 17:22

Andrey is it available in 4.55?

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Mon 20 Jul 2009 07:16

Yes, it is.

Post Reply