Summary | Schema checking broken in Turba_Driver_Ldap |
Queue | Turba |
Queue Version | 3.0 |
Type | Bug |
State | Resolved |
Priority | 2. Medium |
Owners | jan (at) horde (dot) org |
Requester | heinz (at) htl-steyr (dot) ac (dot) at |
Created | 04/06/2011 (5193 days ago) |
Due | |
Updated | 04/26/2011 (5173 days ago) |
Assigned | 04/14/2011 (5185 days ago) |
Resolved | 04/19/2011 (5180 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | 3.0.1 |
Patch | No |
[jan] Fix detecting superiour objectclass' must/may attributes (
Bug #9826).2 files changed, 18 insertions(+), 12 deletions(-)
http://git.horde.org/horde-git/-/commit/fd141fa43b966363f2c8035c62b1a4db3fcd8b36
There is still a problem in class Horde_Ldap_Schema.
If there is an objectclass with no must attributes but superclasses
would have one,
an empty array is returned.
current code:
public function must($oc, $checksup = false)
{
try {
$attributes = $this->_getAttr($oc, 'must');
if ($checksup) {
foreach ($this->superclass($oc) as $sup) {
$attributes = array_merge($attributes, $this->must($sup));
}
$attributes = array_values(array_unique($attributes));
}
return $attributes;
} catch (Horde_Ldap_Exception $e) {
return array();
}
}
_getAttr throws an Exception and if catched an empty arry ist
returned, no superclass is called
Possible solution:
public function must($oc, $checksup = false)
{
try {
$attributes = $this->_getAttr($oc, 'must');
} catch (Horde_Ldap_Exception $e) {
$attributes = array();
}
if ($checksup) {
foreach ($this->superclass($oc) as $sup) {
$attributes = array_merge($attributes,
$this->must($sup, true));
}
$attributes = array_values(array_unique($attributes));
}
return $attributes;
}
Make sure that may() and must() are recursively called (
Bug #9826).1 files changed, 2 insertions(+), 2 deletions(-)
http://git.horde.org/horde-git/-/commit/283bceb26af9dd1fbf5ddc9cccf66a6b65859231
checksup parameter set to false. It should default to true to get
all required attributes.
checksup parameter set to false. It should default to true to get all
required attributes. Alternativly add an parameter in turba's
backend.php config file.
$attributes = array_merge($attributes, $this->may($sup));
You should provide a "true" value to the parameter "checksup" to check
ALL superclasses
(also superclasses of the superclass)
-> $attributes = array_merge($attributes, $this->may($sup,true));
Milestone ⇒ 3.0.1
[jan] Add parameter to Horde_Ldap_Schema#must() and #may() to return
attributes from superior objectclasses too (
Bug #9826).3 files changed, 26 insertions(+), 9 deletions(-)
http://git.horde.org/horde-git/-/commit/41119a20da71a6c2a91aa16e2a74ed721883daba
[jan] Don't throw exceptions from Horde_Ldap_Schema#must() and #may()
(
Bug #9826).2 files changed, 12 insertions(+), 6 deletions(-)
http://git.horde.org/horde-git/-/commit/557c7142c6a052b3c7f51f1a518d3d9d8644f603
Use Horde_Ldap_Schema to check for required attributes (
Bug #9826).1 files changed, 20 insertions(+), 20 deletions(-)
http://git.horde.org/horde-git/-/commit/b5a1551f40db490d8c5a0a783b687be059e860a4
New Attachment: patch_horde_turba_ldap.diff
_checkRequiredAttributes
The schema is now retrieved, but:
- if an objectclass (like turbacontacts) has no MUST attribute, the
function must() in Horde_Ldap_Schema throws an Exception
I've added an empty array entry as a workaround in the parse() function for
must, may and sup attributes if the are not set yet.
- if an objectclass (like inetorgperson) has no MUST attribute but
MUST attributes
are defined in superior objectclasses we shout recurse to get all
required attributenames. I have implemented this (quick and dirty)
only in the function must().
Should be done also in may().
With this changes the Turba_Driver_Ldap works now fine for me.
State ⇒ Feedback
Assigned to Jan Schneider
Complete half-finished conversion to Horde_Ldap_Schema (
Bug #9826).3 files changed, 46 insertions(+), 9 deletions(-)
http://git.horde.org/horde-git/-/commit/5090bf32fab18405baf39897d30829a03511cc39
Priority ⇒ 2. Medium
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Summary ⇒ Schema checking broken in Turba_Driver_Ldap
Type ⇒ Bug
Queue ⇒ Turba
turba fails.
In function _checkRequiredAttributes the schema is retrieved with
$this->_ldap->schema()
but property _ldap is undefined in the class Turba_Driver_Ldap
same behavier in function _getSyntax