Copied to clipboard

Flag this post as spam?

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


  • Puck Holshuijsen 184 posts 727 karma points
    Jan 23, 2024 @ 12:26
    Puck Holshuijsen
    0

    Multiple sites in one CMS - unique member registration

    Hi All,

    I am hoping that someone might have a brilliant idea for something i can't fully wrap my head around.

    Let's say I have 5 websites in 1 CMS, and all 5 websites have the possibility to register on the front-end. But I must be able to register on all 5 sites with the same e-mailaddress/username. And also, none of the website-admins must be able to see the members that are registered on the other websites.

    The idea I had, was to add a unique ID to each website, and when someone registers to that website, I add a _UNIQUEID (tied to that website) to the username. This would mean, that in the backoffice I need to hide the _UNIQUEID in the member / UserName property. I also need to find a way to hide the other members for the website admin based on the UNIQUEID. Not sure how to do that part.

    Thanks in advance!

    Kind regards,

    Puck

  • Marc Goodson 2155 posts 14406 karma points MVP 9x c-trib
    Jan 23, 2024 @ 14:27
    Marc Goodson
    100

    Hi Puck

    I did a similar thing a long time ago with a site, and it was the email address I prepended with the homepage site id (I think you can have duplicate names for members but not duplicate emails!)

    But I didn't have the need to hide the members from different editors! nor the need to show the Member data without the prepended element.

    But I think the two things that might come in handy for you are:

    1. MemberSendingNotification

    https://docs.umbraco.com/umbraco-cms/reference/notifications/editormodel-notifications

    this gets fired just before a Member is opened in the backoffice by an editor, and here you could remove anything you had prepended

    you would then need to add it back in again when the member was saved by the editor and for this you'd need the MemberService MemberSaving Notification for this

    https://docs.umbraco.com/umbraco-cms/reference/notifications/memberservice-notifications

    But you'd need to know at this point 'which site' the Member belonged to, so I think you'd need to add a Label property to the Member Type to record which site the Member belonged to so you'd know what to re append...

    and

    1. when an editor is searching in the backoffice, then trying to customise the Member Search Results is a lot trickier, because the Member search is using the database and a ListView - there is an article here:

    https://dev.to/skttl/how-to-customize-searching-in-umbraco-list-views-1knk

    that outlines a possible strategy for hijacking the request, so if you could pull that off, you could perhaps use the UserGroups of the current logged in user to filter the Member search results...

    regards

    marc

  • Puck Holshuijsen 184 posts 727 karma points
    Jan 23, 2024 @ 14:52
    Puck Holshuijsen
    0

    Hi Marc,

    Wow, this sounds great. Especially the membersending notification and the customize searching.

    I have done the searching for another site already, but for the content tree. Didn't think about the Members. I think I will have a go at this tomorrow, and will post the results!

    Thanks again

  • Puck Holshuijsen 184 posts 727 karma points
    Jan 24, 2024 @ 14:07
    Puck Holshuijsen
    0

    Your solution totally worked!

    Thanks so much for handing me the missing pieces :D

Please Sign in or register to post replies

Write your reply to:

Draft