MediaWiki
1.29.2
|
Implements a title blacklist for MediaWiki. More...
Public Member Functions | |
getBlacklist () | |
Get the current blacklist. More... | |
getWhitelist () | |
Get the current whitelist. More... | |
invalidate () | |
Invalidate the blacklist cache. More... | |
isBlacklisted ( $title, $action='edit') | |
Check whether the blacklist restricts performing a specific action on the given Title. More... | |
isWhitelisted ( $title, $action='edit') | |
Check whether it has been explicitly whitelisted that the current User may perform a specific action on the given Title. More... | |
load () | |
Load all configured blacklist sources. More... | |
loadWhitelist () | |
Load local whitelist. More... | |
userCannot ( $title, $user, $action='edit', $override=true) | |
Check whether the blacklist restricts given user performing a specific action on the given Title. More... | |
validate ( $blacklist) | |
Validate a new blacklist. More... | |
Static Public Member Functions | |
static | destroySingleton () |
Destroy/reset the current singleton instance. More... | |
static | parseBlacklist ( $list, $sourceName) |
Parse blacklist from a string. More... | |
static | singleton () |
Get an instance of this class. More... | |
static | userCanOverride ( $user, $action) |
Inidcates whether user can override blacklist on certain action. More... | |
Public Attributes | |
$mWhitelist = null | |
const | VERSION = 3 |
Static Protected Attributes | |
static TitleBlacklist | $instance = null |
Static Private Member Functions | |
static | getBlacklistText ( $source) |
Get the text of a blacklist from a specified source. More... | |
static | getHttp ( $url) |
Get the text of a blacklist source via HTTP. More... | |
Private Attributes | |
$mBlacklist = null | |
Implements a title blacklist for MediaWiki.
Definition at line 18 of file TitleBlacklist.list.php.
|
static |
Destroy/reset the current singleton instance.
This is solely for testing and will fail unless MW_PHPUNIT_TEST is defined.
Definition at line 44 of file TitleBlacklist.list.php.
Referenced by ApiQueryTitleBlacklistTest::setUp(), and ApiQueryTitleBlacklistTest::tearDown().
TitleBlacklist::getBlacklist | ( | ) |
Get the current blacklist.
Definition at line 250 of file TitleBlacklist.list.php.
References $mBlacklist, and load().
Referenced by isBlacklisted().
|
staticprivate |
Get the text of a blacklist from a specified source.
string | $source | A blacklist source from $wgTitleBlacklistSources |
Definition at line 104 of file TitleBlacklist.list.php.
References $page, $source, $title, captcha-old::count, WikiPage::factory(), ContentHandler::getContentText(), Title::newFromText(), NS_MEDIAWIKI, and wfMessage().
Referenced by load().
|
staticprivate |
Get the text of a blacklist source via HTTP.
$url | string URL of the blacklist source |
Definition at line 275 of file TitleBlacklist.list.php.
References $messageMemc, Http::get(), global, and wfMemcKey().
TitleBlacklist::getWhitelist | ( | ) |
Get the current whitelist.
Definition at line 262 of file TitleBlacklist.list.php.
References $mWhitelist, and loadWhitelist().
Referenced by isWhitelisted().
TitleBlacklist::invalidate | ( | ) |
Invalidate the blacklist cache.
Definition at line 292 of file TitleBlacklist.list.php.
References $cache, ObjectCache::getMainWANInstance(), and wfMemcKey().
TitleBlacklist::isBlacklisted | ( | $title, | |
$action = 'edit' |
|||
) |
Check whether the blacklist restricts performing a specific action on the given Title.
Definition at line 196 of file TitleBlacklist.list.php.
References $params, $title, as, getBlacklist(), isWhitelisted(), and Title::newFromText().
Referenced by userCannot().
TitleBlacklist::isWhitelisted | ( | $title, | |
$action = 'edit' |
|||
) |
Check whether it has been explicitly whitelisted that the current User may perform a specific action on the given Title.
Definition at line 232 of file TitleBlacklist.list.php.
References $title, as, getWhitelist(), and Title::newFromText().
Referenced by isBlacklisted().
TitleBlacklist::load | ( | ) |
Load all configured blacklist sources.
Definition at line 59 of file TitleBlacklist.list.php.
References $cache, $source, array(), as, captcha-old::count, getBlacklistText(), ObjectCache::getMainWANInstance(), global, parseBlacklist(), wfDebugLog(), and wfMemcKey().
Referenced by getBlacklist().
TitleBlacklist::loadWhitelist | ( | ) |
Load local whitelist.
Definition at line 84 of file TitleBlacklist.list.php.
References $cache, captcha-old::count, ObjectCache::getMainWANInstance(), global, parseBlacklist(), text, wfMemcKey(), and wfMessage().
Referenced by getWhitelist().
|
static |
Parse blacklist from a string.
$list | string Text of a blacklist source |
Definition at line 148 of file TitleBlacklist.list.php.
References $line, $lines, array(), as, and TitleBlacklistEntry::newFromString().
Referenced by load(), and loadWhitelist().
|
static |
Get an instance of this class.
Definition at line 31 of file TitleBlacklist.list.php.
Referenced by TitleBlacklistHooks::clearBlacklist(), TitleBlacklistHooks::displayBlacklistOverrideNotice(), ApiQueryTitleBlacklist::execute(), TitleBlacklistHooks::onMovePageCheckPermissions(), Scribunto_LuaTitleBlacklistLibrary::test(), TitleBlacklistHooks::testUserName(), TitleBlacklistHooks::userCan(), and TitleBlacklistHooks::validateBlacklist().
TitleBlacklist::userCannot | ( | $title, | |
$user, | |||
$action = 'edit' , |
|||
$override = true |
|||
) |
Check whether the blacklist restricts given user performing a specific action on the given Title.
$title | Title to check |
$user | User to check |
$action | string Action to check; 'edit' if unspecified |
$override | bool If set to true, overrides work |
Definition at line 172 of file TitleBlacklist.list.php.
References $params, $title, $user, and isBlacklisted().
|
static |
Inidcates whether user can override blacklist on certain action.
$action | Action |
Definition at line 323 of file TitleBlacklist.list.php.
References $user.
Referenced by TitleBlacklistHooks::addOverrideCheckbox(), and TitleBlacklistPreAuthenticationProvider::getAuthenticationRequests().
TitleBlacklist::validate | ( | $blacklist | ) |
Validate a new blacklist.
$blacklist | array |
Definition at line 303 of file TitleBlacklist.list.php.
References $e, array(), as, wfRestoreWarnings(), and wfSuppressWarnings().
|
staticprotected |
Definition at line 22 of file TitleBlacklist.list.php.
|
private |
Definition at line 19 of file TitleBlacklist.list.php.
Referenced by getBlacklist().
TitleBlacklist::$mWhitelist = null |
Definition at line 19 of file TitleBlacklist.list.php.
Referenced by getWhitelist().
const TitleBlacklist::VERSION = 3 |
Definition at line 24 of file TitleBlacklist.list.php.
Referenced by TitleBlacklistEntry::__construct().