SIP Profiles: Token integration.

This commit is contained in:
Nate
2019-09-19 07:36:23 -06:00
parent f50e99b02a
commit 359d3830c9

View File

@@ -70,6 +70,14 @@
$sip_profile_uuid = $_POST["sip_profile_uuid"];
}
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: sip_profiles.php');
exit;
}
//check for all required data
$msg = '';
//if (strlen($sip_profile_uuid) == 0) { $msg .= $text['message-required']." ".$text['label-sip_profile_uuid']."<br>\n"; }
@@ -235,6 +243,10 @@
$sip_profile_domains[$x]['sip_profile_domain_alias'] = '';
$sip_profile_domains[$x]['sip_profile_domain_parse'] = '';
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);
//show the header
require_once "resources/header.php";
@@ -479,10 +491,11 @@
echo " <tr>\n";
echo " <td colspan='2' align='right'>\n";
if ($action == "update") {
echo " <input type='hidden' name='sip_profile_uuid' value='".escape($sip_profile_uuid)."'>\n";
echo " <input type='hidden' name='sip_profile_uuid' value='".escape($sip_profile_uuid)."'>\n";
}
echo " <br>\n";
echo " <input type='submit' class='btn' value='".$text['button-save']."'>\n";
echo " <input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
echo " <br>\n";
echo " <input type='submit' class='btn' value='".$text['button-save']."'>\n";
echo " </td>\n";
echo " </tr>";
echo "</table>";