38 lines
1.3 KiB
PHP
38 lines
1.3 KiB
PHP
<?php
|
|
|
|
if ( !defined( 'MEDIAWIKI' ) ) {
|
|
die( 'This is an extension to the MediaWiki package and cannot be run standalone.' );
|
|
}
|
|
|
|
class SecretSpecialHooks {
|
|
public static function onSpecialPage_initList( &$list ) {
|
|
$context = RequestContext::getMain();
|
|
$user = $context->getUser();
|
|
//Debug print of userID. We may not use $user->isRegistered() here, because the Session Context may not be called and it breaks session functionality on th rest of the wiki
|
|
//print_r($user->mId);
|
|
//if ( $user->mId == 1 ) {
|
|
// print_r($list);
|
|
//}
|
|
|
|
// Do this if the user is not logged in. Logged in usere have a ID > 0
|
|
if ( $user->mId <= 0 ) {
|
|
$templist = $list;
|
|
|
|
//Clear list of available Special Pages
|
|
$list = array();
|
|
|
|
// Enable Login page
|
|
$list['Userlogin'] = $templist['Userlogin'];
|
|
// Enable Logout page
|
|
$list['Userlogout'] = $templist['Userlogout'];
|
|
// Enable RequestAccount Page
|
|
$list['RequestAccount'] = $templist['RequestAccount'];
|
|
// Enable CreateAccount Page
|
|
$list['CreateAccount'] = $templist['CreateAccount'];
|
|
// Enable Search
|
|
$list['Search'] = $templist['Search'];
|
|
}
|
|
return true;
|
|
}
|
|
}
|