Skip to content

Commit

Permalink
fixed button labels to be more accurate. Added more descriptive error…
Browse files Browse the repository at this point in the history
… message for incorrect fpbx client secret token
  • Loading branch information
Ian committed Mar 15, 2024
1 parent 9dd18aa commit 202907b
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,18 @@ function fixbutton(array $params, $label="update") {
$out .= "</label><br />";
}
}
if($label == 'update'){
if($params['fix']){
if($params['fix'] == 'inbound_webhook_url'){
$params['fix'] = 'register_' . $params['fix'];
}
$label = explode('_',$params['fix']);
if($params['fix'] == 'register_inbound_webhook_url'){
$label[3] ='';
}
$label = implode(' ', $label);
}
}
$out .= "<input type='submit' class='btn' value='".$label."' />";
$out .= "</form>";
return $out;
Expand Down Expand Up @@ -157,9 +169,8 @@ function fixbutton(array $params, $label="update") {
if($inboundRouting->callbackUrl != $desiredWebhookURL) {
$problems[] = "webhook URL is wrong: <code>".$inboundRouting->callbackUrl."</code> should be <code>".$desiredWebhookURL."</code>";
}

if ($inboundRouting->clientSecret != $_SESSION['webtexting']['acceleratenetworks_inbound_token']['text']) {
$problems[] = "client secret incorrect";
if($inboundRouting->clientSecret != $_SESSION['webtexting']['acceleratenetworks_inbound_token']['text']){
$problems[] = "client secret incorrect. FusionPBX Client Secret: ". $inboundRouting->clientSecret . " FusionPBX Session Secret: ".$_SESSION['webtexting']['acceleratenetworks_inbound_token']['text'];
}

if ($inboundRouting->asDialed != $sms_number) {
Expand Down

0 comments on commit 202907b

Please sign in to comment.