MediaWiki  1.34.0
QuestyCaptcha Class Reference
Inheritance diagram for QuestyCaptcha:
Collaboration diagram for QuestyCaptcha:

Public Member Functions

 describeCaptchaType ()
 
 getCaptcha ()
 
 getCaptchaInfo ( $captchaData, $id)
 
 getFormInformation ( $tabIndex=1)
 
 onAuthChangeFormFields (array $requests, array $fieldInfo, array &$formDescriptor, $action)
 
 showHelp ()
 Show a page explaining what this wacky thing is. More...
 
- 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)
 
 canSkipCaptcha ( $user, Config $config)
 Check whether the user provided / IP making the request is allowed to skip captchas. 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...
 
 getError ()
 Return the error from the last passCaptcha* call. 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...
 
 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...
 
 storeCaptcha ( $info)
 Generate a captcha session ID and save the info in PHP's session storage. More...
 
 triggersCaptcha ( $action, $title=null)
 Checks, whether the passed action should trigger a CAPTCHA. More...
 

Protected Member Functions

 addCaptchaAPI (&$resultArr)
 
 keyMatch ( $answer, $info)
 Validate a captcha response. More...
 
- Protected Member Functions inherited from SimpleCaptcha
 getCaptchaParamsFromRequest (WebRequest $request)
 
 isAPICaptchaModule ( $module)
 
 log ( $message)
 Log the status and any triggering info for debugging or statistics. More...
 
 passCaptcha ( $index, $word)
 Given a required captcha run, test form input for correct input on the open session. More...
 

Static Protected Attributes

static $messagePrefix = 'questycaptcha-'
 
- 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...
 

Detailed Description

Definition at line 13 of file QuestyCaptcha.php.

Member Function Documentation

◆ addCaptchaAPI()

QuestyCaptcha::addCaptchaAPI ( $resultArr)
protected
Parameters
array&$resultArr

Reimplemented from SimpleCaptcha.

Definition at line 35 of file QuestyCaptcha.php.

References describeCaptchaType(), getCaptcha(), and SimpleCaptcha\storeCaptcha().

◆ describeCaptchaType()

QuestyCaptcha::describeCaptchaType ( )
Returns
array

Reimplemented from SimpleCaptcha.

Definition at line 46 of file QuestyCaptcha.php.

Referenced by addCaptchaAPI().

◆ getCaptcha()

QuestyCaptcha::getCaptcha ( )
Returns
array

Reimplemented from SimpleCaptcha.

Definition at line 56 of file QuestyCaptcha.php.

Referenced by addCaptchaAPI(), and getFormInformation().

◆ getCaptchaInfo()

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

Reimplemented from SimpleCaptcha.

Definition at line 114 of file QuestyCaptcha.php.

◆ getFormInformation()

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

Reimplemented from SimpleCaptcha.

Definition at line 73 of file QuestyCaptcha.php.

References Xml\element(), getCaptcha(), and SimpleCaptcha\storeCaptcha().

◆ keyMatch()

QuestyCaptcha::keyMatch (   $answer,
  $info 
)
protected

Validate a captcha response.

Parameters
string$answer
array$info
Returns
bool

Reimplemented from SimpleCaptcha.

Definition at line 24 of file QuestyCaptcha.php.

◆ onAuthChangeFormFields()

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

Reimplemented from SimpleCaptcha.

Definition at line 124 of file QuestyCaptcha.php.

◆ showHelp()

QuestyCaptcha::showHelp ( )

Show a page explaining what this wacky thing is.

Reimplemented from SimpleCaptcha.

Definition at line 100 of file QuestyCaptcha.php.

References $wgOut, CaptchaStore\get(), and wfMessage().

Member Data Documentation

◆ $messagePrefix

QuestyCaptcha::$messagePrefix = 'questycaptcha-'
staticprotected

Definition at line 16 of file QuestyCaptcha.php.


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