From 25d157526e7dc349af0b8c0dcce58796b7469d1f Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 25 Feb 2009 15:50:57 +0000 Subject: [PATCH] Updated group modification -Added information message if gidNumber is used more than once. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13458 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../plugins/admin/groups/class_groupGeneric.inc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/gosa-core/plugins/admin/groups/class_groupGeneric.inc b/gosa-core/plugins/admin/groups/class_groupGeneric.inc index 1d0941340..a5426f94d 100644 --- a/gosa-core/plugins/admin/groups/class_groupGeneric.inc +++ b/gosa-core/plugins/admin/groups/class_groupGeneric.inc @@ -1073,6 +1073,22 @@ class group extends plugin $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $this->dn)); } + + /* Check generated gidNumber, it may be used by another group. + */ + if($this->gidNumber != ""){ + $ldap->cd($this->config->current['BASE']); + $ldap->search("(&(!(cn=".$this->orig_cn."))(objectClass=posixGroup)(gidNumber=".$this->gidNumber."))",array("cn")); + if($ldap->count()){ + $cns = ""; + while($attrs = $ldap->fetch()){ + $cns .= $attrs['cn'][0].", "; + } + $cns = rtrim($cns,", "); + msg_dialog::display(_("Warning"),sprintf(_("The gidNumber (%s) used or generated for this group is not uniq! It is already used in the following groups: '%s'."),$this->gidNumber,$cns) , WARNING_DIALOG ); + } + } + /* Write back to ldap */ $ldap->cd($this->dn); $this->cleanup(); -- 2.30.2