Code

Skip primary-group creation if this user account was edited.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 9 Nov 2006 07:05:14 +0000 (07:05 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 9 Nov 2006 07:05:14 +0000 (07:05 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5053 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/personal/posix/class_posixAccount.inc

index fca536fb9b3e2cf41e9c2c86383ae385b82851c1..9db5681170926940b3d9bb84fb67474cac4b2029 100644 (file)
@@ -852,15 +852,15 @@ class posixAccount extends plugin
     del_lock ("uidnumber");
 
 
-    /* Posix accounts have group interrelationship, take care about these here. */
-    if ($this->force_ids == 0 && $this->primaryGroup == 0){
+    /* 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){
       $ldap->cd($this->config->current['BASE']);
       $ldap->search("(&(objectClass=posixGroup)(gidNumber=".$this->gidNumber."))", array("cn"));
 
       /* Create group if it doesn't exist */
       if ($ldap->count() == 0){
         $groupdn= preg_replace ('/^'.$this->config->current['DNMODE'].'=[^,]+,'.get_people_ou().'/i', 'cn='.$this->uid.','.get_groups_ou(), $this->dn);
-
         $g= new group($this->config, $groupdn);
         $g->cn= $this->uid;
         $g->force_gid= 1;