Delete recordings from FOP2 + permissions
Is it possible to have a little red X next to each recording on the recordings page so certain people can delete recordings with the GUI?
https://img.skitch.com/20120210-fyfyfa8ufa3ekehk1ffn4rxd5h.png
https://img.skitch.com/20120210-fyfyfa8ufa3ekehk1ffn4rxd5h.png
Comments
We would also like to have this option.
We look after about 10 different companies that use Fop2 and they have all asked for this feature to be able to delete either old recordings that are no longer needed or accidental recordings.
If we remove the files for them from the command line they still show up in the GUI but when you click on the file it says "ERROR: file not found" is the a way if you remove it from the command line to also remove it from the GUI?
Regards,
Kane
to
The file itself will remain on disk when you remove the database entry.
Best regards,
I looked at the /usr/src/fop2/html/download.php file but i couldnt find that line?
We are using version 2.24
here is what is in our file:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
?php
define("MYAP", "FOP2");
define("TITLE", "Flash Operator Panel 2");
if(isset($_SERVER)) {
define("SELF", substr($_SERVER, 0, (strlen($_SERVER) - @strlen($_SERVER))));
} else {
define("SELF", $_SERVER);
}
// Session start
session_start();
if(!isset($_REQUEST)) {
die("No filename specified");
}
list ($getid,$filename2) = preg_split("/!/",$_REQUEST,2);
$filename2 = preg_replace("/\.\./","",$filename2);
$filename2 = preg_replace("/%2e/","",$filename2);
$filename2 = preg_replace("/\/+/","/",$filename2);
$file_extension = strtolower(substr(strrchr($filename2,"."),1));
// required for IE, otherwise Content-disposition is ignored
if(ini_get('zlib.output_compression')) {
ini_set('zlib.output_compression', 'Off');
}
if(!isset($_SESSION[MYAP])) {
die("unavailable");
}
if($_SESSION[MYAP] <> $filename2) {
die("unavailable");
}
if(!stristr($_SESSION[MYAP],$_SESSION[MYAP]) && !stristr($_SESSION[MYAP],'/var/spool/asterisk/monitor/fop2')) {
die("unavailable");
}
$realid=md5($_SESSION[MYAP]);
if($realid<>$getid) {
die("invalid id");
}
if($file_extension<>"wav" && $file_extension<>"WAV" && $file_extension<>"gsm") {
die("Only wav or gsm allowed");
}
if( $filename2 == "" ) {
echo "ERROR: download file NOT SPECIFIED.";
exit;
} elseif ( ! file_exists( $filename2 ) ) {
echo "ERROR: File not found.";
exit;
}
header("Pragma: public"); // required
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false); // required for certain browsers
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"".basename($filename2)."\";" );
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize($filename2));
readfile("$filename2");
exit();
?>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
(not download.php)