« DRI/Protocol/EPP/Extensions/ARNES/Domain.pm
↑ Summary
DRI/Protocol/EPP/Extensions/E164Validation/RFC5076.pm »
| 1 | ## Domain Registry Interface, Handling of contact data for .IT | ||||||||||||||||||||||||||||
| 2 | ## | ||||||||||||||||||||||||||||
| 3 | ## Copyright (C) 2009-2010 Tower Technologies. All rights reserved. | ||||||||||||||||||||||||||||
| 4 | ## | ||||||||||||||||||||||||||||
| 5 | ## This program free software; you can redistribute it and/or modify | ||||||||||||||||||||||||||||
| 6 | ## it under the terms of the GNU General Public License v2. | ||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | package Net::DRI::Data::Contact::IT; | ||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 1 | ▶ | use base qw / Net::DRI::Data::Contact /; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 1 | ▶ | use Net::DRI::Exception; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 1 | __PACKAGE__->register_attributes(qw/ | |||||||||||||||||||||||||||
| 18 | consent_for_publishing entity_type | ||||||||||||||||||||||||||||
| 19 | nationality_code reg_code /); | ||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | =pod | ||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | =head1 NAME | ||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | Net::DRI::Data::Contact::IT - Handle .IT contact data for Net::DRI | ||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | =head1 SUPPORT | ||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | For now, support questions should be sent to: | ||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | E<lt>noc@towertech.itE<gt> | ||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | Please also see the SUPPORT file in the distribution. | ||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | =head1 AUTHOR | ||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | Alessandro Zummo, E<lt>a.zummo@towertech.itE<gt> | ||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | =head1 COPYRIGHT | ||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | Copyright (C) 2009-2010 Tower Technologies. | ||||||||||||||||||||||||||||
| 42 | All rights reserved. | ||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | This program is free software; you can redistribute it and/or modify | ||||||||||||||||||||||||||||
| 45 | it under the terms of the GNU General Public License v2 as published by | ||||||||||||||||||||||||||||
| 46 | the Free Software Foundation. | ||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | See the LICENSE file that comes with this distribution for more details. | ||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | =cut | ||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||
| 54 | sub validate | ||||||||||||||||||||||||||||
| 55 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
validate: not called CC=9 SCAR=45.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 56 | 0 | my ($self, $change) = @_; | |||||||||||||||||||||||||||
| 57 | 0 | ▶ | $change ||= 0; | ||||||||||||||||||||||||||
|
Condition0%0/2
$change ||= 0
MC/DC0%0/1
$change ||= 0
$change
Truth table0%0/2
A
A= $change
| |||||||||||||||||||||||||||||
| 58 | 0 | my @errs; | |||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||
| 60 | 0 | $self->SUPER::validate($change); | |||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||
| 62 | 0 | ▶ | push @errs, 'consent_for_publishing' | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $self->consent_for_publishing and not $self->consent_for_publishing =~ /^(?:0|1)$/
MC/DC0%0/2
defined $self->consent_for_publishing and not $self->consent_for_publishing =~ /^(?:0|1)$/
defined $self->consent_for_publishing
not $self->consent_for_publishing =~ /^(?:0|1)$/
Truth table0%0/3
A and not(B)
A= defined $self->consent_for_publishingB= not $self->consent_for_publishing =~ /^(?:0|1)$/
| |||||||||||||||||||||||||||||
| 63 | if defined $self->consent_for_publishing | ||||||||||||||||||||||||||||
| 64 | and $self->consent_for_publishing !~m/^(?:0|1)$/; | ||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||
| 66 | 0 | ▶ | push @errs, 'nationality_code' | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $self->nationality_code and not $self->nationality_code =~ /^[a-zA-Z]{2}$/
MC/DC0%0/2
defined $self->nationality_code and not $self->nationality_code =~ /^[a-zA-Z]{2}$/
defined $self->nationality_code
not $self->nationality_code =~ /^[a-zA-Z]{2}$/
Truth table0%0/3
A and not(B)
A= defined $self->nationality_codeB= not $self->nationality_code =~ /^[a-zA-Z]{2}$/
| |||||||||||||||||||||||||||||
| 67 | if defined $self->nationality_code | ||||||||||||||||||||||||||||
| 68 | and $self->nationality_code !~m/^[a-zA-Z]{2}$/; | ||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||
| 70 | 0 | ▶ | push @errs, 'entity_type' | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $self->entity_type and not $self->entity_type =~ /^[1-7]$/
MC/DC0%0/2
defined $self->entity_type and not $self->entity_type =~ /^[1-7]$/
defined $self->entity_type
not $self->entity_type =~ /^[1-7]$/
Truth table0%0/3
A and not(B)
A= defined $self->entity_typeB= not $self->entity_type =~ /^[1-7]$/
| |||||||||||||||||||||||||||||
| 71 | if defined $self->entity_type | ||||||||||||||||||||||||||||
| 72 | and $self->entity_type !~m/^[1-7]$/; | ||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||
| 74 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('Invalid contact information: ' . join('/', @errs)) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 75 | if scalar @errs; | ||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||
| 77 | 0 | return 1; | |||||||||||||||||||||||||||
| 78 | } | ||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||
| 80 | 1 | 1; | |||||||||||||||||||||||||||