TitleBlacklist:

Use a better hook (getUserPermissionsErrors)
This commit is contained in:
Victor Vasiliev 2007-12-15 06:16:19 +00:00
parent 9ecaa4f5b2
commit 281c040bd2
2 changed files with 5 additions and 6 deletions

View file

@ -20,8 +20,8 @@ class TitleBlacklistHooks {
} }
$blacklisted = $wgTitleBlacklist->isBlacklisted( $title, $action ); $blacklisted = $wgTitleBlacklist->isBlacklisted( $title, $action );
if( is_string( $blacklisted ) ) { if( is_string( $blacklisted ) ) {
//return wfMsgWikiHtml( "titleblacklist-forbidden-edit", htmlspecialchars( $blacklisted ), $title->getFullText() ); $result = array( 'titleblacklist-forbidden-edit', htmlspecialchars( $blacklisted ), $title->getFullText() );
return $result = false; return false;
} }
return $result = true; return $result = true;

View file

@ -43,8 +43,7 @@ function efSetupTitleBlacklistMessages() {
function efSetupTitleBlacklistHooks() { function efSetupTitleBlacklistHooks() {
global $wgHooks; global $wgHooks;
$titleBlacklistHooks = new TitleBlacklistHooks(); $wgHooks['getUserPermissionsErrors'][] = 'TitleBlacklistHooks::userCan';
$wgHooks['userCan'][] = array( $titleBlacklistHooks, 'userCan' ); $wgHooks['AbortMove'][] = 'TitleBlacklistHooks::abortMove';
$wgHooks['AbortMove'][] = array( $titleBlacklistHooks, 'abortMove' ); $wgHooks['UploadVerification'][] = 'TitleBlacklistHooks::verifyUpload';
$wgHooks['UploadVerification'][] = array( $titleBlacklistHooks, 'verifyUpload' );
} }