From 25c440bd304e71e6abdc723c113d353965c48306 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 7 Aug 2006 04:37:16 +0000 Subject: [PATCH] Fixed posixs group add git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4402 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/personal/generic/main.inc | 1 - plugins/personal/posix/class_posixAccount.inc | 25 ++++++++----------- plugins/personal/posix/main.inc | 3 +-- 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/plugins/personal/generic/main.inc b/plugins/personal/generic/main.inc index e9610876e..729d9d5c1 100644 --- a/plugins/personal/generic/main.inc +++ b/plugins/personal/generic/main.inc @@ -166,7 +166,6 @@ if (!$remove_lock){ } /* Only display edit button if there is at least one attribute editable */ - $display .= "edit buttons does not work."; if(preg_match("/w/",$ui->get_permissions($ui->dn,"users/user"))){ if ($fn == "edit"){ $info.= "\"\" ". diff --git a/plugins/personal/posix/class_posixAccount.inc b/plugins/personal/posix/class_posixAccount.inc index 4c2790d2b..bf5a6c837 100644 --- a/plugins/personal/posix/class_posixAccount.inc +++ b/plugins/personal/posix/class_posixAccount.inc @@ -299,22 +299,14 @@ class posixAccount extends plugin if (isset($_POST['add_groups_finish']) && isset($_POST['groups']) && count($_POST['groups'])){ - echo "FIXME, 302, put the acl check into addGroup function "; - #if (chk acl ($this->acl, "memberUid") == ""){ - # $this->addGroup ($_POST['groups']); - # $this->is_modified= TRUE; - #} + $this->addGroup ($_POST['groups']); } /* Delete selected groups */ if (isset($_POST['delete_groupmembership']) && isset($_POST['group_list']) && count($_POST['group_list'])){ - echo "FIXME, 302, put the acl check into addGroup function "; - #if (chk acl ($this->acl, "memberUid") == ""){ - # $this->delGroup ($_POST['group_list']); - # $this->is_modified= TRUE; - #} + $this->delGroup ($_POST['group_list']); } /* Add user workstation? */ @@ -407,7 +399,7 @@ class posixAccount extends plugin /* remove already assigned groups */ $glist= array(); foreach ($this->grouplist as $key => $value){ - if (!isset($this->groupMembership[$key]) && obj_is_writable($key,"group","memberUid",$SkipWrite)){ + if (!isset($this->groupMembership[$key]) && obj_is_writable($key,"groups/group","memberUid")){ $glist[$key]= $value; } } @@ -1007,7 +999,10 @@ class posixAccount extends plugin $entry= $attrs["cn"][0]." [$dsc]"; } error_reporting (E_ALL); - $this->groupMembership[$attrs['dn']]= $entry; + + if(obj_is_writable($attrs['dn'],"groups/group","memberUid")){ + $this->groupMembership[$attrs['dn']]= $entry; + } } } @@ -1023,7 +1018,7 @@ class posixAccount extends plugin $dest= array(); foreach ($this->groupMembership as $key => $value){ - if (!in_array($key, $groups)){ + if ((!in_array($key, $groups)) || (obj_is_writable($attrs['dn'],"groups/group","memberUid"))){ $dest[$key]= $value; } } @@ -1132,8 +1127,7 @@ class posixAccount extends plugin $base = get_groups_ou().$base; } - $res= get_list($filter, "groups/group", $base,$attrs, $Flags); - print_a($res); + $res= get_list($filter, "groups", $base,$attrs, $Flags); /* check sizelimit */ if (preg_match("/size limit/i", $ldap->error)){ @@ -1163,6 +1157,7 @@ class posixAccount extends plugin $this->grouplist[$val['dn']]=$val['cn'][0]; } } + reset ($this->grouplist); } diff --git a/plugins/personal/posix/main.inc b/plugins/personal/posix/main.inc index 5d68f0f21..252de9494 100644 --- a/plugins/personal/posix/main.inc +++ b/plugins/personal/posix/main.inc @@ -107,8 +107,7 @@ if (!$remove_lock){ "\"> ".$ui->dn." "; /* Only display edit button if there is at least one attribute editable */ - $display .= "edit buttons does not work."; - if(preg_match("/w/",$ui->get_category_permissions($ui->dn,"users"))){ + if(preg_match("/w/",$ui->get_permissions($ui->dn,"users/user"))){ $info.= "\"\" ". _("Click the 'Edit' button below to change informations in this dialog"); -- 2.30.2