Add permissions for call detail record details. Purpose to hide advanced details from the admin group.

This commit is contained in:
FusionPBX
2023-10-24 17:06:39 -06:00
committed by GitHub
parent 713e79a57d
commit 2be533687d
3 changed files with 213 additions and 186 deletions
+14 -1
View File
@@ -5,7 +5,7 @@
$apps[$x]['uuid'] = "4a085c51-7635-ff03-f67b-86e834422848"; $apps[$x]['uuid'] = "4a085c51-7635-ff03-f67b-86e834422848";
$apps[$x]['category'] = "Switch"; $apps[$x]['category'] = "Switch";
$apps[$x]['subcategory'] = ""; $apps[$x]['subcategory'] = "";
$apps[$x]['version'] = "1.1"; $apps[$x]['version'] = "1.2";
$apps[$x]['license'] = "Mozilla Public License 1.1"; $apps[$x]['license'] = "Mozilla Public License 1.1";
$apps[$x]['url'] = "http://www.fusionpbx.com"; $apps[$x]['url'] = "http://www.fusionpbx.com";
$apps[$x]['description']['en-us'] = "Call Detail Records with all information about the call."; $apps[$x]['description']['en-us'] = "Call Detail Records with all information about the call.";
@@ -192,6 +192,7 @@
$y++; $y++;
$apps[$x]['permissions'][$y]['name'] = "xml_cdr_details"; $apps[$x]['permissions'][$y]['name'] = "xml_cdr_details";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin"; $apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++; $y++;
$apps[$x]['permissions'][$y]['name'] = "xml_cdr_b_leg"; $apps[$x]['permissions'][$y]['name'] = "xml_cdr_b_leg";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin"; $apps[$x]['permissions'][$y]['groups'][] = "superadmin";
@@ -222,6 +223,18 @@
$apps[$x]['permissions'][$y]['groups'][] = "superadmin"; $apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin"; $apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++; $y++;
$apps[$x]['permissions'][$y]['name'] = "xml_cdr_call_stats";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "xml_cdr_channel_data";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "xml_cdr_variables";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "xml_cdr_application_log";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "xml_cdr_extension_summary_all"; $apps[$x]['permissions'][$y]['name'] = "xml_cdr_extension_summary_all";
//default settings //default settings
+8 -8
View File
@@ -593,10 +593,6 @@
echo "<th class='right hide-md-dn' title=\"".$text['description-tta']."\">".$text['label-tta']."</th>\n"; echo "<th class='right hide-md-dn' title=\"".$text['description-tta']."\">".$text['label-tta']."</th>\n";
$col_count++; $col_count++;
} }
if (permission_exists('xml_cdr_duration')) {
echo "<th class='center hide-sm-dn'>".$text['label-duration']."</th>\n";
$col_count++;
}
if (permission_exists('xml_cdr_pdd')) { if (permission_exists('xml_cdr_pdd')) {
echo "<th class='right hide-md-dn' title=\"".$text['description-pdd']."\">".$text['label-pdd']."</th>\n"; echo "<th class='right hide-md-dn' title=\"".$text['description-pdd']."\">".$text['label-pdd']."</th>\n";
$col_count++; $col_count++;
@@ -605,6 +601,10 @@
echo "<th class='center hide-md-dn' title=\"".$text['description-mos']."\">".$text['label-mos']."</th>\n"; echo "<th class='center hide-md-dn' title=\"".$text['description-mos']."\">".$text['label-mos']."</th>\n";
$col_count++; $col_count++;
} }
if (permission_exists('xml_cdr_duration')) {
echo "<th class='center hide-sm-dn'>".$text['label-duration']."</th>\n";
$col_count++;
}
if (permission_exists('xml_cdr_status')) { if (permission_exists('xml_cdr_status')) {
echo "<th class='hide-sm-dn shrink'>".$text['label-status']."</th>\n"; echo "<th class='hide-sm-dn shrink'>".$text['label-status']."</th>\n";
$col_count++; $col_count++;
@@ -841,10 +841,6 @@
if (permission_exists('xml_cdr_tta')) { if (permission_exists('xml_cdr_tta')) {
$content .= " <td class='middle right hide-md-dn'>".(!empty($row['tta']) && $row['tta'] >= 0 ? $row['tta']."s" : "&nbsp;")."</td>\n"; $content .= " <td class='middle right hide-md-dn'>".(!empty($row['tta']) && $row['tta'] >= 0 ? $row['tta']."s" : "&nbsp;")."</td>\n";
} }
//duration
if (permission_exists('xml_cdr_duration')) {
$content .= " <td class='middle center hide-sm-dn'>".gmdate("G:i:s", $seconds)."</td>\n";
}
//pdd (post dial delay) //pdd (post dial delay)
if (permission_exists("xml_cdr_pdd")) { if (permission_exists("xml_cdr_pdd")) {
$content .= " <td class='middle right hide-md-dn'>".number_format(escape($row['pdd_ms'])/1000,2)."s</td>\n"; $content .= " <td class='middle right hide-md-dn'>".number_format(escape($row['pdd_ms'])/1000,2)."s</td>\n";
@@ -857,6 +853,10 @@
} }
$content .= " <td class='middle center hide-md-dn' ".($title ?? '').">".($value ?? '')."</td>\n"; $content .= " <td class='middle center hide-md-dn' ".($title ?? '').">".($value ?? '')."</td>\n";
} }
//duration
if (permission_exists('xml_cdr_duration')) {
$content .= " <td class='middle center hide-sm-dn'>".gmdate("G:i:s", $seconds)."</td>\n";
}
//call result/status //call result/status
if (permission_exists("xml_cdr_status")) { if (permission_exists("xml_cdr_status")) {
$content .= " <td class='middle no-wrap hide-sm-dn'><a href='".$list_row_url."'>".escape($text['label-'.$status])."</a></td>\n"; $content .= " <td class='middle no-wrap hide-sm-dn'><a href='".$list_row_url."'>".escape($text['label-'.$status])."</a></td>\n";
+14
View File
@@ -311,7 +311,9 @@
echo "<th>".$text['label-end']."</th>\n"; echo "<th>".$text['label-end']."</th>\n";
echo "<th>".$text['label-duration']."</th>\n"; echo "<th>".$text['label-duration']."</th>\n";
echo "<th align='center'>".$text['label-status']."</th>\n"; echo "<th align='center'>".$text['label-status']."</th>\n";
if (permission_exists('xml_cdr_hangup_cause')) {
echo "<th>".$text['label-hangup_cause']."</th>\n"; echo "<th>".$text['label-hangup_cause']."</th>\n";
}
echo "</tr>\n"; echo "</tr>\n";
echo "<tr >\n"; echo "<tr >\n";
echo " <td valign='top' class='".$row_style[$c]."'><a href='xml_cdr_details.php?id=".urlencode($uuid)."'>".escape($direction)."</a></td>\n"; echo " <td valign='top' class='".$row_style[$c]."'><a href='xml_cdr_details.php?id=".urlencode($uuid)."'>".escape($direction)."</a></td>\n";
@@ -346,7 +348,9 @@
echo " <td valign='top' class='".$row_style[$c]."'>".escape(date("Y-m-d H:i:s", (int) $end_epoch))."</td>\n"; echo " <td valign='top' class='".$row_style[$c]."'>".escape(date("Y-m-d H:i:s", (int) $end_epoch))."</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".escape(gmdate("G:i:s", (int)$duration))."</td>\n"; echo " <td valign='top' class='".$row_style[$c]."'>".escape(gmdate("G:i:s", (int)$duration))."</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".escape($text['label-'.$status])."</td>\n"; echo " <td valign='top' class='".$row_style[$c]."'>".escape($text['label-'.$status])."</td>\n";
if (permission_exists('xml_cdr_hangup_cause')) {
echo " <td valign='top' class='".$row_style[$c]."'>".escape($hangup_cause)."</td>\n"; echo " <td valign='top' class='".$row_style[$c]."'>".escape($hangup_cause)."</td>\n";
}
echo "</table>"; echo "</table>";
echo "<br /><br />\n"; echo "<br /><br />\n";
} }
@@ -390,6 +394,7 @@
echo "<br /><br />\n"; echo "<br /><br />\n";
//call stats //call stats
if (permission_exists('xml_cdr_call_stats')) {
$c = 0; $c = 0;
$row_style["0"] = "row_style0"; $row_style["0"] = "row_style0";
$row_style["1"] = "row_style1"; $row_style["1"] = "row_style1";
@@ -446,8 +451,10 @@
} }
} }
} }
}
//channel data loop //channel data loop
if (permission_exists('xml_cdr_channel_data')) {
$c = 0; $c = 0;
$row_style["0"] = "row_style0"; $row_style["0"] = "row_style0";
$row_style["1"] = "row_style1"; $row_style["1"] = "row_style1";
@@ -476,8 +483,10 @@
} }
echo "</table>"; echo "</table>";
echo "<br /><br />\n"; echo "<br /><br />\n";
}
//variable loop //variable loop
if (permission_exists('xml_cdr_variables')) {
$c = 0; $c = 0;
$row_style["0"] = "row_style0"; $row_style["0"] = "row_style0";
$row_style["1"] = "row_style1"; $row_style["1"] = "row_style1";
@@ -538,8 +547,10 @@
} }
echo "</table>"; echo "</table>";
echo "<br /><br />\n"; echo "<br /><br />\n";
}
//application log //application log
if (permission_exists('xml_cdr_application_log')) {
$c = 0; $c = 0;
$row_style["0"] = "row_style0"; $row_style["0"] = "row_style0";
$row_style["1"] = "row_style1"; $row_style["1"] = "row_style1";
@@ -579,8 +590,10 @@
} }
echo "</table>"; echo "</table>";
echo "<br /><br />\n"; echo "<br /><br />\n";
}
//call flow //call flow
/*
$c = 0; $c = 0;
$row_style["0"] = "row_style0"; $row_style["0"] = "row_style0";
$row_style["1"] = "row_style1"; $row_style["1"] = "row_style1";
@@ -786,6 +799,7 @@
echo "</table>"; echo "</table>";
} }
} }
*/
//get the footer //get the footer
require_once "resources/footer.php"; require_once "resources/footer.php";