Call Flows: Token integration.

This commit is contained in:
Nate 2019-09-17 22:03:13 -06:00
parent 5a8dcd04bd
commit 9acf15d844
1 changed files with 16 additions and 3 deletions

View File

@ -91,6 +91,14 @@
$call_flow_uuid = $_POST["call_flow_uuid"];
}
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: call_flows.php');
exit;
}
//check for all required data
$msg = '';
//if (strlen($domain_uuid) == 0) { $msg .= $text['message-required']." ".$text['label-domain_uuid']."<br>\n"; }
@ -458,6 +466,10 @@
echo "</tr>\n";
}
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);
//show the header
require_once "resources/header.php";
@ -673,10 +685,11 @@
echo " <tr>\n";
echo " <td colspan='2' align='right'>\n";
if ($action == "update") {
echo " <input type='hidden' name='call_flow_uuid' value='".escape($call_flow_uuid)."'>\n";
echo " <input type='hidden' name='dialplan_uuid' value='".escape($dialplan_uuid)."'>\n";
echo " <input type='hidden' name='call_flow_uuid' value='".escape($call_flow_uuid)."'>\n";
echo " <input type='hidden' name='dialplan_uuid' value='".escape($dialplan_uuid)."'>\n";
}
echo " <input type='submit' class='btn' value='".$text['button-save']."'>\n";
echo " <input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
echo " <input type='submit' class='btn' value='".$text['button-save']."'>\n";
echo " </td>\n";
echo " </tr>";
echo "</table>";