Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ben McKean 272 posts 549 karma points
    Oct 24, 2011 @ 17:15
    Ben McKean
    0

    Membership requiresUniqueEmail

    Hi

    I'm trying to change Umbraco so that it allows many members to enter the same email address. I've changed the relevant setting in web.config but it doesn't seem to have any affect. Am I missing something or should this just work?

    requiresUniqueEmail="false"
  • Rodion Novoselov 694 posts 859 karma points
    Oct 24, 2011 @ 23:55
    Rodion Novoselov
    0

    Hi. It seems that despite that UmbracoMembershipProvider recognises this setting it never uses it actually and this setting has no effect at all. I think you could work it around in a couple steps - as a user registers themselves replace the registration e-mail with some auto-generated unique fake e-mail and store the real e-mail in some designated member type property.

  • Ben McKean 272 posts 549 karma points
    Oct 25, 2011 @ 09:22
    Ben McKean
    0

    Hi Rodion

    I think what your saying is the following?

    1. User registers (filling in form on site)
    2. I generate random email address and save that to Umbraco email field
    3. I save the real email to a custom email field that I add

    My problem with this is that I'm using the standard .net CreateUser control that uses the Email field and also I'll lose the ability to use methods such as .GetUsernameByEmail.

    Anybody out there who can offer a solution overriding existing Umbraco code?

    Thanks!

  • Rodion Novoselov 694 posts 859 karma points
    Oct 25, 2011 @ 09:33
    Rodion Novoselov
    0

    Hi. I suppose it's quite possible to modify an existent UmbracoMembershipProvider. In 4.7.1 it resides in the 'umbraco.providers' project. It seems that it would be enough to change the line #376 of the MembersMembershipProvider.cs file from:

    else if (Member.GetMemberFromEmail(email) != null)

    to:

    else if (m_RequiresUniqueEmail && Member.GetMemberFromEmail(email) != null)

    However, of course I'm not a core developer, so I'm not sure how it can affect other code :-)

  • Ben McKean 272 posts 549 karma points
    Oct 25, 2011 @ 10:58
    Ben McKean
    0

    Thanks for your help Rodion.

    I've not edited the Umbraco source before. I've downloaded the source and opened the Cms.Development.sln file but I can't see the umbraco.providers project. I've done a find for the MembersMembershipProvider.cs but I can't find it.

    Can you point me in the right direction please?

  • Rodion Novoselov 694 posts 859 karma points
    Oct 25, 2011 @ 11:29
    Rodion Novoselov
    0

    Hm. It seems that you have got the version 5 (that's yet alpha and not targeted to production). What version do you use for your site? If you work with e.g. 4.7.1 then you can get sources here: http://umbraco.codeplex.com/releases/view/73692 (Source code link). The name of a solution is 'umbraco.sln'. The project that you need should be visible in VS by the name of "providers". In the file system it resides in the umbraco\providers subfolder of the solution root folder.

  • Ben McKean 272 posts 549 karma points
    Oct 25, 2011 @ 11:41
    Ben McKean
    0

    Got it! Thanks for you help.

    I'll let you know how I get on

  • Ben McKean 272 posts 549 karma points
    Oct 25, 2011 @ 12:22
    Ben McKean
    0

    I've downloaded the source and made the necessary amend for my installation.

    I've also submitted this as an issue. http://umbraco.codeplex.com/workitem/30558

    Please feel free to vote for it.

    Thanks for all your help!

    Ben

  • Anders Brännmark 226 posts 277 karma points
    Jan 31, 2012 @ 08:56
    Anders Brännmark
    0

    ttt

Please Sign in or register to post replies

Write your reply to:

Draft