MediaWiki
1.30.0
|
FancyCaptcha for displaying captchas precomputed by captcha.py. More...
Public Member Functions | |
addCaptchaAPI (&$resultArr) | |
describeCaptchaType () | |
estimateCaptchaCount () | |
getBackend () | |
getCaptcha () | |
Returns an array with 'salt' and 'hash' keys. More... | |
getCaptchaCount () | |
getCaptchaInfo ( $captchaData, $id) | |
getFormInformation ( $tabIndex=1) | |
hashFromImageName ( $basename) | |
imagePath ( $salt, $hash) | |
keyMatch ( $answer, $info) | |
Check if the submitted form matches the captcha session data provided by the plugin when the form was generated. More... | |
onAuthChangeFormFields (array $requests, array $fieldInfo, array &$formDescriptor, $action) | |
showImage () | |
Public Member Functions inherited from SimpleCaptcha | |
addFormInformationToOutput (OutputPage $out, array $formInformation) | |
Processes the given $formInformation array and adds the options (see getFormInformation()) to the given OutputPage object. More... | |
addFormToOutput (OutputPage $out, $tabIndex=1) | |
Uses getFormInformation() to get the CAPTCHA form and adds it to the given OutputPage object. More... | |
APIGetAllowedParams (&$module, &$params, $flags) | |
buildRegexes ( $lines) | |
Build regex from whitelist. More... | |
captchaTriggers ( $title, $action) | |
clearCaptcha ( $index) | |
Clear out existing captcha info from the session, to ensure it can't be reused. More... | |
confirmEditMerged ( $context, $content, $status, $summary, $user, $minorEdit) | |
An efficient edit filter callback based on the text after section merging. More... | |
confirmEmailUser ( $from, $to, $subject, $text, &$error) | |
Check the captcha on Special:EmailUser. More... | |
createAuthenticationRequest () | |
editShowCaptcha ( $editPage) | |
Insert the captcha prompt into an edit form. More... | |
filterLink ( $url) | |
Filter callback function for URL whitelisting. More... | |
findLinks ( $title, $text) | |
Extract a list of all recognized HTTP links in the text. More... | |
getError () | |
Return the error from the last passCaptcha* call. More... | |
getLinksFromTracker ( $title) | |
Load external links from the externallinks table. More... | |
getMessage ( $action) | |
Show a message asking the user to enter a captcha on edit The result will be treated as wiki text. More... | |
increaseBadLoginCounter ( $username) | |
Increase bad login counter after a failed login. More... | |
injectEmailUser (&$form) | |
Inject whazawhoo @fixme if multiple thingies insert a header, could break. More... | |
isBadLoginPerUserTriggered ( $u) | |
Is the per-user captcha triggered? More... | |
isBadLoginTriggered () | |
Check if a bad login has already been registered for this IP address. More... | |
isIPWhitelisted () | |
Check if the current IP is allowed to skip captchas. More... | |
loadText ( $title, $section, $flags=Revision::READ_LATEST) | |
Retrieve the current version of the page or section being edited... More... | |
log ( $message) | |
Log the status and any triggering info for debugging or statistics. More... | |
needCreateAccountCaptcha (User $creatingUser=null) | |
Logic to check if we need to pass a captcha for the current user to create a new account, or not. More... | |
passCaptchaFromRequest (WebRequest $request, User $user) | |
Given a required captcha run, test form input for correct input on the open session. More... | |
passCaptchaLimited ( $index, $word, User $user) | |
Checks, if the user reached the amount of false CAPTCHAs and give him some vacation or run self::passCaptcha() and clear counter if correct. More... | |
passCaptchaLimitedFromRequest (WebRequest $request, User $user) | |
Checks, if the user reached the amount of false CAPTCHAs and give him some vacation or run self::passCaptcha() and clear counter if correct. More... | |
resetBadLoginCounter ( $username) | |
Reset bad login counter after a successful login. More... | |
retrieveCaptcha ( $index) | |
Fetch this session's captcha info. More... | |
setAction ( $action) | |
setTrigger ( $trigger) | |
shouldCheck (WikiPage $page, $content, $section, $context, $oldtext=null) | |
showEditFormFields (&$editPage, &$out) | |
Show error message for missing or incorrect captcha on EditPage. More... | |
showHelp () | |
Show a page explaining what this wacky thing is. More... | |
storeCaptcha ( $info) | |
Generate a captcha session ID and save the info in PHP's session storage. More... | |
Protected Member Functions | |
passCaptcha ( $index, $word) | |
Delete a solved captcha image, if $wgCaptchaDeleteOnSolve is true. More... | |
pickImage () | |
Select a previously generated captcha image from the queue. More... | |
pickImageDir ( $directory, $levels, &$lockouts) | |
pickImageFromDir ( $directory, &$lockouts) | |
pickImageFromList ( $directory, array $files, &$lockouts) | |
Protected Member Functions inherited from SimpleCaptcha | |
getCaptchaParamsFromRequest (WebRequest $request) | |
isAPICaptchaModule ( $module) | |
Static Protected Attributes | |
static | $messagePrefix = 'fancycaptcha-' |
Static Protected Attributes inherited from SimpleCaptcha | |
static | $messagePrefix = 'captcha-' |
Additional Inherited Members | |
Protected Attributes inherited from SimpleCaptcha | |
string | $action |
Used to select the right message. More... | |
string | $trigger |
Used in log messages. More... | |
FancyCaptcha for displaying captchas precomputed by captcha.py.
Definition at line 9 of file FancyCaptcha.class.php.
FancyCaptcha::addCaptchaAPI | ( | & | $resultArr | ) |
array | $resultArr |
Reimplemented from SimpleCaptcha.
Definition at line 86 of file FancyCaptcha.class.php.
References $title, describeCaptchaType(), SpecialPage::getTitleFor(), pickImage(), and SimpleCaptcha::storeCaptcha().
FancyCaptcha::describeCaptchaType | ( | ) |
Reimplemented from SimpleCaptcha.
Definition at line 102 of file FancyCaptcha.class.php.
Referenced by addCaptchaAPI().
FancyCaptcha::estimateCaptchaCount | ( | ) |
Definition at line 43 of file FancyCaptcha.class.php.
References getCaptchaCount(), and wfDeprecated().
FancyCaptcha::getBackend | ( | ) |
Definition at line 17 of file FancyCaptcha.class.php.
References global, FileBackendGroup::singleton(), and wfWikiID().
Referenced by getCaptchaCount(), imagePath(), passCaptcha(), pickImage(), pickImageDir(), pickImageFromDir(), pickImageFromList(), and showImage().
FancyCaptcha::getCaptcha | ( | ) |
Returns an array with 'salt' and 'hash' keys.
Hash is md5( $wgCaptchaSecret . $salt . $answer . $wgCaptchaSecret . $salt )[0..15]
Exception | When a captcha image cannot be produced. |
Reimplemented from SimpleCaptcha.
Definition at line 422 of file FancyCaptcha.class.php.
References pickImage().
Referenced by getFormInformation().
FancyCaptcha::getCaptchaCount | ( | ) |
Definition at line 51 of file FancyCaptcha.class.php.
References getBackend().
Referenced by estimateCaptchaCount().
FancyCaptcha::getCaptchaInfo | ( | $captchaData, | |
$id | |||
) |
array | $captchaData | |
string | $id |
Reimplemented from SimpleCaptcha.
Definition at line 435 of file FancyCaptcha.class.php.
References $title, and SpecialPage::getTitleFor().
Referenced by onAuthChangeFormFields().
FancyCaptcha::getFormInformation | ( | $tabIndex = 1 | ) |
int | $tabIndex |
Reimplemented from SimpleCaptcha.
Definition at line 113 of file FancyCaptcha.class.php.
References $modules, $title, $wgEnableAPI, captcha-old::action, Html::closeElement(), Html::element(), getCaptcha(), SpecialPage::getTitleFor(), global, Html::openElement(), Html::rawElement(), SimpleCaptcha::storeCaptcha(), text, and wfMessage().
FancyCaptcha::hashFromImageName | ( | $basename | ) |
$basename | string |
Exception |
Definition at line 389 of file FancyCaptcha.class.php.
References $matches.
FancyCaptcha::imagePath | ( | $salt, | |
$hash | |||
) |
$salt | string |
$hash | string |
Definition at line 372 of file FancyCaptcha.class.php.
References getBackend(), and global.
Referenced by passCaptcha(), and showImage().
FancyCaptcha::keyMatch | ( | $answer, | |
$info | |||
) |
Check if the submitted form matches the captcha session data provided by the plugin when the form was generated.
string | $answer | |
array | $info |
Reimplemented from SimpleCaptcha.
Definition at line 68 of file FancyCaptcha.class.php.
FancyCaptcha::onAuthChangeFormFields | ( | array | $requests, |
array | $fieldInfo, | ||
array & | $formDescriptor, | ||
$action | |||
) |
array | $requests | |
array | $fieldInfo | |
array | $formDescriptor | |
string | $action |
Reimplemented from SimpleCaptcha.
Definition at line 446 of file FancyCaptcha.class.php.
References SimpleCaptcha::$action, $req, $requests, captcha-old::action, class, getCaptchaInfo(), and SimpleCaptcha::getMessage().
|
protected |
Delete a solved captcha image, if $wgCaptchaDeleteOnSolve is true.
Given a required captcha run, test form input for correct input on the open session.
string | $index | Captcha idenitifier |
string | $word | Captcha solution |
Reimplemented from SimpleCaptcha.
Definition at line 401 of file FancyCaptcha.class.php.
References getBackend(), global, imagePath(), and SimpleCaptcha::retrieveCaptcha().
|
protected |
Select a previously generated captcha image from the queue.
Definition at line 192 of file FancyCaptcha.class.php.
References getBackend(), global, and pickImageDir().
Referenced by addCaptchaAPI(), and getCaptcha().
|
protected |
$directory | string |
$levels | integer |
$lockouts | integer |
Definition at line 206 of file FancyCaptcha.class.php.
References $dirs, $wgMemc, as, captcha-old::count, getBackend(), global, pickImageFromDir(), and wfDebug().
Referenced by pickImage().
|
protected |
$directory | string |
$lockouts | integer |
Definition at line 258 of file FancyCaptcha.class.php.
References $wgMemc, as, captcha-old::count, getBackend(), global, pickImageFromList(), and wfDebug().
Referenced by pickImageDir().
|
protected |
$directory | string |
$files | array |
$lockouts | integer |
Definition at line 301 of file FancyCaptcha.class.php.
References $matches, $wgMemc, add, captcha-old::count, getBackend(), and global.
Referenced by pickImageFromDir().
FancyCaptcha::showImage | ( | ) |
Definition at line 342 of file FancyCaptcha.class.php.
References $wgOut, $wgRequest, getBackend(), global, imagePath(), SimpleCaptcha::retrieveCaptcha(), SimpleCaptcha::storeCaptcha(), and wfHttpError().
|
staticprotected |
Definition at line 12 of file FancyCaptcha.class.php.