From 7d68422e94e202a5d5927bde3d496de77dbba5b7 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 7 Oct 2020 16:35:12 -0700 Subject: [PATCH] web: in "all projects" certificate, show message if no projects ... rather than a certificate with PHP warnings at the top --- html/inc/user.inc | 1 + html/user/cert_all.php | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/html/inc/user.inc b/html/inc/user.inc index 483403c218..3f57c54f92 100644 --- a/html/inc/user.inc +++ b/html/inc/user.inc @@ -78,6 +78,7 @@ function get_other_projects($user) { // $remote = @json_decode(json_encode((array)$xml_object))->project; if (!$remote) { + $user->projects = null; return $user; } if (count($remote) == 1) { diff --git a/html/user/cert_all.php b/html/user/cert_all.php index 13adc0c691..82e8837255 100644 --- a/html/user/cert_all.php +++ b/html/user/cert_all.php @@ -38,6 +38,11 @@ if ($border=="no") { $font = "\"Optima,Lucida Bright,Times New Roman\""; $user = get_other_projects($user); + +if (!$user->projects) { + error_page("No accounts found"); +} + $total_credit = 0; foreach ($user->projects as $p) { $total_credit += $p->total_credit;