summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a1f7ebf)
raw | patch | inline | side by side (parent: a1f7ebf)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 15 Feb 2008 13:25:34 +0000 (13:25 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 15 Feb 2008 13:25:34 +0000 (13:25 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8931 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 0fb23e5a4878299eb059a653384abc093d59c738..04d61596fc2231e66ea1f3e17cf033f94f982bc4 100644 (file)
/* Save data to LDAP */
$ldap->cd($this->dn);
$this->cleanup();
+
+ /* This is just a test, we have had duplicated ids
+ in the past when copy & paste was used.
+ Normaly this should not happen.
+ */
+ if(isset($this->attrs['uidNumber']) && !$this->force_ids){
+ $used = $this->get_used_uid_numbers();
+ if(isset($used[$this->attrs['uidNumber']]) && $used[$this->attrs['uidNumber']] != $this->dn){
+ msg_dialog::display(_("Uid number"),_("A duplicated uid number was written for this user, if this was not intended please verify all used uidNumbers."), WARNING_DIALOG);
+ }
+ }
+
unset($this->attrs['uid']);
$ldap->modify ($this->attrs);
}
+ function get_used_uid_numbers()
+ {
+ $ids= array();
+ $ldap= $this->config->get_ldap_link();
+
+ $ldap->cd ($this->config->current['BASE']);
+ $ldap->search ("(&(objectClass=posixAccount)(uidNumber=*))", array("uidNumber"));
+
+ /* Get list of ids */
+ while ($attrs= $ldap->fetch()){
+ $ids[$attrs['uidNumber'][0]] = $attrs['dn'];
+ }
+ return($ids);
+ }
+
+
function get_next_id($attrib, $dn)
{
$ids= array();