Skip to main content
Topic: Multi-forums sharing users (Read 7419 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Multi-forums sharing users

That's something that every once in a while pops up, and today is my day. :P

I was wondering how difficult would be to have two (or more) (almost) completely separated forums sharing the same users.
In fact is not that difficult, doing it the lazy way it would be just a matter of str_replace {db_prefix}members with another in a different database (with or without a different prefix or in the same db with a different prefix).

The most obvious drawback is that all the users would belong to the same membergroups on all the forums.
To avoid this the only solution is separate the member and the membergroups in the {db_prefix}members table, so create a new one...dunno {db_prefix}members_groups  (yeah I know it's way too similar to {db_prefix}membergroups, though for the sake of discussion is okay).
As a first approximation a table with | id_member | id_group | additional_groups | should do the trick.

That would be the basic, but there are quite few ways to "separate" two forums, I wonder how many would be of interest if any...well, not something worth think now.

Opinions, suggestions, insults, everything is welcome! :P

I'm not proposing this as a "core feature", but I'm thinking of supporting a "variation" of Elkarte that has this/these feature/s (a bit like WP and WP-multiuser were in the past).
Bugs creator.
Features destroyer.
Template killer.

Re: Multi-forums sharing users

Reply #1

Honestly, I'd suggest not doing it and instead taking the approach that IPS built for IPB - IP.Connect. You don't 'share' by having a common database but instead have a master/slave approach. When logging in the slave contacts the parent, if the account already exists it'll authenticate and pass back a token to log in that account, if not it'll create the account.

The best bit is that despite the name it isn't entirely IPS bound so you could conceivably implement a plugin for SMF, Elkarte and Wedge that acts as both master and slave and handles all this stuff.

Re: Multi-forums sharing users

Reply #2

I've spend some time on a master/slave approach back in 2010, based on 2.0RC3 IIRC. Well, it's horribly coded ...  :D  O:-)
The idea was to set SMF into slave mode and use an existing login to authenticate in SMF, such as the webserver's integrated auth mechanism (NTLM, Kerberos, basic auth...) or even another database...
Code is attached, but please don't laugh, I already know ..  :P

Re: Multi-forums sharing users

Reply #3

Oh. I see this as a significant step forward. (with the necessary care). Users shouldn't be stuck in atomic logins to each and every site and server and whatnot. Today, too much you install your forum and find yourself and your members in an "island".
The way I see forums/sites/webapps going in the future, is definitely the opposite of "islands".

Master-slave approach sounds very good IMO.
TE, how about adapting your code to Elk? ;)

Please note, that it's currently licensed under SMF old license.

Somewhat related, but on a different note...
I had started to redo our Auth, in the intention to rewrite it to support multiple authentication mechanisms as auth plugins/extensions. I didn't get far yet, though, only refactored small stuff. Next, it'd be to disentangle OpenID auth, from being hardcoded in, to have the implementation follow an interface. (= even remove it, and make it an extension)
What I'd like to know (from your integrations too, Ema), is what are the needs such plugins have from the core. To refactor/rewrite authentication-related methods to serve those needs better. (i.e. without these plugins needing to do "tricks" and "workarounds" limitations of the core methods.)
So any grumbles like "this is weird, I have to set some var to trick Elk, then call that function" should be bugs filed against our (coming) authentication backend.
The best moment for testing your PR is right after you merge it. Can't miss with that one.

Re: Multi-forums sharing users

Reply #4

Quote from: TestMonkey – TE, how about adapting your code to Elk? ;)
Please note, that it's currently licensed under SMF old license.
please ignore the licence, was just to lazy to replace it with a BSD license  :D
QuoteI had started to redo our Auth, in the intention to rewrite it to support multiple authentication mechanisms as auth plugins/extensions. I didn't get far yet, though, only refactored small stuff. Next, it'd be to disentangle OpenID auth, from being hardcoded in, to have the implementation follow an interface. (= even remove it, and make it an extension)
Sounds great, Auth really needs a refactoring :) I'll wait before I adapt parts of my "plugin" to Elk.
Thorsten "TE" Eurich
------------------------

Re: Multi-forums sharing users

Reply #5

Quote from: TestMonkey – So any grumbles like "this is weird, I have to set some var to trick Elk, then call that function" should be bugs filed against our (coming) authentication backend.
In that respect, I think that it would be nice to remove any IsAllowedTo, AllowedTo, fatal_[lang_]error from subs files.
I'm not sure there is any of these in any function registration/login related or have a parameter to override it.
Bugs creator.
Features destroyer.
Template killer.

Re: Multi-forums sharing users

Reply #6

Ema: file it as bug pretty please. I keep forgetting about it, and people don't even know this intention.

 TestMonkey gets older. :P
The best moment for testing your PR is right after you merge it. Can't miss with that one.

Re: Multi-forums sharing users

Reply #7

 emanuele didn't file a bug because he created (or he was thinking to create, that's not entirely clear :P) a branch a while ago. O:-)
Bugs creator.
Features destroyer.
Template killer.

Re: Multi-forums sharing users

Reply #8

Just put "remove authentication from models and move it to controllers where it belongs"