From: Tim Starling Date: Sun, 24 Feb 2008 03:50:05 +0000 (+0000) Subject: * Add wfReadOnlyReason() to supply the reason for the wiki being read only. Use it... X-Git-Tag: 1.31.0-rc.0~49384 X-Git-Url: http://git.cyclocoop.org//%22javascript:ModifierStyle%28%27%22.%24id.%22%27%29/%22?a=commitdiff_plain;h=cd56a97356138520c706067c9e3b9ee89344583f;p=lhc%2Fweb%2Fwiklou.git * Add wfReadOnlyReason() to supply the reason for the wiki being read only. Use it in OutputPage. --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 8556505d2e..286a9b80d4 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -305,6 +305,11 @@ function wfReadOnly() { return (bool)$wgReadOnly; } +function wfReadOnlyReason() { + global $wgReadOnly; + wfReadOnly(); + return $wgReadOnly; +} /** * Get a message from anywhere, for the current user language. diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 917a730c24..f152fac8d3 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -1097,7 +1097,7 @@ class OutputPage { * @param array $reasons List of reasons for this error, as returned by Title::getUserPermissionsErrors(). */ public function readOnlyPage( $source = null, $protected = false, $reasons = array() ) { - global $wgUser, $wgReadOnlyFile, $wgReadOnly, $wgTitle; + global $wgUser, $wgTitle; $skin = $wgUser->getSkin(); $this->setRobotpolicy( 'noindex,nofollow' ); @@ -1121,12 +1121,7 @@ class OutputPage { } else { // Wiki is read only $this->setPageTitle( wfMsg( 'readonly' ) ); - if ( $wgReadOnly ) { - $reason = $wgReadOnly; - } else { - // Should not happen, user should have called wfReadOnly() first - $reason = file_get_contents( $wgReadOnlyFile ); - } + $reason = wfReadOnlyReason(); $this->addWikiMsg( 'readonlytext', $reason ); }