Commit e9d42054 authored by Côme Chilliet's avatar Côme Chilliet

Merge branch...

Merge branch '5731-add-a-tab-in-the-opsi-plugin-on-a-system-to-show-log-for-this-computer' into '1.3-dev'

Resolve "Add a tab in the opsi plugin on a system to show log for this computer"

See merge request fusiondirectory/fd-plugins!91
parents e4923c71 46171a77
......@@ -172,7 +172,7 @@ class faiLogView extends simplePlugin
return array(
'plShortName' => _('FAI Logs'),
'plDescription' => _('FAI Logs Viewer'),
'plPriority' => 30,
'plPriority' => 31,
'plObjectType' => array('workstation', 'server', 'ogroup-dynamic'),
'plProvidedAcls' => parent::generatePlProvidedAcls(static::getAttributesInfo())
......
......@@ -37,6 +37,7 @@ class opsiClient extends simplePlugin
'plObjectType' => array('workstation', 'ogroup-dynamic'),
'plDepends' => array('sambaSystemTab'),
'plConflicts' => array('debconfStartup','faiStartup'),
'plPriority' => 8,
'plProvidedAcls' => parent::generatePlProvidedAcls(static::getAttributesInfo())
);
......
......@@ -60,20 +60,20 @@ class opsiLogView extends simplePlugin
function __construct ($dn = NULL, $object = NULL, $parent = NULL, $mainTab = FALSE)
{
/* Try to fetch logs for the given event (mac) */
$this->o_queue = new supportDaemon();
if ($dn == '') {
$dn = 'new';
}
parent::__construct($dn, $object, $parent, $mainTab);
/* Try to fetch logs for the given event (mac) */
$this->o_queue = new supportDaemon();
/* Get correct macAddress. Check if an event is given or a ldap object. */
if (isset($this->attrs['macAddress'][0])) {
$this->mac = $this->attrs['macAddress'][0];
}
if ($this->mac != '') {
if (isset($this->parent->by_object['opsiClient']) && $this->parent->by_object['opsiClient']->is_account && ($this->mac != '')) {
/* Query for log files */
$res = $this->o_queue->append_call('System.list_logs', $this->mac, array('args' => array()));
if ($this->o_queue->is_error()) {
......@@ -97,7 +97,7 @@ class opsiLogView extends simplePlugin
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']->getChoices()) > 0);
return (count($this->attributesAccess['available_logs']->getChoices()) > 1);
}
function loadLog()
......
......@@ -31,7 +31,7 @@ class sambaSystemTab extends simplePlugin
'plDescription' => _('Windows workstation information'),
'plSelfModify' => FALSE,
'plObjectType' => array('workstation'),
'plPriority' => 5,
'plPriority' => 6,
'plProvidedAcls' => parent::generatePlProvidedAcls(static::getAttributesInfo())
);
......
Markdown is supported
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