Code

Fixed posixs group add
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 7 Aug 2006 04:37:16 +0000 (04:37 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 7 Aug 2006 04:37:16 +0000 (04:37 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4402 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/personal/generic/main.inc
plugins/personal/posix/class_posixAccount.inc
plugins/personal/posix/main.inc

index e9610876edbdb272437e1e26c5a2dcf19bb2c025..729d9d5c15e4b348d9e1f87f87770dced9a624db 100644 (file)
@@ -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.= "<img class=\"center\" alt=\"\" align=\"middle\" src=\"".get_template_path('images/lamp.png')."\"> ".
index 4c2790d2b76904b612be94b8d8d29445811eeb9e..bf5a6c837e6fb69ec390c4273378e84418cbc37c 100644 (file)
@@ -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);
   }
 
index 5d68f0f21bcc191fbeee1dcf78472bf10928cfff..252de94946a0cd65c8a8d9ab3103ddc9d8c35c21 100644 (file)
@@ -107,8 +107,7 @@ if (!$remove_lock){
              "\"> ".$ui->dn."&nbsp;";
 
       /* 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.= "<img alt=\"\" align=\"middle\" src=\"".get_template_path('images/lamp.png')."\"> ".
           _("Click the 'Edit' button below to change informations in this dialog");