Index: trunk/extensions/CentralNotice/CentralNotice.php |
— | — | @@ -64,6 +64,10 @@ |
65 | 65 | // This setting is currently shared with CentralAuth extension. |
66 | 66 | $wgCentralAuthCookieDomain = ''; |
67 | 67 | |
| 68 | +// Enable HideBanners Special Page |
| 69 | +// Set to true on wikis with donation thank you pages. |
| 70 | +$wgAllowHideBanners = 'false'; |
| 71 | + |
68 | 72 | $wgExtensionFunctions[] = 'efCentralNoticeSetup'; |
69 | 73 | |
70 | 74 | $wgExtensionCredits['other'][] = array( |
Index: trunk/extensions/CentralNotice/SpecialHideBanners.php |
— | — | @@ -5,7 +5,7 @@ |
6 | 6 | } |
7 | 7 | |
8 | 8 | /** |
9 | | - * Unlisted Special page to set cookies for hiding banners across all wikis. |
| 9 | + * Unlisted Special Page to set cookies for hiding banners across all wikis. |
10 | 10 | */ |
11 | 11 | class SpecialHideBanners extends UnlistedSpecialPage { |
12 | 12 | function __construct() { |
— | — | @@ -13,17 +13,19 @@ |
14 | 14 | } |
15 | 15 | |
16 | 16 | function execute( $par ) { |
17 | | - global $wgRequest, $wgOut; |
| 17 | + global $wgAllowHideBanners, $wgRequest, $wgOut; |
18 | 18 | |
19 | | - $this->setHideCookie(); |
20 | | - |
21 | | - $wgOut->disable(); |
22 | | - wfResetOutputBuffers(); |
23 | | - |
24 | | - header( 'Content-Type: image/png' ); |
25 | | - header( 'Cache-Control: no-cache' ); |
26 | | - |
27 | | - readfile( dirname( __FILE__ ) . '/1x1.png' ); |
| 19 | + if ( $wgAllowHideBanners ) { |
| 20 | + $this->setHideCookie(); |
| 21 | + |
| 22 | + $wgOut->disable(); |
| 23 | + wfResetOutputBuffers(); |
| 24 | + |
| 25 | + header( 'Content-Type: image/png' ); |
| 26 | + header( 'Cache-Control: no-cache' ); |
| 27 | + |
| 28 | + readfile( dirname( __FILE__ ) . '/1x1.png' ); |
| 29 | + } |
28 | 30 | } |
29 | 31 | |
30 | 32 | function setHideCookie() { |