Copied to clipboard

Flag this post as spam?

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


  • Charlie Key 3 posts 23 karma points
    Jan 04, 2010 @ 14:27
    Charlie Key
    0

    Using User Table from Another Umbraco Install

    I am looking to setup a second umbraco install that runs separately but uses the user table from another install. I am still pretty new to umbraco so I am not quite sure how to go about doing this? Thanks in advance for the help.

  • Jamie Howarth 306 posts 773 karma points c-trib
    Jan 04, 2010 @ 14:34
    Jamie Howarth
    0

    Hi Charlie,

    Currently the in-built membership providers only allow for the current website connectionstring (umbracoDbDsn) to be used, so there is no "easy quick-fix" for this. However, I believe Neils was discussing using membership and role providers, and if this does go ahead and is built using correct inheritance from the base .NET classes for membership and roles, then you'll be able to specify different connection strings for different parts of the membership and role functionality.

    You could always roll your own in the meantime - check out MSDN's documentation on Membership Providers to get you started.

    Hope this helps,

    Benjamin

  • Charlie Key 3 posts 23 karma points
    Jan 04, 2010 @ 14:40
    Charlie Key
    0

    It was my understanding that users and members are different though. I am talking about users, not members here. Can I still use the membership providers for that?

  • Dennis Milandt 190 posts 517 karma points
    Jan 04, 2010 @ 14:58
    Dennis Milandt
    0

    You can define different MembershipProviders for Users and for Members.

    See web.config:

        <!-- Membership Provider -->
        <membership defaultProvider="UmbracoMembershipProvider" userIsOnlineTimeWindow="15">
          <providers>
            <clear />
            <add name="UmbracoMembershipProvider" type="umbraco.providers.members.UmbracoMembershipProvider" enablePasswordRetrieval="false" enablePasswordReset="false" requiresQuestionAndAnswer="false" defaultMemberTypeAlias="Another Type" passwordFormat="Hashed" />
            <add name="UsersMembershipProvider" type="umbraco.providers.UsersMembershipProvider" enablePasswordRetrieval="false" enablePasswordReset="false" requiresQuestionAndAnswer="false" passwordFormat="Hashed" />
          </providers>
        </membership>
  • Charlie Key 3 posts 23 karma points
    Jan 04, 2010 @ 15:03
    Charlie Key
    0

    Awesome thanks. I will attempt to attack it that way. 

  • Jamie Howarth 306 posts 773 karma points c-trib
    Jan 04, 2010 @ 15:28
    Jamie Howarth
    0

    Membership and users are different but directly related - if you check out the default ASP.NET schema that aspnet_regsql creates, you'll see how.

    Membership commonly describes not only a user structure but a hierarchy. Membership is subsequently made up of user registration/management and role membership in a many-to-many relationship. A .NET "user" is also a "member", but in general this only means "site member, member of no groups or roles". The role provider handles user membership of roles and .NET role-based authorisation of resources (such as setting up groups of users with various permissions - the in-built editor, writer and translator roles in Umbraco are a great example of this), whereas the membership provider is the "umbrella" that you need to be able to implement any .NET membership scheme to begin with, and deals with all the common functionality of a basic user authentication mechanism - register, login, forgot password, password encryptions etc.

    Hope this helps. Keep us posted on how you proceed with this, as I previously mentioned, similar functionality has been proposed for the core and would be a good idea IMHO.

    Benjamin

  • Jamie Howarth 306 posts 773 karma points c-trib
    Jan 04, 2010 @ 15:31
    Jamie Howarth
    0

    P.S. You'll still have to either write your own membership provider that will connect to a different database or hack the existing Umbraco.providers library to allow you to specify a connectionstring per-function (roles, members etc.).

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Jan 04, 2010 @ 23:11
    Aaron Powell
    0

    If you're talking Users as in back-office accounts I think you're going to be struggling. Although it does work with ASP.NET Membership Providers it's quite different to how standard 'membership' is often though of.

    Although it should work in theory I don't know if it's ever been tried (swapping out the User provider with a custom implementation).

    The way I'd go about it depends on whether you want the users synced between to two installs:

    One-time sync

    This is if you want the users duplicated on the first new install but going forward each has their own unique user management. To do this you just need to copy the data from the following tables:

    • UmbracoUser
    • UmbracoUseGroup
    • UmbracoUserType
    • UmbracoUser2App
    • UmbracoUser2Group

    You can also copy the 2NodeNotify and 2NodePermission but only if you copy the umbracoNode tableotherwise the ID's wont be valid

    Continuous sync

    If you want the users to be always synced you need to either have a scheduled task which would query the two DB's and map up the data (on the above tables) or have triggers set up to catch the insert and copy the data across. The former works if the DB's are on different servers, the latter if they are on the same server.

Please Sign in or register to post replies

Write your reply to:

Draft