Skip to content

Instantly share code, notes, and snippets.

@sdouglas
Created July 30, 2012 20:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sdouglas/3209877 to your computer and use it in GitHub Desktop.
Save sdouglas/3209877 to your computer and use it in GitHub Desktop.
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