Index: trunk/extensions/CentralNotice/special/SpecialHideBanners.php |
— | — | @@ -28,9 +28,16 @@ |
29 | 29 | readfile( dirname( __FILE__ ) . '/../1x1.png' ); |
30 | 30 | } |
31 | 31 | |
| 32 | + /** |
| 33 | + * Set the cookie for hiding fundraising banners. |
| 34 | + */ |
32 | 35 | function setHideCookie() { |
33 | | - global $wgNoticeCookieDomain, $wgCookieSecure; |
34 | | - $exp = time() + 86400 * 14; // Cookie expires after 2 weeks |
| 36 | + global $wgNoticeCookieDomain, $wgCookieSecure, $wgNoticeHideBannersExpiration; |
| 37 | + if ( is_numeric( $wgNoticeHideBannersExpiration ) ) { |
| 38 | + $exp = $wgNoticeHideBannersExpiration; |
| 39 | + } else { |
| 40 | + $exp = time() + 86400 * 14; // Cookie expires after 2 weeks |
| 41 | + } |
35 | 42 | if ( is_callable( array( 'CentralAuthUser', 'getCookieDomain' ) ) ) { |
36 | 43 | $cookieDomain = CentralAuthUser::getCookieDomain(); |
37 | 44 | } else { |
Index: trunk/extensions/CentralNotice/CentralNotice.php |
— | — | @@ -52,6 +52,11 @@ |
53 | 53 | // Example: '.wikipedia.org' |
54 | 54 | $wgNoticeCookieDomain = ''; |
55 | 55 | |
| 56 | +// When the cookie set in SpecialHideBanners.php should expire |
| 57 | +// This would typically be the end date for a fundraiser |
| 58 | +// NOTE: This must be in UNIX timestamp format, for example, '1325462400' |
| 59 | +$wgNoticeHideBannersExpiration = ''; |
| 60 | + |
56 | 61 | $wgExtensionFunctions[] = 'efCentralNoticeSetup'; |
57 | 62 | |
58 | 63 | $wgExtensionCredits['other'][] = array( |