Bug 11807 - Add categorycode conversions to LDAP authentication.
Summary: Add categorycode conversions to LDAP authentication.
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Authentication (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Frédérick Capovilla
QA Contact: Martin Renvoize (ashimema)
URL:
Keywords: Manual
Depends on:
Blocks:
 
Reported: 2014-02-20 21:15 UTC by Frédérick Capovilla
Modified: 2024-05-31 18:06 UTC (History)
10 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Add support for categorycode conversions when updating an user using a LDAP server. (2.52 KB, patch)
2014-02-20 21:15 UTC, Frédérick Capovilla
Details | Diff | Splinter Review
Bug 11807: (follow-up) remove date conversions (1.16 KB, patch)
2015-08-31 09:43 UTC, Joonas Kylmälä
Details | Diff | Splinter Review
Bug 11807 : Add support for categorycode conversions when updating an user using a LDAP server. (3.25 KB, patch)
2016-01-04 03:54 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 11807: (follow-up) remove date conversions (2.17 KB, patch)
2016-01-04 03:57 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 11807 : Add support for categorycode conversions when updating an user using a LDAP server. (3.31 KB, patch)
2016-04-01 14:10 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 11807: (follow-up) remove date conversions (2.23 KB, patch)
2016-04-01 14:10 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Frédérick Capovilla 2014-02-20 21:15:44 UTC Comment hidden (obsolete)
Comment 1 Frédérick Capovilla 2014-02-20 21:18:35 UTC
Note: This patch also includes a small fix for the update of mapped LDAP date values.
Comment 2 Dobrica Pavlinusic 2014-03-12 10:35:31 UTC
I like category mapping but have problem with date mappings.

We are not using sql format in our LDAP but dd.mm.yyyy. format. To side-step this we are currently using our own ldap rewrite in front of Koha which rewrites it into yyyy-mm-dd format. More info about this is available at

http://blog.rot13.org//2009/03/virtual-ldap-rewrite-or-augment-data-on-the-fly.html

if anybody is interesed.

Since US libraries probably use mm.dd.yyyy format and our format dd.mm.yyyy. isn't supported by C4::Date i would prefer to see configuration option in koha-conf.xml ldap section to specify which format of dates is used in LDAP installation.
Comment 3 Galen Charlton 2014-05-08 14:34:15 UTC
Following up on Dobrica's comment, I suggest that the patch be revised so that it only adds category code mapping; that way, such a patch could get in more quickl.  Date normalization can be put on a separate bug.
Comment 4 Martin Renvoize (ashimema) 2014-12-31 18:54:02 UTC
Agreed, Frédérick could you update the patch and submit a new bug (if you wish to do so) for the date piece.

I'de love to get this one moving again.
Comment 5 Joonas Kylmälä 2015-08-31 09:43:14 UTC Comment hidden (obsolete)
Comment 6 Chris Cormack 2016-01-04 03:54:40 UTC Comment hidden (obsolete)
Comment 7 Chris Cormack 2016-01-04 03:57:26 UTC Comment hidden (obsolete)
Comment 8 Jonathan Druart 2016-01-04 13:39:29 UTC
It cannot work, C4::Dates has been removed from the codebase.
Comment 9 Rémi Mayrand-Provencher 2016-02-09 21:32:26 UTC
If I'm not mistaken, the use of C4::dates has been removed in the second patch on this bug. I don't think it should have failed QA.
Comment 10 Katrin Fischer 2016-02-09 22:00:16 UTC
A bit confusing :) But both patches together don't include the date conversions. Patches are from different authors and both signed. Moving back to Signed off.
Comment 11 Jonathan Druart 2016-02-10 08:49:17 UTC
Rémi, sorry about that!

Martin, any chances to see you QA these patches?
Comment 12 Katrin Fischer 2016-03-31 14:12:47 UTC
Could we get a second sign-off on this to help things along quicker?
Comment 13 Martin Renvoize (ashimema) 2016-04-01 14:10:49 UTC
Created attachment 49789 [details] [review]
Bug 11807 : Add support for categorycode conversions when updating an user using a LDAP server.

To test

1/ Apply both patches

2/ This patch lets you easily configure mappings for categorycode values.
These mapping will be used when updating the user's account after a successful LDAP login.

Here is an example configuration :

<config>
  <ldapserver id="ldapserver>
    <mapping>
      <categorycode is="usertype">STU</categorycode>
      ...
    </mapping>

    <categorycode_mapping>
      <categorycode value="STU">STUDENT</categorycode>
      <categorycode value="EMP">EMPLOYEE</categorycode>
    </categorycode_mapping>
  </ldapserver>
</config>

3/ With this configuration, LDAP users with the usertype value "EMP" on the LDAP server should have the "EMPLOYEE" categorycode in Koha.

Signed-off-by: Chris <chris@bigballofwax.co.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 14 Martin Renvoize (ashimema) 2016-04-01 14:10:52 UTC
Created attachment 49790 [details] [review]
Bug 11807: (follow-up) remove date conversions

To test

1/ Apply both patches

2/ This patch lets you easily configure mappings for categorycode values.
These mapping will be used when updating the user's account after a successful LDAP login.

Here is an example configuration :

<config>
  <ldapserver id="ldapserver>
    <mapping>
      <categorycode is="usertype">STU</categorycode>
      ...
    </mapping>

    <categorycode_mapping>
      <categorycode value="STU">STUDENT</categorycode>
      <categorycode value="EMP">EMPLOYEE</categorycode>
    </categorycode_mapping>
  </ldapserver>
</config>

3/ With this configuration, LDAP users with the usertype value "EMP" on the LDAP server should have the "EMPLOYEE" categorycode in Koha.

Signed-off-by: Chris <chris@bigballofwax.co.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 15 Martin Renvoize (ashimema) 2016-04-01 14:11:44 UTC
Happy there no breaking changes here, and a worthwhile addition. :)
Comment 16 Brendan Gallagher 2016-04-01 19:24:41 UTC
Pushed to Master - Should be in the May 2016 release.  Thanks!
Comment 17 David Cook 2021-12-20 02:51:44 UTC
Noticed this while looking through the code, but noticed it doesn't appear to be documented anywhere. 

Would be good to have this in the manual or on the wiki.
Comment 18 Katrin Fischer 2021-12-20 08:06:42 UTC
You can use the "manual" keyword to make this show up for the Docs team.
Comment 19 teddy 2023-09-20 10:05:58 UTC
I am a bit confused, how to map with ldap - usertype or DN for categorycode mapping.