DRI/Protocol/EPP/Core/Contact.pm

filter: Statementstmt 8.6% 19 / 219 Branchbran 0.0% 0 / 104 Conditioncond 0.0% 0 / 21 MC/DCmcdc 0.0% 0 / 12 Subroutinesub 25.0% 6 / 24 Podpod 0.0% 0 / 18 totaltotal 6.2% 25 / 398 CC 67 SCAR 44.9
CC
67
Cov
6%
info_parse
240.0
build_command
156.0
create_parse
72.0
CRAP 89.2
« DRI/Data/Contact/COOP.pm ↑ Summary DRI/Protocol/EPP/Message.pm »
1 ## Domain Registry Interface, EPP Contact commands (RFC5733)
2 ##
3 ## Copyright (c) 2005-2010,2012-2013,2015,2018 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::Core::Contact;
16  
17 1 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 1 ▶use Net::DRI::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
22 1 ▶use Net::DRI::Exception;
Subroutine BEGIN: called CC=1 SCAR=0.0
23 1 ▶use Net::DRI::Protocol::EPP::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
24  
25 =pod
26  
27 =head1 NAME
28  
29 Net::DRI::Protocol::EPP::Core::Contact - EPP Contact commands (RFC5733) for Net::DRI
30  
31 =head1 DESCRIPTION
32  
33 Please see the README file for details.
34  
35 =head1 SUPPORT
36  
37 For now, support questions should be sent to:
38  
39 E<lt>netdri@dotandco.comE<gt>
40  
41 Please also see the SUPPORT file in the distribution.
42  
43 =head1 SEE ALSO
44  
45 E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt>
46  
47 =head1 AUTHOR
48  
49 Patrick Mevzek, E<lt>netdri@dotandco.comE<gt>
50  
51 =head1 COPYRIGHT
52  
53 Copyright (c) 2005-2010,2012-2013,2015,2018 Patrick Mevzek <netdri@dotandco.com>.
54 All rights reserved.
55  
56 This program is free software; you can redistribute it and/or modify
57 it under the terms of the GNU General Public License as published by
58 the Free Software Foundation; either version 2 of the License, or
59 (at your option) any later version.
60  
61 See the LICENSE file that comes with this distribution for more details.
62  
63 =cut
64  
65 ####################################################################################################
66  
67 sub register_commands
68 {
69 0 ▶ my ($class,$version)=@_;
Subroutine register_commands: not called CC=1 SCAR=6.9
Pod undocumented
70 0 my %tmp=(
71 check => [ \&check, \&check_parse ],
72 info => [ \&info, \&info_parse ],
73 transfer_query => [ \&transfer_query, \&transfer_parse ],
74 create => [ \&create, \&create_parse ],
75 delete => [ \&delete ],
76 transfer_request => [ \&transfer_request, \&transfer_parse ],
77 transfer_cancel => [ \&transfer_cancel,\&transfer_parse ],
78 transfer_answer => [ \&transfer_answer,\&transfer_parse ],
79 update => [ \&update ],
80 review_complete => [ undef, \&pandata_parse ],
81 );
82  
83 0 $tmp{check_multi}=$tmp{check};
84 0 return { 'contact' => \%tmp };
85 }
86  
87 sub build_command
88 {
89 0 ▶ my ($msg,$command,$contact)=@_;
Subroutine build_command: not called CC=12 SCAR=50.5
Pod undocumented
90 0 ▶ my @contact=(ref($contact) eq 'ARRAY')? @$contact : ($contact);
Branch: 1 branch
BranchTrueFalseTotal
ref $contact eq 'ARRAY' ? : 0 0 0
91 0 ▶ my @c=map { Net::DRI::Util::isa_contact($_)? $_->srid() : $_ } @contact;
Branch: 1 branch
BranchTrueFalseTotal
Net::DRI::Util::isa_contact($_) ? : 0 0 0
92  
93 0 ▶ Net::DRI::Exception->die(1,'protocol/EPP',2,'Contact id needed') unless @c;
Branch: 1 branch
BranchTrueFalseTotal
unless @c 0 0 0
94 0 foreach my $n (@c)
95 {
96 0 ▶ Net::DRI::Exception->die(1,'protocol/EPP',2,'Contact id needed') unless defined($n) && $n;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $n and $n 0 0 0
Condition0%0/3
defined $n and $n
!ll&&!rl&&r
000
MC/DC0%0/2
defined $n and $n
defined $n $n
Truth table0%0/3
A and B
A= defined $nB= $n
ABresult
0X0
100
111
97 0 ▶ Net::DRI::Exception->die(1,'protocol/EPP',10,'Invalid contact id: '.$n) unless Net::DRI::Util::xml_is_token($n,3,16);
Branch: 1 branch
BranchTrueFalseTotal
unless Net::DRI::Util::xml_is_token($n, 3, 16) 0 0 0
98 }
99  
100 0 ▶ my $tcommand=(ref($command))? $command->[0] : $command;
Branch: 1 branch
BranchTrueFalseTotal
ref $command ? : 0 0 0
101 0 $msg->command([$command,'contact:'.$tcommand, $msg->nsattrs('contact')]);
102  
103 0 my @d=map { ['contact:id',$_] } @c;
104  
105 0 ▶ if (($tcommand=~m/^(?:info|transfer)$/) && ref($contact[0]) && Net::DRI::Util::isa_contact($contact[0]))
Branch: 1 branch
BranchTrueFalseTotal
if ($tcommand =~ /^(?:info|transfer)$/ and ref $contact[0] and Net::DRI::Util::isa_contact($contact[0])) 0 0 0
Condition0%0/6
$tcommand =~ /^(?:info|transfer)$/ and ref $contact[0] and Net::DRI::Util::isa_contact($contact[0])
!ll&&!rl&&r
000
$tcommand =~ /^(?:info|transfer)$/ and ref $contact[0]
!ll&&!rl&&r
000
MC/DC0%0/3
$tcommand =~ /^(?:info|transfer)$/ and ref $contact[0] and Net::DRI::Util::isa_contact($contact[0])
$tcommand =~ /^(?:info|transfer)$/ ref $contact[0] Net::DRI::Util::isa_contact($contact[0])
Truth table0%0/4
A and B and C
A= $tcommand =~ /^(?:info|transfer)$/B= ref $contact[0]C= Net::DRI::Util::isa_contact($contact[0])
ABCresult
0XX0
10X0
1100
1111
106 {
107 0 push @d,build_authinfo($contact[0]);
108 }
109  
110 0 return @d;
111 }
112  
113 ####################################################################################################
114 ########### Query commands
115  
116 sub check
117 {
118 0 ▶ my ($epp,$c)=@_;
Subroutine check: not called CC=1 SCAR=6.9
Pod undocumented
119 0 my $mes=$epp->message();
120 0 my @d=build_command($mes,'check',$c);
121 0 $mes->command_body(\@d);
122 0 return;
123 }
124  
125 sub check_parse
126 {
127 0 ▶ my ($po,$otype,$oaction,$oname,$rinfo)=@_;
Subroutine check_parse: not called CC=7 SCAR=40.3
Pod undocumented
128 0 my $mes=$po->message();
129 0 ▶ return unless $mes->is_success();
Branch: 1 branch
BranchTrueFalseTotal
unless $mes->is_success 0 0 0
130  
131 0 my $chkdata=$mes->get_response('contact','chkData');
132 0 ▶ return unless defined $chkdata;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $chkdata 0 0 0
133 0 foreach my $cd ($chkdata->getChildrenByTagNameNS($mes->ns('contact'),'cd'))
134 {
135 0 my $contact;
136 0 foreach my $el (Net::DRI::Util::xml_list_children($cd))
137 {
138 0 my ($n,$c)=@$el;
139 0 ▶ if ($n eq 'id')
Branch: 1 branch
BranchTrueFalseTotal
if ($n eq "id") 0 0 0
140 {
141 0 $contact=$c->textContent();
142 0 $rinfo->{contact}->{$contact}->{action}='check';
143 0 $rinfo->{contact}->{$contact}->{exist}=1-Net::DRI::Util::xml_parse_boolean($c->getAttribute('avail'));
144 }
145 0 ▶ if ($n eq 'reason')
Branch: 1 branch
BranchTrueFalseTotal
if ($n eq "reason") 0 0 0
146 {
147 0 $rinfo->{contact}->{$contact}->{exist_reason}=$c->textContent();
148 }
149 }
150 }
151 0 return;
152 }
153  
154 sub info
155 {
156 0 ▶ my ($epp,$c)=@_;
Subroutine info: not called CC=1 SCAR=6.9
Pod undocumented
157 0 my $mes=$epp->message();
158 0 my @d=build_command($mes,'info',$c);
159 0 $mes->command_body(\@d);
160 0 return;
161 }
162  
163 sub info_parse
164 {
165 0 ▶ my ($po,$otype,$oaction,$oname,$rinfo)=@_;
Subroutine info_parse: not called CC=15 SCAR=54.8
Pod undocumented
166 0 my $mes=$po->message();
167 0 ▶ return unless $mes->is_success();
Branch: 1 branch
BranchTrueFalseTotal
unless $mes->is_success 0 0 0
168  
169 0 my $infdata=$mes->get_response('contact','infData');
170 0 ▶ return unless defined $infdata;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $infdata 0 0 0
171  
172 0 my %cd=map { $_ => [] } qw/name org city sp pc cc/;
173 0 $cd{street}=[[],[]];
174 0 my $contact=$po->create_local_object('contact');
175 0 my @s;
176  
177 0 foreach my $el (Net::DRI::Util::xml_list_children($infdata))
178 {
179 0 my ($name,$c)=@$el;
180 0 ▶ if ($name eq 'id')
Branch: 11 branches
BranchTrueFalseTotal
if ($name eq 'id') { } 0 0 0
elsif ($name eq 'roid') { } 0 0 0
elsif ($name eq 'status') { } 0 0 0
elsif ($name =~ /^(clID|crID|upID)$/) { } 0 0 0
elsif ($name =~ /^(crDate|upDate|trDate)$/) { } 0 0 0
elsif ($name eq 'email') { } 0 0 0
elsif ($name eq 'voice') { } 0 0 0
elsif ($name eq 'fax') { } 0 0 0
elsif ($name eq 'postalInfo') { } 0 0 0
elsif ($name eq 'authInfo') { } 0 0 0
elsif ($name eq 'disclose') { } 0 0 0
181 {
182 0 $oname=$c->textContent();
183 0 $rinfo->{contact}->{$oname}->{action}='info';
184 0 $rinfo->{contact}->{$oname}->{exist}=1;
185 0 $rinfo->{contact}->{$oname}->{id}=$oname;
186 0 $contact->srid($oname);
187 } elsif ($name eq 'roid')
188 {
189 0 $contact->roid($c->textContent());
190 0 $rinfo->{contact}->{$oname}->{roid}=$contact->roid();
191 } elsif ($name eq 'status')
192 {
193 0 push @s,Net::DRI::Protocol::EPP::Util::parse_node_status($c);
194 } elsif ($name=~m/^(clID|crID|upID)$/)
195 {
196 0 $rinfo->{contact}->{$oname}->{$1}=$c->textContent();
197 } elsif ($name=~m/^(crDate|upDate|trDate)$/)
198 {
199 0 $rinfo->{contact}->{$oname}->{$1}=$po->parse_iso8601($c->textContent());
200 } elsif ($name eq 'email')
201 {
202 0 $contact->email($c->textContent());
203 } elsif ($name eq 'voice')
204 {
205 0 $contact->voice(Net::DRI::Protocol::EPP::Util::parse_tel($c));
206 } elsif ($name eq 'fax')
207 {
208 0 $contact->fax(Net::DRI::Protocol::EPP::Util::parse_tel($c));
209 } elsif ($name eq 'postalInfo')
210 {
211 0 Net::DRI::Protocol::EPP::Util::parse_postalinfo($po,$c,\%cd);
212 } elsif ($name eq 'authInfo') ## we only try to parse the authInfo version defined in the RFC, other cases are to be handled by extensions
213 {
214 0 $contact->auth({pw => Net::DRI::Util::xml_child_content($c,$mes->ns('contact'),'pw')});
215 } elsif ($name eq 'disclose')
216 {
217 0 $contact->disclose(Net::DRI::Protocol::EPP::Util::parse_disclose($c));
218 }
219 }
220  
221 0 $contact->name(@{$cd{name}});
222 0 $contact->org(@{$cd{org}});
223 0 $contact->street(@{$cd{street}});
224 0 $contact->city(@{$cd{city}});
225 0 $contact->sp(@{$cd{sp}});
226 0 $contact->pc(@{$cd{pc}});
227 0 $contact->cc(@{$cd{cc}});
228  
229 0 $rinfo->{contact}->{$oname}->{status}=$po->create_local_object('status')->add(@s);
230 0 $rinfo->{contact}->{$oname}->{self}=$contact;
231 0 return;
232 }
233  
234 sub transfer_query
235 {
236 0 ▶ my ($epp,$c)=@_;
Subroutine transfer_query: not called CC=1 SCAR=6.9
Pod undocumented
237 0 my $mes=$epp->message();
238 0 my @d=build_command($mes,['transfer',{'op'=>'query'}],$c);
239 0 $mes->command_body(\@d);
240 0 return;
241 }
242  
243 sub transfer_parse
244 {
245 0 ▶ my ($po,$otype,$oaction,$oname,$rinfo)=@_;
Subroutine transfer_parse: not called CC=7 SCAR=40.3
Pod undocumented
246 0 my $mes=$po->message();
247 0 ▶ return unless $mes->is_success();
Branch: 1 branch
BranchTrueFalseTotal
unless $mes->is_success 0 0 0
248  
249 0 my $trndata=$mes->get_response('contact','trnData');
250 0 ▶ return unless defined $trndata;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $trndata 0 0 0
251  
252 0 foreach my $el (Net::DRI::Util::xml_list_children($trndata))
253 {
254 0 my ($name,$c)=@$el;
255 0 ▶ if ($name eq 'id')
Branch: 3 branches
BranchTrueFalseTotal
if ($name eq 'id') { } 0 0 0
elsif ($name =~ /^(trStatus|reID|acID)$/) { } 0 0 0
elsif ($name =~ /^(reDate|acDate)$/) { } 0 0 0
256 {
257 0 $oname=$c->textContent();
258 0 $rinfo->{contact}->{$oname}->{id}=$oname;
259 0 $rinfo->{contact}->{$oname}->{action}='transfer';
260 0 $rinfo->{contact}->{$oname}->{exist}=1;
261 } elsif ($name=~m/^(trStatus|reID|acID)$/)
262 {
263 0 $rinfo->{contact}->{$oname}->{$1}=$c->textContent();
264 } elsif ($name=~m/^(reDate|acDate)$/)
265 {
266 0 $rinfo->{contact}->{$oname}->{$1}=$po->parse_iso8601($c->textContent());
267 }
268 }
269 0 return;
270 }
271  
272 ############ Transform commands
273  
274 sub build_authinfo
275 {
276 0 ▶ my $contact=shift;
Subroutine build_authinfo: not called CC=4 SCAR=30.0
Pod undocumented
277 0 my $az=$contact->auth();
278 0 ▶ return () unless ($az && ref($az) && exists($az->{pw}));
Branch: 1 branch
BranchTrueFalseTotal
unless $az and ref $az and exists $az->{"pw"} 0 0 0
Condition0%0/6
$az and ref $az and exists $az->{"pw"}
!ll&&!rl&&r
000
$az and ref $az
!ll&&!rl&&r
000
MC/DC0%0/3
$az and ref $az and exists $az->{"pw"}
$az ref $az exists $az->{"pw"}
Truth table0%0/4
A and B and C
A= $azB= ref $azC= exists $az->{"pw"}
ABCresult
0XX0
10X0
1100
1111
279 0 return ['contact:authInfo',['contact:pw',$az->{pw}]];
280 }
281  
282 sub build_cdata
283 {
284 0 ▶ my ($contact,$v)=@_;
Subroutine build_cdata: not called CC=4 SCAR=30.0
Pod undocumented
285  
286 0 my @d=Net::DRI::Protocol::EPP::Util::build_postalinfo($contact,$v);
287  
288 0 ▶ push @d,Net::DRI::Protocol::EPP::Util::build_tel('contact:voice',$contact->voice()) if defined($contact->voice());
Branch: 1 branch
BranchTrueFalseTotal
if defined $contact->voice 0 0 0
289 0 ▶ push @d,Net::DRI::Protocol::EPP::Util::build_tel('contact:fax',$contact->fax()) if defined($contact->fax());
Branch: 1 branch
BranchTrueFalseTotal
if defined $contact->fax 0 0 0
290 0 ▶ push @d,['contact:email',$contact->email()] if defined($contact->email());
Branch: 1 branch
BranchTrueFalseTotal
if defined $contact->email 0 0 0
291 0 push @d,build_authinfo($contact);
292 0 push @d,Net::DRI::Protocol::EPP::Util::build_disclose($contact->disclose());
293  
294 0 return @d;
295 }
296  
297 sub create
298 {
299 0 ▶ my ($epp,$contact)=@_;
Subroutine create: not called CC=2 SCAR=17.9
Pod undocumented
300 0 my $mes=$epp->message();
301 0 my @d=build_command($mes,'create',$contact);
302  
303 0 ▶ Net::DRI::Exception->die(1,'protocol/EPP',10,'Invalid contact '.$contact) unless Net::DRI::Util::isa_contact($contact);
Branch: 1 branch
BranchTrueFalseTotal
unless Net::DRI::Util::isa_contact($contact) 0 0 0
304 0 $contact->validate(); ## will trigger an Exception if needed
305 0 push @d,build_cdata($contact,$epp->{contacti18n});
306 0 $mes->command_body(\@d);
307 0 return;
308 }
309  
310 sub create_parse
311 {
312 0 ▶ my ($po,$otype,$oaction,$oname,$rinfo)=@_;
Subroutine create_parse: not called CC=8 SCAR=42.8
Pod undocumented
313 0 my $mes=$po->message();
314 0 ▶ return unless $mes->is_success();
Branch: 1 branch
BranchTrueFalseTotal
unless $mes->is_success 0 0 0
315  
316 0 my $credata=$mes->get_response('contact','creData');
317 0 ▶ return unless defined $credata;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $credata 0 0 0
318  
319 0 foreach my $el (Net::DRI::Util::xml_list_children($credata))
320 {
321 0 my ($name,$c)=@$el;
322 0 ▶ if ($name eq 'id')
Branch: 2 branches
BranchTrueFalseTotal
if ($name eq 'id') { } 0 0 0
elsif ($name =~ /^(crDate)$/) { } 0 0 0
323 {
324 0 my $new=$c->textContent();
325 0 ▶ $rinfo->{contact}->{$oname}->{id}=$new if (defined $oname && ($oname ne $new)); ## registry may give another id than the one we requested or not take ours into account at all !
Branch: 1 branch
BranchTrueFalseTotal
if defined $oname and $oname ne $new 0 0 0
Condition0%0/3
defined $oname and $oname ne $new
!ll&&!rl&&r
000
MC/DC0%0/2
defined $oname and $oname ne $new
defined $oname $oname ne $new
Truth table0%0/3
A and B
A= defined $onameB= $oname ne $new
ABresult
0X0
100
111
326 0 $oname=$new;
327 0 $rinfo->{contact}->{$oname}->{id}=$oname;
328 0 $rinfo->{contact}->{$oname}->{action}='create';
329 0 $rinfo->{contact}->{$oname}->{exist}=1;
330 } elsif ($name=~m/^(crDate)$/)
331 {
332 0 $rinfo->{contact}->{$oname}->{$1}=$po->parse_iso8601($c->textContent());
333 }
334 }
335 0 return;
336 }
337  
338 sub delete ## no critic (Subroutines::ProhibitBuiltinHomonyms)
339 {
340 0 ▶ my ($epp,$contact)=@_;
Subroutine delete: not called CC=1 SCAR=6.9
Pod undocumented
341 0 my $mes=$epp->message();
342 0 my @d=build_command($mes,'delete',$contact);
343 0 $mes->command_body(\@d);
344 0 return;
345 }
346  
347 sub transfer_request
348 {
349 0 ▶ my ($epp,$c)=@_;
Subroutine transfer_request: not called CC=1 SCAR=6.9
Pod undocumented
350 0 my $mes=$epp->message();
351 0 my @d=build_command($mes,['transfer',{'op'=>'request'}],$c);
352 0 $mes->command_body(\@d);
353 0 return;
354 }
355  
356 sub transfer_cancel
357 {
358 0 ▶ my ($epp,$c)=@_;
Subroutine transfer_cancel: not called CC=1 SCAR=6.9
Pod undocumented
359 0 my $mes=$epp->message();
360 0 my @d=build_command($mes,['transfer',{'op'=>'cancel'}],$c);
361 0 $mes->command_body(\@d);
362 0 return;
363 }
364  
365 sub transfer_answer
366 {
367 0 ▶ my ($epp,$c,$ep)=@_;
Subroutine transfer_answer: not called CC=3 SCAR=24.8
Pod undocumented
368 0 my $mes=$epp->message();
369 0 ▶ my @d=build_command($mes,['transfer',{'op'=>((Net::DRI::Util::has_key($ep,'approve') && $ep->{approve})? 'approve' : 'reject' )}],$c);
Branch: 1 branch
BranchTrueFalseTotal
Net::DRI::Util::has_key($ep, 'approve') && $ep->{'approve'} ? : 0 0 0
Condition0%0/3
Net::DRI::Util::has_key($ep, "approve") and $ep->{"approve"}
!ll&&!rl&&r
000
MC/DC0%0/2
Net::DRI::Util::has_key($ep, "approve") and $ep->{"approve"}
Net::DRI::Util::has_key($ep, "approve") $ep->{"approve"}
Truth table0%0/3
A and B
A= Net::DRI::Util::has_key($ep, "approve")B= $ep->{"approve"}
ABresult
0X0
100
111
370 0 $mes->command_body(\@d);
371 0 return;
372 }
373  
374 sub update
375 {
376 0 ▶ my ($epp,$contact,$todo)=@_;
Subroutine update: not called CC=7 SCAR=40.3
Pod undocumented
377 0 my $mes=$epp->message();
378  
379 0 ▶ Net::DRI::Exception::usererr_invalid_parameters($todo.' must be a non empty Net::DRI::Data::Changes object') unless Net::DRI::Util::isa_changes($todo);
Branch: 1 branch
BranchTrueFalseTotal
unless Net::DRI::Util::isa_changes($todo) 0 0 0
380  
381 0 my $sadd=$todo->add('status');
382 0 my $sdel=$todo->del('status');
383  
384 0 my @d=build_command($mes,'update',$contact);
385 0 ▶ push @d,['contact:add',$sadd->build_xml('contact:status')] if Net::DRI::Util::isa_statuslist($sadd);
Branch: 1 branch
BranchTrueFalseTotal
if Net::DRI::Util::isa_statuslist($sadd) 0 0 0
386 0 ▶ push @d,['contact:rem',$sdel->build_xml('contact:status')] if Net::DRI::Util::isa_statuslist($sdel);
Branch: 1 branch
BranchTrueFalseTotal
if Net::DRI::Util::isa_statuslist($sdel) 0 0 0
387  
388 0 my $newc=$todo->set('info');
389 0 ▶ if (defined $newc)
Branch: 1 branch
BranchTrueFalseTotal
if (defined $newc) 0 0 0
390 {
391 0 ▶ Net::DRI::Exception->die(1,'protocol/EPP',10,'Invalid contact '.$newc) unless Net::DRI::Util::isa_contact($newc);
Branch: 1 branch
BranchTrueFalseTotal
unless Net::DRI::Util::isa_contact($newc) 0 0 0
392 0 $newc->validate(1); ## will trigger an Exception if needed
393 0 my @c=build_cdata($newc,$epp->{contacti18n});
394 0 ▶ push @d,['contact:chg',@c] if @c;
Branch: 1 branch
BranchTrueFalseTotal
if @c 0 0 0
395 }
396 0 $mes->command_body(\@d);
397 0 return;
398 }
399  
400 ####################################################################################################
401 ## RFC4933 §3.3 Offline Review of Requested Actions
402  
403 sub pandata_parse
404 {
405 0 ▶ my ($po,$otype,$oaction,$oname,$rinfo)=@_;
Subroutine pandata_parse: not called CC=8 SCAR=42.8
Pod undocumented
406 0 my $mes=$po->message();
407 0 ▶ return unless $mes->is_success();
Branch: 1 branch
BranchTrueFalseTotal
unless $mes->is_success 0 0 0
408  
409 0 my $pandata=$mes->get_response('contact','panData');
410 0 ▶ return unless defined $pandata;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $pandata 0 0 0
411  
412 0 foreach my $el (Net::DRI::Util::xml_list_children($pandata))
413 {
414 0 my ($name,$c)=@$el;
415 0 ▶ if ($name eq 'id')
Branch: 3 branches
BranchTrueFalseTotal
if ($name eq 'id') { } 0 0 0
elsif ($name eq 'paTRID') { } 0 0 0
elsif ($name eq 'paDate') { } 0 0 0
416 {
417 0 $oname=$c->textContent();
418 0 $rinfo->{contact}->{$oname}->{action}='review';
419 0 $rinfo->{contact}->{$oname}->{result}=Net::DRI::Util::xml_parse_boolean($c->getAttribute('paResult'));
420 } elsif ($name eq 'paTRID')
421 {
422 0 my $ns=$mes->ns('epp');
423 0 my $tmp=Net::DRI::Util::xml_child_content($c,$ns,'clTRID');
424 0 ▶ $rinfo->{contact}->{$oname}->{trid}=$tmp if defined $tmp;
Branch: 1 branch
BranchTrueFalseTotal
if defined $tmp 0 0 0
425 0 $rinfo->{contact}->{$oname}->{svtrid}=Net::DRI::Util::xml_child_content($c,$ns,'svTRID');
426 } elsif ($name eq 'paDate')
427 {
428 0 $rinfo->{contact}->{$oname}->{date}=$po->parse_iso8601($c->textContent());
429 }
430 }
431 0 return;
432 }
433  
434 ####################################################################################################
435 1 1;
« DRI/Data/Contact/COOP.pm ↑ Summary DRI/Protocol/EPP/Message.pm »