MediaWiki REL1_31
MathCaptcha Class Reference
Inheritance diagram for MathCaptcha:
Collaboration diagram for MathCaptcha:

Public Member Functions

 addCaptchaAPI (&$resultArr)
 
 describeCaptchaType ()
 
 fetchMath ( $sum)
 Fetch the math.
 
 getCaptcha ()
 
 getCaptchaInfo ( $captchaData, $id)
 
 getFormInformation ( $tabIndex=1)
 
 keyMatch ( $answer, $info)
 Validate a captcha response.
 
 onAuthChangeFormFields (array $requests, array $fieldInfo, array &$formDescriptor, $action)
 
 pickSum ()
 Pick a random sum.
 
- 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)
 
 buildRegexes ( $lines)
 Build regex from whitelist.
 
 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.
 
 filterLink ( $url)
 Filter callback function for URL whitelisting.
 
 findLinks ( $title, $text)
 Extract a list of all recognized HTTP links in the text.
 
 getError ()
 Return the error from the last passCaptcha* call.
 
 getLinksFromTracker ( $title)
 Load external links from the externallinks table.
 
 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.
 
 isIPWhitelisted ()
 Check if the current IP is allowed to skip captchas.
 
 loadText ( $title, $section, $flags=Revision::READ_LATEST)
 Retrieve the current version of the page or section being edited...
 
 log ( $message)
 Log the status and any triggering info for debugging or statistics.
 
 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.
 

Additional Inherited Members

- Protected Member Functions inherited from SimpleCaptcha
 getCaptchaParamsFromRequest (WebRequest $request)
 
 isAPICaptchaModule ( $module)
 
 passCaptcha ( $index, $word)
 Given a required captcha run, test form input for correct input on the open session.
 
- Protected Attributes inherited from SimpleCaptcha
string $action
 Used to select the right message.
 
string $trigger
 Used in log messages.
 
- Static Protected Attributes inherited from SimpleCaptcha
static $messagePrefix = 'captcha-'
 

Detailed Description

Definition at line 5 of file MathCaptcha.class.php.

Member Function Documentation

◆ addCaptchaAPI()

MathCaptcha::addCaptchaAPI ( & $resultArr)
Parameters
array&$resultArr

Reimplemented from SimpleCaptcha.

Definition at line 20 of file MathCaptcha.class.php.

References $html, describeCaptchaType(), fetchMath(), list, pickSum(), and SimpleCaptcha\storeCaptcha().

◆ describeCaptchaType()

MathCaptcha::describeCaptchaType ( )
Returns
array

Reimplemented from SimpleCaptcha.

Definition at line 32 of file MathCaptcha.class.php.

Referenced by addCaptchaAPI().

◆ fetchMath()

MathCaptcha::fetchMath ( $sum)

Fetch the math.

Parameters
int$sum
Returns
string

Definition at line 75 of file MathCaptcha.class.php.

References $html.

Referenced by addCaptchaAPI(), getCaptchaInfo(), and getFormInformation().

◆ getCaptcha()

MathCaptcha::getCaptcha ( )
Returns
array

Reimplemented from SimpleCaptcha.

Definition at line 90 of file MathCaptcha.class.php.

References list, and pickSum().

◆ getCaptchaInfo()

MathCaptcha::getCaptchaInfo ( $captchaData,
$id )
Parameters
array$captchaData
string$id
Returns
mixed

Reimplemented from SimpleCaptcha.

Definition at line 100 of file MathCaptcha.class.php.

References fetchMath().

◆ getFormInformation()

MathCaptcha::getFormInformation ( $tabIndex = 1)
Parameters
int$tabIndex
Returns
array

Reimplemented from SimpleCaptcha.

Definition at line 43 of file MathCaptcha.class.php.

References fetchMath(), list, pickSum(), and SimpleCaptcha\storeCaptcha().

◆ keyMatch()

MathCaptcha::keyMatch ( $answer,
$info )

Validate a captcha response.

Parameters
string$answer
array$info
Returns
bool

Reimplemented from SimpleCaptcha.

Definition at line 13 of file MathCaptcha.class.php.

◆ onAuthChangeFormFields()

MathCaptcha::onAuthChangeFormFields ( array $requests,
array $fieldInfo,
array & $formDescriptor,
$action )
Parameters
array$requests
array$fieldInfo
array&$formDescriptor
string$action

Reimplemented from SimpleCaptcha.

Definition at line 111 of file MathCaptcha.class.php.

References $req, and $requests.

◆ pickSum()

MathCaptcha::pickSum ( )

Pick a random sum.

Returns
array

Definition at line 61 of file MathCaptcha.class.php.

Referenced by addCaptchaAPI(), getCaptcha(), and getFormInformation().


The documentation for this class was generated from the following file: