Contacts: Token integration.

This commit is contained in:
Nate
2019-09-17 22:28:22 -06:00
parent d319080d19
commit 1efed156b5
10 changed files with 131 additions and 1 deletions
+13
View File
@@ -70,6 +70,14 @@
$contact_note_uuid = $_POST["contact_note_uuid"];
}
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: contacts.php');
exit;
}
//check for all required data
$msg = '';
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
@@ -160,6 +168,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 == "update") {
@@ -204,6 +216,7 @@
if ($action == "update") {
echo " <input type='hidden' name='contact_note_uuid' value='".escape($contact_note_uuid)."'>\n";
}
echo " <input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
echo " </td>\n";
echo " </tr>";