ASP.Net Membership Provider Issue - requiresUniqueEmail

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

Poll ended at Mon 02 Mar 2009 23:58

 
Total votes : 0

ASP.Net Membership Provider Issue - requiresUniqueEmail

Postby 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?
mrlami
 
Posts: 13
Joined: Sat 27 Dec 2008 23:50

Postby 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.
Shalex
Devart Team
 
Posts: 7659
Joined: Thu 14 Aug 2008 12:44

Postby 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

Postby mrlami » Sat 28 Mar 2009 02:36

@Shalex...

has this bug been fixed?
mrlami
 
Posts: 13
Joined: Sat 27 Dec 2008 23:50

Postby Shalex » Mon 30 Mar 2009 11:33

The requiresUniqueEmail functionality is not implemented yet. We cannot provide any timeframe now.
Shalex
Devart Team
 
Posts: 7659
Joined: Thu 14 Aug 2008 12:44

Postby 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.
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Postby mrlami » Fri 17 Jul 2009 17:22

Andrey is it available in 4.55?
mrlami
 
Posts: 13
Joined: Sat 27 Dec 2008 23:50

Postby AndreyR » Mon 20 Jul 2009 07:16

Yes, it is.
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16


Return to dotConnect for PostgreSQL