Page MenuHomePhorge

Allow values of attributes defined to be expanded and as such, match between the configured user type and the LDAP object entry (T496)
ClosedPublic

Authored by vanmeeuwen on Jun 17 2015, 1:16 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jun 24, 10:15 AM
Unknown Object (File)
Sun, Jun 9, 7:12 PM
Unknown Object (File)
Wed, Jun 5, 4:30 AM
Unknown Object (File)
Mon, Jun 3, 1:53 AM
Unknown Object (File)
Tue, May 28, 12:20 PM
Unknown Object (File)
Tue, May 28, 10:14 AM
Unknown Object (File)
May 26 2024, 2:52 PM
Unknown Object (File)
May 24 2024, 3:19 AM
Subscribers

Details

Summary

Allow values of attributes defined to be expanded and as such, match between the configured user type and the LDAP object entry (T496)

Test Plan

No particular test plan.

Diff Detail

Repository
rWAP webadmin
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

vanmeeuwen retitled this revision from to Allow values of attributes defined to be expanded and as such, match between the configured user type and the LDAP object entry (T496).
vanmeeuwen updated this object.
vanmeeuwen edited the test plan for this revision. (Show Details)
  • Also expand the input correctly (in case the "static" value is an array), and unify the need for a base dn in to a function

This way base_dn() method is executed multiple times, it should cache the result in memory to not call domain_info() every time. I suppose we could even check if the value contains replacement macro before we call expand().

lib/kolab_api_service.php
167

array_values() here does not make sense.

379

$_key and $custom variables aren't used anywhere. Also, I prefer to use lowercase for PHP types (i.e. array).

  • Don't use array_values() needlessly, cache the resulting base_dn

See inline comments. Other than that it looks good. Still we could improve performance for cases where value does not contain base_dn expansion macro. I think it would be good to improve Conf::expand() method so $custom could accept values of type function, then we could probably (untested) do:

$base_dn_fn = function() use ($this) { return $this->base_dn(); };
$this->conf->expand($_value, $custom = array('base_dn' => $base_dn_fn));

Of course , we can do this later.

lib/kolab_api_service.php
170

Here we should cast $v to array.

372

Here we could add $custom with base_dn, right?

machniak added a reviewer: machniak.
This revision now requires changes to proceed.Jun 24 2015, 11:12 AM
lib/kolab_api_service.php
170

Yup.

372

Yes.

vanmeeuwen edited edge metadata.
  • Cast $v to array
  • Use $custom also for singular (non-array) values

Updated to reflect comments.

machniak edited edge metadata.
This revision is now accepted and ready to land.Jun 24 2015, 4:09 PM
This revision was automatically updated to reflect the committed changes.