Bug 18589: Show ILLs as part of patron profile
[srvgit] / members / memberentry.pl
index 600eff9..031a8e1 100755 (executable)
@@ -306,7 +306,7 @@ $debug and warn join "\t", map {"$_: $newdata{$_}"} qw(dateofbirth dateenrolled
 my $extended_patron_attributes = ();
 if ($op eq 'save' || $op eq 'insert'){
 
-    die "Wrong CSRF token"
+    output_and_exit( $input, $cookie, $template,  'wrong_csrf_token' )
         unless Koha::Token->new->check_csrf({
             session_id => scalar $input->cookie('CGISESSID'),
             token  => scalar $input->param('csrf_token'),
@@ -535,7 +535,11 @@ if ((!$nok) and $nodouble and ($op eq 'insert' or $op eq 'save')){
                                                                 # which can happen if we're only editing the
                                                                 # patron attributes or messaging preferences sections
 
-        $patron->update_password($newdata{userid}, $newdata{password});
+        # should never raise an exception as password validity is checked above
+        my $password = $newdata{password};
+        if ( $password and $password ne '****' ) {
+            $patron->set_password({ password => $password });
+        }
 
         if (C4::Context->preference('ExtendedPatronAttributes') and $input->param('setting_extended_patron_attributes')) {
             C4::Members::Attributes::SetBorrowerAttributes($borrowernumber, $extended_patron_attributes);