Name Date Size #Lines LOC

..--

.git/H21-Jul-2026-

conf/H21-Jul-2026-1612

LICENSEH A D21-Jul-202617.6 KiB339280

README.mdH A D21-Jul-20261.6 KiB3524

action.phpH A D21-Jul-20263.6 KiB13282

plugin.info.txtH A D21-Jul-2026217 87

script.jsH A D21-Jul-20263.1 KiB8558

style.cssH A D21-Jul-20261.4 KiB7867

syntax.phpH A D21-Jul-20262.9 KiB8966

README.md

1# PASSWD — Password Protected Sections for DokuWiki
2
3A syntax plugin that lets authors protect page sections with a password. Integrated with the [Captcha plugin](https://www.dokuwiki.org/plugin:captcha) to prevent brute-force attacks.
4
5## Syntax
6
7```
8<passwd password="secret" prompt="Enter password:" btn="Unlock" error="Invalid password or captcha">
9Protected content here. Supports all DokuWiki formatting.
10</passwd>
11```
12
13All attributes except `password` are optional — defaults are set via the plugin configuration panel.
14
15## How it works
16
171. **Rendering** — `syntax.php` outputs a password form with an empty captcha placeholder. No sensitive data enters the HTML, so the page cache stays clean.
182. **Captcha loading** — On DOM ready, `script.js` fetches a fresh captcha per block via `passwd_refresh_captcha`. Captcha tokens are never cached.
193. **Unlocking** — The user enters a password and submits the form. The AJAX handler `passwd_check` verifies the captcha first, then compares the password against the raw wiki text. On success it renders the hidden wikitext; on failure it returns a new captcha together with the error.
20
21## Files
22
23| File | Role |
24|------|------|
25| `syntax.php` | Lexer pattern and XHTML rendering |
26| `action.php` | AJAX handlers for captcha refresh and password check |
27| `script.js` | Client-side unlock logic |
28| `conf/default.php` | Default prompt/button/error texts |
29| `conf/metadata.php` | Config field metadata |
30
31## Requirements
32
33- DokuWiki 2024-02-06 "Kaos" or later
34- [Captcha plugin](https://www.dokuwiki.org/plugin:captcha) (recommended; works without it too)
35