diff --git a/app/dialplan_inbound/dialplan_inbound_add.php b/app/dialplan_inbound/dialplan_inbound_add.php
index 63d84b01dc..4b54869887 100644
--- a/app/dialplan_inbound/dialplan_inbound_add.php
+++ b/app/dialplan_inbound/dialplan_inbound_add.php
@@ -27,9 +27,10 @@
*/
//includes
- include "root.php";
+ require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
+ require_once "resources/paging.php";
//check permissions
if (permission_exists('inbound_route_add')) {
@@ -44,11 +45,6 @@
$language = new text;
$text = $language->get();
-//includes and title
- require_once "resources/header.php";
- $document['title'] = $text['title-dialplan-inbound-add'];
- require_once "resources/paging.php";
-
//get the http get values and set them as php variables
$order_by = $_GET["order_by"];
$order = $_GET["order"];
@@ -124,6 +120,14 @@
//process the http post data
if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
+ //validate the token
+ $token = new token;
+ if (!$token->validate($_SERVER['PHP_SELF'])) {
+ message::add($text['message-invalid_token'],'negative');
+ header('Location: '.PROJECT_PATH.'/app/dialplans/dialplans.php?app_uuid=c03b422e-13a8-bd1b-e42b-b6b9b4d27ce4');
+ exit;
+ }
+
//check for all required data
if (strlen($domain_uuid) == 0) { $msg .= "".$text['label-required-domain_uuid']."
\n"; }
if (strlen($dialplan_name) == 0) { $msg .= "".$text['label-required-dialplan_name']."
\n"; }
@@ -427,6 +431,14 @@
//initialize the destinations object
$destination = new destinations;
+//create token
+ $object = new token;
+ $token = $object->create($_SERVER['PHP_SELF']);
+
+//include the header
+ $document['title'] = $text['title-dialplan-inbound-add'];
+ require_once "resources/header.php";
+
?>
\n";
- echo "
| \n"; - echo " ".$text['title-dialplan-inbound-add']."\n"; - echo " | \n"; - echo "\n"; - echo " \n"; + echo " | \n"; - echo "
| \n";
- echo " "; - echo " ".$text['description-dialplan-inbound-add']."\n"; - echo " \n"; - echo " \n"; - echo " | \n";
- echo " |
| \n"; + echo " |
| \n"; - echo " ".$text['label-outbound-routes']."\n"; - echo " | \n"; - echo "\n"; - echo " \n"; - echo " \n"; - echo " | \n"; - echo "
| \n";
- echo " "; - echo " ".$text['description-outbound-routes']."\n"; - echo " | \n";
- echo " |