Fix for update_lead list-restrict phone number update issue in Non-Agent API

git-svn-id: svn://192.168.202.10@3697 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2023-03-08 23:00:22 +00:00
parent c04185cb65
commit 6de39f95ea
+9 -6
View File
@@ -200,10 +200,11 @@
# 221108-1849 - Added include_ip option for agent_status function # 221108-1849 - Added include_ip option for agent_status function
# 230118-0833 - Added ingroup_list and callmenu_list functions # 230118-0833 - Added ingroup_list and callmenu_list functions
# 230122-1821 - Added reset_password option to update_user function # 230122-1821 - Added reset_password option to update_user function
# 230308-1758 - Fix for update_lead list-restrict phone number update issue
# #
$version = '2.14-177'; $version = '2.14-178';
$build = '230122-1821'; $build = '230308-1758';
$php_script='non_agent_api.php'; $php_script='non_agent_api.php';
$api_url_log = 0; $api_url_log = 0;
@@ -359,6 +360,8 @@ if (isset($_GET["hotkeys_active"])) {$hotkeys_active=$_GET["hotkeys_active"];
elseif (isset($_POST["hotkeys_active"])) {$hotkeys_active=$_POST["hotkeys_active"];} elseif (isset($_POST["hotkeys_active"])) {$hotkeys_active=$_POST["hotkeys_active"];}
if (isset($_GET["voicemail_id"])) {$voicemail_id=$_GET["voicemail_id"];} if (isset($_GET["voicemail_id"])) {$voicemail_id=$_GET["voicemail_id"];}
elseif (isset($_POST["voicemail_id"])) {$voicemail_id=$_POST["voicemail_id"];} elseif (isset($_POST["voicemail_id"])) {$voicemail_id=$_POST["voicemail_id"];}
if (isset($_GET["email"])) {$email=$_GET["email"];}
elseif (isset($_POST["email"])) {$email=$_POST["email"];}
if (isset($_GET["custom_one"])) {$custom_one=$_GET["custom_one"];} if (isset($_GET["custom_one"])) {$custom_one=$_GET["custom_one"];}
elseif (isset($_POST["custom_one"])) {$custom_one=$_POST["custom_one"];} elseif (isset($_POST["custom_one"])) {$custom_one=$_POST["custom_one"];}
if (isset($_GET["custom_two"])) {$custom_two=$_GET["custom_two"];} if (isset($_GET["custom_two"])) {$custom_two=$_GET["custom_two"];}
@@ -15096,7 +15099,7 @@ if ($function == 'update_lead')
if (!preg_match("/ $list_id /",$allowed_lists)) if (!preg_match("/ $list_id /",$allowed_lists))
{ {
$result = 'ERROR'; $result = 'ERROR';
$result_reason = "update_lead NOT AN ALLOWED LIST ID"; $result_reason = "update_lead NOT AN ALLOWED LIST ID, SEARCH";
$data = "$phone_number|$list_id"; $data = "$phone_number|$list_id";
echo "$result: $result_reason - $data\n"; echo "$result: $result_reason - $data\n";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
@@ -15293,7 +15296,7 @@ if ($function == 'update_lead')
if (!preg_match("/ $search_lead_list[$n] /",$allowed_lists)) if (!preg_match("/ $search_lead_list[$n] /",$allowed_lists))
{ {
$result = 'ERROR'; $result = 'ERROR';
$result_reason = "update_lead NOT AN ALLOWED LIST ID"; $result_reason = "update_lead NOT AN ALLOWED LIST ID, RESULTS";
$data = "$search_lead_list[$n]"; $data = "$search_lead_list[$n]";
echo "$result: $result_reason - $data\n"; echo "$result: $result_reason - $data\n";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
@@ -15712,10 +15715,10 @@ if ($function == 'update_lead')
{ {
if ( ($api_list_restrict > 0) and ($list_id >= 99) ) if ( ($api_list_restrict > 0) and ($list_id >= 99) )
{ {
if (!preg_match("/ $search_lead_list[$n] /",$allowed_lists)) if (!preg_match("/ $list_id /",$allowed_lists)) # $search_lead_list[$n] replaced with $list_id 03/08/23
{ {
$result = 'ERROR'; $result = 'ERROR';
$result_reason = "update_lead NOT AN ALLOWED LIST ID"; $result_reason = "update_lead NOT AN ALLOWED LIST ID, INSERT";
$data = "$phone_number|$list_id"; $data = "$phone_number|$list_id";
echo "$result: $result_reason - $data\n"; echo "$result: $result_reason - $data\n";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);