DRI/Protocol/EPP/Extensions/EURid/Domain.pm

filter: Statementstmt 8.9% 16 / 178 Branchbran 0.0% 0 / 114 Conditioncond 0.0% 0 / 42 MC/DCmcdc 0.0% 0 / 25 Subroutinesub 29.4% 5 / 17 Podpod 0.0% 0 / 12 totaltotal 5.4% 21 / 388 CC 79 SCAR 50.9
CC
79
Cov
5%
info_parse
342.0
update
306.0
transfer_request
132.0
CRAP 162.6
« DRI/Protocol/EPP/Extensions/DNSBE/Notifications.pm ↑ Summary DRI/Protocol/BookMyName/WS/Domain.pm »
1 ## Domain Registry Interface, EURid Domain EPP extension commands
2 ## (based on EURid registration_guidelines_v1_0E-epp.pdf)
3 ##
4 ## Copyright (c) 2005-2013,2015,2016,2018 Patrick Mevzek <netdri@dotandco.com>. All rights reserved.
5 ## 2014 Michael Kefeder <michael.kefeder@world4you.com>. All rights reserved.
6 ##
7 ## This file is part of Net::DRI
8 ##
9 ## Net::DRI is free software; you can redistribute it and/or modify
10 ## it under the terms of the GNU General Public License as published by
11 ## the Free Software Foundation; either version 2 of the License, or
12 ## (at your option) any later version.
13 ##
14 ## See the LICENSE file that comes with this distribution for more details.
15 ####################################################################################################
16  
17 package Net::DRI::Protocol::EPP::Extensions::EURid::Domain;
18  
19 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22 1 ▶use Net::DRI::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
23 1 ▶use Net::DRI::Exception;
Subroutine BEGIN: called CC=1 SCAR=0.0
24 1 ▶use Net::DRI::Protocol::EPP::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
25  
26 =pod
27  
28 =head1 NAME
29  
30 Net::DRI::Protocol::EPP::Extensions::EURid::Domain - EURid EPP Domain extension commands for Net::DRI
31  
32 =head1 DESCRIPTION
33  
34 Please see the README file for details.
35  
36 =head1 SUPPORT
37  
38 For now, support questions should be sent to:
39  
40 E<lt>netdri@dotandco.comE<gt>
41  
42 Please also see the SUPPORT file in the distribution.
43  
44 =head1 SEE ALSO
45  
46 E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt>
47  
48 =head1 AUTHOR
49  
50 Patrick Mevzek, E<lt>netdri@dotandco.comE<gt>
51  
52 =head1 COPYRIGHT
53  
54 Copyright (c) 2005-2013,2015,2016,2018 Patrick Mevzek <netdri@dotandco.com>.
55 2014 Michael Kefeder <michael.kefeder@world4you.com>.
56 All rights reserved.
57  
58 This program is free software; you can redistribute it and/or modify
59 it under the terms of the GNU General Public License as published by
60 the Free Software Foundation; either version 2 of the License, or
61 (at your option) any later version.
62  
63 See the LICENSE file that comes with this distribution for more details.
64  
65 =cut
66  
67 ####################################################################################################
68  
69 sub register_commands
70 {
71 0 ▶ my ($class,$version)=@_;
Subroutine register_commands: not called CC=1 SCAR=6.9
Pod undocumented
72 0 my %tmp=(
73 create => [ \&create, undef ],
74 update => [ \&update, undef ],
75 info => [ \&info, \&info_parse ],
76 delete => [ \&delete, undef ],
77 transfer_request => [ \&transfer_request, undef ],
78 renew => [ undef, \&renew_parse ],
79 );
80  
81 0 return { 'domain' => \%tmp };
82 }
83  
84 sub setup
85 {
86 0 ▶ my ($class,$po,$version)=@_;
Subroutine setup: not called CC=3 SCAR=24.8
Pod undocumented
87 0 foreach my $ns (qw/domain-ext/)
88 {
89 0 $po->ns({ $ns => 'http://www.eurid.eu/xml/epp/'.$ns.'-1.1' });
90 }
91 0 foreach my $ns (qw/authInfo/)
92 {
93 0 $po->ns({ $ns => 'http://www.eurid.eu/xml/epp/'.$ns.'-1.0' });
94 }
95 0 return;
96 }
97  
98 ####################################################################################################
99  
100 sub create
101 {
102 0 ▶ my ($epp,$domain,$rd)=@_;
Subroutine create: not called CC=5 SCAR=34.0
Pod undocumented
103 0 my $mes=$epp->message();
104 0 my $cs=$rd->{contact};
105  
106 0 my @n;
107 0 push @n,map { ['domain-ext:contact',$_->srid(),{'type'=>'onsite'}] } $cs->get('onsite');
108 0 ▶ push @n,add_nsgroup($rd->{nsgroup}) if Net::DRI::Util::has_key($rd,'nsgroup');
Branch: 1 branch
BranchTrueFalseTotal
if Net::DRI::Util::has_key($rd, "nsgroup") 0 0 0
109 0 ▶ push @n,['domain-ext:keygroup',$rd->{keygroup}] if Net::DRI::Util::has_key($rd,'keygroup') && Net::DRI::Util::xml_is_token($rd->{keygroup},1,100);
Branch: 1 branch
BranchTrueFalseTotal
if Net::DRI::Util::has_key($rd, "keygroup") and Net::DRI::Util::xml_is_token($rd->{"keygroup"}, 1, 100) 0 0 0
Condition0%0/3
Net::DRI::Util::has_key($rd, "keygroup") and Net::DRI::Util::xml_is_token($rd->{"keygroup"}, 1, 100)
!ll&&!rl&&r
000
MC/DC0%0/2
Net::DRI::Util::has_key($rd, "keygroup") and Net::DRI::Util::xml_is_token($rd->{"keygroup"}, 1, 100)
Net::DRI::Util::has_key($rd, "keygroup") Net::DRI::Util::xml_is_token($rd->{"keygroup"}, 1, 100)
Truth table0%0/3
A and B
A= Net::DRI::Util::has_key($rd, "keygroup")B= Net::DRI::Util::xml_is_token($rd->{"keygroup"}, 1, 100)
ABresult
0X0
100
111
110 ## TODO domain-ext-voucher
111  
112 0 ▶ return unless @n;
Branch: 1 branch
BranchTrueFalseTotal
unless @n 0 0 0
113  
114 0 my $eid=$mes->command_extension_register('domain-ext','create');
115 0 $mes->command_extension($eid,\@n);
116 0 return;
117 }
118  
119 sub update
120 {
121 0 ▶ my ($epp,$domain,$todo)=@_;
Subroutine update: not called CC=17 SCAR=57.2
Pod undocumented
122 0 my $mes=$epp->message();
123  
124 0 ▶ if (grep { ! /^(?:add|del)$/ } $todo->types('nsgroup'))
Branch: 1 branch
BranchTrueFalseTotal
if (grep {not /^(?:add|del)$/;} $todo->types("nsgroup")) 0 0 0
125 {
126 0 Net::DRI::Exception->die(0,'protocol/EPP',11,'Only nsgroup add/del available for domain');
127 }
128  
129 0 my $nsgadd=$todo->add('nsgroup');
130 0 my $nsgdel=$todo->del('nsgroup');
131 0 my $cadd=$todo->add('contact');
132 0 my $cdel=$todo->del('contact');
133 0 ▶ return unless ($nsgadd || $nsgdel || $cadd || $cdel);
Branch: 1 branch
BranchTrueFalseTotal
unless $nsgadd or $nsgdel or $cadd or $cdel 0 0 0
Condition0%0/9
$nsgadd or $nsgdel or $cadd or $cdel
l!l&&r!l&&!r
000
$nsgadd or $nsgdel or $cadd
l!l&&r!l&&!r
000
$nsgadd or $nsgdel
l!l&&r!l&&!r
000
MC/DC0%0/4
$nsgadd or $nsgdel or $cadd or $cdel
$nsgadd $nsgdel $cadd $cdel
Truth table0%0/5
A or B or C or D
A= $nsgaddB= $nsgdelC= $caddD= $cdel
ABCDresult
1XXX1
01XX1
001X1
00011
00000
134  
135 0 my @n;
136 0 ▶ if ($nsgadd || $cadd)
Branch: 1 branch
BranchTrueFalseTotal
if ($nsgadd or $cadd) 0 0 0
Condition0%0/3
$nsgadd or $cadd
l!l&&r!l&&!r
000
MC/DC0%0/2
$nsgadd or $cadd
$nsgadd $cadd
Truth table0%0/3
A or B
A= $nsgaddB= $cadd
ABresult
1X1
011
000
137 {
138 0 my @todo;
139 0 ▶ push @todo,add_nsgroup($nsgadd) if $nsgadd;
Branch: 1 branch
BranchTrueFalseTotal
if $nsgadd 0 0 0
140 0 ▶ push @todo,map { ['domain-ext:contact',$_->srid(),{'type'=>'onsite'}] } $cadd->get('onsite') if $cadd;
Branch: 1 branch
BranchTrueFalseTotal
if $cadd 0 0 0
141 0 ▶ push @n,['domain-ext:add',@todo] if @todo;
Branch: 1 branch
BranchTrueFalseTotal
if @todo 0 0 0
142 }
143 0 ▶ if ($nsgdel || $cdel)
Branch: 1 branch
BranchTrueFalseTotal
if ($nsgdel or $cdel) 0 0 0
Condition0%0/3
$nsgdel or $cdel
l!l&&r!l&&!r
000
MC/DC0%0/2
$nsgdel or $cdel
$nsgdel $cdel
Truth table0%0/3
A or B
A= $nsgdelB= $cdel
ABresult
1X1
011
000
144 {
145 0 my @todo;
146 0 ▶ push @todo,add_nsgroup($nsgdel) if $nsgdel;
Branch: 1 branch
BranchTrueFalseTotal
if $nsgdel 0 0 0
147 0 ▶ push @todo,map { ['domain-ext:contact',$_->srid(),{'type'=>'onsite'}] } $cdel->get('onsite') if $cdel;
Branch: 1 branch
BranchTrueFalseTotal
if $cdel 0 0 0
148 0 ▶ push @n,['domain-ext:rem',@todo] if @todo;
Branch: 1 branch
BranchTrueFalseTotal
if @todo 0 0 0
149 }
150 ## TODO : handle domain-ext:keygroup
151  
152 0 ▶ return unless @n;
Branch: 1 branch
BranchTrueFalseTotal
unless @n 0 0 0
153  
154 0 my $eid=$mes->command_extension_register('domain-ext','update');
155 0 $mes->command_extension($eid,\@n);
156 0 return;
157 }
158  
159 sub info
160 {
161 0 ▶ my ($epp,$domain,$rd)=@_;
Subroutine info: not called CC=3 SCAR=24.8
Pod undocumented
162 0 my $mes=$epp->message();
163  
164 0 ▶ return unless Net::DRI::Util::has_key($rd,'authinfo_request') && $rd->{authinfo_request};
Branch: 1 branch
BranchTrueFalseTotal
unless Net::DRI::Util::has_key($rd, "authinfo_request") and $rd->{"authinfo_request"} 0 0 0
Condition0%0/3
Net::DRI::Util::has_key($rd, "authinfo_request") and $rd->{"authinfo_request"}
!ll&&!rl&&r
000
MC/DC0%0/2
Net::DRI::Util::has_key($rd, "authinfo_request") and $rd->{"authinfo_request"}
Net::DRI::Util::has_key($rd, "authinfo_request") $rd->{"authinfo_request"}
Truth table0%0/3
A and B
A= Net::DRI::Util::has_key($rd, "authinfo_request")B= $rd->{"authinfo_request"}
ABresult
0X0
100
111
165  
166 0 my $eid=$mes->command_extension_register('authInfo','info');
167 0 $mes->command_extension($eid,['authInfo:request']);
168 0 return;
169 }
170  
171 sub info_parse
172 {
173 0 ▶ my ($po,$otype,$oaction,$oname,$rinfo)=@_;
Subroutine info_parse: not called CC=18 SCAR=58.3
Pod undocumented
174 0 my $mes=$po->message();
175  
176 0 ▶ return unless $mes->is_success();
Branch: 1 branch
BranchTrueFalseTotal
unless $mes->is_success 0 0 0
177  
178 0 my $infdata=$mes->get_extension('domain-ext','infData');
179 0 ▶ return unless defined $infdata;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $infdata 0 0 0
180  
181 0 my @nsg;
182 0 my $status=$rinfo->{domain}->{$oname}->{status};
183 0 my $contact=$rinfo->{domain}->{$oname}->{contact};
184 0 foreach my $el (Net::DRI::Util::xml_list_children($infdata))
185 {
186 0 my ($name,$c)=@$el;
187 0 ▶ if ($name=~m/^(onHold|quarantined)$/) ## onHold here has nothing to do with EPP client|serverHold, unfortunately
Branch: 6 branches
BranchTrueFalseTotal
if ($name =~ /^(onHold|quarantined)$/) { } 0 0 0
elsif ($name =~ /^(availableDate|deletionDate)$/) { } 0 0 0
elsif ($name eq 'contact') { } 0 0 0
elsif ($name eq 'nsgroup') { } 0 0 0
elsif ($name eq 'keygroup') { } 0 0 0
elsif ($name eq 'pendingTransfer') { } 0 0 0
188 {
189 0 ▶ $status->add($name) if Net::DRI::Util::xml_parse_boolean($c->textContent()); ## TODO : correct status name?
Branch: 1 branch
BranchTrueFalseTotal
if Net::DRI::Util::xml_parse_boolean($c->textContent) 0 0 0
190 } elsif ($name=~m/^(availableDate|deletionDate)$/)
191 {
192 0 $rinfo->{domain}->{$oname}->{$name}=$po->parse_iso8601($c->textContent());
193 } elsif ($name eq 'contact')
194 {
195 0 $contact->add($po->create_local_object('contact')->srid($c->textContent()),$c->getAttribute('type'));
196 } elsif ($name eq 'nsgroup')
197 {
198 0 push @nsg,$po->create_local_object('hosts')->name($c->textContent());
199 } elsif ($name eq 'keygroup')
200 {
201 0 $rinfo->{domain}->{$oname}->{keygroup}=$c->textContent();
202 } elsif ($name eq 'pendingTransfer')
203 {
204 0 $status->add('pendingTransfer');
205 0 my %p;
206 0 my $cs=$po->create_local_object('contactset');
207 0 my %ccache;
208 0 foreach my $subel (Net::DRI::Util::xml_list_children($c))
209 {
210 0 my ($subname,$subc)=@$subel;
211 0 ▶ if ($subname eq 'registrant')
Branch: 3 branches
BranchTrueFalseTotal
if ($subname eq 'registrant') { } 0 0 0
elsif ($subname eq 'contact') { } 0 0 0
elsif ($subname eq 'initiationDate') { } 0 0 0
212 {
213 0 my $id=$subc->textContent();
214 0 ▶ $ccache{$id}=$po->create_local_object('contact')->srid($id) unless exists $ccache{$id};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $ccache{$id} 0 0 0
215 0 $cs->set($ccache{$id},'registrant');
216 } elsif ($subname eq 'contact')
217 {
218 0 my $id=$subc->textContent();
219 0 ▶ $ccache{$id}=$po->create_local_object('contact')->srid($id) unless exists $ccache{$id};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $ccache{$id} 0 0 0
220 0 $cs->add($ccache{$id},$subc->getAttribute('type'));
221 } elsif ($subname eq 'initiationDate')
222 {
223 0 $p{initiationDate}=$po->parse_iso8601($subc->textContent());
224 }
225 }
226 0 $p{contact}=$cs;
227 0 $rinfo->{domain}->{$oname}->{pending_transaction}=\%p;
228 }
229 }
230 0 ▶ $rinfo->{domain}->{$oname}->{nsgroup}=\@nsg if @nsg;
Branch: 1 branch
BranchTrueFalseTotal
if @nsg 0 0 0
231 0 return;
232 }
233  
234 sub check_parse
235 {
236 0 ▶ my ($po,$otype,$oaction,$oname,$rinfo)=@_;
Subroutine check_parse: not called CC=8 SCAR=42.8
Pod undocumented
237 0 my $mes=$po->message();
238 0 ▶ return unless $mes->is_success();
Branch: 1 branch
BranchTrueFalseTotal
unless $mes->is_success 0 0 0
239  
240 0 my $chkdata=$mes->get_extension('domain-ext','chkData');
241 0 ▶ return unless defined $chkdata;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $chkdata 0 0 0
242  
243 0 my $ns=$mes->ns('domain-ext');
244 0 foreach my $cd ($chkdata->getChildrenByTagNameNS($ns,'domain'))
245 {
246 0 my $domain;
247 0 foreach my $el (Net::DRI::Util::xml_list_children($cd))
248 {
249 0 my ($n,$c)=@$el;
250 0 ▶ if ($n eq 'name')
Branch: 3 branches
BranchTrueFalseTotal
if ($n eq 'name') { } 0 0 0
elsif ($n eq 'availableDate') { } 0 0 0
elsif ($n eq 'status') { } 0 0 0
251 {
252 0 $domain=lc $c->textContent();
253 0 $rinfo->{domain}->{$domain}->{action}='check';
254 } elsif ($n eq 'availableDate')
255 {
256 0 $rinfo->{domain}->{$domain}->{availableDate}=$po->parse_iso8601($c->textContent());
257 } elsif ($n eq 'status')
258 {
259 0 $rinfo->{domain}->{$domain}->{status}=$po->create_local_object('status')->add(Net::DRI::Protocol::EPP::Util::parse_node_status($c));
260 }
261 }
262 }
263 0 return;
264 }
265  
266 sub delete ## no critic (Subroutines::ProhibitBuiltinHomonyms)
267 {
268 0 ▶ my ($epp,$domain,$rd)=@_;
Subroutine delete: not called CC=10 SCAR=47.0
Pod undocumented
269 0 my $mes=$epp->message();
270  
271 0 ▶ my $hasdelete=Net::DRI::Util::has_key($rd,'deleteDate') ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
Net::DRI::Util::has_key($rd, 'deleteDate') ? : 0 0 0
272 0 ▶ my $hascancel=(Net::DRI::Util::has_key($rd,'cancel') && $rd->{cancel}) ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
Net::DRI::Util::has_key($rd, 'cancel') && $rd->{'cancel'} ? : 0 0 0
Condition0%0/3
Net::DRI::Util::has_key($rd, "cancel") and $rd->{"cancel"}
!ll&&!rl&&r
000
MC/DC0%0/2
Net::DRI::Util::has_key($rd, "cancel") and $rd->{"cancel"}
Net::DRI::Util::has_key($rd, "cancel") $rd->{"cancel"}
Truth table0%0/3
A and B
A= Net::DRI::Util::has_key($rd, "cancel")B= $rd->{"cancel"}
ABresult
0X0
100
111
273  
274 0 ▶ return unless $hasdelete || $hascancel;
Branch: 1 branch
BranchTrueFalseTotal
unless $hasdelete or $hascancel 0 0 0
Condition0%0/3
$hasdelete or $hascancel
l!l&&r!l&&!r
000
MC/DC0%0/2
$hasdelete or $hascancel
$hasdelete $hascancel
Truth table0%0/3
A or B
A= $hasdeleteB= $hascancel
ABresult
1X1
011
000
275 0 ▶ Net::DRI::Exception::usererr_invalid_parameters('For domain_delete, parameters deleteDate & cancel can not be set at the same time') if $hasdelete && $hascancel;
Branch: 1 branch
BranchTrueFalseTotal
if $hasdelete and $hascancel 0 0 0
Condition0%0/3
$hasdelete and $hascancel
!ll&&!rl&&r
000
MC/DC0%0/2
$hasdelete and $hascancel
$hasdelete $hascancel
Truth table0%0/3
A and B
A= $hasdeleteB= $hascancel
ABresult
0X0
100
111
276  
277 0 my $eid=$mes->command_extension_register('domain-ext','delete');
278 0 my @n;
279  
280 0 ▶ if ($hasdelete)
Branch: 1 branch
BranchTrueFalseTotal
if ($hasdelete) 0 0 0
281 {
282 0 Net::DRI::Util::check_isa($rd->{deleteDate},'DateTime');
283 0 @n=(['domain-ext:schedule',['domain-ext:delDate',$rd->{deleteDate}->set_time_zone('UTC')->strftime('%Y-%m-%dT%T.%NZ')]]);
284 }
285 0 ▶ if ($hascancel)
Branch: 1 branch
BranchTrueFalseTotal
if ($hascancel) 0 0 0
286 {
287 0 @n=(['domain-ext:cancel']);
288 }
289  
290 0 $mes->command_extension($eid,\@n);
291 0 return;
292 }
293  
294 sub transfer_request
295 {
296 0 ▶ my ($epp,$domain,$rd)=@_;
Subroutine transfer_request: not called CC=11 SCAR=48.8
Pod undocumented
297 0 my $mes=$epp->message();
298  
299 0 my $eid=$mes->command_extension_register('domain-ext','transfer');
300 0 my @d;
301  
302 0 ▶ if (Net::DRI::Util::has_contact($rd))
Branch: 1 branch
BranchTrueFalseTotal
if (Net::DRI::Util::has_contact($rd)) 0 0 0
303 {
304 0 my $cs=$rd->{contact};
305 0 my $creg=$cs->get('registrant');
306 0 ▶ push @d,['domain-ext:registrant',$creg->srid()] if Net::DRI::Util::isa_contact($creg,'Net::DRI::Data::Contact::EURid');
Branch: 1 branch
BranchTrueFalseTotal
if Net::DRI::Util::isa_contact($creg, "Net::DRI::Data::Contact::EURid") 0 0 0
307 0 my $cbill=$cs->get('billing');
308 0 ▶ push @d,['domain-ext:contact',$cbill->srid(),{type => 'billing'}] if Net::DRI::Util::isa_contact($cbill,'Net::DRI::Data::Contact::EURid');
Branch: 1 branch
BranchTrueFalseTotal
if Net::DRI::Util::isa_contact($cbill, "Net::DRI::Data::Contact::EURid") 0 0 0
309 0 ▶ push @d,add_contact('tech',$cs,9) if $cs->has_type('tech');
Branch: 1 branch
BranchTrueFalseTotal
if $cs->has_type("tech") 0 0 0
310 0 ▶ push @d,add_contact('onsite',$cs,5) if $cs->has_type('onsite');
Branch: 1 branch
BranchTrueFalseTotal
if $cs->has_type("onsite") 0 0 0
311 }
312  
313 0 ▶ push @d,Net::DRI::Protocol::EPP::Util::build_ns($epp,$rd->{ns},$domain,'domain-ext') if Net::DRI::Util::has_ns($rd);
Branch: 1 branch
BranchTrueFalseTotal
if Net::DRI::Util::has_ns($rd) 0 0 0
314 0 ▶ push @d,add_nsgroup($rd->{nsgroup}) if Net::DRI::Util::has_key($rd,'nsgroup');
Branch: 1 branch
BranchTrueFalseTotal
if Net::DRI::Util::has_key($rd, "nsgroup") 0 0 0
315 ## TODO keygroup
316 ## push @n,['eurid:keygroup',$rd->{keygroup}] if Net::DRI::Util::has_key($rd,'keygroup') && Net::DRI::Util::xml_is_token($rd->{keygroup},1,100);
317  
318 0 $mes->command_extension($eid,['domain-ext:request',@d]);
319  
320 0 ▶ if ($epp->has_module('Net::DRI::Protocol::EPP::Extensions::SecDNS'))
Branch: 1 branch
BranchTrueFalseTotal
if ($epp->has_module("Net::DRI::Protocol::EPP::Extensions::SecDNS")) 0 0 0
321 {
322 0 my $ref=$epp->find_action_in_class('Net::DRI::Protocol::EPP::Extensions::SecDNS','domain','create');
323 0 ▶ $ref->($epp,$domain,$rd) if defined $ref && ref $ref;
Branch: 1 branch
BranchTrueFalseTotal
if defined $ref and ref $ref 0 0 0
Condition0%0/3
defined $ref and ref $ref
!ll&&!rl&&r
000
MC/DC0%0/2
defined $ref and ref $ref
defined $ref ref $ref
Truth table0%0/3
A and B
A= defined $refB= ref $ref
ABresult
0X0
100
111
324 }
325 0 return;
326 }
327  
328 sub add_nsgroup
329 {
330 0 ▶ my ($nsg)=@_;
Subroutine add_nsgroup: not called CC=8 SCAR=42.8
Pod undocumented
331 0 ▶ return unless (defined($nsg) && $nsg);
Branch: 1 branch
BranchTrueFalseTotal
unless defined $nsg and $nsg 0 0 0
Condition0%0/3
defined $nsg and $nsg
!ll&&!rl&&r
000
MC/DC0%0/2
defined $nsg and $nsg
defined $nsg $nsg
Truth table0%0/3
A and B
A= defined $nsgB= $nsg
ABresult
0X0
100
111
332 0 ▶ my @a=grep { defined($_) && $_ && !ref($_) && Net::DRI::Util::xml_is_normalizedstring($_,1,100) } map { Net::DRI::Util::isa_nsgroup($_)? $_->name() : $_ } (ref($nsg) eq 'ARRAY')? @$nsg : ($nsg);
Branch: 3 branches
BranchTrueFalseTotal
defined $_ and $_ and not ref $_ and Net::DRI::Util::xml_is_normalizedstring($_, 1, 100) 0 0 0
Net::DRI::Util::isa_nsgroup($_) ? : 0 0 0
ref $nsg eq 'ARRAY' ? : 0 0 0
Condition0%0/6
defined $_ and $_ and not ref $_
!ll&&!rl&&r
000
defined $_ and $_
!ll&&!rl&&r
000
MC/DC0%0/3
defined $_ and $_ and not ref $_
defined $_ $_ not ref $_
Truth table0%0/4
A and B and not(C)
A= defined $_B= $_C= not ref $_
ABCresult
0XX0
10X0
1100
1111
333 0 return map { ['domain-ext:nsgroup',$_] } grep {defined} @a[0..8];
334 }
335  
336 sub add_contact
337 {
338 0 ▶ my ($type,$cs,$max)=@_;
Subroutine add_contact: not called CC=1 SCAR=6.9
Pod undocumented
339 0 my @r=grep { Net::DRI::Util::isa_contact($_,'Net::DRI::Data::Contact::EURid') } ($cs->get($type));
340 0 return map { ['domain-ext:contact',$_->srid(),{type=>$type}] } grep { defined } @r[0..($max-1)];
341 }
342  
343 sub renew_parse
344 {
345 0 ▶ my ($po,$otype,$oaction,$oname,$rinfo)=@_;
Subroutine renew_parse: not called CC=5 SCAR=34.0
Pod undocumented
346 0 my $mes=$po->message();
347 0 ▶ return unless $mes->is_success();
Branch: 1 branch
BranchTrueFalseTotal
unless $mes->is_success 0 0 0
348  
349 0 my $rendata=$mes->get_extension('domain-ext','renData');
350 0 ▶ return unless defined $rendata;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $rendata 0 0 0
351  
352 0 foreach my $el (Net::DRI::Util::xml_list_children($rendata))
353 {
354 0 my ($name,$c)=@$el;
355 0 ▶ if ($name=~m/^(removedDeletionDate)$/)
Branch: 1 branch
BranchTrueFalseTotal
if ($name =~ /^(removedDeletionDate)$/) 0 0 0
356 {
357 0 $rinfo->{domain}->{$oname}->{$1}=Net::DRI::Util::xml_parse_boolean($c->textContent());
358 }
359 }
360 0 return;
361 }
362  
363 ####################################################################################################
364 1 1;
« DRI/Protocol/EPP/Extensions/DNSBE/Notifications.pm ↑ Summary DRI/Protocol/BookMyName/WS/Domain.pm »