MediaWiki REL1_32
|
FancyCaptcha for displaying captchas precomputed by captcha.py. More...
Public Member Functions | |
describeCaptchaType () | |
estimateCaptchaCount () | |
getBackend () | |
getCaptcha () | |
Returns an array with 'salt' and 'hash' keys. | |
getCaptchaCount () | |
getCaptchaInfo ( $captchaData, $id) | |
getFormInformation ( $tabIndex=1) | |
hashFromImageName ( $basename) | |
imagePath ( $salt, $hash) | |
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. | |
addFormToOutput (OutputPage $out, $tabIndex=1) | |
Uses getFormInformation() to get the CAPTCHA form and adds it to the given OutputPage object. | |
apiGetAllowedParams (&$module, &$params, $flags) | |
canSkipCaptcha ( $user, Config $config) | |
Check whether the user provided / IP making the request is allowed to skip captchas. | |
captchaTriggers ( $title, $action) | |
clearCaptcha ( $index) | |
Clear out existing captcha info from the session, to ensure it can't be reused. | |
confirmEditMerged ( $context, $content, $status, $summary, $user, $minorEdit) | |
An efficient edit filter callback based on the text after section merging. | |
confirmEmailUser ( $from, $to, $subject, $text, &$error) | |
Check the captcha on Special:EmailUser. | |
createAuthenticationRequest () | |
editShowCaptcha ( $editPage) | |
Insert the captcha prompt into an edit form. | |
getError () | |
Return the error from the last passCaptcha* call. | |
getMessage ( $action) | |
Show a message asking the user to enter a captcha on edit The result will be treated as wiki text. | |
increaseBadLoginCounter ( $username) | |
Increase bad login counter after a failed login. | |
injectEmailUser (&$form) | |
Inject whazawhoo @fixme if multiple thingies insert a header, could break. | |
isBadLoginPerUserTriggered ( $u) | |
Is the per-user captcha triggered? | |
isBadLoginTriggered () | |
Check if a bad login has already been registered for this IP address. | |
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. | |
passCaptchaFromRequest (WebRequest $request, User $user) | |
Given a required captcha run, test form input for correct input on the open session. | |
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. | |
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. | |
resetBadLoginCounter ( $username) | |
Reset bad login counter after a successful login. | |
retrieveCaptcha ( $index) | |
Fetch this session's captcha info. | |
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. | |
showHelp () | |
Show a page explaining what this wacky thing is. | |
storeCaptcha ( $info) | |
Generate a captcha session ID and save the info in PHP's session storage. | |
triggersCaptcha ( $action, $title=null) | |
Checks, whether the passed action should trigger a CAPTCHA. | |
Protected Member Functions | |
addCaptchaAPI (&$resultArr) | |
keyMatch ( $answer, $info) | |
Check if the submitted form matches the captcha session data provided by the plugin when the form was generated. | |
passCaptcha ( $index, $word) | |
Delete a solved captcha image, if $wgCaptchaDeleteOnSolve is true. | |
pickImage () | |
Select a previously generated captcha image from the queue. | |
pickImageDir ( $directory, $levels, &$lockouts) | |
pickImageFromDir ( $directory, &$lockouts) | |
pickImageFromList ( $directory, array $files, &$lockouts) | |
Protected Member Functions inherited from SimpleCaptcha | |
getCaptchaParamsFromRequest (WebRequest $request) | |
isAPICaptchaModule ( $module) | |
log ( $message) | |
Log the status and any triggering info for debugging or statistics. | |
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. | |
string | $trigger |
Used in log messages. | |
FancyCaptcha for displaying captchas precomputed by captcha.py.
Definition at line 9 of file FancyCaptcha.php.
|
protected |
array | &$resultArr |
Reimplemented from SimpleCaptcha.
Definition at line 86 of file FancyCaptcha.php.
References describeCaptchaType(), pickImage(), and SimpleCaptcha\storeCaptcha().
FancyCaptcha::describeCaptchaType | ( | ) |
Reimplemented from SimpleCaptcha.
Definition at line 102 of file FancyCaptcha.php.
Referenced by addCaptchaAPI().
FancyCaptcha::estimateCaptchaCount | ( | ) |
Definition at line 43 of file FancyCaptcha.php.
References getCaptchaCount(), and wfDeprecated().
FancyCaptcha::getBackend | ( | ) |
Definition at line 17 of file FancyCaptcha.php.
References 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 443 of file FancyCaptcha.php.
References pickImage().
Referenced by getFormInformation().
FancyCaptcha::getCaptchaCount | ( | ) |
Definition at line 51 of file FancyCaptcha.php.
References getBackend().
Referenced by estimateCaptchaCount().
FancyCaptcha::getCaptchaInfo | ( | $captchaData, | |
$id ) |
array | $captchaData | |
string | $id |
Reimplemented from SimpleCaptcha.
Definition at line 456 of file FancyCaptcha.php.
Referenced by onAuthChangeFormFields().
FancyCaptcha::getFormInformation | ( | $tabIndex = 1 | ) |
int | $tabIndex |
Reimplemented from SimpleCaptcha.
Definition at line 113 of file FancyCaptcha.php.
References $modules, getCaptcha(), SimpleCaptcha\storeCaptcha(), text, and wfMessage().
FancyCaptcha::hashFromImageName | ( | $basename | ) |
string | $basename |
Exception |
Definition at line 409 of file FancyCaptcha.php.
References $matches.
FancyCaptcha::imagePath | ( | $salt, | |
$hash ) |
string | $salt | |
string | $hash |
Definition at line 392 of file FancyCaptcha.php.
References getBackend().
Referenced by passCaptcha(), and showImage().
|
protected |
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.php.
References wfDebug().
FancyCaptcha::onAuthChangeFormFields | ( | array | $requests, |
array | $fieldInfo, | ||
array & | $formDescriptor, | ||
$action ) |
array | $requests | |
array | $fieldInfo | |
array | &$formDescriptor | |
string | $action |
Reimplemented from SimpleCaptcha.
Definition at line 467 of file FancyCaptcha.php.
References SimpleCaptcha\$action, $formDescriptor, $req, $requests, getCaptchaInfo(), and SimpleCaptcha\getMessage().
|
protected |
Delete a solved captcha image, if $wgCaptchaDeleteOnSolve is true.
@inheritDoc
Reimplemented from SimpleCaptcha.
Definition at line 421 of file FancyCaptcha.php.
References getBackend(), imagePath(), and SimpleCaptcha\retrieveCaptcha().
|
protected |
Select a previously generated captcha image from the queue.
Definition at line 189 of file FancyCaptcha.php.
References getBackend(), and pickImageDir().
Referenced by addCaptchaAPI(), and getCaptcha().
|
protected |
string | $directory | |
int | $levels | |
int | &$lockouts |
Definition at line 204 of file FancyCaptcha.php.
References $dirs, $wgMemc, getBackend(), pickImageDir(), pickImageFromDir(), and wfDebug().
Referenced by pickImage(), and pickImageDir().
|
protected |
string | $directory | |
int | &$lockouts |
Definition at line 265 of file FancyCaptcha.php.
References $wgMemc, getBackend(), pickImageFromList(), and wfDebug().
Referenced by pickImageDir().
|
protected |
string | $directory | |
array | $files | |
int | &$lockouts |
Definition at line 312 of file FancyCaptcha.php.
References $matches, $wgMemc, add, and getBackend().
Referenced by pickImageFromDir().
FancyCaptcha::showImage | ( | ) |
Definition at line 362 of file FancyCaptcha.php.
References $wgOut, $wgRequest, getBackend(), imagePath(), SimpleCaptcha\retrieveCaptcha(), SimpleCaptcha\storeCaptcha(), and wfHttpError().
|
staticprotected |
Definition at line 12 of file FancyCaptcha.php.