6.0.0-beta1
7/12/25

[#9770] LDAP driver for Portal Block account info do not work
Summary LDAP driver for Portal Block account info do not work
Queue Horde Base
Queue Version Git master
Type Bug
State Resolved
Priority 1. Low
Owners jan (at) horde (dot) org
Requester Klaus.Steinberger (at) physik (dot) uni-muenchen (dot) de
Created 04/01/2011 (5216 days ago)
Due
Updated 04/26/2011 (5191 days ago)
Assigned
Resolved 04/14/2011 (5203 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
04/26/2011 05:17:05 PM Git Commit Comment #9 Reply to this comment
Changes have been made in Git for this ticket:

Fix shadowlastchange calculation (Bug #9770).

  2 files changed, 3 insertions(+), 1 deletions(-)
http://git.horde.org/horde-git/-/commit/7c5b7fc12ec223b2685adcf47059626e4a304551
04/26/2011 11:35:22 AM giunta (at) sissa (dot) it Comment #8 Reply to this comment
Changes have been made in Git for this ticket:

Refactor LDAP driver to user Horde_Ldap (Bug #9770).

  1 files changed, 74 insertions(+), 151 deletions(-)
http://git.horde.org/horde-git/-/commit/2bb5eb64a50c270fe0f7d9fce688af14a4c7ed96
There is still an error in getPasswordChange function: it always 
return 01/01/1970 because it miss '* 86400'

Here solution:

--- Ldap.php.orig        2011-04-26 12:17:18.000000000 +0200
+++ Ldap.php        2011-04-26 13:27:43.000000000 +0200
@@ -175,7 +175,7 @@
      {
          $information = $this->_getAccount();
          try {
-            return strftime('%x', 
$information->getValue('shadowlastchange', 'single'));
+            return strftime('%x', 
$information->getValue('shadowlastchange', 'single') * 86400);
          } catch (Horde_Ldap_Exception $e) {
          }
          try {

Regards,
   Marco
04/19/2011 02:30:23 PM Jan Schneider Comment #7 Reply to this comment
I've tried the changes but got:
No, you did not. You downloaded the complete file which had even more 
changes after this one.
04/19/2011 02:03:07 PM Klaus (dot) Steinberger (at) physik (dot) uni-muenchen (dot) de Comment #6 Reply to this comment
Changes have been made in Git for this ticket:

Refactor LDAP driver to user Horde_Ldap (Bug #9770).

  1 files changed, 74 insertions(+), 151 deletions(-)
http://git.horde.org/horde-git/-/commit/2bb5eb64a50c270fe0f7d9fce688af14a4c7ed96
Did it work only with git head?
I've tried the changes but got:

[Tue Apr 19 15:55:48 2011] [error] [client 141.84.12.60] PHP Fatal 
error:  Class 'Horde_Block_Account_Ldap' not found in 
/var/www/html/horde/lib/Block/Account.php on line 57, referer: 
http://dmz-sv-webmail.physik.uni-muenchen.de/horde/admin/config/index.php

Sincerly,
Klaus
04/19/2011 01:47:05 PM Git Commit Comment #5 Reply to this comment
Changes have been made in Git for this ticket:

Refactor LDAP driver to user Horde_Ldap (Bug #9770).

  1 files changed, 74 insertions(+), 151 deletions(-)
http://git.horde.org/horde-git/-/commit/2bb5eb64a50c270fe0f7d9fce688af14a4c7ed96
04/15/2011 09:16:01 AM Klaus (dot) Steinberger (at) physik (dot) uni-muenchen (dot) de Comment #4 Reply to this comment
Changes have been made in Git for this ticket:
I have just seen that there is a little more to be done.

in horde/lib/Block/Account.php line 445 "host" ist used as parameter, 
but the new config structure uses "hostspec"

         // Connect to the LDAP server.
         $this->_ds = ldap_connect($this->_params['host'],
                                   $this->_params['port']);

this is easy to change, but also the defaults are not taken correctly:

in the     function Accounts_Driver_ldap($params = array())

there is also host referenced instead of hostspec. I have changed 
both, but the horde default config is not used, so maybe the array 
merging is done incorrectly?

04/14/2011 07:53:42 PM Jan Schneider Assigned to Jan Schneider
Version ⇒ Git master
State ⇒ Resolved
 
04/14/2011 07:53:35 PM Git Commit Comment #3 Reply to this comment
Changes have been made in Git for this ticket:

[jan] Fix LDAP parameters of account portal block (Klaus Steinberger, 
Bug #9770).

  3 files changed, 15 insertions(+), 7 deletions(-)
http://git.horde.org/horde-git/-/commit/a145d8735d1142c78ca4e623ea822e3b283134df
04/14/2011 10:25:06 AM Klaus (dot) Steinberger (at) physik (dot) uni-muenchen (dot) de Comment #2
New Attachment: conf.xml.diff Download
Reply to this comment
It is just a simple patch in horde/config/conf.xml

The "configsection" is missing around the Account Block LDAP driver. 
Appended is a patch
04/01/2011 10:29:23 AM Klaus (dot) Steinberger (at) physik (dot) uni-muenchen (dot) de Comment #1
Priority ⇒ 1. Low
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Queue ⇒ Horde Base
Summary ⇒ LDAP driver for Portal Block account info do not work
Type ⇒ Bug
Reply to this comment
The portal Block for Account info throws errors with LDAP driver:

Apr  1 12:18:32 dmz-sv-webmail HORDE: HORDE [horde] PHP ERROR: 
Undefined index: params [pid 9310 on line 46 of 
"/var/www/html/horde/lib/Block/Account.php"]
Apr  1 12:18:32 dmz-sv-webmail HORDE: HORDE [horde] PHP ERROR: 
array_merge(): Argument #2 is not an array [pid 9310 on line 443 of 
"/var/www/html/horde/lib/Block/Account.php"]
Apr  1 12:18:32 dmz-sv-webmail HORDE: HORDE [horde] PHP ERROR: 
ldap_search(): Search: Bad search filter [pid 9310 on line 548 of 
"/var/www/html/horde/lib/Block/Account.php"]
Apr  1 12:18:32 dmz-sv-webmail HORDE: HORDE [horde] PHP ERROR: 
ldap_first_entry() expects parameter 2 to be resource, boolean given 
[pid 9310 on line 549 of "/var/www/html/horde/lib/Block/Account.php"]
Apr  1 12:18:32 dmz-sv-webmail HORDE: HORDE [horde] PHP ERROR: 
ldap_get_entries() expects parameter 2 to be resource, boolean given 
[pid 9310 on line 550 of "/var/www/html/horde/lib/Block/Account.php"]


The reason is a mismatch between conf.php file an the code:

The code assumes parameters for LDAP in ['accounts']['params'] but the 
configuration looks like this:

$conf['accounts']['basedn'] = 'ou=Personen,o=physik';
$conf['accounts']['scope'] = 'sub';
$conf['accounts']['attr'] = 'cn';
$conf['accounts']['strip'] = false;
$conf['accounts']['driverconfig'] = 'horde';
$conf['accounts']['driver'] = 'ldap';
$

Saved Queries