- if ( $query->param('Newkey') =~ m|^\s+| or $query->param('Newkey') =~ m|\s+$| ) {
- $template->param(
- Error_messages => 1,
- PasswordContainsTrailingSpaces => 1,
- );
- }
- elsif ( $query->param('Newkey') eq $query->param('Confirm')
- && length( $query->param('Confirm') ) >= $minpasslen )
- { # Record password
- my $clave = hash_password( $query->param('Newkey') );
- $sth->execute( $clave, $borrowernumber );
- $template->param( 'password_updated' => '1' );
- $template->param( 'borrowernumber' => $borrowernumber );
- }
- elsif ( $query->param('Newkey') ne $query->param('Confirm') ) {
- $template->param( 'Ask_data' => '1' );
- $template->param( 'Error_messages' => '1' );
- $template->param( 'PassMismatch' => '1' );
- }
- elsif ( length( $query->param('Confirm') ) < $minpasslen ) {