digestTest: don't display empty digest when not logged in

This commit is contained in:
Andrew Dolgov 2019-03-04 07:00:20 +03:00
parent c68ac04020
commit 6ec602e1a4
1 changed files with 10 additions and 6 deletions

View File

@ -7,6 +7,7 @@ class Backend extends Handler {
} }
function digestTest() { function digestTest() {
if (isset($_SESSION['uid'])) {
header("Content-type: text/html"); header("Content-type: text/html");
$rv = Digest::prepare_headlines_digest($_SESSION['uid'], 1, 1000); $rv = Digest::prepare_headlines_digest($_SESSION['uid'], 1, 1000);
@ -15,6 +16,9 @@ class Backend extends Handler {
print $rv[0]; print $rv[0];
print "<h1>Plain text</h1>"; print "<h1>Plain text</h1>";
print "<pre>".$rv[3]."</pre>"; print "<pre>".$rv[3]."</pre>";
} else {
print error_json(6);
}
} }
private function display_main_help() { private function display_main_help() {