Question

Is it possible to load different LocalSettings.php in MediaWiki based on login.

Was it helpful?

Solution

LocalSettings.php can be treated as any other server-side script. These settings are not cached, so they are processed with each page request.

In your case, simply choosing settings based on the user rights would be easy to implement. I would look at:

User::getRights() or User::getGroups()

and alter config options accordingly.

In addition, /includes/WebStart.php loads LocalSettings.php, so you could also change your config file path there based on user settings.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top