Code

Updated groupManagement
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 26 Jul 2010 08:53:10 +0000 (08:53 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 26 Jul 2010 08:53:10 +0000 (08:53 +0000)
-Ensure that new members are part of the objectCache else we got several errors.

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19099 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/plugins/admin/ogroups/class_ogroup.inc

index 66a8d79e873925b9d7722879bd106146406811af..5cb4ff83743749bc06ec2e6fd02b8b74185b7a10 100644 (file)
@@ -161,10 +161,22 @@ class ogroup extends plugin
 
   function AddDelMembership($NewMember = false){
 
-    if($NewMember){
+      if($NewMember){
+
+          // Ensure that we definitely know the new members attributes.
+          //  - Fetch unknown objects here. 
+          if(!isset($this->memberList[$NewMember])){
+
+              $ldap = $this->config->get_ldap_link();
+              $ldap->cd($this->config->current['BASE']);
+              $ldap->cat($NewMember);
+              $attrs = $ldap->fetch();
+              $this->objcache[$NewMember] = $attrs;
+          }
+
+          /* Add member and force reload */
+          $this->member[$NewMember]= $NewMember;
 
-      /* Add member and force reload */
-      $this->member[$NewMember]= $NewMember;
 
       $this->memberList[$NewMember]= $this->objcache[$NewMember];
       unset ($this->objects[$NewMember]);