diff options
| author | Syndamia <kamen@syndamia.com> | 2025-02-02 15:30:53 +0200 |
|---|---|---|
| committer | Syndamia <kamen@syndamia.com> | 2025-02-02 15:30:53 +0200 |
| commit | 179ebaebc36b6dc470dacad5a9020e4d6bf9921a (patch) | |
| tree | 053c11e48ccda6cf22e532c5f65a98d7ff0a6dd1 /views/list/index.php | |
| parent | d7c2e638a5ea39caeadd40406f840e9b90f893d5 (diff) | |
| download | nowayforward_human-179ebaebc36b6dc470dacad5a9020e4d6bf9921a.tar nowayforward_human-179ebaebc36b6dc470dacad5a9020e4d6bf9921a.tar.gz nowayforward_human-179ebaebc36b6dc470dacad5a9020e4d6bf9921a.zip | |
feat: Allow admins to delete lists
Diffstat (limited to 'views/list/index.php')
| -rw-r--r-- | views/list/index.php | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/views/list/index.php b/views/list/index.php index 759ab04..98c2eb4 100644 --- a/views/list/index.php +++ b/views/list/index.php @@ -22,14 +22,18 @@ <p><?= $list->Description ?></p> <section id="list-buttons" hidden> - <form action="/list/update" method="GET"> - <input type="hidden" name="lid" value="<?= $list->LID ?>"> - <input type="submit" value="Update"> - </form> - <form action="/list/delete" method="GET"> - <input type="hidden" name="lid" value="<?= $list->LID ?>"> - <input type="submit" value="Delete"> - </form> + <?php if ($user !== null && $user->UID === $author->UID): ?> + <form action="/list/update" method="GET"> + <input type="hidden" name="lid" value="<?= $list->LID ?>"> + <input type="submit" value="Update"> + </form> + <?php endif; ?> + <?php if ($user !== null && ($user->UID === $author->UID || $user->Role === 'Admin')): ?> + <form action="/list/delete" method="GET"> + <input type="hidden" name="lid" value="<?= $list->LID ?>"> + <input type="submit" value="Delete"> + </form> + <?php endif; ?> </section> <script type="text/javascript"> function showListButtons() { |
