mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 11:43:50 +00:00
Audited the permissions names. Permissions names are to be non plural.
This commit is contained in:
@@ -37,32 +37,32 @@
|
||||
$apps[$x]['menu'][0]['groups'][] = 'superadmin';
|
||||
|
||||
//permission details
|
||||
$apps[$x]['permissions'][0]['name'] = 'recordings_view';
|
||||
$apps[$x]['permissions'][0]['name'] = 'recording_view';
|
||||
$apps[$x]['permissions'][0]['groups'][] = 'admin';
|
||||
$apps[$x]['permissions'][0]['groups'][] = 'superadmin';
|
||||
|
||||
$apps[$x]['permissions'][1]['name'] = 'recordings_add';
|
||||
$apps[$x]['permissions'][1]['name'] = 'recording_add';
|
||||
$apps[$x]['permissions'][1]['groups'][] = 'admin';
|
||||
$apps[$x]['permissions'][1]['groups'][] = 'superadmin';
|
||||
|
||||
$apps[$x]['permissions'][2]['name'] = 'recordings_edit';
|
||||
$apps[$x]['permissions'][2]['name'] = 'recording_edit';
|
||||
$apps[$x]['permissions'][2]['groups'][] = 'admin';
|
||||
$apps[$x]['permissions'][2]['groups'][] = 'superadmin';
|
||||
|
||||
$apps[$x]['permissions'][3]['name'] = 'recordings_delete';
|
||||
$apps[$x]['permissions'][3]['name'] = 'recording_delete';
|
||||
$apps[$x]['permissions'][3]['groups'][] = 'admin';
|
||||
$apps[$x]['permissions'][3]['groups'][] = 'superadmin';
|
||||
|
||||
$apps[$x]['permissions'][4]['name'] = 'recordings_upload';
|
||||
$apps[$x]['permissions'][4]['name'] = 'recording_upload';
|
||||
$apps[$x]['permissions'][4]['groups'][] = 'admin';
|
||||
$apps[$x]['permissions'][4]['groups'][] = 'superadmin';
|
||||
|
||||
$apps[$x]['permissions'][5]['name'] = 'recordings_play';
|
||||
$apps[$x]['permissions'][5]['name'] = 'recording_play';
|
||||
$apps[$x]['permissions'][5]['groups'][] = 'user';
|
||||
$apps[$x]['permissions'][5]['groups'][] = 'admin';
|
||||
$apps[$x]['permissions'][5]['groups'][] = 'superadmin';
|
||||
|
||||
$apps[$x]['permissions'][6]['name'] = 'recordings_download';
|
||||
$apps[$x]['permissions'][6]['name'] = 'recording_download';
|
||||
$apps[$x]['permissions'][6]['groups'][] = 'user';
|
||||
$apps[$x]['permissions'][6]['groups'][] = 'admin';
|
||||
$apps[$x]['permissions'][6]['groups'][] = 'superadmin';
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
include "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
if (permission_exists('recordings_view')) {
|
||||
if (permission_exists('recording_view')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
@@ -50,7 +50,7 @@ require_once "resources/paging.php";
|
||||
$order = $_GET["order"];
|
||||
|
||||
//download the recordings
|
||||
if ($_GET['a'] == "download" && permission_exists('recordings_download')) {
|
||||
if ($_GET['a'] == "download" && permission_exists('recording_download')) {
|
||||
session_cache_limiter('public');
|
||||
if ($_GET['type'] = "rec") {
|
||||
if (file_exists($_SESSION['switch']['recordings']['dir'].'/'.base64_decode($_GET['filename']))) {
|
||||
@@ -82,8 +82,8 @@ require_once "resources/paging.php";
|
||||
}
|
||||
|
||||
//upload the recording
|
||||
if (permission_exists('recordings_upload')) {
|
||||
if (($_POST['submit'] == "Upload") && is_uploaded_file($_FILES['ulfile']['tmp_name']) && permission_exists('recordings_upload')) {
|
||||
if (permission_exists('recording_upload')) {
|
||||
if (($_POST['submit'] == "Upload") && is_uploaded_file($_FILES['ulfile']['tmp_name']) && permission_exists('recording_upload')) {
|
||||
if ($_POST['type'] == 'rec') {
|
||||
move_uploaded_file($_FILES['ulfile']['tmp_name'], $_SESSION['switch']['recordings']['dir'].'/'.$_FILES['ulfile']['name']);
|
||||
$savemsg = $text['message-uploaded']." ".$_SESSION['switch']['recordings']['dir']."/". htmlentities($_FILES['ulfile']['name']);
|
||||
@@ -177,7 +177,7 @@ require_once "resources/paging.php";
|
||||
echo $_SESSION['switch']['recordings']['dir'];
|
||||
}
|
||||
echo " </td>\n";
|
||||
if (permission_exists('recordings_upload')) {
|
||||
if (permission_exists('recording_upload')) {
|
||||
echo "<form action=\"\" method=\"POST\" enctype=\"multipart/form-data\" name=\"frmUpload\" onSubmit=\"\">\n";
|
||||
echo " <td valign=\"top\" class=\"label\">\n";
|
||||
echo " <input name=\"type\" type=\"hidden\" value=\"rec\">\n";
|
||||
@@ -229,8 +229,8 @@ require_once "resources/paging.php";
|
||||
echo "<th width=\"10%\" class=\"listhdr\" nowrap>Size</th>\n";
|
||||
echo th_order_by('recording_description', $text['label-description'], $order_by, $order);
|
||||
echo "<td align='right' width='42'>\n";
|
||||
if (permission_exists('recordings_add')) {
|
||||
echo " <a href='recordings_edit.php' alt='add'>$v_link_label_add</a>\n";
|
||||
if (permission_exists('recording_add')) {
|
||||
echo " <a href='recording_edit.php' alt='add'>$v_link_label_add</a>\n";
|
||||
}
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
@@ -247,7 +247,7 @@ require_once "resources/paging.php";
|
||||
echo " </a>";
|
||||
echo " </td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>";
|
||||
echo " <a href=\"javascript:void(0);\" onclick=\"window.open('recordings_play.php?a=download&type=moh&filename=".base64_encode($row['recording_filename'])."', 'play',' width=420,height=40,menubar=no,status=no,toolbar=no')\">\n";
|
||||
echo " <a href=\"javascript:void(0);\" onclick=\"window.open('recording_play.php?a=download&type=moh&filename=".base64_encode($row['recording_filename'])."', 'play',' width=420,height=40,menubar=no,status=no,toolbar=no')\">\n";
|
||||
echo $row['recording_name'];
|
||||
echo " </a>";
|
||||
echo "</td>\n";
|
||||
@@ -256,11 +256,11 @@ require_once "resources/paging.php";
|
||||
echo " </td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."' width='30%'>".$row['recording_description']."</td>\n";
|
||||
echo " <td valign='top' align='right'>\n";
|
||||
if (permission_exists('recordings_edit')) {
|
||||
echo " <a href='recordings_edit.php?id=".$row['recording_uuid']."' alt='edit'>$v_link_label_edit</a>\n";
|
||||
if (permission_exists('recording_edit')) {
|
||||
echo " <a href='recording_edit.php?id=".$row['recording_uuid']."' alt='edit'>$v_link_label_edit</a>\n";
|
||||
}
|
||||
if (permission_exists('recordings_delete')) {
|
||||
echo " <a href='recordings_delete.php?id=".$row['recording_uuid']."' alt='delete' onclick=\"return confirm('".$text['message-delete']."')\">$v_link_label_delete</a>\n";
|
||||
if (permission_exists('recording_delete')) {
|
||||
echo " <a href='recording_delete.php?id=".$row['recording_uuid']."' alt='delete' onclick=\"return confirm('".$text['message-delete']."')\">$v_link_label_delete</a>\n";
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo "</tr>\n";
|
||||
@@ -276,8 +276,8 @@ require_once "resources/paging.php";
|
||||
echo " <td width='33.3%' nowrap> </td>\n";
|
||||
echo " <td width='33.3%' align='center' nowrap>$paging_controls</td>\n";
|
||||
echo " <td width='33.3%' align='right'>\n";
|
||||
if (permission_exists('recordings_add')) {
|
||||
echo " <a href='recordings_edit.php' alt='add'>$v_link_label_add</a>\n";
|
||||
if (permission_exists('recording_add')) {
|
||||
echo " <a href='recording_edit.php' alt='add'>$v_link_label_add</a>\n";
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
include "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
if (permission_exists('recordings_delete')) {
|
||||
if (permission_exists('recording_delete')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
include "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
if (permission_exists('recordings_add') || permission_exists('recordings_edit')) {
|
||||
if (permission_exists('recording_add') || permission_exists('recording_edit')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
@@ -92,7 +92,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
|
||||
//add or update the database
|
||||
if ($_POST["persistformvar"] != "true") {
|
||||
if ($action == "add" && permission_exists('recordings_add')) {
|
||||
if ($action == "add" && permission_exists('recording_add')) {
|
||||
$recording_uuid = uuid();
|
||||
$sql = "insert into v_recordings ";
|
||||
$sql .= "(";
|
||||
@@ -122,7 +122,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
return;
|
||||
} //if ($action == "add")
|
||||
|
||||
if ($action == "update" && permission_exists('recordings_edit')) {
|
||||
if ($action == "update" && permission_exists('recording_edit')) {
|
||||
//get the original filename
|
||||
$sql = "select * from v_recordings ";
|
||||
$sql .= "where recording_uuid = '$recording_uuid' ";
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
include "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
if (permission_exists('recordings_play')) {
|
||||
if (permission_exists('recording_play')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user