diff options
author | Jonas Kohl | 2024-09-14 19:28:40 +0200 |
---|---|---|
committer | Jonas Kohl | 2024-09-14 19:28:40 +0200 |
commit | cc97f36b8c9a9522636d5b50fbcd2f52de06a01a (patch) | |
tree | 711486591d1ef8906b1bb0a8d6c2c86c9556553a /src/application/views/view_topic_start.php | |
parent | d8b74761c6cefdd83360d3f2add0e9ccdc6064c7 (diff) |
Add warning for logged out users when clicking attachment
Diffstat (limited to 'src/application/views/view_topic_start.php')
-rw-r--r-- | src/application/views/view_topic_start.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/application/views/view_topic_start.php b/src/application/views/view_topic_start.php index 37e8cf8..fc54623 100644 --- a/src/application/views/view_topic_start.php +++ b/src/application/views/view_topic_start.php @@ -32,6 +32,32 @@ $canDelete = ($GLOBALS["currentUser"]?->id === $topicAuthor->id && $topicAuthor- </form> </div> <?php endif; ?> +<?php if ($GLOBALS["currentUser"] === null): ?> + <div class="modal fade" tabindex="-1" role="dialog" id="diag-cant-view-attachment"> + <div class="modal-dialog modal-danger" role="document"> + <div class="modal-content panel-danger"> + <div class="modal-header panel-heading"> + <h4 class="modal-title"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span> Permission denied</h4> + </div> + <div class="modal-body"> + You must be logged in to view attachments + </div> + <div class="modal-footer"> + <button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span> Close</button> + <a href="?_action=auth&next=<?= htmlentities(urlencode($_SERVER["REQUEST_URI"])) ?>" class="btn btn-success"><span class="glyphicon glyphicon-user" aria-hidden="true"></span> Log in</a> + </div> + </div> + </div> + </div> + <script> + $(function() { + $(".attachment").click(function(e) { + e.preventDefault(); + $("#diag-cant-view-attachment").modal(); + }); + }); + </script> +<?php endif; ?> <div class="page-header margin-top-0 clearfix"> <div id="displayHeading"> |