Created attachment 25526 [details] [review] Add support for categorycode conversions when updating an user using a LDAP server. 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> With this configuration, LDAP users with the usertype value "EMP" on the LDAP server should have the "EMPLOYEE" categorycode in Koha. Sponsored-by: CCSR ( http://www.ccsr.qc.ca )
Note: This patch also includes a small fix for the update of mapped LDAP date values.
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.
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.
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.
Created attachment 42105 [details] [review] Bug 11807: (follow-up) remove date conversions The date conversions are now removed with this patch.
Created attachment 46182 [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>
Created attachment 46183 [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>
It cannot work, C4::Dates has been removed from the codebase.
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.
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.
Rémi, sorry about that! Martin, any chances to see you QA these patches?
Could we get a second sign-off on this to help things along quicker?
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>
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>
Happy there no breaking changes here, and a worthwhile addition. :)
Pushed to Master - Should be in the May 2016 release. Thanks!
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.
You can use the "manual" keyword to make this show up for the Docs team.
I am a bit confused, how to map with ldap - usertype or DN for categorycode mapping.