Destinations: Token integration.
This commit is contained in:
parent
1efed156b5
commit
ff15eca48e
|
|
@ -135,6 +135,14 @@
|
|||
$destination_context = $_SESSION['domain_name'];
|
||||
}
|
||||
|
||||
//validate the token
|
||||
$token = new token;
|
||||
if (!$token->validate($_SERVER['PHP_SELF'])) {
|
||||
message::add($text['message-invalid_token'],'negative');
|
||||
header('Location: destinations.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
//check for all required data
|
||||
$msg = '';
|
||||
if (strlen($destination_type) == 0) { $msg .= $text['message-required']." ".$text['label-destination_type']."<br>\n"; }
|
||||
|
|
@ -790,6 +798,10 @@
|
|||
if ($destination_type =="outbound") { $destination_context = $_SESSION['domain_name']; }
|
||||
if ($destination_type =="local") { $destination_context = $_SESSION['domain_name']; }
|
||||
|
||||
//create token
|
||||
$object = new token;
|
||||
$token = $object->create($_SERVER['PHP_SELF']);
|
||||
|
||||
//show the header
|
||||
require_once "resources/header.php";
|
||||
if ($action == "update") {
|
||||
|
|
@ -1180,6 +1192,7 @@
|
|||
echo " <input type='hidden' name='dialplan_uuid' value='".escape($dialplan_uuid)."'>\n";
|
||||
echo " <input type='hidden' name='destination_uuid' value='".escape($destination_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";
|
||||
|
|
|
|||
Loading…
Reference in New Issue