Streams: Token integration.

This commit is contained in:
Nate 2019-09-19 07:37:49 -06:00
parent 359d3830c9
commit c224da7062
1 changed files with 15 additions and 2 deletions

View File

@ -66,6 +66,14 @@
$stream_uuid = $_POST["stream_uuid"]; $stream_uuid = $_POST["stream_uuid"];
} }
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: streams.php');
exit;
}
//check for all required data //check for all required data
$msg = ''; $msg = '';
if (strlen($stream_name) == 0) { $msg .= $text['message-required']." ".$text['label-stream_name']."<br>\n"; } if (strlen($stream_name) == 0) { $msg .= $text['message-required']." ".$text['label-stream_name']."<br>\n"; }
@ -142,6 +150,10 @@
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";
@ -243,6 +255,7 @@
echo " <tr>\n"; echo " <tr>\n";
echo " <td colspan='2' align='right'>\n"; echo " <td colspan='2' align='right'>\n";
echo " <input type='hidden' name='stream_uuid' value='".escape($stream_uuid)."'>\n"; echo " <input type='hidden' name='stream_uuid' value='".escape($stream_uuid)."'>\n";
echo " <input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
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";
echo " </tr>"; echo " </tr>";