From d4dc8de2ba09ed7e5651a103489ecd997c3566e8 Mon Sep 17 00:00:00 2001 From: mattf Date: Thu, 18 Jul 2024 13:45:24 +0000 Subject: [PATCH] Fixes for inconsistencies in documentation and permissions for some functions in the non-agent API git-svn-id: svn://192.168.202.10@3854 3d104415-ff17-0410-8863-d5cf3c621b8a --- agc_2-X/trunk/docs/NON-AGENT_API.txt | 9 +++++---- agc_2-X/trunk/www/vicidial/non_agent_api.php | 17 +++++++++-------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/agc_2-X/trunk/docs/NON-AGENT_API.txt b/agc_2-X/trunk/docs/NON-AGENT_API.txt index 8a489ef4..f234d381 100644 --- a/agc_2-X/trunk/docs/NON-AGENT_API.txt +++ b/agc_2-X/trunk/docs/NON-AGENT_API.txt @@ -1,4 +1,4 @@ -NON-AGENT API DOCUMENT Started: 2008-07-24 Updated: 2024-07-03 +NON-AGENT API DOCUMENT Started: 2008-07-24 Updated: 2024-07-18 This document describes the functions of an API(Application Programming Interface) for all functions NOT directly relating to the VICIDIAL Agent screen. @@ -221,6 +221,7 @@ Changes: 240217-0907 - Added more missing vicidial_users fields from copy function 240302-0804 - Added delete_dnc_phone function 240703-1657 - Added update_remote_agent function +240718-0942 - Fixes for inconsistencies in documentation and permissions for some functions API Functions use the 'function' variable @@ -377,7 +378,7 @@ ERROR: agent_ingroup_info INVALID USER ID - 1255|6666 -------------------------------------------------------------------------------- agent_campaigns - looks up allowed campaigns/in-groups for a specific user -NOTE: api user for this function must have user_level set to 7 or higher +NOTE: api user for this function must have user_level set to 8 or higher and "view reports" and "modify users" enabled REQUIRED FIELDS- agent_user - 2-20 characters @@ -412,7 +413,7 @@ user|allowed_campaigns_list|allowed_ingroups_list -------------------------------------------------------------------------------- campaigns_list - displays information about all campaigns in the system -NOTE: api user for this function must have user_level set to 7 or higher +NOTE: api user for this function must have user_level set to 8 or higher and "view reports" enabled REQUIRED FIELDS- source - description of what originated the API call (maximum 20 characters) @@ -443,7 +444,7 @@ TESTCAMP|Test Campaign|Y|---ALL---|INBOUND_MAN|1|DOWN|PDROP DROP B NEW -------------------------------------------------------------------------------- hopper_list - displays information about leads in the hopper for a campaign -NOTE: api user for this function must have user_level set to 7 or higher +NOTE: api user for this function must have user_level set to 8 or higher and "view reports" enabled REQUIRED FIELDS- source - description of what originated the API call (maximum 20 characters) diff --git a/agc_2-X/trunk/www/vicidial/non_agent_api.php b/agc_2-X/trunk/www/vicidial/non_agent_api.php index 23f412a0..3309d810 100644 --- a/agc_2-X/trunk/www/vicidial/non_agent_api.php +++ b/agc_2-X/trunk/www/vicidial/non_agent_api.php @@ -212,10 +212,11 @@ # 240302-0804 - Added delete_dnc_phone function # 240420-2236 - Added ConfBridge code # 240703-1657 - Added update_remote_agent function +# 240718-0942 - Fixes for inconsistencies in documentation and permissions for some functions # -$version = '2.14-189'; -$build = '240703-1657'; +$version = '2.14-190'; +$build = '240718-0942'; $php_script='non_agent_api.php'; $api_url_log = 0; $camp_lead_order_random=1; @@ -2719,7 +2720,7 @@ if ($function == 'agent_campaigns') api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); exit; } - $stmt="SELECT count(*) from vicidial_users where user='$user' and vdc_agent_api_access='1' and view_reports='1' and user_level > 6 and active='Y';"; + $stmt="SELECT count(*) from vicidial_users where user='$user' and vdc_agent_api_access='1' and view_reports='1' and user_level > 7 and modify_users='1' and active='Y';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $allowed_user=$row[0]; @@ -2734,7 +2735,7 @@ if ($function == 'agent_campaigns') } else { - $stmt="SELECT user_level,user_group from vicidial_users where user='$user' and vdc_agent_api_access='1' and modify_users='1' and user_level >= 8;"; + $stmt="SELECT user_level,user_group from vicidial_users where user='$user' and vdc_agent_api_access='1' and user_level >= 8;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $user_level = $row[0]; @@ -2906,7 +2907,7 @@ if ($function == 'campaigns_list') api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); exit; } - $stmt="SELECT count(*) from vicidial_users where user='$user' and vdc_agent_api_access='1' and view_reports='1' and user_level > 6 and active='Y';"; + $stmt="SELECT count(*) from vicidial_users where user='$user' and vdc_agent_api_access='1' and view_reports='1' and user_level > 7 and active='Y';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $allowed_user=$row[0]; @@ -2921,7 +2922,7 @@ if ($function == 'campaigns_list') } else { - $stmt="SELECT user_level,user_group from vicidial_users where user='$user' and vdc_agent_api_access='1' and modify_users='1' and user_level >= 8;"; + $stmt="SELECT user_level,user_group from vicidial_users where user='$user' and vdc_agent_api_access='1' and user_level >= 8;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $user_level = $row[0]; @@ -3037,7 +3038,7 @@ if ($function == 'hopper_list') api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); exit; } - $stmt="SELECT count(*) from vicidial_users where user='$user' and vdc_agent_api_access='1' and view_reports='1' and user_level > 6 and active='Y';"; + $stmt="SELECT count(*) from vicidial_users where user='$user' and vdc_agent_api_access='1' and view_reports='1' and user_level > 7 and active='Y';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $allowed_user=$row[0]; @@ -3052,7 +3053,7 @@ if ($function == 'hopper_list') } else { - $stmt="SELECT user_level,user_group from vicidial_users where user='$user' and vdc_agent_api_access='1' and modify_users='1' and user_level >= 8;"; + $stmt="SELECT user_level,user_group from vicidial_users where user='$user' and vdc_agent_api_access='1' and user_level >= 8;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $user_level = $row[0];