MediaWiki REL1_34
TitleBlacklistHooks Class Reference

Hooks for Title Blacklist. More...

Static Public Member Functions

static logFilterHitUsername ( $user, $title, $entry)
 Logs the filter username hit to Special:Log if $wgTitleBlacklistLogHits is enabled.
 
static onClearBlacklist (WikiPage $wikiPage, &$user, $content, $summary, $isminor, $iswatch, $section)
 PageContentSaveComplete hook.
 
static onDisplayBlacklistOverrideNotice (Title $title, $oldid, array &$notices)
 Display a notice if a user is only able to create or edit a page because they have tboverride.
 
static onMovePageCheckPermissions (Title $oldTitle, Title $newTitle, User $user, $reason, Status $status)
 MovePageCheckPermissions hook (1.25+)
 
static onScribuntoExternalLibraries ( $engine, array &$extraLibraries)
 External Lua library for Scribunto.
 
static onUserCan ( $title, $user, $action, &$result)
 getUserPermissionsErrorsExpensive hook
 
static onValidateBlacklist ( $editor, $text, $section, &$error)
 EditFilter hook.
 
static testUserName ( $userName, User $creatingUser, $override=true, $log=false)
 Check whether a user name is acceptable for account creation or autocreation, and explain why not if that's the case.
 

Detailed Description

Hooks for Title Blacklist.

Author
Victor Vasiliev
Note
© 2007-2010 Victor Vasiliev et al
GPL-2.0-or-later Hooks for the TitleBlacklist class

Definition at line 14 of file TitleBlacklistHooks.php.

Member Function Documentation

◆ logFilterHitUsername()

static TitleBlacklistHooks::logFilterHitUsername ( $user,
$title,
$entry )
static

Logs the filter username hit to Special:Log if $wgTitleBlacklistLogHits is enabled.

Parameters
User$user
Title$title
string$entry

Definition at line 237 of file TitleBlacklistHooks.php.

References $title.

Referenced by testUserName().

◆ onClearBlacklist()

static TitleBlacklistHooks::onClearBlacklist ( WikiPage $wikiPage,
& $user,
$content,
$summary,
$isminor,
$iswatch,
$section )
static

PageContentSaveComplete hook.

Parameters
WikiPage$wikiPage
User&$user
Content$content
string$summary
bool$isminor
bool$iswatch
string$section

Definition at line 220 of file TitleBlacklistHooks.php.

References $title, WikiPage\getTitle(), NS_MEDIAWIKI, and TitleBlacklist\singleton().

◆ onDisplayBlacklistOverrideNotice()

static TitleBlacklistHooks::onDisplayBlacklistOverrideNotice ( Title $title,
$oldid,
array & $notices )
static

Display a notice if a user is only able to create or edit a page because they have tboverride.

Parameters
Title$title
int$oldid
array&$notices

Definition at line 76 of file TitleBlacklistHooks.php.

References $title, getUser(), TitleBlacklist\singleton(), and wfMessage().

◆ onMovePageCheckPermissions()

static TitleBlacklistHooks::onMovePageCheckPermissions ( Title $oldTitle,
Title $newTitle,
User $user,
$reason,
Status $status )
static

MovePageCheckPermissions hook (1.25+)

Parameters
Title$oldTitle
Title$newTitle
User$user
string$reason
Status$status
Returns
bool

Definition at line 110 of file TitleBlacklistHooks.php.

References ApiMessage\create(), StatusValue\fatal(), Title\getFullText(), and TitleBlacklist\singleton().

◆ onScribuntoExternalLibraries()

static TitleBlacklistHooks::onScribuntoExternalLibraries ( $engine,
array & $extraLibraries )
static

External Lua library for Scribunto.

Parameters
string$engine
array&$extraLibraries

Definition at line 257 of file TitleBlacklistHooks.php.

◆ onUserCan()

static TitleBlacklistHooks::onUserCan ( $title,
$user,
$action,
& $result )
static

getUserPermissionsErrorsExpensive hook

Parameters
Title$title
User$user
string$action
array | IApiMessage&$result
Returns
bool

Definition at line 26 of file TitleBlacklistHooks.php.

References $title, ApiMessage\create(), TitleBlacklist\singleton(), and wfMessage().

◆ onValidateBlacklist()

static TitleBlacklistHooks::onValidateBlacklist ( $editor,
$text,
$section,
& $error )
static

EditFilter hook.

Parameters
EditPage$editor
string$text
string$section
string&$error

Definition at line 183 of file TitleBlacklistHooks.php.

References $title, NS_MEDIAWIKI, TitleBlacklist\parseBlacklist(), TitleBlacklist\singleton(), and wfMessage().

◆ testUserName()

static TitleBlacklistHooks::testUserName ( $userName,
User $creatingUser,
$override = true,
$log = false )
static

Check whether a user name is acceptable for account creation or autocreation, and explain why not if that's the case.

Parameters
string$userName
User$creatingUser
bool$overrideShould the test be skipped, if the user has sufficient privileges?
bool$logLog blacklist hits to Special:Log
Returns
StatusValue

Definition at line 142 of file TitleBlacklistHooks.php.

References $title, ApiMessage\create(), logFilterHitUsername(), NS_USER, and TitleBlacklist\singleton().

Referenced by TitleBlacklistPreAuthenticationProvider\testForAccountCreation(), and TitleBlacklistPreAuthenticationProvider\testUserForCreation().


The documentation for this class was generated from the following file: