Ring Groups: Token integration.

This commit is contained in:
Nate
2019-09-19 07:34:03 -06:00
parent 54755bdc59
commit 8ad8ad7869
2 changed files with 26 additions and 0 deletions

View File

@@ -179,6 +179,14 @@
//process the HTTP POST
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
$msg = '';
if (strlen($ring_group_name) == 0) { $msg .= $text['message-name']."<br>\n"; }
@@ -501,6 +509,10 @@
$sounds = new sounds;
$sounds = $sounds->get();
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);
//show the header
require_once "resources/header.php";
@@ -938,6 +950,7 @@
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='".$token['name']."' value='".$token['hash']."'>\n";
echo " <br>";
echo " <input type='submit' class='btn' value='".$text['button-save']."'>\n";
echo " </td>\n";