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
d84978eb3d
commit
6dbcd3362f
|
@ -34,6 +34,11 @@ if ($user->isGuest()) {
|
|||
UI::exitError(getMLText("edit_event"),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
/* Check if the form data comes from a trusted request */
|
||||
if(!checkFormKey('addevent')) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_request_token"))),getMLText("invalid_request_token"));
|
||||
}
|
||||
|
||||
if (!isset($_POST["from"]) && !(isset($_POST["frommonth"]) && isset($_POST["fromday"]) && isset($_POST["fromyear"])) ) {
|
||||
UI::exitError(getMLText("add_event"),getMLText("error_occured"));
|
||||
}
|
||||
|
|
|
@ -84,6 +84,7 @@ $(document).ready(function() {
|
|||
?>
|
||||
|
||||
<form class="form-horizontal" action="../op/op.AddEvent.php" id="form1" name="form1" method="post">
|
||||
<?php echo createHiddenFieldWithKey('addevent'); ?>
|
||||
|
||||
<?php
|
||||
$this->formField(
|
||||
|
|
Loading…
Reference in New Issue
Block a user