The DynDN.eS Blog

About DynDN.eS, eQmail, Gentoo & some other network stuff

User Tools

Site Tools


Dokuwiki: CAPTCHA patch

This patch extends the functionality of the CAPTCHA plugin by the dokuwiki founder Andreas Gohr. It adds

  1. a config option to hide the honeypot (default: visible)
  2. a config option to change the position of the text “Please fill …” below the(/an) image (default: above the image)
  3. limits the length of the input field (default: unlimited)

The first 2 changes a simply visual, the third change I consider as critical. I made a pull request at Feb 6, 2017. There was a short discussion but no further progress since. As I think it could be useful for others I provide a patch. The patch name contains the version string of the corresponding plugin version always. I'll try to keep updated for each new (latest) plugin version. On the other side I didn't have to made changes since the initial change round about in 2014.

Download latest: captcha-patch-latest (sha256sum)

Download the patch and extract it. The archive contains a file captcha.css with some style changes too - see Configuration section below later on. Apply the patch as follows (replace  <version>  with the correct version string):

$> cd <dokuwiki_root>/lib/plugins/captcha
$> patch --verbose -p1 < /path/to/the/captcha-<version>.patch

Configuration

The new config options are now available in the plugins→captcha section of the Configuration Manager. Some more visual styles could be customized by editing  captcha.css .  Create folders and files mentioned in the next steps if they don't exists. Assuming the used template is the default dokuwiki, copy  captcha.css  into  conf/tpl/dokuwiki/ . Edit  style.ini  inside this folder and add a line  captcha.css                = screen  in the stylesheets section:

; Define additional stylesheets for the template here. The format have to
; identical to the "style.ini" file.
[stylesheets]
;css/user.css               = screen
captcha.css                = screen
... <snip>

Now you can customize your styles using  captcha.css . Add  [&|?]purge=true  to your address bar to make changes take effect immediately!


Comments

Error: Class "XMLReader" not found

Error: Class "XMLReader" not found

An unforeseen error has occured. This is most likely a bug somewhere. It might be a problem in the captcha plugin.

More info has been written to the DokuWiki error log.