From b8cc3248e71138ef86f245f0733e1952bdbacdf3 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 1 Jun 2010 11:32:58 +0000 Subject: [PATCH] Added checks git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18812 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../addons/dyngroup/classDynamicLdapGroup.inc | 31 ++++++++++++++++++- .../dyngroup/addons/dyngroup/dyngroup.tpl | 4 +-- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/gosa-plugins/dyngroup/addons/dyngroup/classDynamicLdapGroup.inc b/gosa-plugins/dyngroup/addons/dyngroup/classDynamicLdapGroup.inc index 35a925ec6..b8bf59797 100644 --- a/gosa-plugins/dyngroup/addons/dyngroup/classDynamicLdapGroup.inc +++ b/gosa-plugins/dyngroup/addons/dyngroup/classDynamicLdapGroup.inc @@ -95,7 +95,36 @@ class DynamicLdapGroup extends plugin public function check () { - return Array(); + $messages = plugin::check(); + + // At least one entry is required. + if(!count($this->labeledURIparsed)){ + $messages[] = msgPool::required(_("Labeled Uri")); + } + + // Check entries + foreach($this->labeledURIparsed as $key => $entry){ + $nr = $key +1; + + // A base is required + if(empty($entry['base'])){ + $messages[] = msgPool::required(_("Base")." {$nr}"); + } + + // Check for invalid attributes + if(empty($entry['attr'])){ + $messages[] = msgPool::required(_("Attribute")." {$nr}"); + }elseif(in_array(strtolower($entry['attr']), array('objectclass'))){ + $messages[] = msgPool::reserved(_("Attribute")." {$nr}"); + } + + // A filter is required + if(empty($entry['filter'])){ + $messages[] = msgPool::required(_("Filter")." {$nr}"); + } + } + + return($messages); } diff --git a/gosa-plugins/dyngroup/addons/dyngroup/dyngroup.tpl b/gosa-plugins/dyngroup/addons/dyngroup/dyngroup.tpl index c50aa14df..ad5dfc69a 100644 --- a/gosa-plugins/dyngroup/addons/dyngroup/dyngroup.tpl +++ b/gosa-plugins/dyngroup/addons/dyngroup/dyngroup.tpl @@ -12,10 +12,10 @@ {foreach item=item key=key from=$labeledURIparsed} - + - {html_options options=$scopes selected=$item.scope} -- 2.30.2