14 global $wgCaptcha, $wgCaptchaClass;
16 $class = $wgCaptchaClass;
17 if ( $class ==
null ) {
18 $class =
'SimpleCaptcha';
20 if ( !static::$instanceCreated ) {
21 static::$instanceCreated =
true;
22 $wgCaptcha =
new $class;
40 return self::getInstance()->confirmEditMerged(
$context,
$content, $status, $summary,
63 $summary, $isMinor, $isWatch, $section, $flags, $revision,
Status $status, $baseRevId
67 $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
68 $cache->delete(
$cache->makeKey(
'confirmedit',
'ipwhitelist' ) );
78 self::getInstance()->editShowCaptcha( $editpage );
86 self::getInstance()->showEditFormFields( $editPage, $out );
94 return self::getInstance()->injectEmailUser( $form );
106 return self::getInstance()->confirmEmailUser( $from, $to, $subject, $text, $error );
118 return self::getInstance()->apiGetAllowedParams( $module, $params, $flags );
128 array $requests, array $fieldInfo, array &$formDescriptor, $action
130 self::getInstance()->onAuthChangeFormFields( $requests, $fieldInfo, $formDescriptor, $action );
135 global $wgCaptchaTriggers, $wgAllowConfirmedEmail,
136 $wgWikimediaJenkinsCI, $ceAllowConfirmedEmail;
140 if ( isset( $wgWikimediaJenkinsCI ) && $wgWikimediaJenkinsCI ===
true ) {
141 $wgCaptchaTriggers = array_fill_keys( array_keys( $wgCaptchaTriggers ),
false );
146 if ( isset( $ceAllowConfirmedEmail ) ) {
148 'Using $ceAllowConfirmedEmail is deprecated, ' .
149 'please migrate to $wgAllowConfirmedEmail as a replacement.' );
150 $wgAllowConfirmedEmail = $ceAllowConfirmedEmail;
162 $image = SpecialPage::getTitleFor(
'Captcha',
'image' );
163 $help = SpecialPage::getTitleFor(
'Captcha',
'help' );
176 if ( !$wgCaptchaDirectory ) {
177 $wgCaptchaDirectory =
"$wgUploadDirectory/captcha";
195 $exceptionTitle = Title::makeTitle(
NS_MEDIAWIKI,
'Captcha-ip-whitelist' );
197 if ( !
$title->equals( $exceptionTitle ) ) {
202 $out = $ctx->getOutput();
203 $lang = $ctx->getLanguage();
206 $html .= Html::rawElement(
208 [
'class' =>
'warningbox' ],
209 $ctx->msg(
'confirmedit-preview-description' )->parse()
213 [
'class' =>
'wikitable sortable' ]
215 Html::openElement(
'thead' ) .
216 Html::element(
'th', [], $ctx->msg(
'confirmedit-preview-line' )->text() ) .
217 Html::element(
'th', [], $ctx->msg(
'confirmedit-preview-content' )->text() ) .
218 Html::element(
'th', [], $ctx->msg(
'confirmedit-preview-validity' )->text() ) .
219 Html::closeElement(
'thead' );
223 if ( $ip ===
'' || strpos( $ip,
'#' ) !==
false ) {
226 if ( IP::isIPAddress( $ip ) ) {
227 $validity = $ctx->msg(
'confirmedit-preview-valid' )->escaped();
230 $validity = $ctx->msg(
'confirmedit-preview-invalid' )->escaped();
233 $html .= Html::openElement(
'tr' ) .
237 $lang->formatNum( $count + 1 )
244 $lang->truncateForVisual( $ip, 50 )
251 [
'class' =>
'mw-confirmedit-ip-' . $css ],
254 Html::closeElement(
'tr' );
256 $html .= Html::closeElement(
'table' );
257 $out->addModuleStyles(
'ext.confirmEdit.editPreview.ipwhitelist.styles' );
$wgUploadDirectory
The filesystem path of the images directory.
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
static onFancyCaptchaSetup()
Callback for extension.json of FancyCaptcha to set a default captcha directory, which depends on wgUp...
static injectEmailUser(&$form)
static confirmEditMerged( $context, $content, $status, $summary, $user, $minorEdit)
static showEditFormFields( $editPage, &$out)
static confirmEditPage(EditPage $editpage)
static confirmEmailUser( $from, $to, $subject, $text, &$error)
static onTitleReadWhitelist(Title $title, User $user, &$whitelisted)
TitleReadWhitelist hook handler.
static onAlternateEditPreview(EditPage $editor, &$content, &$html, &$po)
AlternateEditPreview hook handler.
static onAuthChangeFormFields(array $requests, array $fieldInfo, array &$formDescriptor, $action)
static onPageContentSaveComplete(WikiPage $wikiPage, User $user, Content $content, $summary, $isMinor, $isWatch, $section, $flags, $revision, Status $status, $baseRevId)
PageContentSaveComplete hook handler.
static onAPIGetAllowedParams(&$module, &$params, $flags=1)
APIGetAllowedParams hook handler Default $flags to 1 for backwards-compatible behavior.
static getInstance()
Get the global Captcha instance.
static confirmEditSetup()
The edit page/HTML interface (split from Article) The actual database and text munging is still in Ar...
Generic operation result class Has warning/error list, boolean status and arbitrary value.
Represents a title within MediaWiki.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
Class representing a MediaWiki article and history.
getTitle()
Get the title object of the article.
Base interface for content objects.
if(!isset( $args[0])) $lang