Source for file captcha-audio.php
Documentation is available at captcha-audio.php
* Captcha audio handling for Mambo
* @author Mambo Foundation Inc see README.php
* @copyright Mambo Foundation Inc.
* See COPYRIGHT.php for copyright notices and details.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
* Mambo is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2 of the
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
global $mosConfig_lang, $mosConfig_absolute_path;
$code =
$_SESSION['code'];
// language select (for future addition of own wav files)
$lang =
$mosConfig_absolute_path.
'/includes/captchaAudio/'.
$mosConfig_lang.
'/';
$lang =
$mosConfig_absolute_path.
'/includes/captchaAudio/en/';
$file =
$lang.
$code{$i}.
'.wav';
//$totalsize = filesize($filename);
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header('Content-type: audio/x-wav');
header("Content-Transfer-Encoding: binary");
//header("Content-Length: ".$totalsize);
header('Content-Disposition: attachment;filename=captcha.wav');
* CAPTCHA antispam plugin - sound generator
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author Andreas Gohr <gohr@cosmocode.de>
$fields =
join('/',array( 'H8ChunkID', 'VChunkSize', 'H8Format',
'H8Subchunk1ID', 'VSubchunk1Size',
'vAudioFormat', 'vNumChannels', 'VSampleRate',
'VByteRate', 'vBlockAlign', 'vBitsPerSample' ));
$info =
unpack($fields,$header);
if($info['Subchunk1Size'] >
16){
$header .=
fread($fp,($info['Subchunk1Size']-
16));
$data .=
fread($fp,$size);
Documentation generated on Mon, 05 May 2008 16:16:49 +0400 by phpDocumentor 1.4.0