DRI/Protocol/EPP/Extensions/AFNIC/Contact.pm

filter: Statementstmt 7.1% 13 / 181 Branchbran 0.0% 0 / 130 Conditioncond 0.0% 0 / 39 MC/DCmcdc 0.0% 0 / 22 Subroutinesub 26.6% 4 / 15 Podpod 0.0% 0 / 11 totaltotal 4.2% 17 / 398 CC 83 SCAR 56.4
CC
83
Cov
4%
create
756.0
info_parse
210.0
update
132.0
CRAP 280.2
« DRI/Protocol/EPP/Extensions/CZ/Domain.pm ↑ Summary DRI/Protocol/EPP/Extensions/PL/Domain.pm »
1 ## Domain Registry Interface, AFNIC (.FR/.RE/.TF/.WF/.PM/.YT) Contact EPP extension commands
2 ##
3 ## Copyright (c) 2008,2009,2012,2013,2016 Patrick Mevzek <netdri@dotandco.com>. All rights reserved.
4 ##
5 ## This file is part of Net::DRI
6 ##
7 ## Net::DRI is free software; you can redistribute it and/or modify
8 ## it under the terms of the GNU General Public License as published by
9 ## the Free Software Foundation; either version 2 of the License, or
10 ## (at your option) any later version.
11 ##
12 ## See the LICENSE file that comes with this distribution for more details.
13 ####################################################################################################
14  
15 package Net::DRI::Protocol::EPP::Extensions::AFNIC::Contact;
16  
17 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 1 ▶use Net::DRI::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 1 ▶use Net::DRI::Exception;
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 =pod
24  
25 =head1 NAME
26  
27 Net::DRI::Protocol::EPP::Extensions::AFNIC::Contact - AFNIC (.FR/.RE/.TF/.WF/.PM/.YT) EPP Contact extensions for Net::DRI
28  
29 =head1 DESCRIPTION
30  
31 Please see the README file for details.
32  
33 =head1 SUPPORT
34  
35 For now, support questions should be sent to:
36  
37 E<lt>netdri@dotandco.comE<gt>
38  
39 Please also see the SUPPORT file in the distribution.
40  
41 =head1 SEE ALSO
42  
43 E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt>
44  
45 =head1 AUTHOR
46  
47 Patrick Mevzek, E<lt>netdri@dotandco.comE<gt>
48  
49 =head1 COPYRIGHT
50  
51 Copyright (c) 2008,2009,2012,2013,2016 Patrick Mevzek <netdri@dotandco.com>.
52 All rights reserved.
53  
54 This program is free software; you can redistribute it and/or modify
55 it under the terms of the GNU General Public License as published by
56 the Free Software Foundation; either version 2 of the License, or
57 (at your option) any later version.
58  
59 See the LICENSE file that comes with this distribution for more details.
60  
61 =cut
62  
63 ####################################################################################################
64  
65 sub register_commands
66 {
67 0 ▶ my ($class,$version)=@_;
Subroutine register_commands: not called CC=1 SCAR=6.9
Pod undocumented
68 0 my %tmp=(
69 create => [ \&create, \&create_parse ],
70 update => [ \&update, undef ],
71 info => [ undef, \&info_parse ],
72 );
73  
74 0 return { 'contact' => \%tmp };
75 }
76  
77 ####################################################################################################
78  
79 sub create
80 {
81 0 ▶ my ($epp,$contact)=@_;
Subroutine create: not called CC=27 SCAR=66.3
Pod undocumented
82 0 my $mes=$epp->message();
83  
84 ## validate() has been called
85 0 my @n;
86 0 my $qual=$contact->qualification();
87 0 ▶ if ($contact->legal_form()) # PM
Branch: 1 branch
BranchTrueFalseTotal
if ($contact->legal_form) { } 0 0 0
88 {
89 0 my @d;
90 0 push @d,build_q_idtstatus($qual);
91  
92 0 ▶ Net::DRI::Exception::usererr_insufficient_parameters('legal_form data mandatory') unless ($contact->legal_form());
Branch: 1 branch
BranchTrueFalseTotal
unless $contact->legal_form 0 0 0
93 0 ▶ Net::DRI::Exception::usererr_invalid_parameters('legal_form_other data mandatory if legal_form=other') if (($contact->legal_form() eq 'other') && !$contact->legal_form_other());
Branch: 1 branch
BranchTrueFalseTotal
if $contact->legal_form eq "other" and not $contact->legal_form_other 0 0 0
Condition0%0/3
$contact->legal_form eq "other" and not $contact->legal_form_other
!ll&&!rl&&r
000
MC/DC0%0/2
$contact->legal_form eq "other" and not $contact->legal_form_other
$contact->legal_form eq "other" not $contact->legal_form_other
Truth table0%0/3
A and not(B)
A= $contact->legal_form eq "other"B= not $contact->legal_form_other
ABresult
0X0
100
111
94  
95 0 ▶ push @d,['frnic:legalStatus',{'s' => $contact->legal_form()},$contact->legal_form() eq 'other'? $contact->legal_form_other() : ''];
Branch: 1 branch
BranchTrueFalseTotal
$contact->legal_form eq 'other' ? : 0 0 0
96 0 my @id;
97  
98 0 ▶ if ($contact->legal_id() && $contact->legal_id_type())
Branch: 1 branch
BranchTrueFalseTotal
if ($contact->legal_id and $contact->legal_id_type) 0 0 0
Condition0%0/3
$contact->legal_id and $contact->legal_id_type
!ll&&!rl&&r
000
MC/DC0%0/2
$contact->legal_id and $contact->legal_id_type
$contact->legal_id $contact->legal_id_type
Truth table0%0/3
A and B
A= $contact->legal_idB= $contact->legal_id_type
ABresult
0X0
100
111
99 {
100 0 ▶ push @d,['frnic:siren',$contact->legal_id()] if $contact->legal_id_type() eq 'siren';
Branch: 1 branch
BranchTrueFalseTotal
if $contact->legal_id_type eq "siren" 0 0 0
101 0 ▶ push @id,['frnic:DUNS',$contact->legal_id()] if $contact->legal_id_type() eq 'duns';
Branch: 1 branch
BranchTrueFalseTotal
if $contact->legal_id_type eq "duns" 0 0 0
102 0 ▶ push @id,['frnic:local',$contact->legal_id()] if $contact->legal_id_type() eq 'local';
Branch: 1 branch
BranchTrueFalseTotal
if $contact->legal_id_type eq "local" 0 0 0
103 }
104 0 ▶ push @d,['frnic:VAT',$contact->vat()] if $contact->vat();
Branch: 1 branch
BranchTrueFalseTotal
if $contact->vat 0 0 0
105 0 ▶ push @d,['frnic:trademark',$contact->trademark()] if $contact->trademark();
Branch: 1 branch
BranchTrueFalseTotal
if $contact->trademark 0 0 0
106 0 my $jo=$contact->jo();
107 0 ▶ if (defined($jo) && (ref($jo) eq 'HASH'))
Branch: 1 branch
BranchTrueFalseTotal
if (defined $jo and ref $jo eq "HASH") 0 0 0
Condition0%0/3
defined $jo and ref $jo eq "HASH"
!ll&&!rl&&r
000
MC/DC0%0/2
defined $jo and ref $jo eq "HASH"
defined $jo ref $jo eq "HASH"
Truth table0%0/3
A and B
A= defined $joB= ref $jo eq "HASH"
ABresult
0X0
100
111
108 {
109 0 my @j;
110 0 ▶ push @j,['frnic:waldec',$jo->{waldec}] if exists $jo->{waldec};
Branch: 1 branch
BranchTrueFalseTotal
if exists $jo->{"waldec"} 0 0 0
111 0 ▶ push @j,['frnic:waldec',$contact->legal_id()] if (defined $contact->legal_id() && defined $contact->legal_form_other() && $contact->legal_form_other() eq 'asso'); ## not sure API ok
Branch: 1 branch
BranchTrueFalseTotal
if defined $contact->legal_id and defined $contact->legal_form_other and $contact->legal_form_other eq "asso" 0 0 0
Condition0%0/6
defined $contact->legal_id and defined $contact->legal_form_other and $contact->legal_form_other eq "asso"
!ll&&!rl&&r
000
defined $contact->legal_id and defined $contact->legal_form_other
!ll&&!rl&&r
000
MC/DC0%0/3
defined $contact->legal_id and defined $contact->legal_form_other and $contact->legal_form_other eq "asso"
defined $contact->legal_id defined $contact->legal_form_other $contact->legal_form_other eq "asso"
Truth table0%0/4
A and B and C
A= defined $contact->legal_idB= defined $contact->legal_form_otherC= $contact->legal_form_other eq "asso"
ABCresult
0XX0
10X0
1100
1111
112 0 push @j,['frnic:decl',$jo->{date_declaration}];
113 0 push @j,['frnic:publ',{announce=>$jo->{number},page=>$jo->{page}},$jo->{date_publication}];
114 0 push @d,['frnic:asso',@j];
115 }
116 0 ▶ push @d,@id if @id;
Branch: 1 branch
BranchTrueFalseTotal
if @id 0 0 0
117 0 push @n,['frnic:legalEntityInfos',@d];
118 } else # PP
119 {
120 0 my @d;
121 0 push @d,build_q_idtstatus($qual);
122  
123 0 my $b=$contact->birth();
124 0 ▶ if (Net::DRI::Util::has_key($b,'date') && Net::DRI::Util::has_key($b,'place'))
Branch: 1 branch
BranchTrueFalseTotal
if (Net::DRI::Util::has_key($b, "date") and Net::DRI::Util::has_key($b, "place")) 0 0 0
Condition0%0/3
Net::DRI::Util::has_key($b, "date") and Net::DRI::Util::has_key($b, "place")
!ll&&!rl&&r
000
MC/DC0%0/2
Net::DRI::Util::has_key($b, "date") and Net::DRI::Util::has_key($b, "place")
Net::DRI::Util::has_key($b, "date") Net::DRI::Util::has_key($b, "place")
Truth table0%0/3
A and B
A= Net::DRI::Util::has_key($b, "date")B= Net::DRI::Util::has_key($b, "place")
ABresult
0X0
100
111
125 {
126 0 ▶ push @d,['frnic:birthDate',ref $b->{date} ? $b->{date}->strftime('%Y-%m-%d') : $b->{date}];
Branch: 1 branch
BranchTrueFalseTotal
ref $b->{'date'} ? : 0 0 0
127 0 ▶ if ($b->{place}=~m/^[A-Z]{2}$/i) ## country not France
Branch: 1 branch
BranchTrueFalseTotal
if ($b->{'place'} =~ /^[A-Z]{2}$/i) { } 0 0 0
128 {
129 0 push @d,['frnic:birthCc',$b->{place}];
130 } else
131 {
132 0 my @p=($b->{place}=~m/^\s*(\S.*\S)\s*,\s*(\S.+\S)\s*$/);
133 0 push @d,['frnic:birthCity',$p[1]];
134 0 push @d,['frnic:birthPc',$p[0]];
135 0 push @d,['frnic:birthCc','FR'];
136 }
137 }
138 0 ▶ if (@d)
Branch: 1 branch
BranchTrueFalseTotal
if (@d) 0 0 0
139 {
140 0 ▶ push @n,['frnic:list','restrictedPublication'] if (defined $contact->disclose() && $contact->disclose() eq 'N');
Branch: 1 branch
BranchTrueFalseTotal
if defined $contact->disclose and $contact->disclose eq "N" 0 0 0
Condition0%0/3
defined $contact->disclose and $contact->disclose eq "N"
!ll&&!rl&&r
000
MC/DC0%0/2
defined $contact->disclose and $contact->disclose eq "N"
defined $contact->disclose $contact->disclose eq "N"
Truth table0%0/3
A and B
A= defined $contact->discloseB= $contact->disclose eq "N"
ABresult
0X0
100
111
141 0 push @n,['frnic:individualInfos',@d];
142 }
143 0 push @n,['frnic:firstName',$contact->firstname()];
144 }
145  
146 0 push @n,build_q_reachable($qual);
147  
148 0 my $eid=$mes->command_extension_register('frnic', 'ext');
149 0 $mes->command_extension($eid,['frnic:create',['frnic:contact',@n]]);
150 0 return;
151 }
152  
153 sub create_parse
154 {
155 0 ▶ my ($po,$otype,$oaction,$oname,$rinfo)=@_;
Subroutine create_parse: not called CC=7 SCAR=40.3
Pod undocumented
156 0 my $mes=$po->message();
157 0 ▶ return unless $mes->is_success();
Branch: 1 branch
BranchTrueFalseTotal
unless $mes->is_success 0 0 0
158  
159 0 my $credata=$mes->get_extension('frnic','ext');
160 0 ▶ return unless defined $credata;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $credata 0 0 0
161  
162 0 my $ns=$mes->ns('frnic');
163 0 $credata=Net::DRI::Util::xml_traverse($credata,$ns,'resData','creData');
164 0 ▶ return unless defined $credata;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $credata 0 0 0
165  
166 0 $oname=$rinfo->{contact}->{$oname}->{id}; ## take into account true ID (the one returned by the registry)
167 0 foreach my $el (Net::DRI::Util::xml_list_children($credata))
168 {
169 0 my ($name,$c)=@$el;
170 0 ▶ if ($name eq 'nhStatus')
Branch: 2 branches
BranchTrueFalseTotal
if ($name eq 'nhStatus') { } 0 0 0
elsif ($name eq 'idStatus') { } 0 0 0
171 {
172 0 $rinfo->{contact}->{$oname}->{new_handle}=Net::DRI::Util::xml_parse_boolean($c->getAttribute('new'));
173 } elsif ($name eq 'idStatus')
174 {
175 0 $rinfo->{contact}->{$oname}->{qualification}={ identification => parse_q_idtstatus($po,$c) };
176 }
177 }
178 0 return;
179 }
180  
181 sub build_q_idtstatus
182 {
183 0 ▶ my ($qual)=@_;
Subroutine build_q_idtstatus: not called CC=3 SCAR=24.8
Pod undocumented
184 0 my @d;
185 0 ▶ if (Net::DRI::Util::has_key($qual,'identification') && Net::DRI::Util::has_key($qual->{identification},'status'))
Branch: 1 branch
BranchTrueFalseTotal
if (Net::DRI::Util::has_key($qual, "identification") and Net::DRI::Util::has_key($qual->{"identification"}, "status")) 0 0 0
Condition0%0/3
Net::DRI::Util::has_key($qual, "identification") and Net::DRI::Util::has_key($qual->{"identification"}, "status")
!ll&&!rl&&r
000
MC/DC0%0/2
Net::DRI::Util::has_key($qual, "identification") and Net::DRI::Util::has_key($qual->{"identification"}, "status")
Net::DRI::Util::has_key($qual, "identification") Net::DRI::Util::has_key($qual->{"identification"}, "status")
Truth table0%0/3
A and B
A= Net::DRI::Util::has_key($qual, "identification")B= Net::DRI::Util::has_key($qual->{"identification"}, "status")
ABresult
0X0
100
111
186 {
187 0 push @d,['frnic:idStatus',$qual->{identification}->{status}];
188 }
189 0 return @d;
190 }
191  
192 sub build_q_reachable
193 {
194 0 ▶ my ($qual)=@_;
Subroutine build_q_reachable: not called CC=5 SCAR=34.0
Pod undocumented
195 0 my @n;
196 0 ▶ if (Net::DRI::Util::has_key($qual,'reachable') && Net::DRI::Util::has_key($qual->{reachable},'value') && Net::DRI::Util::has_key($qual->{reachable},'media'))
Branch: 1 branch
BranchTrueFalseTotal
if (Net::DRI::Util::has_key($qual, "reachable") and Net::DRI::Util::has_key($qual->{"reachable"}, "value") and Net::DRI::Util::has_key($qual->{"reachable"}, "media")) 0 0 0
Condition0%0/6
Net::DRI::Util::has_key($qual, "reachable") and Net::DRI::Util::has_key($qual->{"reachable"}, "value") and Net::DRI::Util::has_key($qual->{"reachable"}, "media")
!ll&&!rl&&r
000
Net::DRI::Util::has_key($qual, "reachable") and Net::DRI::Util::has_key($qual->{"reachable"}, "value")
!ll&&!rl&&r
000
MC/DC0%0/3
Net::DRI::Util::has_key($qual, "reachable") and Net::DRI::Util::has_key($qual->{"reachable"}, "value") and Net::DRI::Util::has_key($qual->{"reachable"}, "media")
Net::DRI::Util::has_key($qual, "reachable") Net::DRI::Util::has_key($qual->{"reachable"}, "value") Net::DRI::Util::has_key($qual->{"reachable"}, "media")
Truth table0%0/4
A and B and C
A= Net::DRI::Util::has_key($qual, "reachable")B= Net::DRI::Util::has_key($qual->{"reachable"}, "value")C= Net::DRI::Util::has_key($qual->{"reachable"}, "media")
ABCresult
0XX0
10X0
1100
1111
197 {
198 0 ▶ push @n,['frnic:reachable',{media=>$qual->{reachable}->{media}},$qual->{reachable}->{value} ? 1 : 0];
Branch: 1 branch
BranchTrueFalseTotal
$qual->{'reachable'}{'value'} ? : 0 0 0
199 }
200 0 return @n;
201 }
202  
203 sub update
204 {
205 0 ▶ my ($epp,$domain,$todo)=@_;
Subroutine update: not called CC=11 SCAR=48.8
Pod undocumented
206 0 my $mes=$epp->message();
207  
208 0 my $dadd=$todo->add('disclose');
209 0 my $ddel=$todo->del('disclose');
210 0 my $qadd=$todo->add('qualification');
211 0 my $qdel=$todo->del('qualification');
212 0 ▶ return unless ($dadd || $ddel || $qadd || $qdel);
Branch: 1 branch
BranchTrueFalseTotal
unless $dadd or $ddel or $qadd or $qdel 0 0 0
Condition0%0/9
$dadd or $ddel or $qadd or $qdel
l!l&&r!l&&!r
000
$dadd or $ddel or $qadd
l!l&&r!l&&!r
000
$dadd or $ddel
l!l&&r!l&&!r
000
MC/DC0%0/4
$dadd or $ddel or $qadd or $qdel
$dadd $ddel $qadd $qdel
Truth table0%0/5
A or B or C or D
A= $daddB= $ddelC= $qaddD= $qdel
ABCDresult
1XXX1
01XX1
001X1
00011
00000
213  
214 0 my (@add,@del);
215 0 ▶ push @add,['frnic:list',$dadd] if $dadd;
Branch: 1 branch
BranchTrueFalseTotal
if $dadd 0 0 0
216 0 ▶ push @del,['frnic:list',$ddel] if $ddel;
Branch: 1 branch
BranchTrueFalseTotal
if $ddel 0 0 0
217  
218 0 ▶ if ($qadd)
Branch: 1 branch
BranchTrueFalseTotal
if ($qadd) 0 0 0
219 {
220 0 push @add,build_q_idtstatus($qadd);
221 0 push @add,build_q_reachable($qadd);
222 }
223 0 ▶ if ($qdel)
Branch: 1 branch
BranchTrueFalseTotal
if ($qdel) 0 0 0
224 {
225 0 push @del,build_q_idtstatus($qdel);
226 0 push @del,build_q_reachable($qdel);
227 }
228  
229 0 my @n;
230 0 ▶ push @n,['frnic:add',@add] if @add;
Branch: 1 branch
BranchTrueFalseTotal
if @add 0 0 0
231 0 ▶ push @n,['frnic:rem',@del] if @del;
Branch: 1 branch
BranchTrueFalseTotal
if @del 0 0 0
232  
233 0 my $eid=$mes->command_extension_register('frnic', 'ext');
234 0 $mes->command_extension($eid,['frnic:update',['frnic:contact',@n]]);
235 0 return;
236 }
237  
238 sub parse_q_idtstatus
239 {
240 0 ▶ my ($po,$c)=@_;
Subroutine parse_q_idtstatus: not called CC=3 SCAR=24.8
Pod undocumented
241 0 my %i;
242 0 ▶ $i{when}=$po->parse_iso8601($c->getAttribute('when')) if $c->hasAttribute('when');
Branch: 1 branch
BranchTrueFalseTotal
if $c->hasAttribute("when") 0 0 0
243 0 ▶ $i{source}=$c->getAttribute('source') if $c->hasAttribute('source');
Branch: 1 branch
BranchTrueFalseTotal
if $c->hasAttribute("source") 0 0 0
244 0 $i{value}=$c->textContent();
245 0 return \%i;
246 }
247  
248 sub parse_q_reachable
249 {
250 0 ▶ my ($po,$c)=@_;
Subroutine parse_q_reachable: not called CC=4 SCAR=30.0
Pod undocumented
251 0 my %r;
252 0 ▶ $r{when}=$po->parse_iso8601($c->getAttribute('when')) if $c->hasAttribute('when');
Branch: 1 branch
BranchTrueFalseTotal
if $c->hasAttribute("when") 0 0 0
253 0 ▶ $r{media}=$c->getAttribute('media') if $c->hasAttribute('media');
Branch: 1 branch
BranchTrueFalseTotal
if $c->hasAttribute("media") 0 0 0
254 0 ▶ $r{source}=$c->getAttribute('source') if $c->hasAttribute('source');
Branch: 1 branch
BranchTrueFalseTotal
if $c->hasAttribute("source") 0 0 0
255 0 $r{value}=Net::DRI::Util::xml_parse_boolean($c->textContent());
256 0 return \%r;
257 }
258  
259 sub info_parse
260 {
261 0 ▶ my ($po,$otype,$oaction,$oname,$rinfo)=@_;
Subroutine info_parse: not called CC=14 SCAR=53.5
Pod undocumented
262 0 my $mes=$po->message();
263 0 ▶ return unless $mes->is_success();
Branch: 1 branch
BranchTrueFalseTotal
unless $mes->is_success 0 0 0
264  
265 0 my $infdata=$mes->get_extension('frnic','ext');
266 0 ▶ return unless defined $infdata;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $infdata 0 0 0
267  
268 0 my $ns=$mes->ns('frnic');
269 0 $infdata=Net::DRI::Util::xml_traverse($infdata,$ns,'resData','infData','contact');
270 0 ▶ return unless defined $infdata;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $infdata 0 0 0
271  
272 0 my $co=$rinfo->{contact}->{$oname}->{self};
273 0 my %q;
274 0 foreach my $el (Net::DRI::Util::xml_list_children($infdata))
275 {
276 0 my ($name,$c)=@$el;
277 0 ▶ if ($name eq 'firstName')
Branch: 6 branches
BranchTrueFalseTotal
if ($name eq 'firstName') { } 0 0 0
elsif ($name eq 'list') { } 0 0 0
elsif ($name eq 'individualInfos') { } 0 0 0
elsif ($name eq 'legalEntityInfos') { } 0 0 0
elsif ($name eq 'obsoleted') { } 0 0 0
elsif ($name eq 'reachable') { } 0 0 0
278 {
279 0 $co->firstname($c->textContent());
280 } elsif ($name eq 'list')
281 {
282 0 ▶ $co->disclose($c->textContent() eq 'restrictedPublication'? 'N' : 'Y');
Branch: 1 branch
BranchTrueFalseTotal
$c->textContent eq 'restrictedPublication' ? : 0 0 0
283 } elsif ($name eq 'individualInfos')
284 {
285 0 parse_individualinfos($po,$otype,$oaction,$oname,$rinfo,$c,$co,$mes,\%q);
286 } elsif ($name eq 'legalEntityInfos')
287 {
288 0 parse_legalentityinfos($po,$otype,$oaction,$oname,$rinfo,$c,$co,$mes,\%q);
289 } elsif ($name eq 'obsoleted')
290 {
291 0 my %o;
292 0 $o{value}=Net::DRI::Util::xml_parse_boolean($c->textContent());
293 0 ▶ $o{when}=$po->parse_iso8601($c->getAttribute('when')) if $c->hasAttribute('when');
Branch: 1 branch
BranchTrueFalseTotal
if $c->hasAttribute("when") 0 0 0
294 0 $co->obsoleted(\%o);
295 } elsif ($name eq 'reachable')
296 {
297 0 $q{reachable}=parse_q_reachable($po,$c);
298 }
299 }
300 0 ▶ $co->qualification(\%q) if %q;
Branch: 1 branch
BranchTrueFalseTotal
if %q 0 0 0
301  
302 0 return;
303 }
304  
305 sub parse_individualinfos
306 {
307 0 ▶ my ($po,$otype,$oaction,$oname,$rinfo,$c,$co,$mes,$rq)=@_;
Subroutine parse_individualinfos: not called CC=8 SCAR=42.8
Pod undocumented
308  
309 0 my %birth;
310 0 foreach my $sel (Net::DRI::Util::xml_list_children($c))
311 {
312 0 my ($nn,$cc)=@$sel;
313 0 ▶ if ($nn eq 'idStatus')
Branch: 5 branches
BranchTrueFalseTotal
if ($nn eq 'idStatus') { } 0 0 0
elsif ($nn eq 'birthDate') { } 0 0 0
elsif ($nn eq 'birthCity') { } 0 0 0
elsif ($nn eq 'birthPc') { } 0 0 0
elsif ($nn eq 'birthCc') { } 0 0 0
314 {
315 0 $rq->{identification}=parse_q_idtstatus($po,$c);
316 } elsif ($nn eq 'birthDate')
317 {
318 0 $birth{date}=$cc->textContent();
319 } elsif ($nn eq 'birthCity')
320 {
321 0 $birth{place}=$cc->textContent();
322 } elsif ($nn eq 'birthPc')
323 {
324 0 $birth{place}=sprintf('%s, %s',$cc->textContent(),$birth{place});
325 } elsif ($nn eq 'birthCc')
326 {
327 0 my $v=$cc->textContent();
328 0 ▶ $birth{place}=$v unless ($v eq 'FR');
Branch: 1 branch
BranchTrueFalseTotal
unless $v eq "FR" 0 0 0
329 }
330 }
331 0 $co->birth(\%birth);
332  
333 0 return;
334 }
335  
336 sub parse_legalentityinfos
337 {
338 0 ▶ my ($po,$otype,$oaction,$oname,$rinfo,$c,$co,$mes,$rq)=@_;
Subroutine parse_legalentityinfos: not called CC=10 SCAR=47.0
Pod undocumented
339  
340 0 foreach my $sel (Net::DRI::Util::xml_list_children($c))
341 {
342 0 my ($nn,$cc)=@$sel;
343 0 ▶ if ($nn eq 'idStatus')
Branch: 5 branches
BranchTrueFalseTotal
if ($nn eq 'idStatus') { } 0 0 0
elsif ($nn eq 'legalStatus') { } 0 0 0
elsif ($nn =~ /^(?:siren|DUNS|local)$/) { } 0 0 0
elsif ($nn eq 'trademark') { } 0 0 0
elsif ($nn eq 'asso') { } 0 0 0
344 {
345 0 $rq->{identification}=parse_q_idtstatus($po,$cc);
346 } elsif ($nn eq 'legalStatus')
347 {
348 0 $co->legal_form($cc->getAttribute('s'));
349 0 my $v=$cc->textContent();
350 0 ▶ $co->legal_form_other($v) if $v;
Branch: 1 branch
BranchTrueFalseTotal
if $v 0 0 0
351 } elsif ($nn=~m/^(?:siren|DUNS|local)$/)
352 {
353 0 $co->legal_id($cc->textContent());
354 0 $co->legal_id_type(lc $nn);
355 } elsif ($nn eq 'trademark')
356 {
357 0 $co->trademark($cc->textContent());
358 } elsif ($nn eq 'asso')
359 {
360 0 my %jo;
361 0 my $ccc=$cc->getChildrenByTagNameNS($mes->ns('frnic'),'decl');
362 0 ▶ $jo{date_declaration}=$ccc->get_node(1)->textContent() if $ccc->size();
Branch: 1 branch
BranchTrueFalseTotal
if $ccc->size 0 0 0
363 0 $ccc=$cc->getChildrenByTagNameNS($mes->ns('frnic'),'publ');
364 0 ▶ if ($ccc->size())
Branch: 1 branch
BranchTrueFalseTotal
if ($ccc->size) 0 0 0
365 {
366 0 my $p=$ccc->get_node(1);
367 0 $jo{number}=$p->getAttribute('announce');
368 0 $jo{page}=$p->getAttribute('page');
369 0 $jo{date_publication}=$p->textContent();
370 }
371 0 $co->jo(\%jo);
372 }
373 }
374  
375 0 return;
376 }
377  
378 ####################################################################################################
379 1 1;
« DRI/Protocol/EPP/Extensions/CZ/Domain.pm ↑ Summary DRI/Protocol/EPP/Extensions/PL/Domain.pm »