Call Center: Token integration.

This commit is contained in:
Nate
2019-09-17 21:59:42 -06:00
parent 2d4f2acaf5
commit 5a8dcd04bd
3 changed files with 38 additions and 0 deletions

View File

@@ -165,6 +165,14 @@
$call_center_queue_uuid = $_POST["call_center_queue_uuid"];
}
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: call_center_queues.php');
exit;
}
//check for all required data
$msg = '';
//if (strlen($domain_uuid) == 0) { $msg .= $text['message-required']."domain_uuid<br>\n"; }
@@ -478,6 +486,10 @@
if (strlen($queue_discard_abandoned_after) == 0) { $queue_discard_abandoned_after = "900"; }
if (strlen($queue_abandoned_resume_allowed) == 0) { $queue_abandoned_resume_allowed = "false"; }
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);
//show the header
require_once "resources/header.php";
if ($action == "add") {
@@ -1000,6 +1012,7 @@
echo " <input type='hidden' name='call_center_queue_uuid' value='".escape($call_center_queue_uuid)."'>\n";
echo " <input type='hidden' name='dialplan_uuid' value='".escape($dialplan_uuid)."'>\n";
}
echo " <input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
echo " <br />";
echo " <input type='submit' class='btn' value='".$text['button-save']."'>\n";
echo " </td>\n";