xref: /plugin/captcha/wav.php (revision 63609b6ea4366bd9c8e1bff48a61b5e5cd514a21)
1<?php
2/**
3 * CAPTCHA antispam plugin - sound generator
4 *
5 * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
6 * @author     Andreas Gohr <gohr@cosmocode.de>
7 */
8
9if (!defined('DOKU_INC')) define('DOKU_INC', dirname(__FILE__) . '/../../../');
10define('NOSESSION', true);
11define('DOKU_DISABLE_GZIP_OUTPUT', 1);
12require_once(DOKU_INC . 'inc/init.php');
13require_once(DOKU_INC . 'inc/auth.php');
14
15$ID = $_REQUEST['id'];
16/** @var helper_plugin_captcha $plugin */
17$plugin = plugin_load('helper', 'captcha');
18
19if ($plugin->getConf('mode') != 'audio' && $plugin->getConf('mode') != 'svgaudio') {
20    http_status(404);
21    exit;
22}
23
24$rand = $plugin->decrypt($_REQUEST['secret']);
25$ident= $plugin->_fixedIdent();
26$code = $plugin->_generateCAPTCHA($ident, $rand);
27$plugin->_audioCAPTCHA($code);
28