Add a new xml cdr permission to allow normal users to see all cdr records for a domain.

permission: xml_cdr_domain
This commit is contained in:
Mark Crane 2013-03-16 15:14:36 +00:00
parent faeee96624
commit 1ab5f67234
3 changed files with 15 additions and 7 deletions

View File

@ -57,10 +57,18 @@
$apps[$x]['menu'][1]['groups'][] = 'superadmin';
//permission details
$apps[$x]['permissions'][0]['name'] = 'xml_cdr_view';
$apps[$x]['permissions'][0]['groups'][] = 'user';
$apps[$x]['permissions'][0]['groups'][] = 'admin';
$apps[$x]['permissions'][0]['groups'][] = 'superadmin';
$y = 0;
$apps[$x]['permissions'][$y]['name'] = 'xml_cdr_view';
$apps[$x]['permissions'][$y]['groups'][] = 'user';
$apps[$x]['permissions'][$y]['groups'][] = 'admin';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
$y++;
$apps[$x]['permissions'][$y]['name'] = 'xml_cdr_domain';
$apps[$x]['permissions'][$y]['groups'][] = 'admin';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
//$y++;
//$apps[$x]['permissions'][$y]['name'] = 'xml_cdr_all';
//$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
//schema details
$y = 0; //table array index

View File

@ -123,7 +123,7 @@ else {
echo "</table>\n";
//search the call detail records
if (if_group("admin") || if_group("superadmin")) {
if (if_group("admin") || if_group("superadmin") || permission_exists('xml_cdr_domain')) {
echo "<form method='post' action=''>\n";
echo "<table width='95%' cellpadding='3' border='0'>\n";
echo "<tr>\n";

View File

@ -115,7 +115,7 @@ else {
//example sql
// select caller_id_number, destination_number from v_xml_cdr where domain_uuid = ''
// and (caller_id_number = '1001' or destination_number = '1001' or destination_number = '*991001')
if (!if_group("admin") && !if_group("superadmin")) {
if (!if_group("admin") && !if_group("superadmin") && !permission_exists('xml_cdr_domain')) {
$sql_where = "where domain_uuid = '$domain_uuid' ";
$sql_where .= "and ( ";
if (count($_SESSION['user']['extension']) > 0) {
@ -138,7 +138,7 @@ else {
$sql_where .= ") ";
}
else {
//superadmin or admin
//superadmin or admin or permission_exists('xml_cdr_domain')
$sql_where = "where domain_uuid = '$domain_uuid' ".$sql_where;
}
//$sql_where = str_replace ("where or", "where", $sql_where);