Modules: Token integration.

This commit is contained in:
Nate
2019-09-19 06:40:56 -06:00
parent 54da1c0aef
commit 46c5979684

View File

@@ -70,6 +70,14 @@
$module_uuid = $_POST["module_uuid"];
}
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: modules.php');
exit;
}
//check for all required data
$msg = '';
if (strlen($module_label) == 0) { $msg .= $text['message-required'].$text['label-label']."<br>\n"; }
@@ -152,6 +160,10 @@
unset($sql, $parameters, $row);
}
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);
//show the header
require_once "resources/header.php";
if ($action == "add") {
@@ -290,6 +302,7 @@
if ($action == "update") {
echo " <input type='hidden' name='module_uuid' value='".escape($module_uuid)."'>\n";
}
echo " <input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
echo " <br>";
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
echo " </td>\n";