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

Merge branch...

Merge branch '5799-when-we-rename-a-department-foreignkeys-on-subobjects-dn-are-not-updated' into '1.3-dev'

Resolve "When we rename a department foreignKeys on subobjects DN are not updated"

See merge request fusiondirectory/fd!339
Showing with 20 additions and 5 deletions
+20 -5
......@@ -136,6 +136,8 @@ class simplePlugin
*/
protected $entryCSN = '';
private $hadSubobjects = FALSE;
/*! \brief constructor
*
* \param string $dn The dn of this instance
......@@ -1404,7 +1406,16 @@ class simplePlugin
*/
function handle_pre_events($mode, array $addAttrs = array())
{
global $config;
$this->ldap_error = '';
if ($this->mainTab && ($mode == 'remove')) {
/* Store information if there was subobjects before deletion */
$ldap = $config->get_ldap_link();
$ldap->cd($this->dn);
$ldap->search('(objectClass=*)', array('dn'), 'one');
$this->hadSubobjects = ($ldap->count() > 0);
}
return $this->handle_hooks('PRE', $mode, $addAttrs);
}
......@@ -1543,11 +1554,15 @@ class simplePlugin
$olddn = $param1;
$newdn = $param2;
$classes = array(get_class($this));
if ($olddn != $newdn) {
$ldap = $config->get_ldap_link();
$ldap->cd($newdn);
$ldap->search('(objectClass=*)', array('dn'), 'one');
$subobjects = ($ldap->count() > 0);
if (($olddn != $newdn) && $this->mainTab) {
if ($newdn === NULL) {
$subobjects = $this->hadSubobjects;
} else {
$ldap = $config->get_ldap_link();
$ldap->cd($newdn);
$ldap->search('(objectClass=*)', array('dn'), 'one');
$subobjects = ($ldap->count() > 0);
}
}
} elseif ($mode == 'references') {
$classes = array_keys($this->parent->by_object);
......
  • bmortier @bmortier

    mentioned in commit 729635fd

    By Côme Chilliet on 2018-07-18T12:40:33 (imported from GitLab)

    ·

    mentioned in commit 729635fd

    By Côme Chilliet on 2018-07-18T12:40:33 (imported from GitLab)

    Toggle commit list
  • bmortier @bmortier

    mentioned in merge request !340

    By Côme Chilliet on 2018-07-18T12:40:56 (imported from GitLab)

    ·

    mentioned in merge request !340

    By Côme Chilliet on 2018-07-18T12:40:56 (imported from GitLab)

    Toggle commit list
  • bmortier @bmortier

    mentioned in commit bfded108

    By Côme Chilliet on 2018-07-18T12:47:07 (imported from GitLab)

    ·

    mentioned in commit bfded108

    By Côme Chilliet on 2018-07-18T12:47:07 (imported from GitLab)

    Toggle commit list
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