summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6304333)
raw | patch | inline | side by side (parent: 6304333)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 2 May 2012 12:37:38 +0000 (12:37 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 2 May 2012 12:37:38 +0000 (12:37 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6@21143 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 2befec7c1c1fc1eabc5b41b53a9a2ee55537a45c..7754baeaf3af7e6a40a75c225129e17834caf618 100644 (file)
}
$this->initially_was_account= $this->is_account;
+ // Templates do not have a gidNumber
+ if($this->gidNumber == 2147483647){
+ $this->gidNumber = "";
+ $this->primaryGroup = 0;
+ }
+
/* Fill group */
$this->primaryGroup= $this->gidNumber;
/* Generate group list */
$this->ui = get_userinfo();
- $this->secondaryGroups[]= "- "._("automatic")." -";
+ $this->secondaryGroups[0]= "- "._("automatic")." -";
$ldap->cd($this->config->current['BASE']);
$ldap->search("(objectClass=posixGroup)", array("cn", "gidNumber"));
while($attrs = $ldap->fetch()){
* - .. if we couldn't find a group with the same name, we will create a new one,
* using the users uid as cn and a generated uniqe gidNumber.
* */
- if ($this->primaryGroup == 0 || $this->force_ids){
+ if($this->is_template && !$this->primaryGroup){
+ $this->gidNumber = 2147483647;
+ }elseif ($this->primaryGroup == 0 || $this->force_ids){
/* Search for existing group */
$ldap = $this->config->get_ldap_link();
}
/* Fix primary group settings */
- $ldap->cd($this->config->current['BASE']);
- $ldap->search("(&(objectClass=posixGroup)(cn=$template)(gidNumber=".$this->gidNumber."))", array("cn"));
- if ($ldap->count() != 1){
- $this->primaryGroup= $this->gidNumber;
+ if($this->gidNumber == 2147483647){
+ $this->gidNumber = "";
+ }
+
+ if($this->gidNumber){
+ $ldap->cd($this->config->current['BASE']);
+ $ldap->search("(&(objectClass=posixGroup)(cn=$template)(gidNumber=".$this->gidNumber."))", array("cn"));
+ if ($ldap->count() != 1){
+ $this->primaryGroup= $this->gidNumber;
+ }
}
$ldap->cd($this->config->current['BASE']);