16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
# File 'lib/median/aleph/patron.rb', line 16
def change_patron_password(patron_id, current_password, new_password)
if AlephApi.authenticate(patron_id, current_password)
data = post_url(Median.config.aleph_x_service_base_url,
op: 'update_bor',
update_flag: 'Y',
library: Median.config.aleph_user_library,
xml_full_req: " <?xml version=\"1.0\"?>\n <p-file-20>\n <patron-record>\n <z303>\n <match-id-type>01</match-id-type>\n <match-id>\#{patron_id}</match-id>\n <record-action>X</record-action>\n </z303>\n <z308>\n <record-action>U</record-action>\n <z308-key-type>01</z308-key-type>\n <z308-key-data>\#{patron_id}</z308-key-data>\n <z308-verification>\#{new_password}</z308-verification>\n </z308>\n </patron-record>\n </p-file-20>\n XML\n )\n\n if bor_update_successfull?(data)\n return true\n else\n return false\n end\n else\n return false\n end\nend\n"
|