Bug#1077759: gosa: failed to change user entry: Uncaught ReflectionException: Property LDAP::$count does not exist

devel at sumpfralle.de devel at sumpfralle.de
Fri Sep 6 12:27:16 BST 2024


Hello,

now I realized, that this problem does not only affect account modifications,
but also the creation of new accounts.

I took a closer look at the problematic code in
`plugins/personal/generic/class_user.inc` around line 1355:

```
if ($this->config->get_cfg_value("core","accountPrimaryAttribute") != "uid"){
  $ldap->cat($this->new_dn);
  if ($ldap->count() != 0 && $this->dn != $this->new_dn && $this->dn == 'new'){
    $message[]= msgPool::duplicated(_("Name"));
  }
}
```

The above code was changed in 2022 (f9076ea89512):

```
- $ldap->cat($this->new_dn);
- if ($ldap->count() != 0 && $this->dn != $this->new_dn && $this->dn == 'new'){
+ $ldap->cat($ldap->count);
+ if ($ldap->count != 0 && $this->dn != $this->new_dn && $this->dn == 'new'){
```

I lack the understanding for the `cat()` call.
But the direct `ldap->count` access (instead of `ldap->count()`) looks weird to
me.

In the end I decided to disable (comment) the whole `if` block (see the first
code quotation). Now the code does not check for duplicate uid entries anymore,
but at least we can create and modify user accounts again.

Cheers,
Lars



More information about the Debian-edu-pkg-team mailing list