first commit
This commit is contained in:
37
includes/SecretSpecialHooks.php
Normal file
37
includes/SecretSpecialHooks.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user