Skip to content

Commit

Permalink
Merge pull request #2951 from BOINC/dpa_web
Browse files Browse the repository at this point in the history
web: fix undefined var on host page when <show_results> is false
  • Loading branch information
TheAspens committed Jan 11, 2019
2 parents 7a8815a + 9fd7ca5 commit 3979d30
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions html/inc/host.inc
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ function cross_project_links($host) {
// and the logged in user (so show some extra fields)
//
function show_host($host, $user, $ipprivate) {
global $config;
start_table();
row1(tra("Computer information"));
$anonymous = false;
Expand Down Expand Up @@ -174,8 +175,8 @@ function show_host($host, $user, $ipprivate) {
row2(tra("Application details"),
"<a href=host_app_versions.php?hostid=$host->id>".tra("Show")."</a>"
);
$config = get_config();
if (parse_bool($config, "show_results")) {
$show_results = parse_bool($config, "show_results");
if ($show_results) {
$nresults = host_nresults($host);
if ($nresults) {
$results = "<a href=results.php?hostid=$host->id>$nresults</a>";
Expand Down Expand Up @@ -204,7 +205,7 @@ function show_host($host, $user, $ipprivate) {
}
}
row2(tra("Location"), location_form($host));
if ($nresults == 0) {
if ($show_results && $nresults == 0) {
$x = " &middot; <a href=host_delete.php?hostid=$host->id".url_tokens($user->authenticator).">".tra("Delete this computer")."</a> ";
} else {
$x = "";
Expand Down

0 comments on commit 3979d30

Please sign in to comment.