Code

Updated posix Account
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 25 Feb 2009 15:50:12 +0000 (15:50 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 25 Feb 2009 15:50:12 +0000 (15:50 +0000)
-Fixed primary group creation

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

gosa-core/plugins/personal/posix/class_posixAccount.inc

index 213850ee1c9ea6bae0a9719667d8575e45cc0690..65bfcf602ed061088143f0e48075eff0c05ec139 100644 (file)
@@ -947,7 +947,7 @@ class posixAccount extends plugin
 
     /* Posix accounts have group interrelationship, 
        take care about these here if this is a new user without forced gidNumber. */
-    if ($this->force_ids == 0 && $this->primaryGroup == 0 && !$this->initially_was_account){
+    if ($this->force_ids == 0 && $this->primaryGroup == 0){
       $ldap->cd($this->config->current['BASE']);
       $ldap->search("(&(objectClass=posixGroup)(gidNumber=".$this->gidNumber."))", array("cn"));
 
@@ -961,6 +961,12 @@ class posixAccount extends plugin
         $g->gidNumber= $this->gidNumber;
         $g->description= _("Group of user")." ".$this->givenName." ".$this->sn;
         $g->save ();
+
+        @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,
+                sprintf("Primary group '%s' created, using gidNumber '%s'.",$this->uid,$this->gidNumber),"");
+      }else{
+        @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,
+                sprintf("Primary group '%s' exists.",$this->uid),"");
       }
     }