Disabled deleting Preorders for non-admins

This commit is contained in:
Frank Schubert
2025-11-18 14:37:37 +01:00
parent 36dff8da6a
commit 36c646e335
2 changed files with 6 additions and 0 deletions

View File

@@ -1075,6 +1075,8 @@ $pagination_entity_name = "Vorbestellungen";
<?php if(!$me->is(["preorderfront"]) && !$me->is("preorderreadonly")): ?>
<a href="#" data-home-id="<?=$preorder->adb_wohneinheit_id?>" data-home-contact title="Kontakte bearbeiten"><i class="fas fa-users-cog text-primary"></i></a>
<a href="<?=self::getUrl("Preorder", "edit", ["id" => $preorder->id])?>"><i class="far fa-edit" title="Vorbestellung Bearbeiten"></i></a>
<?php endif; ?>
<?php if($me->isAdmin()): ?>
<a href="<?=self::getUrl("Preorder", "delete", ["id" => $preorder->id, "filter" => $filter])?>" class="text-danger" onclick="if(!confirm('Vorbestellung wirklich löschen?')) return false;" title="Vorbestellung Löschen"><i class="fas fa-trash"></i></a>
<?php endif; ?>
</div>

View File

@@ -791,6 +791,10 @@ class PreorderController extends mfBaseController {
$qs = http_build_query($qs);
}
if(!$this->me->isAdmin()) {
$this->redirect("Preorder", "Index", $qs);
}
$id = $this->request->id;
if(!is_numeric($id) || $id < 1) {
$this->layout()->setFlash("Vorbestellung nicht gefunden!", "error");