-
Notifications
You must be signed in to change notification settings - Fork 11
/
wav.php
36 lines (28 loc) · 901 Bytes
/
wav.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
/**
* CAPTCHA antispam plugin - sound generator
*
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author Andreas Gohr <[email protected]>
*/
if (!defined('DOKU_INC')) define('DOKU_INC', __DIR__ . '/../../../');
define('NOSESSION', true);
define('DOKU_DISABLE_GZIP_OUTPUT', 1);
require_once(DOKU_INC . 'inc/init.php');
require_once(DOKU_INC . 'inc/auth.php');
global $INPUT;
global $ID;
$ID = $INPUT->str('id');
/** @var helper_plugin_captcha $plugin */
$plugin = plugin_load('helper', 'captcha');
if ($plugin->getConf('mode') != 'audio' && $plugin->getConf('mode') != 'svgaudio') {
http_status(404);
exit;
}
header('Content-type: audio/x-wav');
header('Content-Disposition: attachment;filename=captcha.wav');
$code = $plugin->generateCaptchaCode(
$plugin->fixedIdent(),
$plugin->decrypt($INPUT->str('secret'))
);
echo $plugin->audioCaptcha($code);