Commit 1e96eafb authored by Côme Chilliet's avatar Côme Chilliet
Browse files

Fixes #4544 List the entries which have duplicated uid numbers in the setup

parent e48c13a8
......@@ -264,7 +264,7 @@ class Step_Migrate extends setupStep
'outsideGroups' => new StepMigrateCheck($this, 'outsideGroups', _('Checking for groups outside the groups tree')),
'orgUnits' => new StepMigrateCheck($this, 'orgUnits', _('Checking for invisible departments')),
'uidNumber' => new StepMigrateCheck($this, 'uidNumber', _('Checking for duplicated UID numbers')),
'gidNumber' => new StepMigrateCheck($this, 'gidNumber', _('Checking for duplicate GID numbers')),
'gidNumber' => new StepMigrateCheck($this, 'gidNumber', _('Checking for duplicated GID numbers')),
);
$this->checks = $checks;
......@@ -1362,15 +1362,20 @@ class Step_Migrate extends setupStep
foreach ($tmp as $entries) {
if (count($entries) > 1) {
foreach ($entries as $entry) {
$this->check_uidNumbers[base64_encode($entry['dn'])] = $entry;
$this->check_uidNumbers[$entry['dn']] = $entry;
}
}
}
if ($this->check_uidNumbers) {
$list = '<ul>';
foreach ($this->check_uidNumbers as $dn => $entry) {
$list .= '<li>'.$dn.' ('.$entry['uidNumber'][0].')</li>';
}
$list .= '</ul>';
throw new CheckFailedException(
"<div style='color:#F0A500'>"._("Warning")."</div>",
sprintf(_('Found %s duplicate values for attribute "uidNumber".'), count($this->check_uidNumbers))
sprintf(_('Found %s duplicate values for attribute "uidNumber":%s'), count($this->check_uidNumbers), $list)
);
} else {
return '';
......@@ -1401,15 +1406,20 @@ class Step_Migrate extends setupStep
foreach ($tmp as $entries) {
if (count($entries) > 1) {
foreach ($entries as $entry) {
$this->check_gidNumbers[base64_encode($entry['dn'])] = $entry;
$this->check_gidNumbers[$entry['dn']] = $entry;
}
}
}
if ($this->check_gidNumbers) {
$list = '<ul>';
foreach ($this->check_gidNumbers as $dn => $entry) {
$list .= '<li>'.$dn.' ('.$entry['gidNumber'][0].')</li>';
}
$list .= '</ul>';
throw new CheckFailedException(
"<div style='color:#F0A500'>"._("Warning")."</div>",
sprintf(_('Found %s duplicate values for attribute "gidNumber".'), count($this->check_gidNumbers))
sprintf(_('Found %s duplicate values for attribute "gidNumber":%s'), count($this->check_gidNumbers), $list)
);
} else {
return '';
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment