Ring Groups: Token integration.
This commit is contained in:
@@ -86,6 +86,14 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||||||
$ring_group_destination_uuid = $_POST["ring_group_destination_uuid"];
|
$ring_group_destination_uuid = $_POST["ring_group_destination_uuid"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//validate the token
|
||||||
|
$token = new token;
|
||||||
|
if (!$token->validate($_SERVER['PHP_SELF'])) {
|
||||||
|
message::add($text['message-invalid_token'],'negative');
|
||||||
|
header('Location: ring_groups.php');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
//check for all required data
|
//check for all required data
|
||||||
//if (strlen($domain_uuid) == 0) { $msg .= $text['message-required']." ".$text['label-domain_uuid']."<br>\n"; }
|
//if (strlen($domain_uuid) == 0) { $msg .= $text['message-required']." ".$text['label-domain_uuid']."<br>\n"; }
|
||||||
//if (strlen($ring_group_uuid) == 0) { $msg .= $text['message-required']." ".$text['label-ring_group_uuid']."<br>\n"; }
|
//if (strlen($ring_group_uuid) == 0) { $msg .= $text['message-required']." ".$text['label-ring_group_uuid']."<br>\n"; }
|
||||||
@@ -174,6 +182,10 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||||||
unset($sql, $parameters, $row);
|
unset($sql, $parameters, $row);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//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";
|
||||||
|
|
||||||
@@ -255,6 +267,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||||||
if ($action == "update") {
|
if ($action == "update") {
|
||||||
echo " <input type='hidden' name='ring_group_destination_uuid' value='".escape($ring_group_destination_uuid)."'>\n";
|
echo " <input type='hidden' name='ring_group_destination_uuid' value='".escape($ring_group_destination_uuid)."'>\n";
|
||||||
}
|
}
|
||||||
|
echo " <input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
|
||||||
echo " <br>";
|
echo " <br>";
|
||||||
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
|
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
|
||||||
echo " </td>\n";
|
echo " </td>\n";
|
||||||
|
|||||||
@@ -179,6 +179,14 @@
|
|||||||
//process the HTTP POST
|
//process the HTTP POST
|
||||||
if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
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: ring_groups.php');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
//check for all required data
|
//check for all required data
|
||||||
$msg = '';
|
$msg = '';
|
||||||
if (strlen($ring_group_name) == 0) { $msg .= $text['message-name']."<br>\n"; }
|
if (strlen($ring_group_name) == 0) { $msg .= $text['message-name']."<br>\n"; }
|
||||||
@@ -501,6 +509,10 @@
|
|||||||
$sounds = new sounds;
|
$sounds = new sounds;
|
||||||
$sounds = $sounds->get();
|
$sounds = $sounds->get();
|
||||||
|
|
||||||
|
//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";
|
||||||
|
|
||||||
@@ -938,6 +950,7 @@
|
|||||||
if (is_uuid($ring_group_uuid)) {
|
if (is_uuid($ring_group_uuid)) {
|
||||||
echo " <input type='hidden' name='ring_group_uuid' value='".escape($ring_group_uuid)."'>\n";
|
echo " <input type='hidden' name='ring_group_uuid' value='".escape($ring_group_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";
|
||||||
|
|||||||
Reference in New Issue
Block a user