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
<?xml version="1.0"?>
<p-file-20>
<patron-record>
<z303>
<match-id-type>01</match-id-type>
<match-id>#{patron_id}</match-id>
<record-action>X</record-action>
</z303>
<z308>
<record-action>U</record-action>
<z308-key-type>01</z308-key-type>
<z308-key-data>#{patron_id}</z308-key-data>
<z308-verification>#{new_password}</z308-verification>
</z308>
</patron-record>
</p-file-20>
XML
)
if bor_update_successfull?(data)
return true
else
return false
end
else
return false
end
end
|