diff --git a/app/controllers/oer/mymaterial.php b/app/controllers/oer/mymaterial.php index 7d3271842649bd3a4b34736ea4749f4cfb995fa4..27a949dd7f9a49dfb5ad10279f865cae08d757be 100644 --- 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']; $data = Request::getArray('data'); diff --git a/app/views/oer/market/details.php b/app/views/oer/market/details.php index 6ec8378eae47fe207b9077775f2132e64a3a7ff1..9e1c60ba368e95dcd137a681140106fd8158aa22 100644 --- a/app/views/oer/market/details.php +++ b/app/views/oer/market/details.php @@ -73,6 +73,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 5d1238193f67a2d7072de3fe4cf0c26a33871bde..12c1676fea974067d5267ea5cc3cd07a2492b98e 100644 --- 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>