From e8de826734b70df5881bc7321579c9ae84acb545 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 17 Feb 2010 16:56:17 +0000 Subject: [PATCH] Display an icon in the system list again, if system is member of an object group git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15637 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/systems/class_systemManagement.inc | 34 ++++++++++++++++--- .../systems/admin/systems/system-list.xml | 2 +- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/gosa-plugins/systems/admin/systems/class_systemManagement.inc b/gosa-plugins/systems/admin/systems/class_systemManagement.inc index 369d7b649..08e1ced82 100644 --- a/gosa-plugins/systems/admin/systems/class_systemManagement.inc +++ b/gosa-plugins/systems/admin/systems/class_systemManagement.inc @@ -86,16 +86,17 @@ class systemManagement extends management $this->storagePoints = array_unique($sP); // Build filter - if (session::global_is_set(get_class($this)."_filter")){ - $filter= session::global_get(get_class($this)."_filter"); - } else { +# if (session::global_is_set(get_class($this)."_filter")){ + # $filter= session::global_get(get_class($this)."_filter"); + # } else { $filter = new filter(get_template_path("system-filter.xml", true)); $filter->setObjectStorage($this->storagePoints); - } + # } $this->setFilter($filter); // Build headpage $headpage = new listing(get_template_path("system-list.xml", true)); + $headpage->registerElementFilter("systemDescription", "systemManagement::systemDescription"); $headpage->setFilter($filter); $filter->setConverter('INCOMING', 'systemManagement::incomingFilterConverter'); @@ -145,6 +146,9 @@ class systemManagement extends management $this->opsi = new opsi($this->config); } parent::__construct($config, $ui, "systems", $headpage); + + // Used to generate an 'ogroup' icon within the description field. + session::set('SYSTEMS_DESCRIPTION_FILTER', $headpage); } @@ -1344,6 +1348,28 @@ class systemManagement extends management } + function systemDescription($a,$b,$c,$d) + { + global $config; + + // A ... solution, but I can't figure out a better solution right now. + $headpage = session::get('SYSTEMS_DESCRIPTION_FILTER'); + if(!is_object($headpage)) return($str); + $str = $headpage->filterLink($a,$b,$c,$d); + $ldap = $config->get_ldap_link(); + $ldap->cd($config->current['BASE']); + $ldap->search("(&(objectClass=gosaGroupOfNames)(member=".$b."))"); + while($attrs = $ldap->fetch()){ + $str .= " ("._("Object group member").")"; + return($str); + } + + return($str); + } + + /*! \brief !! Incoming dummy acls, required to defined acls for incoming objects */ static function plInfo() diff --git a/gosa-plugins/systems/admin/systems/system-list.xml b/gosa-plugins/systems/admin/systems/system-list.xml index 0ffe42903..d10d8460b 100644 --- a/gosa-plugins/systems/admin/systems/system-list.xml +++ b/gosa-plugins/systems/admin/systems/system-list.xml @@ -177,7 +177,7 @@ description string - %{filter:link(row,dn,"%s",description)} + %{filter:systemDescription(row,dn,"%s",description)} true -- 2.30.2