MediaWiki  1.30.0
TitleBlacklistHooks Class Reference

Hooks for the TitleBlacklist class. More...

Static Public Member Functions

static abortAutoAccount ( $user, &$message)
 AbortAutoAccount hook. More...
 
static abortNewAccount ( $user, &$message, &$status)
 AbortNewAccount hook. More...
 
static acceptNewUserName ( $userName, $permissionsUser, &$err, $override=true, $log=false)
 Check whether a user name is acceptable, and set a message if unacceptable. More...
 
static addOverrideCheckbox (&$template)
 UserCreateForm hook based on the one from AntiSpoof extension. More...
 
static clearBlacklist (&$article, &$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 onAddNewAccountApiForm (ApiBase $apiModule, LoginForm $loginForm)
 Pass API parameter on to the login form when using API account creation. More...
 
static onAPIGetAllowedParams (ApiBase &$module, array &$params)
 
static onMovePageCheckPermissions (Title $oldTitle, Title $newTitle, User $user, $reason, Status $status)
 MovePageCheckPermissions hook (1.25+) More...
 
static onRegistration ()
 Called right after configuration variables have been set. 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 the TitleBlacklist class.

Definition at line 16 of file TitleBlacklist.hooks.php.

Member Function Documentation

◆ abortAutoAccount()

static TitleBlacklistHooks::abortAutoAccount (   $user,
$message 
)
static

AbortAutoAccount hook.

Parameters
User$user
string&$message
Returns
bool

Definition at line 245 of file TitleBlacklist.hooks.php.

References $user, and global.

◆ abortNewAccount()

static TitleBlacklistHooks::abortNewAccount (   $user,
$message,
$status 
)
static

AbortNewAccount hook.

Parameters
User$user
string&$message
Status&$status
Returns
bool

Definition at line 227 of file TitleBlacklist.hooks.php.

References $user, $wgRequest, $wgUser, global, true, and Status::wrap().

◆ acceptNewUserName()

static TitleBlacklistHooks::acceptNewUserName (   $userName,
  $permissionsUser,
$err,
  $override = true,
  $log = false 
)
static

Check whether a user name is acceptable, and set a message if unacceptable.

Used by abortNewAccount and centralAuthAutoCreate. May also be called externally to vet alternate account names.

Parameters
string$userName
User$permissionsUser
string&$err
bool$override
bool$log
Returns
bool Acceptable

Definition at line 166 of file TitleBlacklist.hooks.php.

References Status::wrap().

◆ addOverrideCheckbox()

static TitleBlacklistHooks::addOverrideCheckbox ( $template)
static

UserCreateForm hook based on the one from AntiSpoof extension.

Parameters
UsercreateTemplate&$template
Returns
true

Definition at line 316 of file TitleBlacklist.hooks.php.

References $template, $wgRequest, $wgUser, global, and TitleBlacklist::userCanOverride().

◆ clearBlacklist()

static TitleBlacklistHooks::clearBlacklist ( $article,
$user,
  $content,
  $summary,
  $isminor,
  $iswatch,
  $section 
)
static

PageContentSaveComplete hook.

Parameters
Article&$article
User&$user
Content$content
string$summary
bool$isminor
bool$iswatch
string$section
Returns
true

Definition at line 301 of file TitleBlacklist.hooks.php.

References $article, $title, 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 97 of file TitleBlacklist.hooks.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 373 of file TitleBlacklist.hooks.php.

References $title, $user, and global.

◆ onAddNewAccountApiForm()

static TitleBlacklistHooks::onAddNewAccountApiForm ( ApiBase  $apiModule,
LoginForm  $loginForm 
)
static

Pass API parameter on to the login form when using API account creation.

Parameters
ApiBase$apiModule
LoginForm$loginForm
Returns
bool Always true

Definition at line 351 of file TitleBlacklist.hooks.php.

References $wgRequest, ApiBase::getMain(), and global.

◆ onAPIGetAllowedParams()

static TitleBlacklistHooks::onAPIGetAllowedParams ( ApiBase $module,
array $params 
)
static
Parameters
ApiBase&$module
array&$params
Returns
bool

Definition at line 332 of file TitleBlacklist.hooks.php.

References $params, false, ApiBase::PARAM_DFLT, and ApiBase::PARAM_TYPE.

◆ 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 131 of file TitleBlacklist.hooks.php.

References $oldTitle, $user, ApiMessage::create(), Title::getFullText(), and TitleBlacklist::singleton().

◆ onRegistration()

static TitleBlacklistHooks::onRegistration ( )
static

Called right after configuration variables have been set.

Definition at line 21 of file TitleBlacklist.hooks.php.

References $wgAuthManagerAutoConfig, class, global, and Hooks::register().

◆ scribuntoExternalLibraries()

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

External Lua library for Scribunto.

Parameters
string$engine
array&$extraLibraries
Returns
bool

Definition at line 394 of file TitleBlacklist.hooks.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 186 of file TitleBlacklist.hooks.php.

References $params, $title, ApiMessage::create(), 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 46 of file TitleBlacklist.hooks.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 262 of file TitleBlacklist.hooks.php.

References $editor, $title, Html::closeElement(), captcha-old::count, Html::element(), NS_MEDIAWIKI, Html::openElement(), TitleBlacklist::singleton(), and wfMessage().


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