summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 35d0b03)
raw | patch | inline | side by side (parent: 35d0b03)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 4 Jul 2011 06:31:09 +0000 (06:31 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 4 Jul 2011 06:31:09 +0000 (06:31 +0000) |
-Avoid saving group members while the dyngroup extension is enabled.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20928 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20928 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/plugins/admin/groups/class_group.inc | patch | blob | history | |
gosa-core/plugins/admin/groups/generic.tpl | patch | blob | history |
diff --git a/gosa-core/plugins/admin/groups/class_group.inc b/gosa-core/plugins/admin/groups/class_group.inc
index bf21e508e7c6322ff036e797dc17e0d8073eeee8..7412166ec1933994074a9d27b824864293b85897 100644 (file)
// Prepare lists
$this->memberList = new sortableListing();
$this->memberList->setDeleteable(true);
- $this->memberList->setInstantDelete(true);
+ $this->memberList->setInstantDelete(false);
$this->memberList->setEditable(false);
$this->memberList->setWidth("100%");
$this->memberList->setHeight("300px");
foreach($this->members as $uid => $member){
$data[$uid] = $member;
$givenName = $sn = _("Unknown");
- if(isset($member['sn'][0])) $sn = $member['sn'][0];
- if(isset($member['givenName'][0])) $givenName = $member['givenName'][0];
+ if(isset($member['sn']) && isset($member['sn'][0])) $sn = $member['sn'][0];
+ if(isset($member['givenName']) && isset($member['givenName'][0])) $givenName = $member['givenName'][0];
$image = image('images/false.png');
if(isset($member['sn'])){
$image = image('plugins/users/images/select_user.png');
$lData[$uid] = array('data' => array($image,$sn, $givenName, $uid));
}
$this->memberList->setListData($data,$lData);
+ $bool = $this->isRestrictedByDynGroup();
+ $this->memberList->setDeleteable(!$bool);
$this->memberList->update();
$smarty->assign("memberList", $this->memberList->render());
}else{
$data = $lData = array();
foreach($this->memberUid_used_by_some as $uid => $member){
- $member = $this->members[$member];
+ $member = (isset($this->members[$member])) ? $this->members[$member] : NULL;
$data[$uid] = $member;
$givenName = $sn = _("Unknown");
- if(isset($member['sn'][0])) $sn = $member['sn'][0];
- if(isset($member['givenName'][0])) $givenName = $member['givenName'][0];
+ if(isset($member['sn']) && isset($member['sn'][0])) $sn = $member['sn'][0];
+ if(isset($member['givenName'][0]) && isset($member['givenName'][0])) $givenName = $member['givenName'][0];
$image = image('images/false.png');
if(isset($member['sn'])){
$image = image('plugins/users/images/select_user.png');
}
}
+ $bool = $this->isRestrictedByDynGroup();
+ $smarty->assign("restrictedByDynGroup", $bool);
+ if($bool){
+ $smarty->assign("memberUidACL", preg_replace("/[^r]/","",$this->getacl('memberUid')));
+
+ }
return($smarty->fetch (get_template_path('generic.tpl', TRUE)));
}
+
+ function isRestrictedByDynGroup()
+ {
+ $bool = FALSE;
+ if(isset($this->parent->by_object['DynamicLdapGroup'])){
+ $bool = $this->parent->by_object['DynamicLdapGroup']->isAttributeDynamic('memberUid') ||
+ $this->parent->by_object['DynamicLdapGroup']->isAttributeDynamic('member');
+ }
+ return($bool);
+ }
+
function addUser($uid)
{
/* In mutliple edit we have to handle two arrays.
}
/* Take members array */
- if (count ($this->memberUid)){
+
+ if (!$this->isRestrictedByDynGroup() && count ($this->memberUid)){
$this->attrs['memberUid']= array_values(array_unique($this->memberUid));
}
$this->attrs['member'] = array();
if (count($this->memberUid)){
foreach($this->attrs['memberUid'] as $uid) {
-
if(isset($this->dnMapping[$uid])){
$this->attrs['member'][]= $this->dnMapping[$uid];
}
// - ond one which represents those users which are only part of SOME groups.
$this->commonList = new sortableListing();
$this->commonList->setDeleteable(true);
- $this->commonList->setInstantDelete(true);
+ $this->commonList->setInstantDelete(false);
$this->commonList->setEditable(false);
$this->commonList->setWidth("100%");
$this->commonList->setHeight("120px");
$this->partialList = new sortableListing();
$this->partialList->setDeleteable(true);
- $this->partialList->setInstantDelete(true);
+ $this->partialList->setInstantDelete(false);
$this->partialList->setEditable(false);
$this->partialList->setWidth("100%");
$this->partialList->setHeight("120px");
diff --git a/gosa-core/plugins/admin/groups/generic.tpl b/gosa-core/plugins/admin/groups/generic.tpl
index 5a591fd79959a11a128343e298540bc34b4a1ef2..c2015f6f0e021b6f30137d0d47922534192e1b26 100644 (file)
<table summary="" style="width:100%">
<tr>
<td style="width:50%">
- {if $multiple_support}
- <h3>{t}Common group members{/t}</h3>
- {render acl=$memberUidACL}
- {$commonList}
- {/render}
- {render acl=$memberUidACL}
- <button type='submit' name='edit_membership'>{msgPool type=addButton}</button>
- {/render}
-
- <br>
- <h3>{t}Partial group members{/t}</h3>
- {render acl=$memberUidACL}
- {$partialList}
- {/render}
- {else}
- <h3>{t}Group members{/t}</h3>
- {render acl=$memberUidACL}
- {$memberList}
- {/render}
- {render acl=$memberUidACL}
- <button type='submit' name='edit_membership'>{msgPool type=addButton}</button>
- {/render}
- {/if}
+
+ {if $restrictedByDynGroup}
+ <b>{t}The group members are part of a dyn-group and cannot be managed!{/t}</b>
+ {if $multiple_support}
+ {render acl=$memberUidACL}
+ {$commonList}
+ {/render}
+ {else}
+ {render acl=$memberUidACL}
+ {$memberList}
+ {/render}
+ {/if}
+ {else}
+
+ {if $multiple_support}
+ <h3>{t}Common group members{/t}</h3>
+ {render acl=$memberUidACL}
+ {$commonList}
+ {/render}
+ {render acl=$memberUidACL}
+ <button type='submit' name='edit_membership'>{msgPool type=addButton}</button>
+ {/render}
+
+ <br>
+ <h3>{t}Partial group members{/t}</h3>
+ {render acl=$memberUidACL}
+ {$partialList}
+ {/render}
+ {else}
+ <h3>{t}Group members{/t}</h3>
+ {render acl=$memberUidACL}
+ {$memberList}
+ {/render}
+ {render acl=$memberUidACL}
+ <button type='submit' name='edit_membership'>{msgPool type=addButton}</button>
+ {/render}
+ {/if}
+ {/if}
</td>
</tr>
</table>