From 103fd121e65d9f1874b9d04fc010171c77cf7e8c Mon Sep 17 00:00:00 2001 From: Tsu-ba-me Date: Fri, 4 Jun 2021 19:07:16 -0400 Subject: [PATCH] fix(cgi-bin): add login cookie guard to get_memory --- cgi-bin/get_memory | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cgi-bin/get_memory b/cgi-bin/get_memory index bf7e50a7..b9c89e29 100755 --- a/cgi-bin/get_memory +++ b/cgi-bin/get_memory @@ -31,6 +31,15 @@ if (not $anvil->data->{sys}{database}{connections}) $anvil->nice_exit({exit_code => 1}); } +my $cookie_problem = $anvil->Account->read_cookies(); + +# Don't do anything data-related if the user is not logged in. +if ($cookie_problem) +{ + $anvil->Log->entry({ source => $THIS_FILE, line => __LINE__, level => 0, 'print' => 1, priority => "err", key => "error_0307" }); + $anvil->nice_exit({ exit_code => 1 }); +} + # Read in any CGI variables, if needed. $anvil->Get->cgi();