diff --git a/gosa-core/plugins/admin/groups/class_group.inc b/gosa-core/plugins/admin/groups/class_group.inc
index 327ccef38d5c095687cc258804c561a8dd4f9e4f..b0d44f6f1e3923e7e27494b2d32a6f39f3597c3f 100644 (file)
}
/* Set mail flag */
- if (isset($this->attrs['objectClass']) && in_array('gosaMailAccount', $this->attrs['objectClass'])){
+ if (isset($this->attrs['objectClass']) && in_array_strict('gosaMailAccount', $this->attrs['objectClass'])){
$this->has_mailAccount= TRUE;
}
// 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");
- $this->memberList->setHeader(array('~',_("Given name"),_("Surename"),_("UID")));
+ $this->memberList->setHeader(array('~',_("Given name"),_("Surname"),_("UID")));
$this->memberList->setColspecs(array('20px','*','*','*','20px'));
$this->memberList->setDefaultSortColumn(1);
- $smarty->assign("nagios", $this->config->pluginEnabled("nagiosAccount"));
- $smarty->assign("pickupGroup", $this->config->pluginEnabled("phoneAccount"));
+ $smarty->assign("nagios", $this->config->pluginEnabled("nagiosAccount") && class_available("nagiosAccount"));
+ $smarty->assign("pickupGroup", $this->config->pluginEnabled("phoneAccount") && class_available("phoneAccount"));
/* Manage object add dialog */
if ($this->userSelect){
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');
$smarty->assign("multiple_support",$this->multiple_support_active);
foreach($this->attributes as $val){
- if(in_array($val,$this->multi_boxes)){
+ if(in_array_strict($val,$this->multi_boxes)){
$smarty->assign("use_".$val,TRUE);
}else{
$smarty->assign("use_".$val,FALSE);
}
}
foreach(array("base","smbgroup","groupType","sambaDomainName","fon_group","nagios_group") as $val){
- if(in_array($val,$this->multi_boxes)){
+ if(in_array_strict($val,$this->multi_boxes)){
$smarty->assign("use_".$val,TRUE);
}else{
$smarty->assign("use_".$val,FALSE);
}
}
+ $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];
}
if (strict_uid_mode()){
$message[]= msgPool::invalid(_("Name"), $this->cn, "/[a-z0-9_-]/");
} else {
- $message[]= msgPool::invalid(_("Name"), $this->cn, "/[a-z0-9_-]/i");
+ $message[]= msgPool::invalid(_("Name"), $this->cn, "/[a-z0-9 _.-]/i");
}
}
"name" => "ogroupRDN",
"type" => "rdn",
"default" => "ou=groups,",
- "description" => _("The 'ogroupRDN' statement defines the location where new object groups will be created. The default is 'ou=groups,'."),
+ "description" => _("RDN for object group storage."),
"check" => "gosaProperty::isRdn",
"migrate" => "migrate_ogroupRDN",
"group" => "plugin",
$ret = array_merge($ret,$this->trustModeDialog->get_multi_edit_values());
foreach(array("base","smbgroup","groupType","sambaDomainName","fon_group","nagios_group") as $attr){
- if(in_array($attr,$this->multi_boxes)){
+ if(in_array_strict($attr,$this->multi_boxes)){
$ret[$attr] = $this->$attr;
}
}
if (isset($all['memberUid'])){
for ($i= 0; $i<$all['memberUid']['count']; $i++){
- if(!in_array($all['memberUid'][$i],$this->memberUid)){
+ if(!in_array_strict($all['memberUid'][$i],$this->memberUid)){
$this->memberUid_used_by_some[$all['memberUid'][$i]]= $all['memberUid'][$i];
}
}
// - 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->commonList->setHeader(array('~',_("Given name"),_("Surename"),_("UID")));
+ $this->commonList->setHeader(array('~',_("Given name"),_("Surname"),_("UID")));
$this->commonList->setColspecs(array('20px','*','*','*','20px'));
$this->commonList->setDefaultSortColumn(1);
$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");
- $this->partialList->setHeader(array('~',_("Given name"),_("Surename"),_("UID")));
+ $this->partialList->setHeader(array('~',_("Given name"),_("Surname"),_("UID")));
$this->partialList->setColspecs(array('20px','*','*','*','20px'));
$this->partialList->setDefaultSortColumn(1);
}
}
// Detect samba groups and adapt its values.
- $this->smbgroup = in_array('sambaGroupMapping', $source['objectClass']);
+ $this->smbgroup = in_array_strict('sambaGroupMapping', $source['objectClass']);
if ($this->smbgroup) {
$this->sambaSID = $this->getSambaSID();
}
/* Update groupMembership, keep optinal group */
foreach($attrs['memberUid_used_by_some'] as $uid){
- if(in_array($uid,$this->memberUid)){
+ if(in_array_strict($uid,$this->memberUid)){
$users[$uid] = $uid;
}
}