mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-20 16:41:38 +00:00
add csrf protection
This commit is contained in:
parent
0638dab4f8
commit
ef20172f57
|
@ -44,6 +44,11 @@ if (!$user->isAdmin()) {
|
|||
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
/* Check if the form data comes from a trusted request */
|
||||
if(!checkFormKey('savesettings')) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_request_token"))),getMLText("invalid_request_token"));
|
||||
}
|
||||
|
||||
if (isset($_POST["action"])) $action=$_POST["action"];
|
||||
else if (isset($_GET["action"])) $action=$_GET["action"];
|
||||
else $action=NULL;
|
||||
|
|
|
@ -254,6 +254,7 @@ class SeedDMS_View_Settings extends SeedDMS_Bootstrap_Style {
|
|||
|
||||
?>
|
||||
<form action="../op/op.Settings.php" method="post" enctype="multipart/form-data" name="form0" >
|
||||
<?php echo createHiddenFieldWithKey('savesettings'); ?>
|
||||
<input type="hidden" name="action" value="saveSettings" />
|
||||
<input type="hidden" id="currenttab" name="currenttab" value="<?php echo $currenttab ? $currenttab : 'site'; ?>" />
|
||||
<?php
|
||||
|
|
Loading…
Reference in New Issue
Block a user