Page MenuHomePhabricator

Add variable to represent group of wikis, rather than using $wgDBname
Open, LowPublic

Description

When using OATHAuth with a central DB, it means the account name is going to use the local Sitename... Which is fine if all sites were the same... But we have MediaWiki, Wikipedia... etc

	public function getAccount() {
		global $wgSitename;

		return "$wgSitename:{$this->user->getName()}";
	}

We should force it to something like Wikimedia, possibly in English? As otherwise it could become confusing that the account for Wikipedia 2FA works on MediaWiki

Helps fix like T138423 for WMF wikis too... But that bug is still there for other non WMF wikis

Event Timeline

Reedy renamed this task from Don't use sitename when wgOATHAuthDatabase != $wgDBname to Don't use sitename when $wgOATHAuthDatabase != $wgDBname.Oct 11 2016, 11:42 PM
Reedy updated the task description. (Show Details)

Is there some sense of a global site group name in CentralAuth? If there isn't then we should just have a config variable for this extension, rather than forcing the string "Wikimedia".

Is there some sense of a global site group name in CentralAuth? If there isn't then we should just have a config variable for this extension, rather than forcing the string "Wikimedia".

Oh god, no, I wasn't meaning to suggest to hardcode in Wikimedia or similar; a new config global was gonna be my suggestion if there wasn't some better way to get it. I was just thinking with a Wikimedia centric head on.

Of course, CentralAuth has this as a much larger and systematic problem... T86741 and I'm sure there's another task or two kicking about.

I propose we just define a $wgOATHAuthAccountPrefix or similar. If it's defined, use that instead of $wgSitename, and set it to Wikimedia or something similar in WMF config

Change 318926 had a related patch set uploaded (by Reedy):
Allow override of Site prefix without changing sitename

https://gerrit.wikimedia.org/r/318926

Change 318926 merged by jenkins-bot:
Allow override of Site prefix without changing sitename

https://gerrit.wikimedia.org/r/318926

Reedy claimed this task.

https://gerrit.wikimedia.org/r/320266 will put the config on WMF wikis, and .2 will have the code in place

Tgr subscribed.

This should be a message key, not a plain string. Not all languages use the Latin alphabet; even those that do might adapt the spelling of proper nouns.

This should be a message key, not a plain string. Not all languages use the Latin alphabet; even those that do might adapt the spelling of proper nouns.

The variable should hold a message key? Or this should just be based on a message key? And if said message is not disabled, use it? Do we use the sites language, or the users language on that site?

And in WMF case, translated in WikimediaMessages?

It was to try and mitigate T138423, so we wouldn't have mixed rtl and ltr in the same string...

I would go with a variable which is a message key (given that a message with the site/farm name probably already exists for other purposes). And set it via WikimediaMessages, yeah.

I would go with a variable which is a message key (given that a message with the site/farm name probably already exists for other purposes). And set it via WikimediaMessages, yeah.

I've just had a quick look on WikimediaMessages, there doesn't seem to be a message that is just "Wikimedia"... Curious

Reedy renamed this task from Don't use sitename when $wgOATHAuthDatabase != $wgDBname to Add variable to represent group of wikis, rather than using $wgDBname.Nov 12 2016, 12:59 PM
Reedy removed Reedy as the assignee of this task.Jun 19 2019, 9:31 PM