Closed Bug 296085 Opened 20 years ago Closed 17 years ago

Multiwiki user handling

Categories

(developer.mozilla.org Graveyard :: General, defect)

x86
All
defect
Not set
major

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: spam, Assigned: zbraniecki)

References

()

Details

Attachments

(2 files, 7 obsolete files)

http://developer-test.mozilla.org/docs/ requires login to see wiki source.
wikis on developer-test.mozilla.org uses same cookie PATH.

this causes confusion(browsers), inconvenient(frequent re-login) to editors.
Assignee: justdave → justdave
Alex was looking into this and discovered MediaWiki doesn't support setting a
cookie path (without hacking the code).

Mediawiki does, however, support specifying the same table for login info on
each one, which would effectively give us a single-signon within the domain. 
This might be a better option anyway.
I have looked at the mediawiki pages regarding SUL (single user login), 
http://meta.wikimedia.org/wiki/SUL, and they don't have any merging code yet, 
AFAICT.

On the other hand, there's the wikimania in Frankfurt, June 4th-8th. Or gandalf
can look at merging code.
Assignee: justdave → gandalf
Summary: cookie PATH should be changed → Multiwiki user handling
Ok. We had a chat with Dria and Pike on #devmo.
Pike found a var in MediaWiki that could save us. 

# Shared database for multiple wikis.
# Presently used for storing a user table for single sign-on
# The server for this database must be the same as for the main
# database.
# EXPERIMENTAL
$wgSharedDB = null;

Unfortunately, after checking that code... it sucks. It's absolutely useless
because it fails to deal with different server, different table names (for
example all tables in polish devmo has pl_ prefix and this pref tries to find
table pl_users in userwiki database instead of users) and has some other bugs
that will require patching.
I'll do this.

My plan is to:

1) Patch MediaWiki so it's able to get user data from different
server/db/tables. It's quite easy to fix. 
2) Write a script that will merge userlists from two databases to another. It
will require human interaction on collisions. I want to give ability to rename
one account, merge two to one, remove one.

Test, test, test, test, test, test.
Once I'm ready, I'll provide a bits. Justdave, polvi - any comments?
Status: NEW → ASSIGNED
In our case, the different able prefixes are the only thing you need to worry
about.  They are all on the same server and database already, just different
table prefixes.
Attached patch patch for mediawiki 1.4.5 (obsolete) — Splinter Review
It's a very trivial fix. It works for me with many wikis using their own tables
for everything beside user* tables which are stored in different, common
database.

The only big problem I found is that we can't store User pages :(

If you like this solution, I'll start writing a script to merge databases
without loosing user_id.
Attached patch patch v2 (obsolete) — Splinter Review
same patch - do not share access rights.
Attachment #186941 - Attachment is obsolete: true
(In reply to comment #5)
> The only big problem I found is that we can't store User pages :(

As said on irc, we store user pages per wiki, which is somewhere between OK and
good. So folks can put different emphasise in their user page or just translate
them, or, #REDIRECT if they don't want to.

We may want to evangelize them doing so for the talk page.
There is http://bugzilla.wikimedia.org/show_bug.cgi?id=2396 with a patch, too.
Slightly different, but only slightly, AFAICT. And only some 10 days old.
Do we have a way to push stuff into 1.5? That would be good, I guess.
Their patch still does not fix prefixes in user tables.
Applied the patch and it did do single sign-on. However, it did break the user
access rights because mediawiki uses the user_id instead of user_name. Also when
a new user is created a new entry with a corresponding user_id is put into the
prefix_user_rights table. If we ended up not making it centralized, we would at
least need to sync that table initially.

Deb also encountered a bug while trying to give someone a different access level
after the patch has been applied.

We are waiting a fix on this before we move from -test.
Changing QA contact to the default QA so interested parties can watch bugs filed
before the default QA was changed.  Only bugs in an unfixed state have been
changed; fixed bugs are unlikely to be reopened, and more bugspam is always a
bad thing.  Sorry for the bugspam - filter it into your Junk folder by searching
for 'WhyDoesMediaWikiHaveToBeEvilAndNotAcceptArbitraryCharactersInTitlesAndLinks'.
QA Contact: deb → qa
gandalf - any updates on this?
(In reply to comment #10)
> Applied the patch and it did do single sign-on. However, it did break the user
> access rights because mediawiki uses the user_id instead of user_name.

Yes. It's a feature, not a bug. 
Let's take two wikis: wiki1 and wiki2. We have some users in wiki1 and wiki2, we
want to use wiki1 users in wiki2.
Now, with this patch and after pointing it in wiki2, you can log in on wiki1
account in wiki2. From this moment all wiki2 users are not avaible.
From this moment you can also setup user_rights for User1 in wiki1 and,
independly in wiki2.

> Deb also encountered a bug while trying to give someone a different access level
> after the patch has been applied.

Investigating.
Attached patch patch v3 (obsolete) — Splinter Review
omg... it was so trivial and it took me nearly 3 hours.
I only had to add '`' signs around table name in tableName function.
Attachment #186947 - Attachment is obsolete: true
Attached file script (obsolete) —
Ok. Here comes the script.

It alows you to manage users in wiki (change user name, user rights, remove
user) and you can migrate users from another wiki to yours.
After this, you can switch database in that another wiki to use your wiki and
everything should be synced.
Attached file script v2
updated script. Fixes a problem with moveing user to new database with existing
ID.
Attachment #189235 - Attachment is obsolete: true
the fix was checked in
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Component: developer.mozilla.org → Infrastructure
Product: mozilla.org → Mozilla Developer Center
QA Contact: qa → infrastructure
Version: other → unspecified
Attached patch patch v4 (obsolete) — Splinter Review
patch against 1.6.5
Attachment #189135 - Attachment is obsolete: true
Attached patch emm, this is patch v4 (obsolete) — Splinter Review
the prvious one was v3. This is v4.
Attachment #220833 - Attachment is obsolete: true
REOPEN due to Bug 336474
Status: RESOLVED → REOPENED
Depends on: 336474
Resolution: FIXED → ---
Attached patch updated patch (obsolete) — Splinter Review
previous one had a flaw introduced during merging patch with trunk. This one is a proper one
Attachment #220834 - Attachment is obsolete: true
Attached patch updated patchSplinter Review
This patch updates the script to Mediawiki tip (~1.10.0)
Attachment #221022 - Attachment is obsolete: true
This seems broken on MDC since the last upgrade.

Before the MediaWiki upgrade, the cookies had a "wiki_mdc" prefix (e.g. wiki_mdcUserID).

After the upgrade, it seems that the prefix is "wiki_mdc_mediawiki" on the English pages (e.g. wiki_mdc_mediawikiUserID), and "wiki_mdc_fr" on the French pages (e.g. wiki_mdc_frUserID). Other settings (theme, interface language, ...) aren't shared between locales anymore.
Looks like it was a side effect of bug #381080, which has been fixed. I now stay logged in across all locales again.
Fixed, but never marked as such.
Status: REOPENED → RESOLVED
Closed: 19 years ago17 years ago
Resolution: --- → FIXED
Component: Deki Infrastructure → Other
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: