summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1d6f283)
raw | patch | inline | side by side (parent: 1d6f283)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 10 Mar 2006 09:41:29 +0000 (09:41 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 10 Mar 2006 09:41:29 +0000 (09:41 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2838 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/groups/class_groupGeneric.inc | patch | blob | history |
diff --git a/plugins/admin/groups/class_groupGeneric.inc b/plugins/admin/groups/class_groupGeneric.inc
index 4e235a6c8e0a9a6fecdf5e2a93d7171cfd702a7f..f59768a26af91f514d5a575d1ee490be220656e2 100644 (file)
var $saved_gidNumber= "";
var $oldgroupType= "";
var $orig_dn= "";
+ var $orig_cn= "";
var $has_mailAccount= FALSE;
var $group_dialog= FALSE;
var $nagios_group =FALSE;
var $dialog;
var $OnlyShowFirstEntries =200;
+ var $allowGroupsWithSameNameInOtherSubtrees = true;
+
/* attribute list for save action */
var $attributes= array("cn", "description", "gidNumber","memberUid","sambaGroupType","sambaSID");
var $objectclasses= array("top", "posixGroup");
/* Load attributes depending on the samba version */
$this->samba3= ($config->current['SAMBAVERSION'] == 3);
$this->orig_dn= $dn;
+ $this->orig_cn= $this->cn;
/* Get member list */
if (isset($this->attrs['memberUid'][0])){
$message[]= _("The field 'Name' contains invalid characters. Lowercase, numbers and dashes are allowed.");
}
- /* Check for used 'cn' */
- $ldap= $this->config->get_ldap_link();
- $ldap->cd($this->config->current['BASE']);
- $ldap->search("(&(|(objectClass=gosaGroupOfNames)(objectClass=posixGroup))(cn=$this->cn))",array("cn"));
- if ($ldap->count() != 0){
- /* New entry? */
- if ($this->dn == 'new'){
- $message[]= _("Value specified as 'Name' is already used.");
+ if($this->allowGroupsWithSameNameInOtherSubtrees == true){
+
+ /* Check for used 'cn' */
+ $ldap= $this->config->get_ldap_link();
+ if(($this->cn != $this->orig_cn) || ($this->orig_dn == "new")){
+ $ldap->cd("ou=groups,".$this->base);
+ $ldap->ls("(&(|(objectClass=gosaGroupOfNames)(objectClass=posixGroup))(cn=$this->cn))","ou=groups,".$this->base,array("cn"));
+ if ($ldap->count() != 0){
+ $message[]= _("Value specified as 'Name' is already used.");
+ }
}
-
- /* Moved? */
- elseif ($new_dn != $this->orig_dn){
- $ldap->fetch();
- if ($ldap->getDN() != $this->orig_dn){
+
+ }else{
+
+ /* Check for used 'cn' */
+ $ldap= $this->config->get_ldap_link();
+ $ldap->cd($this->config->current['BASE']);
+ $ldap->search("(&(|(objectClass=gosaGroupOfNames)(objectClass=posixGroup))(cn=$this->cn))",array("cn"));
+ if ($ldap->count() != 0){
+
+ /* New entry? */
+ if ($this->dn == 'new'){
$message[]= _("Value specified as 'Name' is already used.");
}
+
+ /* Moved? */
+ elseif ($new_dn != $this->orig_dn){
+ $ldap->fetch();
+ if ($ldap->getDN() != $this->orig_dn){
+ $message[]= _("Value specified as 'Name' is already used.");
+ }
+ }
}
}
-
+
/* Check ID */
if ($this->force_gid == "1"){
if (!is_id($this->gidNumber)){