MediaWiki  1.33.0
TitleBlacklistHooks Class Reference

Hooks for Title Blacklist. More...

Static Public Member Functions

static clearBlacklist (WikiPage &$wikiPage, &$user, $content, $summary, $isminor, $iswatch, $section)
 PageContentSaveComplete hook. More...
 
static displayBlacklistOverrideNotice (Title $title, $oldid, array &$notices)
 Display a notice if a user is only able to create or edit a page because they have tboverride. More...
 
static logFilterHitUsername ( $user, $title, $entry)
 Logs the filter username hit to Special:Log if $wgTitleBlacklistLogHits is enabled. More...
 
static onMovePageCheckPermissions (Title $oldTitle, Title $newTitle, User $user, $reason, Status $status)
 MovePageCheckPermissions hook (1.25+) More...
 
static scribuntoExternalLibraries ( $engine, array &$extraLibraries)
 External Lua library for Scribunto. More...
 
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. More...
 
static userCan ( $title, $user, $action, &$result)
 getUserPermissionsErrorsExpensive hook More...
 
static validateBlacklist ( $editor, $text, $section, &$error)
 EditFilter hook. More...
 

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

◆ clearBlacklist()

static TitleBlacklistHooks::clearBlacklist ( 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
Returns
true

Definition at line 223 of file TitleBlacklistHooks.php.

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

◆ displayBlacklistOverrideNotice()

static TitleBlacklistHooks::displayBlacklistOverrideNotice ( 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
Returns
true

Definition at line 76 of file TitleBlacklistHooks.php.

References $params, $title, RequestContext\getMain(), TitleBlacklist\singleton(), and wfMessage().

◆ 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 242 of file TitleBlacklistHooks.php.

References $title, and $user.

Referenced by testUserName().

◆ 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 $oldTitle, $user, ApiMessage\create(), Title\getFullText(), and TitleBlacklist\singleton().

◆ scribuntoExternalLibraries()

static TitleBlacklistHooks::scribuntoExternalLibraries (   $engine,
array $extraLibraries 
)
static

External Lua library for Scribunto.

Parameters
string$engine
array&$extraLibraries
Returns
bool

Definition at line 263 of file TitleBlacklistHooks.php.

References $engine.

◆ 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 141 of file TitleBlacklistHooks.php.

References $params, $title, ApiMessage\create(), logFilterHitUsername(), Title\makeTitleSafe(), StatusValue\newFatal(), StatusValue\newGood(), NS_USER, ApiResult\setIndexedTagName(), and TitleBlacklist\singleton().

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

◆ userCan()

static TitleBlacklistHooks::userCan (   $title,
  $user,
  $action,
$result 
)
static

getUserPermissionsErrorsExpensive hook

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

Definition at line 25 of file TitleBlacklistHooks.php.

References $params, $title, $user, ApiMessage\create(), ApiResult\setIndexedTagName(), TitleBlacklist\singleton(), and wfMessage().

◆ validateBlacklist()

static TitleBlacklistHooks::validateBlacklist (   $editor,
  $text,
  $section,
$error 
)
static

EditFilter hook.

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

Definition at line 183 of file TitleBlacklistHooks.php.

References $editor, $title, captcha-old\count, NS_MEDIAWIKI, TitleBlacklist\singleton(), and wfMessage().


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