142a27035SAndreas Gohr<?php 242a27035SAndreas Gohr/** 342a27035SAndreas Gohr * CAPTCHA antispam plugin - sound generator 442a27035SAndreas Gohr * 542a27035SAndreas Gohr * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) 642a27035SAndreas Gohr * @author Andreas Gohr <gohr@cosmocode.de> 742a27035SAndreas Gohr */ 842a27035SAndreas Gohr 9265a0b9eSAndreas Gohrif (!defined('DOKU_INC')) define('DOKU_INC', dirname(__FILE__) . '/../../../'); 1042a27035SAndreas Gohrdefine('NOSESSION', true); 1142a27035SAndreas Gohrdefine('DOKU_DISABLE_GZIP_OUTPUT', 1); 1242a27035SAndreas Gohrrequire_once(DOKU_INC . 'inc/init.php'); 1342a27035SAndreas Gohrrequire_once(DOKU_INC . 'inc/auth.php'); 1442a27035SAndreas Gohr 1542a27035SAndreas Gohr$ID = $_REQUEST['id']; 16*63609b6eSAndreas Gohr/** @var helper_plugin_captcha $plugin */ 1777e00bf9SAndreas Gohr$plugin = plugin_load('helper', 'captcha'); 182cab8f1fSAndreas Gohr 1908f248e4SAndreas Gohrif ($plugin->getConf('mode') != 'audio' && $plugin->getConf('mode') != 'svgaudio') { 202cab8f1fSAndreas Gohr http_status(404); 212cab8f1fSAndreas Gohr exit; 222cab8f1fSAndreas Gohr} 232cab8f1fSAndreas Gohr 24f044313dSAndreas Gohr$rand = $plugin->decrypt($_REQUEST['secret']); 25*63609b6eSAndreas Gohr$ident= $plugin->_fixedIdent(); 26*63609b6eSAndreas Gohr$code = $plugin->_generateCAPTCHA($ident, $rand); 27*63609b6eSAndreas Gohr$plugin->_audioCAPTCHA($code); 28