From 3a17b276638200475d54201fa62566b7440e819a Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 16 Mar 2008 19:58:33 +0000 Subject: --- fs_selfservice/fri/misc/audio.php | 61 +++++++++++++++++++++++++++++ fs_selfservice/fri/misc/popup.css | 10 +++++ fs_selfservice/fri/misc/recording_popup.php | 46 ++++++++++++++++++++++ 3 files changed, 117 insertions(+) create mode 100644 fs_selfservice/fri/misc/audio.php create mode 100644 fs_selfservice/fri/misc/popup.css create mode 100644 fs_selfservice/fri/misc/recording_popup.php (limited to 'fs_selfservice/fri/misc') diff --git a/fs_selfservice/fri/misc/audio.php b/fs_selfservice/fri/misc/audio.php new file mode 100644 index 000000000..2dc355cb3 --- /dev/null +++ b/fs_selfservice/fri/misc/audio.php @@ -0,0 +1,61 @@ +decrypt($_GET['recording'],$ARI_CRYPT_PASSWORD); + + // strip ".." from path for security + $path = preg_replace('/\.\./','',$path); + + // See if the file exists + if (!is_file($path)) { die("404 File not found!"); } + + // Gather relevent info about file + $size = filesize($path); + $name = basename($path); + $extension = strtolower(substr(strrchr($name,"."),1)); + + // This will set the Content-Type to the appropriate setting for the file + $ctype =''; + switch( $extension ) { + case "mp3": $ctype="audio/mpeg"; break; + case "wav": $ctype="audio/x-wav"; break; + case "Wav": $ctype="audio/x-wav"; break; + case "WAV": $ctype="audio/x-wav"; break; + case "gsm": $ctype="audio/x-gsm"; break; + + // not downloadable + default: die("404 File not found!"); break ; + } + + // need to check if file is mislabeled or a liar. + $fp=fopen($path, "rb"); + if ($size && $ctype && $fp) { + header("Pragma: public"); + header("Expires: 0"); + header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); + header("Cache-Control: public"); + header("Content-Description: wav file"); + header("Content-Type: " . $ctype); + header("Content-Disposition: attachment; filename=" . $name); + header("Content-Transfer-Encoding: binary"); + header("Content-length: " . $size); + fpassthru($fp); + } +} + +?> \ No newline at end of file diff --git a/fs_selfservice/fri/misc/popup.css b/fs_selfservice/fri/misc/popup.css new file mode 100644 index 000000000..7a5352805 --- /dev/null +++ b/fs_selfservice/fri/misc/popup.css @@ -0,0 +1,10 @@ +/* + * popup + */ + +.popup_download { + color: #105D90; + margin: 250px; + font-size: 12px; + text-align: right; +} \ No newline at end of file diff --git a/fs_selfservice/fri/misc/recording_popup.php b/fs_selfservice/fri/misc/recording_popup.php new file mode 100644 index 000000000..1546adcc0 --- /dev/null +++ b/fs_selfservice/fri/misc/recording_popup.php @@ -0,0 +1,46 @@ + + + + + + ARI + + + + + +encrypt($_GET['recording'],$ARI_CRYPT_PASSWORD); + + if (isset($path)) { + if (isset($_GET['date'])) { + echo($_GET['date'] . "
"); + } + if (isset($_GET['time'])) { + echo($_GET['time'] . "
"); + } + echo("
"); + echo("
"); + echo("" . _("download") . "
"); + } + +?> + + + + -- cgit v1.2.1