diff --git a/app/voicemails/voicemail_edit.php b/app/voicemails/voicemail_edit.php index c844fa2015..39323725d8 100644 --- a/app/voicemails/voicemail_edit.php +++ b/app/voicemails/voicemail_edit.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2018 + Portions created by the Initial Developer are Copyright (C) 2008-2019 the Initial Developer. All Rights Reserved. Contributor(s): @@ -129,6 +129,14 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { $voicemail_uuid = $_POST["voicemail_uuid"]; } + //validate the token + $token = new token; + if (!$token->validate($_SERVER['PHP_SELF'])) { + message::add($text['message-invalid_token'],'negative'); + header('Location: voicemails.php'); + exit; + } + //check for all required data if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) { require_once "resources/header.php"; @@ -296,6 +304,10 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { $greetings = $database->select($sql, $parameters, 'all'); unset($sql, $parameters); +//create token + $object = new token; + $token = $object->create($_SERVER['PHP_SELF']); + //show the header require_once "resources/header.php"; $document['title'] = $text['title-voicemail']; @@ -719,10 +731,12 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { $http_referer = parse_url($_SERVER["HTTP_REFERER"]); echo " \n"; echo " \n"; + echo " \n"; echo "
"; if ($password_complexity == "true") { echo " "; - } else { + } + else { echo " \n"; } echo " \n"; diff --git a/app/voicemails/voicemail_message_edit.php b/app/voicemails/voicemail_message_edit.php index a0fc7e2bb9..0ca92a3d68 100644 --- a/app/voicemails/voicemail_message_edit.php +++ b/app/voicemails/voicemail_message_edit.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2012 + Portions created by the Initial Developer are Copyright (C) 2008-2019 the Initial Developer. All Rights Reserved. Contributor(s): @@ -71,6 +71,14 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $voicemail_message_uuid = $_POST["voicemail_message_uuid"]; } + //validate the token + $token = new token; + if (!$token->validate($_SERVER['PHP_SELF'])) { + message::add($text['message-invalid_token'],'negative'); + header('Location: voicemails.php'); + exit; + } + //check for all required data //if (strlen($voicemail_uuid) == 0) { $msg .= "Please provide: Voicemail UUID
\n"; } //if (strlen($created_epoch) == 0) { $msg .= "Please provide: Created Epoch
\n"; } @@ -157,6 +165,10 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { unset($sql, $parameters, $row); } +//create token + $object = new token; + $token = $object->create($_SERVER['PHP_SELF']); + //show the header require_once "resources/header.php"; @@ -250,6 +262,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { if ($action == "update") { echo " \n"; } + echo " \n"; echo "
"; echo " \n"; echo " \n"; diff --git a/app/voicemails/voicemail_option_edit.php b/app/voicemails/voicemail_option_edit.php index 585d62a416..70cc35d29c 100644 --- a/app/voicemails/voicemail_option_edit.php +++ b/app/voicemails/voicemail_option_edit.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2012 + Portions created by the Initial Developer are Copyright (C) 2008-2019 the Initial Developer. All Rights Reserved. Contributor(s): @@ -74,6 +74,14 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $msg = ''; $voicemail_option_uuid = $_POST["voicemail_option_uuid"]; + //validate the token + $token = new token; + if (!$token->validate($_SERVER['PHP_SELF'])) { + message::add($text['message-invalid_token'],'negative'); + header('Location: voicemails.php'); + exit; + } + //check for all required data if (strlen($voicemail_option_digits) == 0) { $msg .= $text['message-required'].$text['label-option']."
\n"; } if (strlen($voicemail_option_order) == 0) { $msg .= $text['message-required'].$text['label-order']."
\n"; } @@ -152,6 +160,10 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { unset($sql, $parameters, $row); } +//create token + $object = new token; + $token = $object->create($_SERVER['PHP_SELF']); + //send the content to the browser require_once "resources/header.php"; $document['title'] = $text['title-voicemail_option']; @@ -239,6 +251,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " \n"; echo " \n"; echo " \n"; + echo " \n"; echo "
"; echo " \n"; echo " \n";