Commit 1d1b4134 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

Merge branch '5732-fai-log-tab-is-shown-as-active-even-if-there-is-no-log' into '1.3-dev'

Resolve "FAI log tab is shown as active even if there is no log"

Closes #5732

See merge request fusiondirectory/fd-plugins!78
Showing with 8 additions and 2 deletions
+8 -2
...@@ -196,7 +196,6 @@ class faiLogView extends simplePlugin ...@@ -196,7 +196,6 @@ class faiLogView extends simplePlugin
$this->mac = $this->attrs['macAddress'][0]; $this->mac = $this->attrs['macAddress'][0];
} }
$this->is_account = FALSE;
if ($this->mac != '') { if ($this->mac != '') {
/* Query for log files */ /* Query for log files */
$res = $this->o_queue->get_log_info_for_mac($this->mac); $res = $this->o_queue->get_log_info_for_mac($this->mac);
...@@ -207,9 +206,16 @@ class faiLogView extends simplePlugin ...@@ -207,9 +206,16 @@ class faiLogView extends simplePlugin
/* Check if there is at least one log file */ /* Check if there is at least one log file */
if (isset($res[$this->mac]) && is_array($res[$this->mac])) { if (isset($res[$this->mac]) && is_array($res[$this->mac])) {
$this->attributesAccess['available_logs']->logs = $res; $this->attributesAccess['available_logs']->logs = $res;
$this->is_account = TRUE;
} }
} }
$this->is_account = $this->is_this_account($this->attrs);
$this->ignore_account = FALSE;
}
function is_this_account($attrs)
{
/* Will not work when called from parent constructor (or when $attrs is not us) */
return (count($this->attributesAccess['available_logs']->logs) > 0);
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment