Commit 02d67908 authored by Benoit Mortier's avatar Benoit Mortier

Fixes: #1266 having the mac address next to the ip address in filter system list

parent 5c7caa2a
......@@ -96,6 +96,7 @@ class systemManagement extends management
$headpage = new listing(get_template_path("system-list.xml", true));
$headpage->registerElementFilter("systemRelease", "systemManagement::systemRelease");
$headpage->registerElementFilter("ipOf", "systemManagement::ipOf");
$headpage->registerElementFilter("macOf", "systemManagement::macOf");
$headpage->registerElementFilter("listServices", "systemManagement::listServices");
$headpage->setFilter($filter);
$filter->setConverter('INCOMING', 'systemManagement::incomingFilterConverter');
......@@ -1362,6 +1363,20 @@ class systemManagement extends management
return($str);
}
static function macOf($dn)
{
global $config;
// Load information if needed
$ldap = $config->get_ldap_link();
$ldap->cd($dn);
$ldap->search("(macAddress=*)",array('macAddress'));
$str = " ";
if($attrs = $ldap->fetch()){
$str = $attrs['macAddress'][0];
}
return($str);
}
/*! \brief !! Incoming dummy acls, required to defined acls for incoming objects
*/
......
......@@ -142,7 +142,7 @@
</definition>
<table>
<layout>|20px;c||90px||80px|80px|170px;r|</layout>
<layout>|20px;c||90px|110px|100px||60px|170px;r|</layout>
<department>
<value>%{filter:objectType(dn,objectClass)}</value>
......@@ -173,6 +173,14 @@
<export>true</export>
</column>
<column>
<label>MAC</label>
<sortAttribute>mac</sortAttribute>
<sortType>string</sortType>
<value>%{filter:macOf(dn)}</value>
<export>true</export>
</column>
<column>
<label>Description</label>
<sortAttribute>description</sortAttribute>
......
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