Wrap the recordings upload with the correct permission as recommended here.

http://code.google.com/p/fusionpbx/issues/detail?id=400
This commit is contained in:
Mark Crane
2013-04-24 18:29:46 +00:00
parent bbb98fbe34
commit ef5ac5b6a3
+6 -2
View File
@@ -81,6 +81,7 @@ require_once "includes/paging.php";
} }
//upload the recording //upload the recording
if (permission_exists('recordings_upload')) {
if (($_POST['submit'] == "Upload") && is_uploaded_file($_FILES['ulfile']['tmp_name']) && permission_exists('recordings_upload')) { if (($_POST['submit'] == "Upload") && is_uploaded_file($_FILES['ulfile']['tmp_name']) && permission_exists('recordings_upload')) {
if ($_POST['type'] == 'rec') { if ($_POST['type'] == 'rec') {
move_uploaded_file($_FILES['ulfile']['tmp_name'], $_SESSION['switch']['recordings']['dir'].'/'.$_FILES['ulfile']['name']); move_uploaded_file($_FILES['ulfile']['tmp_name'], $_SESSION['switch']['recordings']['dir'].'/'.$_FILES['ulfile']['name']);
@@ -89,6 +90,7 @@ require_once "includes/paging.php";
unset($_POST['txtCommand']); unset($_POST['txtCommand']);
} }
} }
}
//build a list of recordings //build a list of recordings
$config_recording_list = '|'; $config_recording_list = '|';
@@ -166,7 +168,6 @@ require_once "includes/paging.php";
echo "<br />\n"; echo "<br />\n";
echo "<form action=\"\" method=\"POST\" enctype=\"multipart/form-data\" name=\"frmUpload\" onSubmit=\"\">\n";
echo " <table border='0' width='100%'>\n"; echo " <table border='0' width='100%'>\n";
echo " <tr>\n"; echo " <tr>\n";
echo " <td align='left' width='50%'>\n"; echo " <td align='left' width='50%'>\n";
@@ -175,6 +176,8 @@ require_once "includes/paging.php";
echo $_SESSION['switch']['recordings']['dir']; echo $_SESSION['switch']['recordings']['dir'];
} }
echo " </td>\n"; echo " </td>\n";
if (permission_exists('recordings_upload')) {
echo "<form action=\"\" method=\"POST\" enctype=\"multipart/form-data\" name=\"frmUpload\" onSubmit=\"\">\n";
echo " <td valign=\"top\" class=\"label\">\n"; echo " <td valign=\"top\" class=\"label\">\n";
echo " <input name=\"type\" type=\"hidden\" value=\"rec\">\n"; echo " <input name=\"type\" type=\"hidden\" value=\"rec\">\n";
echo " </td>\n"; echo " </td>\n";
@@ -183,9 +186,10 @@ require_once "includes/paging.php";
echo " <input name=\"ulfile\" type=\"file\" class=\"btn\" id=\"ulfile\">\n"; echo " <input name=\"ulfile\" type=\"file\" class=\"btn\" id=\"ulfile\">\n";
echo " <input name=\"submit\" type=\"submit\" class=\"btn\" id=\"upload\" value=\"".$text['button-upload']."\">\n"; echo " <input name=\"submit\" type=\"submit\" class=\"btn\" id=\"upload\" value=\"".$text['button-upload']."\">\n";
echo " </td>\n"; echo " </td>\n";
echo "</form>";
}
echo " </tr>\n"; echo " </tr>\n";
echo " </table>\n"; echo " </table>\n";
echo "</form>";
$sql = "select * from v_recordings "; $sql = "select * from v_recordings ";
$sql .= "where domain_uuid = '$domain_uuid' "; $sql .= "where domain_uuid = '$domain_uuid' ";