diff --git a/app/controllers/oer/mymaterial.php b/app/controllers/oer/mymaterial.php index 908dae02f5aa5a351b627b181a7ad62241e8a268..fe5f6c005f7b64c8743533b0e993ed1f77b4c0e4 100755 --- a/app/controllers/oer/mymaterial.php +++ b/app/controllers/oer/mymaterial.php @@ -28,12 +28,14 @@ class Oer_MymaterialController extends AuthenticatedController $content_types = ['application/x-zip-compressed', 'application/zip', 'application/x-zip']; $tmp_folder = $GLOBALS['TMP_PATH'] . '/temp_folder_' . md5(uniqid()); if (Request::submitted('delete') && Request::isPost()) { + CSRFProtection::verifyUnsafeRequest(); $material->pushDataToIndexServers('delete'); $material->delete(); PageLayout::postSuccess(_('Das Material wurde gelöscht.')); $this->redirect('oer/market/index'); return; } elseif (Request::isPost()) { + CSRFProtection::verifyUnsafeRequest(); $was_new = $material->isNew(); $was_on_twillo = (bool) $material['published_id_on_twillo']; $material->setData(Request::getArray('data')); diff --git a/app/views/oer/market/details.php b/app/views/oer/market/details.php index 40ebe0971e3c89ecb41703779bbaddfcc22a32f0..112c86f81600c60cce708d96435916c424f83bc3 100755 --- a/app/views/oer/market/details.php +++ b/app/views/oer/market/details.php @@ -65,6 +65,7 @@ <? if (!$material['host_id'] && ($material->isMine() || $GLOBALS['perm']->have_perm("root"))) : ?> <?= \Studip\LinkButton::create(_('Bearbeiten'), $controller->link_for("oer/mymaterial/edit/".$material->getId()), ['data-dialog' => "1"]) ?> <form action="<?= $controller->link_for("oer/mymaterial/edit/".$material->getId()) ?>" method="post" style="display: inline;"> + <?= CSRFProtection::tokenTag() ?> <?= \Studip\Button::create(_('Löschen'), "delete", ['value' => 1, 'data-confirm' => _('Wirklich löschen?')]) ?> </form> <? endif ?> diff --git a/app/views/oer/mymaterial/edit.php b/app/views/oer/mymaterial/edit.php index 1699cd9811811a8adaddad866154bc6c14c40479..01d0ec668674dee90f0bebdffc46f2ce7715a30f 100755 --- a/app/views/oer/mymaterial/edit.php +++ b/app/views/oer/mymaterial/edit.php @@ -4,7 +4,7 @@ onsubmit="$(window).off('beforeunload')" data-secure enctype="multipart/form-data"> - + <?= CSRFProtection::tokenTag() ?> <div class="oercampus_editmaterial"> <fieldset> <legend><?= _('Grunddaten') ?></legend>