From eebb8830cd4816146828e457b231d8f42bdb8868 Mon Sep 17 00:00:00 2001 From: rickparrish <rickparrish@users.noreply.github.com> Date: Sun, 27 Nov 2022 14:25:09 -0500 Subject: [PATCH] Display error if user can't read requested sub --- webv4/pages/001-forum.ssjs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/webv4/pages/001-forum.ssjs b/webv4/pages/001-forum.ssjs index d45ccee38c..154d6b6850 100644 --- a/webv4/pages/001-forum.ssjs +++ b/webv4/pages/001-forum.ssjs @@ -145,6 +145,13 @@ if (typeof http_request.query.notice !== 'undefined') { writeln(format(strings.notice_box, http_request.query.notice[0])); } +if (typeof http_request.query.sub !== 'undefined' && + typeof msg_area.sub[http_request.query.sub[0]] !== 'undefined' && + !msg_area.sub[http_request.query.sub[0]].can_read +) { + writeln('<div class="alert alert-danger">Sorry, you do not have access to the requested sub.</div>'); +} + if (typeof http_request.query.sub !== 'undefined' && typeof msg_area.sub[http_request.query.sub[0]] !== 'undefined' && typeof http_request.query.thread !== 'undefined' && -- GitLab