Commit 510518a3 authored by Côme Chilliet's avatar Côme Chilliet

Same as in userManagement, avoid fetching each objects twice to list services

parent f4295c71
......@@ -106,6 +106,13 @@ class systemManagement extends simpleManagement
$this->registerAction('saveEvent', 'saveEventDialog');
}
function configureFilter ()
{
parent::configureFilter();
/* We need all attributes to list services */
$this->filter->query[0]['attribute'] = '*';
}
/*! \brief Handle Argonaut events
* All schedules and triggered events are handled here.
*/
......@@ -264,7 +271,7 @@ class systemManagement extends simpleManagement
return ' ';
}
static function listServices($row, $dn)
static function listServices($row, $dn, $attrs)
{
global $config;
static $services = array();
......@@ -279,10 +286,8 @@ class systemManagement extends simpleManagement
}
// Load information if needed
$ldap = $config->get_ldap_link();
$ldap->cat($dn);
$services_imgs = array();
if ($attrs = $ldap->fetch()) {
if (!empty($attrs)) {
foreach ($services as $class => $service) {
if ($service->is_this_account($attrs)) {
$infos = pluglist::pluginInfos($class);
......
......@@ -63,7 +63,7 @@
<label>Services</label>
<sortAttribute>services</sortAttribute>
<sortType>string</sortType>
<value>%{filter:listServices(row,dn)}</value>
<value>%{filter:listServices(row,dn,entry)}</value>
<export>true</export>
</column>
......
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