Lines 23-29
use Modern::Perl;
Link Here
|
23 |
use Carp; |
23 |
use Carp; |
24 |
use List::MoreUtils qw( any uniq ); |
24 |
use List::MoreUtils qw( any uniq ); |
25 |
use JSON qw( to_json ); |
25 |
use JSON qw( to_json ); |
26 |
use Text::Unaccent qw( unac_string ); |
26 |
use Unicode::Normalize; |
27 |
|
27 |
|
28 |
use C4::Context; |
28 |
use C4::Context; |
29 |
use C4::Log; |
29 |
use C4::Log; |
Lines 1415-1428
sub generate_userid {
Link Here
|
1415 |
$firstname =~ s/[[:digit:][:space:][:blank:][:punct:][:cntrl:]]//g; |
1415 |
$firstname =~ s/[[:digit:][:space:][:blank:][:punct:][:cntrl:]]//g; |
1416 |
$surname =~ s/[[:digit:][:space:][:blank:][:punct:][:cntrl:]]//g; |
1416 |
$surname =~ s/[[:digit:][:space:][:blank:][:punct:][:cntrl:]]//g; |
1417 |
my $userid = lc(($firstname)? "$firstname.$surname" : $surname); |
1417 |
my $userid = lc(($firstname)? "$firstname.$surname" : $surname); |
1418 |
$userid = unac_string('utf-8',$userid); |
1418 |
$userid = NFKD( $userid ); |
|
|
1419 |
$userid =~ s/\p{NonspacingMark}//g; |
1419 |
$userid .= $offset unless $offset == 0; |
1420 |
$userid .= $offset unless $offset == 0; |
1420 |
$self->userid( $userid ); |
1421 |
$self->userid( $userid ); |
1421 |
$offset++; |
1422 |
$offset++; |
1422 |
} while (! $self->has_valid_userid ); |
1423 |
} while (! $self->has_valid_userid ); |
1423 |
|
1424 |
|
1424 |
return $self; |
1425 |
return $self; |
1425 |
|
|
|
1426 |
} |
1426 |
} |
1427 |
|
1427 |
|
1428 |
=head3 attributes |
1428 |
=head3 attributes |
1429 |
- |
|
|