Go to the documentation of this file.
14 global $wgCaptcha, $wgCaptchaClass;
16 if ( !static::$instanceCreated ) {
17 static::$instanceCreated =
true;
18 $wgCaptcha =
new $wgCaptchaClass;
53 $cache->delete(
$cache->makeKey(
'confirmedit',
'ipwhitelist' ) );
72 return self::getInstance()->confirmEmailUser( $from, $to, $subject, $text, $error );
91 global $wgCaptchaTriggers, $wgWikimediaJenkinsCI, $ceAllowConfirmedEmail,
92 $wgAllowConfirmedEmail;
96 if ( isset( $wgWikimediaJenkinsCI ) && $wgWikimediaJenkinsCI ===
true ) {
97 $wgCaptchaTriggers = array_fill_keys( array_keys( $wgCaptchaTriggers ),
false );
102 if ( isset( $ceAllowConfirmedEmail ) ) {
104 'Using $ceAllowConfirmedEmail is deprecated, ' .
105 'please migrate to $wgAllowConfirmedEmail as a replacement.' );
106 $wgAllowConfirmedEmail = $ceAllowConfirmedEmail;
132 if ( !$wgCaptchaDirectory ) {
133 $wgCaptchaDirectory =
"$wgUploadDirectory/captcha";
142 require_once ( __DIR__ .
'/../ReCaptcha/recaptchalib.php' );
150 global $wgReCaptchaPublicKey, $wgReCaptchaPrivateKey;
152 global $recaptcha_public_key, $recaptcha_private_key;
157 if ( $wgReCaptchaPublicKey ==
'' ) {
158 $wgReCaptchaPublicKey = $recaptcha_public_key;
160 if ( $wgReCaptchaPrivateKey ==
'' ) {
161 $wgReCaptchaPrivateKey = $recaptcha_private_key;
164 if ( $wgReCaptchaPublicKey ==
'' || $wgReCaptchaPrivateKey ==
'' ) {
166 'You need to set $wgReCaptchaPrivateKey and $wgReCaptchaPublicKey in LocalSettings.php to ' .
167 "use the reCAPTCHA plugin. You can sign up for a key <a href='" .
168 htmlentities( recaptcha_get_signup_url(
$wgServerName,
"mediawiki" ) ) .
190 if ( !
$title->equals( $exceptionTitle ) ) {
194 $ctx =
$editor->getArticle()->getContext();
195 $out = $ctx->getOutput();
196 $lang = $ctx->getLanguage();
201 [
'class' =>
'warningbox' ],
202 $ctx->msg(
'confirmedit-preview-description' )->parse()
206 [
'class' =>
'wikitable sortable' ]
209 Html::element(
'th', [], $ctx->msg(
'confirmedit-preview-line' )->text() ) .
210 Html::element(
'th', [], $ctx->msg(
'confirmedit-preview-content' )->text() ) .
211 Html::element(
'th', [], $ctx->msg(
'confirmedit-preview-validity' )->text() ) .
216 if ( $ip ===
'' || strpos( $ip,
'#' ) !==
false ) {
220 $validity = $ctx->msg(
'confirmedit-preview-valid' )->escaped();
223 $validity = $ctx->msg(
'confirmedit-preview-invalid' )->escaped();
230 $lang->formatNum( $count + 1 )
237 $lang->truncate( $ip, 50 )
244 [
'class' =>
'mw-confirmedit-ip-' .
$css ],
250 $out->addModuleStyles(
'ext.confirmEdit.editPreview.ipwhitelist.styles' );
error also a ContextSource you ll probably need to make sure the header is varied on and they can depend only on the ResourceLoaderContext $context
static onTitleReadWhitelist(Title $title, User $user, &$whitelisted)
TitleReadWhitelist hook handler.
if(!isset( $args[0])) $lang
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist and Watchlist you will want to construct new ChangesListBooleanFilter or ChangesListStringOptionsFilter objects When constructing you specify which group they belong to You can reuse existing or create your you must register them with $special registerFilterGroup removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set $status
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
Class representing a MediaWiki article and history.
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name If you don't need a full Title object,...
static getInstance()
Get the global Captcha instance.
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Generic operation result class Has warning/error list, boolean status and arbitrary value.
static closeElement( $element)
Returns "</$element>".
static confirmEditPage( $editpage, $buttons, $tabindex)
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses & $html
namespace and then decline to actually register it file or subcat img or subcat $title
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
static confirmEmailUser( $from, $to, $subject, $text, &$error)
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist and Watchlist you will want to construct new ChangesListBooleanFilter or ChangesListStringOptionsFilter objects When constructing you specify which group they belong to You can reuse existing or create your you must register them with $special registerFilterGroup removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content $content
getTitle()
Get the title object of the article.
in this case you re responsible for computing and outputting the entire conflict i the difference between revisions and your text headers and sections and Diff & $tabindex
static makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
when a variable name is used in a it is silently declared as a new masking the global
passed in as a query string parameter to the various URLs constructed here(i.e. $prevlink) $ldel you ll need to handle error etc yourself modifying $error and returning true will cause the contents of $error to be echoed at the top of the edit form as wikitext Return true without altering $error to allow the edit to proceed & $editor
static confirmEditMerged( $context, $content, $status, $summary, $user, $minorEdit)
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output modifiable modifiable after all normalizations have been except for the $wgMaxImageArea check $image
static efReCaptcha()
Extension function, moved from ReCaptcha.php when that was decimated.
static onFancyCaptchaSetup()
Callback for extension.json of FancyCaptcha to set a default captcha directory, which depends on wgUp...
$wgServerName
Server name.
$wgUploadDirectory
The filesystem path of the images directory.
static onPageContentSaveComplete(WikiPage $wikiPage, User $user, Content $content, $summary, $isMinor, $isWatch, $section, $flags, $revision, Status $status, $baseRevId)
PageContentSaveComplete hook handler.
The edit page/HTML interface (split from Article) The actual database and text munging is still in Ar...
Base interface for content objects.
Represents a title within MediaWiki.
static showEditFormFields(&$editPage, &$out)
static getMainWANInstance()
Get the main WAN cache object.
usually copyright or history_copyright This message must be in HTML not wikitext if the section is included from a template $section
static APIGetAllowedParams(&$module, &$params, $flags=1)
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
static confirmEditSetup()
Set up $wgWhitelistRead.
static openElement( $element, $attribs=[])
Identical to rawElement(), but has no third parameter and omits the end tag (and the self-closing '/'...
static rawElement( $element, $attribs=[], $contents='')
Returns an HTML element in a string.
Allows to change the fields on the form that will be generated are created Can be used to omit specific feeds from being outputted You must not use this hook to add use OutputPage::addFeedLink() instead. & $feedLinks hooks can tweak the array to change how login etc forms should look $requests
static onAlternateEditPreview(EditPage $editor, &$content, &$html, &$po)
AlternateEditPreview hook handler.
static injectEmailUser(&$form)
static element( $element, $attribs=[], $contents='')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
static onAuthChangeFormFields(array $requests, array $fieldInfo, array &$formDescriptor, $action)
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
static onReCaptchaSetup()
Callback for extension.json of ReCaptcha to require the recaptcha library php file.
it s the revision text itself In either if gzip is the revision text is gzipped $flags
static isIPAddress( $ip)
Determine if a string is as valid IP address or network (CIDR prefix).
the array() calling protocol came about after MediaWiki 1.4rc1.
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output $out