Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Share users on two installed forums?

edited October 2006 in Vanilla 1.0 Help
I have a need to share some overlapping users on two different forums (installs). Is there a way to do this without forcing re-registration of those users?

As a simpler case, would it be possible to share all registered users of one forum with another where they were a subset of a larger group? They don't need a distinguished role - just members of both.

Comments

  • Options
    MarkMark Vanilla Staff
    The best way I can think of to do it would be to share all users from both forums in the same table. Create two separate installs in the same database (give the second set of tables a different table prefix) and then make both installs specify the same users table. in your conf/database.php file.
  • Options
    Hmm. Interesting. Since the idea is that Group A should see Forum 1 and 2 but Group B only Forum 2, I guess I would need to give Group A privileges so that Group B wouldn't actually be able to access Forum 1 discussions if they stumbled on the URL. No biggie. I'll have to give this a try ... a couple of weeks away from needing it.
  • Options
    I was thinking along the same lines as mark. You'd either have to align your roles so that each role id had the necessary permissions on each forum (would take a bit of doing but shouldnt be too tricky if you're careful about it) otherwise it sounds like a great place to use jazzmans multiroles extension so you can have a general dual-forum kinda role. I'm not sure if that would work though.
  • Options
    Some fields shouldn't be shared, like "UserBlocksCategories".

    ps: what is "CommentSpamCheck"?
  • Options
    I think it's used to stop users posting more than N times in X seconds?
  • Options
    edited October 2006
    What line would I add to conf/database.php to share the same user table - it currently only identifies the entire database:
    $Configuration['DATABASE_NAME'] = 'database_name';

    @Dinoboff - are there other fields besides "UserBlocksCategories" (Discovery? What is that?) that shouldn't be used? Is this a show-stopper for my use case? Can I turn off these fields within forum(s) as administrator when defining what a role can do, even if it limits to some degree the flexibility of Vanilla for users?

    @Minisweeper - I love the idea of Multi-Role and expect it to be bullet-proofed. But am I wrong in worrying about a variety of subtle collisions (not always bugs; sometime UI) with other extensions or app requirements based, ultimately, on Vanilla's own simpler design point? I know that's vague at the moment; more of an intuition.

    I recently explained in the Premoderation discussion why I need that extension to forestall users who may forget to set the correct categories for confidential (role-centric) discussions. Sharing the same users table and one database across multiple forums seems, in some respects, like a great way to guard the robustness and simplicity of Vanilla while gaining some (not all) of the benefit of multiple roles? I see this as complementary to multiple roles, depending on the requirement.
  • Options
    MarkMark Vanilla Staff
    edited October 2006
    Both Vanilla installs would have to be in the same database. Vanilla doesn't support separate sharing of tables between separate databases.

    So, if you mysqldump one of your databases. Then go into the one you didn't mysqldump and change all of the table prefixes to something else. Then re-load your dump into that database, you'll have both installs of vanilla in the same database.

    Then add either:

    $DatabaseTables['User'] = 'LUM_User';
    or
    $DatabaseTables['User'] = 'OTHER_User';

    to one of the installs.

    Also be sure to change the database name on the set of tables that got moved into the first db.
  • Options
    @Mark - followed instructions and seems to work like a dream. Admin can add, change roles, ban and generally manage accounts from either forum with changes showing up in both forums, as desired. If a user enables 'remember me' on first forum sign-in, no need to re-sign to enter the second forum, as desired.

    Two minor questions:

    ... Should I be concerned with Dinoboff's comment about sharing certain fields in the Users Table?

    ... Is there any reason I can't have a reasonable 'x' number of shared installs in the same database (say, four or five)?
  • Options
    MarkMark Vanilla Staff
    edited October 2006
    I can't think of any reason to not have multiple dbs pointing at the same user table. It's possible that there *could* be some glitches that come up from those fields dinoboff mentioned, yes. I'd have to do further testing to figure out how to overcome the problem. A bigger problem I can think of is the role table. All of your roles in each db should be the same, or else you can have people assigned to roles that don't exist or roles they shouldn't be assigned to. One option is to point all of the role tables at the same source as well, but that could also be difficult to do.
  • Options
    You should try to make copies of the fields that could create some trouble; for example instead of using RoleID, you could create Forum1RoleID and Forum2RoleID and map $DatabaseColumns['User']['RoleID'] to the good field.

    Field like that should have a default value, and in this case you should think to a default role for each forum. When a user sign-up to forum1 you should think to the default role for forum2, and maybe create an extension to allow him to resquest a new role in forum two.
  • Options
    MarkMark Vanilla Staff
    Good ideas, Dinoboff! :)
  • Options
    @Mark ... At first blush, I think sharing the same roles is fine, but much appreciate the needed caution.

    @Dinoboff ... If I go bonkers, would I do the role id mapping also in conf/database.php? Would you mind supplying a 'typical' mapping statement? I am still wondering about UserBlocksCategories - how should I handle this?

    I greatly appreciate the time spent helping. I know this is totally out-of-the-box caveat emptor stuff where the buyer who should beware is me.
  • Options
    On the Categories page, you can see Block category option for each category. This options is stored in UserBlocksCategories. if your forum don't share the same categories (you could), the users that block the #nd cotogy in forum 1 with block it also in forum 2
This discussion has been closed.