#1488024 closed Bugs (fixed)

Variables in ldap_public not always expanded

Reported by: fisher Owned by:
Priority: 5 Milestone: 0.6-stable
Component: LDAP connection Version: git-master
Severity: normal Keywords: ldap, variable, expand
Cc:

Description

I have configured an address book for the plugin new_user_identity. The address book configuration allows to use variables in the base_dn, search_base_dn and so, but the plugin (err, actually I believe the roundcube_plugin object, but I am not really familiar with php) does not resolve them. The config line:

'search_base_dn' => 'dc=%d,ou=domains,dc=server,dc=hu'

Became:

dc=,ou=domains,dc=server,dc=hu'

instead

dc=client.hu,ou=domains,dc=server,dc=hu'

The LDAP log contains 'S: Invalid DN syntax' message.

Tested in 5.2, 5.3 and the trunk version (yesterday :D)

Change History (4)

comment:1 Changed 23 months ago by alec

  • Component changed from Addressbook to LDAP connection
  • Milestone changed from later to 0.6-beta

Right. The domain is not set in the moment when new_user_identity is doing its job. Try a fix, go to rcube_ldap.php and change line 184:

$fu = $RCMAIL->user->get_username();

to

$fu = $RCMAIL->user->get_username();
if (!$fu)
    $fu = $this->mail_domain;

comment:2 Changed 23 months ago by fisher

I have tired the trick above but did not help.

Anyway tt is not big problem for me, I have changed the configuration and replaced the %d with the actual domain name.

comment:3 Changed 22 months ago by thomasb

  • Milestone changed from 0.7-beta to 0.6-stable

comment:4 Changed 22 months ago by thomasb

  • Resolution set to fixed
  • Status changed from new to closed

$this->mail_domain is empty because $_SESSION['imap_host'] isn't set yet when the create_user hook is triggered.

Added host argument to hook parameters. Should now be fixed in [94a5a24f] and r5163/svn.

Note: See TracTickets for help on using tickets.