Bugzilla – Attachment 3572 Details for
Bug 6022
Auth_with_ldap check if categorycode is valid
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
check validity of categorycode when importing from ldap
0001-Bug-6022-Auth_with_ldap-check-if-categorycode-is-val.patch (text/plain), 1.36 KB, created by
Dobrica Pavlinusic
on 2011-03-31 13:18:53 UTC
(
hide
)
Description:
check validity of categorycode when importing from ldap
Filename:
MIME Type:
Creator:
Dobrica Pavlinusic
Created:
2011-03-31 13:18:53 UTC
Size:
1.36 KB
patch
obsolete
>From 65a7f77003e2f385fdd478f7bcb956d9be8c46af Mon Sep 17 00:00:00 2001 >From: Dobrica Pavlinusic <dpavlin@rot13.org> >Date: Thu, 31 Mar 2011 15:14:46 +0200 >Subject: [PATCH] Bug 6022: Auth_with_ldap check if categorycode is valid > >When importing users from LDAP, Auth_with_ldap.pm doesn't check if value for >categorycode is present in categories table in Koha resulting in referential >integrity error instead of using default value from koha-conf.xml >--- > C4/Auth_with_ldap.pm | 13 +++++++++++++ > 1 files changed, 13 insertions(+), 0 deletions(-) > >diff --git a/C4/Auth_with_ldap.pm b/C4/Auth_with_ldap.pm >index b25697c..e829b2c 100644 >--- a/C4/Auth_with_ldap.pm >+++ b/C4/Auth_with_ldap.pm >@@ -221,6 +221,19 @@ sub ldap_entry_2_hash ($$) { > ( substr($borrower{'firstname'},0,1) > . substr($borrower{ 'surname' },0,1) > . " "); >+ >+ # XXX check if categorycode exists, if not, fallback to default from koha-conf.xml >+ my $dbh = C4::Context->dbh; >+ my $sth = $dbh->prepare("SELECT categorycode FROM categories WHERE upper(categorycode) = upper(?)"); >+ $sth->execute( $borrower{'categorycode'} ); >+ if ( my $row = $sth->fetchrow_hashref ) { >+ >+ } else { >+ my $default = $mapping{'categorycode'}->{content}; >+ warn "Can't find ", $borrower{'categorycode'}, " default to: $default for ", $borrower{userid}; >+ $borrower{'categorycode'} = $default >+ } >+ > return %borrower; > } > >-- >1.7.2.5 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 6022
:
3572
|
4140
|
4985
|
6391
|
6392