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>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
This commit is contained in:
parent
b3311913b3
commit
85ea73db9d
|
|
@ -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}};
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue