Wikia code/includes/specials/SpecialSpecialpages.php
Appearance
This page is obsolete. It is being retained for archival purposes. It may document extensions or features that are obsolete and/or no longer supported. Do not rely on the information here being up-to-date. The information shown below refers to the now unmaintained 1.16 MediaWiki release. The current stable release number is 1.42.3. |
This seems like a pretty good idea... would recommend merging this whole $wgSpecialPagesRequiredLogin
(& redirecting to login) system to core.
--- D:\Programming\SVN\mediawiki\branches\REL1_16\phase3\includes\specials\SpecialSpecialpages.php 2011-07-18 22:31:17.680664100 +0100
+++ D:\Programming\SVN\wikia\trunk\includes\specials\SpecialSpecialpages.php 2011-08-17 15:28:16.327148400 +0100
@@ -8,7 +8,7 @@
*
*/
function wfSpecialSpecialpages() {
- global $wgOut, $wgUser, $wgMessageCache, $wgSortSpecialPages;
+ global $wgOut, $wgUser, $wgMessageCache, $wgSortSpecialPages, $wgSpecialPagesRequiredLogin;
$wgMessageCache->loadAllMessages();
@@ -61,7 +61,14 @@
$wgOut->addHTML( "<td width='30%' valign='top'><ul>\n" );
foreach( $sortedPages as $desc => $specialpage ) {
list( $title, $restricted ) = $specialpage;
+ /* Wikia change begin - @author: Marooned */
+ /* Redirect to login page instead of showing error, see Login friction project */
+ if ($wgUser->isAnon() && in_array(SpecialPage::resolveAlias($title->getDBkey()), $wgSpecialPagesRequiredLogin)) {
+ $link = $sk->makeKnownLinkObj( Title::makeTitle(NS_SPECIAL, 'Signup') , htmlspecialchars( $desc ), wfGetReturntoParam($title->getPrefixedDBkey()) );
+ } else {
$link = $sk->linkKnown( $title , htmlspecialchars( $desc ) );
+ }
+ /* Wikia change end */
if( $restricted ) {
$includesRestrictedPages = true;
$wgOut->addHTML( "<li class='mw-specialpages-page mw-specialpagerestricted'><strong>{$link}</strong></li>\n" );