From ca32f08966f1b51fcb19460f0996bb0c4048e6fe Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sat, 3 Dec 2011 13:29:22 +0100 Subject: Update to MediaWiki 1.18.0 * also update ArchLinux skin to chagnes in MonoBook * Use only css to hide our menu bar when printing --- extensions/ConfirmEdit/HTMLCaptchaField.php | 84 +++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 extensions/ConfirmEdit/HTMLCaptchaField.php (limited to 'extensions/ConfirmEdit/HTMLCaptchaField.php') diff --git a/extensions/ConfirmEdit/HTMLCaptchaField.php b/extensions/ConfirmEdit/HTMLCaptchaField.php new file mode 100644 index 00000000..a458544c --- /dev/null +++ b/extensions/ConfirmEdit/HTMLCaptchaField.php @@ -0,0 +1,84 @@ +prefix = $params['prefix']; + } + } + + /** + * Get the captcha body. Don't include any of the surrounding table cells/rows + * + * @param $value String + * @return String + */ + public function getInputHTML( $value ){ + # TODO + } + + public function validate( $data, $alldata ){ + // We sent back the exists status of the captcha before. If it *doesn't* exist + // we actually want to validate this as true, because we don't want an angry red + // error message, just for the user to put the captcha in again + if( $data === false ){ + return true; + } + + + } + + /** + * @param $request WebRequest + * @return void + */ + public function loadDataFromRequest( $request ){ + $this->captcha = Captcha::factory(); + $this->captcha->loadFromRequest( $request, $this ); + if( !$this->captcha->exists() ){ + // The captcha doesn't exist; probably because it's already been used and + // then deleted for security. Load the field up with a new captcha which + // will be shown to the user when the validation of said new object fails + $this->captcha = Captcha::newRandom(); + } + + // This will be useful as the difference between "the captcha doesn't exist" and + // "you answered the captcha wrongly" + return $this->captcha->exists(); + } +} \ No newline at end of file -- cgit v1.2.2