Hi, I'm developing for my own needs an extension that allows to show different content based on whether the user is logged in or not. I don't think it's mature enough to be distributed yet :(
I also wanted to load a different css, based on that.
I proceeded as follows :
if (!self::is_registered()) {
$out->addStyle('/w/index.php?title=MediaWiki:NotLoggedIn.css&action=raw&ctype=text/css');
$out->addMeta( "logged", "no" );
}
else{
$out->addStyle('/w/index.php?title=MediaWiki:LoggedIn.css&action=raw&ctype=text/css');
$out->addMeta( "logged", "yes" );
}
It works, but even though MediaWiki:NotLoggedIn.css
is in my LocalSettings whitelist :
$wgWhitelistRead=array(
"MediaWiki:NotLoggedIn.css",//etc.
It can be displayed by users which are not authenticated. But
'/w/index.php?title=MediaWiki:NotLoggedIn.css&action=raw&ctype=text/css'
cannot.
Any idea of a workaround I could use ?
Thanks in advance for any suggestion anyone might have.