Destinations: Token integration.
This commit is contained in:
parent
1569da66fd
commit
52869dca68
|
|
@ -135,6 +135,14 @@
|
||||||
$destination_context = $_SESSION['domain_name'];
|
$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
|
//check for all required data
|
||||||
$msg = '';
|
$msg = '';
|
||||||
if (strlen($destination_type) == 0) { $msg .= $text['message-required']." ".$text['label-destination_type']."<br>\n"; }
|
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 =="outbound") { $destination_context = $_SESSION['domain_name']; }
|
||||||
if ($destination_type =="local") { $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
|
//show the header
|
||||||
require_once "resources/header.php";
|
require_once "resources/header.php";
|
||||||
if ($action == "update") {
|
if ($action == "update") {
|
||||||
|
|
@ -1180,6 +1192,7 @@
|
||||||
echo " <input type='hidden' name='dialplan_uuid' value='".escape($dialplan_uuid)."'>\n";
|
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='destination_uuid' value='".escape($destination_uuid)."'>\n";
|
||||||
}
|
}
|
||||||
|
echo " <input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
|
||||||
echo " <br>";
|
echo " <br>";
|
||||||
echo " <input type='submit' class='btn' value='".$text['button-save']."'>\n";
|
echo " <input type='submit' class='btn' value='".$text['button-save']."'>\n";
|
||||||
echo " </td>\n";
|
echo " </td>\n";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue