Bug 4256 - C4/Auth_with_ldap.pm replication broken and corrupts data when used without update
Summary: C4/Auth_with_ldap.pm replication broken and corrupts data when used without u...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Authentication (show other bugs)
Version: Main
Hardware: PC All
: PATCH-Sent (DO NOT USE) blocker
Assignee: Galen Charlton
QA Contact: Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-23 08:13 UTC by Chris Cormack
Modified: 2019-06-27 09:24 UTC (History)
1 user (show)

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


Attachments
fix for combination of auth_by_bind and replicate LDAP options (1.33 KB, patch)
2010-02-23 20:13 UTC, Chris Cormack
Details | Diff | Splinter Review
don't update ExtendedPatronAttributes if configured not to (692 bytes, patch)
2010-03-01 21:39 UTC, Chris Cormack
Details | Diff | Splinter Review
LDAP entries without any ExtendedPatronAttributes break replication (569 bytes, patch)
2010-03-01 22:04 UTC, Chris Cormack
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Cormack 2010-05-21 01:25:01 UTC


---- Reported by dpavlin@rot13.org 2010-02-23 20:13:39 ----

Created an attachment
fix for combination of auth_by_bind and replicate LDAP options

Latest git master is broken when using combination of auth_by_bind and replicate because code never fetches user's LDAP entry via search, so replicate dies with

Can't call method "exists" on an undefined value at /usr/share/koha/lib/C4/Auth_with_ldap.pm line 191, <DATA> line 253.

Attached patch fixes it, along with fix for mungling of mapping (I'm not quite sure that code as-is works for anyone).



---- Additional Comments From dpavlin@rot13.org 2010-03-01 21:30:13 ----

There is additional problem with ExtendedPatronAttributes and update disabled. Current code always tries to fill in ExtendedPatronAttributes from LDAP, which doesn't really make sense, since web interface provides edit boxes for it to librarians.

In fact, it started destroying our data during upgrade until we turned ExtendedPatronAttributes off. Fortunately, we had backups.



---- Additional Comments From dpavlin@rot13.org 2010-03-01 21:39:27 ----

Created an attachment
don't update ExtendedPatronAttributes if configured not to

Attached patch adds shortcut if update is not specified in configuration file, thus creating ExtendedPatronAttributes only once (on replicate) and then allowing update over web interface without overwriting it.



---- Additional Comments From dpavlin@rot13.org 2010-03-01 22:04:18 ----

Created an attachment
LDAP entries without any ExtendedPatronAttributes break replication

Logging into OPAC using LDAP user which doesn't have any attribute results in following error:

Software error:

Can't use string ("0") as an ARRAY ref while "strict refs" in use at /usr/share/koha/lib/C4/Auth_with_ldap.pm line 172,



---- Additional Comments From gmcharlt@gmail.com 2010-04-30 13:09:23 ----

Combined diffs and submitted patch to patches mailing list.



---- Additional Comments From gmcharlt@gmail.com 2010-04-30 21:08:29 ----

Committed patches to master.  Please test and close.



--- Bug imported by chris@bigballofwax.co.nz 2010-05-21 01:25 UTC  ---

This bug was previously known as _bug_ 4256 at http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=4256
Imported an attachment (id=1956)
Imported an attachment (id=1957)
Imported an attachment (id=1958)

Unknown Component Authentication
   Using default product and component set in Parameters 
Actual time not defined. Setting to 0.0
The original reporter of this bug does not have
   an account here. Reassigning to the person who moved
   it here: chris@bigballofwax.co.nz.
   Previous reporter was dpavlin@rot13.org.
Setting qa contact to the default for this product.
   This bug either had no qa contact or an invalid one.
CC member dpavlin@rot13.org does not have an account here
The original submitter of attachment 1956 [details] [review] is unknown.
   Reassigning to the person who moved it here: chris@bigballofwax.co.nz.
The original submitter of attachment 1957 [details] [review] is unknown.
   Reassigning to the person who moved it here: chris@bigballofwax.co.nz.
The original submitter of attachment 1958 [details] [review] is unknown.
   Reassigning to the person who moved it here: chris@bigballofwax.co.nz.