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

Comments

  • It would be possible, but also a potential security risk. Not sure if this is a feature I would like to implement. And it will only work on local file systems.
  • Hi Guys,

    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
  • If you want to remove them from the GUI you have to find the record in the fop2recordings mysql table and delete it from there. There is an easy fix for removing database entries (but not the file itself), you can edit the recordings.php file and change the line that says:
    $grid->allow_delete(false);
    

    to
    $grid->allow_delete(true);
    

    The file itself will remain on disk when you remove the database entry.

    Best regards,
  • Hi,

    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();
    ?>
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  • You have to edit /var/www/html/fop2/recordings.php

    (not download.php)
  • I found the file and it worked, Thanks for your help
Sign In or Register to comment.