From 20df9934821599488d36e6f33a08d2fe88282e6c Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 16 Mar 2010 13:01:54 +0000 Subject: [PATCH] Fixed group selection git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@16629 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../groupSelect/class_filterLDAPBlacklist.inc | 46 ++++++++-------- .../posix/groupSelect/class_groupSelect.inc | 10 ++-- .../posix/groupSelect/group-filter.tpl | 34 ------------ .../posix/groupSelect/group-filter.xml | 55 ++++--------------- .../personal/posix/groupSelect/group-list.tpl | 53 +++++++++--------- .../personal/posix/groupSelect/group-list.xml | 19 ++++--- 6 files changed, 74 insertions(+), 143 deletions(-) delete mode 100644 gosa-core/plugins/personal/posix/groupSelect/group-filter.tpl diff --git a/gosa-core/plugins/personal/posix/groupSelect/class_filterLDAPBlacklist.inc b/gosa-core/plugins/personal/posix/groupSelect/class_filterLDAPBlacklist.inc index a465d0916..b78f2b287 100644 --- a/gosa-core/plugins/personal/posix/groupSelect/class_filterLDAPBlacklist.inc +++ b/gosa-core/plugins/personal/posix/groupSelect/class_filterLDAPBlacklist.inc @@ -2,30 +2,30 @@ class filterLDAPBlacklist { -static function query($base, $scope, $filter, $attributes, $category, $objectStorage= "") -{ -$result = filterLDAP::query($base, $scope, $filter, $attributes, $category, $objectStorage); -return(filterLDAPBlacklist::filterByBlacklist($result)); -} + static function query($base, $scope, $filter, $attributes, $category, $objectStorage= "") + { + $result = filterLDAP::query($base, $scope, $filter, $attributes, $category, $objectStorage); + return(filterLDAPBlacklist::filterByBlacklist($result)); + } -static function filterByBlacklist($entries) -{ -if(session::is_set('filterBlacklist')){ -$blist = session::get('filterBlacklist'); -foreach($blist as $attr_name => $attr_values){ -foreach($attr_values as $match){ -foreach($entries as $id => $entry){ -if(isset($entry[$attr_name])){ -$test = $entry[$attr_name]; -if(!is_array($test)) $test = array($test); -if(in_array($match, $test)) unset($entries[$id]); -} -} -} -} -} -return(array_values($entries)); -} + static function filterByBlacklist($entries) + { + if(session::is_set('filterBlacklist')){ + $blist = session::get('filterBlacklist'); + foreach($blist as $attr_name => $attr_values){ + foreach($attr_values as $match){ + foreach($entries as $id => $entry){ + if(isset($entry[$attr_name])){ + $test = $entry[$attr_name]; + if(!is_array($test)) $test = array($test); + if(in_array($match, $test)) unset($entries[$id]); + } + } + } + } + } + return(array_values($entries)); + } } ?> diff --git a/gosa-core/plugins/personal/posix/groupSelect/class_groupSelect.inc b/gosa-core/plugins/personal/posix/groupSelect/class_groupSelect.inc index 2c98adada..b681d00a6 100644 --- a/gosa-core/plugins/personal/posix/groupSelect/class_groupSelect.inc +++ b/gosa-core/plugins/personal/posix/groupSelect/class_groupSelect.inc @@ -33,13 +33,13 @@ class groupSelect extends management $this->storagePoints = array(get_ou("groupRDN")); - // Build filter - if (session::global_is_set(get_class($this)."_filter")){ - $filter= session::global_get(get_class($this)."_filter"); - } else { +# // Build filter + # if (session::global_is_set(get_class($this)."_filter")){ + # $filter= session::global_get(get_class($this)."_filter"); + # } else { $filter = new filter(get_template_path("group-filter.xml", true, dirname(__FILE__))); $filter->setObjectStorage($this->storagePoints); - } + #} $this->setFilter($filter); // Build headpage diff --git a/gosa-core/plugins/personal/posix/groupSelect/group-filter.tpl b/gosa-core/plugins/personal/posix/groupSelect/group-filter.tpl deleted file mode 100644 index 43c1d5d23..000000000 --- a/gosa-core/plugins/personal/posix/groupSelect/group-filter.tpl +++ /dev/null @@ -1,34 +0,0 @@ -
-

- {image path="images/launch.png" align="right"}{t}Filter{/t} -

-
- -
- -
- - {$PRIMARY} 
- {$SAMBA} 
- {$MAIL} 
- - {$SCOPE} - - - - - - - - - -
- - - {$NAME} -
- {$APPLY} -
-
diff --git a/gosa-core/plugins/personal/posix/groupSelect/group-filter.xml b/gosa-core/plugins/personal/posix/groupSelect/group-filter.xml index f44ca2458..a3e6aa917 100644 --- a/gosa-core/plugins/personal/posix/groupSelect/group-filter.xml +++ b/gosa-core/plugins/personal/posix/groupSelect/group-filter.xml @@ -2,62 +2,27 @@ groups - true + default + auto + dn + objectClass + cn + description + default + LDAPBlacklist - (&(objectClass=posixGroup)$NAME(|$PRIMARY$MAIL$SAMBA)) - dn - objectClass - cn - description + (&(objectClass=posixGroup)(cn=$)) - auto - - - - checkbox - PRIMARY - true - - (!(objectClass=gosaObject)) - - - - checkbox - MAIL - true - - (objectClass=gosaMailAccount) - - - - checkbox - SAMBA - true - - (objectClass=sambaGroupMapping) - - - - textfield - NAME - 20 - 60 - - - (|(cn=*$*)(description=*$*)) - true - LDAPBlacklist - (&(objectClass=posixGroup)(|(cn=*$NAME*)(description=*$NAME*))) cn 0.5 3 - + diff --git a/gosa-core/plugins/personal/posix/groupSelect/group-list.tpl b/gosa-core/plugins/personal/posix/groupSelect/group-list.tpl index 559505303..af0f2c69f 100644 --- a/gosa-core/plugins/personal/posix/groupSelect/group-list.tpl +++ b/gosa-core/plugins/personal/posix/groupSelect/group-list.tpl @@ -1,36 +1,33 @@ - - - - - -
-
-

 {$HEADLINE} {$SIZELIMIT}

-
- -
-
- - -
{$ROOT} {$BACK} {$HOME} {$RELOAD} {$SEPARATOR} {t}Base{/t} {$BASE} {$SEPARATOR} {image path="images/rocket.png"} - {$ACTIONS}
-
-
- -
+ + +
+ +
+

{$HEADLINE} {$SIZELIMIT}

+
+ + + + + + + + + + +
{$ROOT}{$BACK}{$HOME}{$RELOAD}{t}Base{/t} {$BASE}{$ACTIONS}{$FILTER}
- {$LIST} -
- {$FILTER} -
+ - + {$LIST} + + +
- - + +
diff --git a/gosa-core/plugins/personal/posix/groupSelect/group-list.xml b/gosa-core/plugins/personal/posix/groupSelect/group-list.xml index 9714ced2f..8703cbc37 100644 --- a/gosa-core/plugins/personal/posix/groupSelect/group-list.xml +++ b/gosa-core/plugins/personal/posix/groupSelect/group-list.xml @@ -1,21 +1,24 @@ + - true - false - true - true + true + false + true + true groups - 1 - + 1 + + - posixGroup + posixGroup groups group plugins/groups/images/select_group.png - + + -- 2.30.2