Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Display "View Source" link in MediaWiki for logged out users
if ( !$wgUser->isAllowed('edit') ) {
# if ( $wgUser->isAnon() ) {
# $this->userNotLoggedInPage();
# return;
# } else {
# $wgOut->readOnlyPage( $this->mArticle->getContent( true ), true );
# return;
# }
# Make source available to anon users
$wgOut->readOnlyPage( $this->mArticle->getContent( true ), true );
return;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.