summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9c643be)
raw | patch | inline | side by side (parent: 9c643be)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 16 Nov 2009 06:56:21 +0000 (06:56 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 16 Nov 2009 06:56:21 +0000 (06:56 +0000) |
-Couldn't create primary groups anymore out of posixAccount class.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14813 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14813 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/plugins/personal/posix/class_posixAccount.inc | patch | blob | history |
diff --git a/gosa-core/plugins/personal/posix/class_posixAccount.inc b/gosa-core/plugins/personal/posix/class_posixAccount.inc
index 9ae31c78e8f69c3a6e98abefc202e336933dfacb..92be4091f53697932b24249b2afedb2a53de1d3d 100644 (file)
if ($ldap->count() == 0){
$groupcn = $this->uid;
- $groupdn= preg_replace ('/^'.preg_quote($this->config->get_cfg_value("accountPrimaryAttribute").'=[^,]+,'.get_people_ou(), '/').'/i',
+ $pri_attr = $this->config->get_cfg_value("accountPrimaryAttribute");
+ $groupdn= preg_replace ('/^'.preg_quote($pri_attr,'/').'=[^,]+,'.preg_quote(get_people_ou(),'/').'/i',
'cn='.$groupcn.','.get_groups_ou(), $this->dn);
/* Request a new and uniqe gidNumber, if required */
if(!$this->force_ids){
$this->gidNumber= get_next_id("gidNumber", $this->dn);
- }else{
-
- /* If forced gidNumber could not be found, then check if the given group name already exists
- we do not want to modify the gidNumber of an existing group.
- */
- $cnt= 0;
- while($ldap->dn_exists($groupdn)){
- $cnt ++;
- $groupcn = $this->uid."_".$cnt;
- $groupdn= preg_replace ('/^'.preg_quote($this->config->get_cfg_value("accountPrimaryAttribute").'=[^,]+,'.get_people_ou(), '/').'/i',
- 'cn='.$groupcn.','.get_groups_ou(), $this->dn);
- }
+ }
+
+ /* If forced gidNumber could not be found, then check if the given group name already exists
+ we do not want to modify the gidNumber of an existing group.
+ */
+ $cnt= 0;
+ while($ldap->dn_exists($groupdn) && ($cnt < 100)){
+ $cnt ++;
+ $groupcn = $this->uid."_".$cnt;
+ $groupdn= preg_replace ('/^'.preg_quote($pri_attr,'/').'=[^,]+,'.preg_quote(get_people_ou(),'/').'/i',
+ 'cn='.$groupcn.','.get_groups_ou(), $this->dn);
}
/* Create new primary group and enforce the new gidNumber */