From b15bd5ebdfb2626a77f36ddb0e54570c0e570f5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joonas=20Kylm=C3=A4l=C3=A4?= Date: Mon, 31 Aug 2015 09:41:34 +0000 Subject: [PATCH] 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 : STU ... STUDENT EMPLOYEE 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 Signed-off-by: Martin Renvoize --- C4/Auth_with_ldap.pm | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/C4/Auth_with_ldap.pm b/C4/Auth_with_ldap.pm index 324783a..c50df76 100644 --- a/C4/Auth_with_ldap.pm +++ b/C4/Auth_with_ldap.pm @@ -27,7 +27,6 @@ use C4::Members qw(AddMember changepassword); use C4::Members::Attributes; use C4::Members::AttributeTypes; use C4::Members::Messaging; -use C4::Dates; use C4::Auth qw(checkpw_internal); use Koha::AuthUtils qw(hash_password); use List::MoreUtils qw( any ); @@ -266,11 +265,7 @@ sub ldap_entry_2_hash { . substr($borrower{ 'surname' },0,1) . " "); - # Date and categorycode conversions - $borrower{'dateexpiry'} = C4::Dates->new($borrower{'dateexpiry'},'sql')->output('iso') if $borrower{'dateexpiry'}; - $borrower{'dateofbirth'} = C4::Dates->new($borrower{'dateofbirth'},'sql')->output('iso') if $borrower{'dateofbirth'}; - $borrower{'dateenrolled'} = C4::Dates->new($borrower{'dateenrolled'},'sql')->output('iso') if $borrower{'dateenrolled'}; - + # categorycode conversions if(defined $categorycode_conversions{$borrower{categorycode}}) { $borrower{categorycode} = $categorycode_conversions{$borrower{categorycode}}; } -- 2.1.4