6.0.0-git
2021-01-19

[#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 2011-04-01 (3581 days ago)
Due
Updated 2011-04-26 (3556 days ago)
Assigned
Resolved 2011-04-14 (3568 days ago)
Milestone
Patch No

History
2011-04-26 17:17:05 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
2011-04-26 11:35:22 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
2011-04-19 14:30:23 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.
2011-04-19 14:03:07 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
2011-04-19 13:47:05 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
2011-04-15 09:16:01 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?

2011-04-14 19:53:42 Jan Schneider Assigned to Jan Schneider
State ⇒ Resolved
Version ⇒ Git master
 
2011-04-14 19:53:35 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
2011-04-14 10:25:06 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
2011-04-01 10:29:23 Klaus (dot) Steinberger (at) physik (dot) uni-muenchen (dot) de Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Summary ⇒ LDAP driver for Portal Block account info do not work
Queue ⇒ Horde Base
Milestone ⇒
Patch ⇒ No
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