* Add wfReadOnlyReason() to supply the reason for the wiki being read only. Use it...
authorTim Starling <tstarling@users.mediawiki.org>
Sun, 24 Feb 2008 03:50:05 +0000 (03:50 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sun, 24 Feb 2008 03:50:05 +0000 (03:50 +0000)
includes/GlobalFunctions.php
includes/OutputPage.php

index 8556505..286a9b8 100644 (file)
@@ -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.
index 917a730..f152fac 100644 (file)
@@ -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 );
                }