mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 07:04:57 +00:00
add csrf protection
This commit is contained in:
parent
6dbcd3362f
commit
64152e0d0b
|
@ -38,6 +38,11 @@ function _printMessage($heading, $message) {
|
|||
return;
|
||||
}
|
||||
|
||||
/* Check if the form data comes from a trusted request */
|
||||
if(!checkFormKey('changepassword')) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_request_token"))),getMLText("invalid_request_token"));
|
||||
}
|
||||
|
||||
if (isset($_POST["hash"])) {
|
||||
$hash = $_POST["hash"];
|
||||
}
|
||||
|
|
|
@ -51,6 +51,7 @@ document.form1.newpassword.focus();
|
|||
$this->contentContainerStart();
|
||||
?>
|
||||
<form class="form-horizontal" action="../op/op.ChangePassword.php" method="post" name="form1">
|
||||
<?php echo createHiddenFieldWithKey('changepassword'); ?>
|
||||
<?php
|
||||
if ($referuri) {
|
||||
echo "<input type='hidden' name='referuri' value='".$referuri."'/>";
|
||||
|
|
Loading…
Reference in New Issue
Block a user