From d817bba9e81ddc20e964723da434b1dede8e3d08 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 4 Jul 2011 07:38:59 +0000 Subject: [PATCH] Updated dyngroup handling for ogroups git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20930 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../plugins/admin/ogroups/class_ogroup.inc | 32 ++++++++++++++++--- gosa-core/plugins/admin/ogroups/generic.tpl | 7 ++++ 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/gosa-core/plugins/admin/ogroups/class_ogroup.inc b/gosa-core/plugins/admin/ogroups/class_ogroup.inc index b4e75fccb..cf60da6fd 100644 --- a/gosa-core/plugins/admin/ogroups/class_ogroup.inc +++ b/gosa-core/plugins/admin/ogroups/class_ogroup.inc @@ -66,7 +66,7 @@ class ogroup extends plugin var $view_logged = FALSE; var $copyMembers = TRUE; - + var $wasDyGroup = FALSE; var $baseSelector; /* Already assigned Workstations. Will be hidden in selection. @@ -361,6 +361,17 @@ class ogroup extends plugin $data[$key] = $dn; $lData[$key] = array('data'=> array(image($image),$name)); } + + if($this->isRestrictedByDynGroup()){ + $this->memberListing->setDeleteable(false); + $smarty->assign("memberACL", preg_replace("/[^r]/", "", $this->getacl("member"))); + $smarty->assign("isRestrictedByDynGroup", TRUE); + + }else{ + $this->memberListing->setDeleteable(true); + $smarty->assign("isRestrictedByDynGroup", FALSE); + } + $this->memberListing->setListData($data,$lData); $this->memberListing->update(); $smarty->assign("memberList",$this->memberListing->render()); @@ -374,6 +385,17 @@ class ogroup extends plugin } + function isRestrictedByDynGroup() + { + $bool = FALSE; + if(isset($this->parent->by_object['DynamicLdapGroup'])){ + $bool = $this->parent->by_object['DynamicLdapGroup']->isAttributeDynamic('member'); + } + $this->wasDyGroup |= $bool; + return($bool); + } + + function set_acl_base($base) { plugin::set_acl_base($base); @@ -710,9 +732,11 @@ class ogroup extends plugin plugin::save(); /* Move members to target array */ - $this->attrs['member'] =array(); - foreach ($this->member as $key => $desc){ - $this->attrs['member'][]= LDAP::fix($key); + if(!$this->wasDyGroup && !$this->isRestrictedByDynGroup()){ + $this->attrs['member'] =array(); + foreach ($this->member as $key => $desc){ + $this->attrs['member'][]= LDAP::fix($key); + } } $ldap= $this->config->get_ldap_link(); diff --git a/gosa-core/plugins/admin/ogroups/generic.tpl b/gosa-core/plugins/admin/ogroups/generic.tpl index 34b4d8c2a..e99cc8ac0 100644 --- a/gosa-core/plugins/admin/ogroups/generic.tpl +++ b/gosa-core/plugins/admin/ogroups/generic.tpl @@ -37,15 +37,22 @@ {$trustModeDialog} + {if $isRestrictedByDynGroup} + {t}The group members are part of a dyn-group and cannot be managed!{/t} +
+
+ {/if}  ({$combinedObjects})
{render acl=$memberACL} {$memberList} {/render} +{if !$isRestrictedByDynGroup} {render acl=$memberACL}   {/render} +{/if} -- 2.30.2