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

filter: Statementstmt 14.0% 25 / 178 Branchbran 0.0% 0 / 94 Conditioncond 0.0% 0 / 120 MC/DCmcdc 0.0% 0 / 64 Subroutinesub 44.4% 8 / 18 Podpod 0.0% 0 / 10 totaltotal 6.8% 33 / 484 CC 90 SCAR 54.3
CC
90
Cov
6%
delete
552.0
transfer_execute
306.0
transfer_request
210.0
CRAP 228.9
« DRI/Protocol/EPP/Extensions/ResellerObject.pm ↑ Summary DRI/Data/Contact/BE.pm »
1 ## Domain Registry Interface, .NO Domain extensions
2 ##
3 ## Copyright (c) 2008-2010,2013-2014 UNINETT Norid AS, E<lt>http://www.norid.noE<gt>,
4 ## Trond Haugen E<lt>info@norid.noE<gt>
5 ## (c) 2016,2018 Patrick Mevzek E<lt>netdri@dotandco.comE<gt>
6 ## All rights reserved.
7 ##
8 ## This file is part of Net::DRI
9 ##
10 ## Net::DRI is free software; you can redistribute it and/or modify
11 ## it under the terms of the GNU General Public License as published by
12 ## the Free Software Foundation; either version 2 of the License, or
13 ## (at your option) any later version.
14 ##
15 ## See the LICENSE file that comes with this distribution for more details.
16 ####################################################################################################
17  
18 package Net::DRI::Protocol::EPP::Extensions::NO::Domain;
19  
20 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 1 ▶use Net::DRI::DRD::NORID;
Subroutine BEGIN: called CC=1 SCAR=0.0
24 1 ▶use Net::DRI::Protocol::EPP::Core::Domain;
Subroutine BEGIN: called CC=1 SCAR=0.0
25 1 ▶use Net::DRI::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
26 1 ▶use Net::DRI::Exception;
Subroutine BEGIN: called CC=1 SCAR=0.0
27 1 ▶use Net::DRI::Protocol::EPP::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
28 1 ▶use Net::DRI::Protocol::EPP::Extensions::NO::Host;
Subroutine BEGIN: called CC=1 SCAR=0.0
29  
30 =pod
31  
32 =head1 NAME
33  
34 Net::DRI::Protocol::EPP::Extensions::NO::Domain - .NO EPP Domain extension commands for Net::DRI
35  
36 =head1 DESCRIPTION
37  
38 Please see the README file for details.
39  
40 =head1 SUPPORT
41  
42 For now, support questions should be sent to:
43  
44 E<lt>netdri@dotandco.comE<gt>
45  
46 Please also see the SUPPORT file in the distribution.
47  
48 =head1 SEE ALSO
49  
50 E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt>
51  
52 =head1 AUTHOR
53  
54 Trond Haugen, E<lt>info@norid.noE<gt>
55  
56 =head1 COPYRIGHT
57  
58 Copyright (c) 2008-2010,2013-2014 UNINETT Norid AS, E<lt>http://www.norid.noE<gt>,
59 Trond Haugen E<lt>info@norid.noE<gt>
60 (c) 2016,2018 Patrick Mevzek E<lt>netdri@dotandco.comE<gt>
61 All rights reserved.
62  
63 This program is free software; you can redistribute it and/or modify
64 it under the terms of the GNU General Public License as published by
65 the Free Software Foundation; either version 2 of the License, or
66 (at your option) any later version.
67  
68 See the LICENSE file that comes with this distribution for more details.
69  
70 =cut
71  
72 ####################################################################################################
73  
74 sub register_commands {
75 0 ▶ my ( $class, $version ) = @_;
Subroutine register_commands: not called CC=1 SCAR=6.9
Pod undocumented
76 0 my %tmp = (
77 check => [ \&facet, undef ],
78 info => [ \&facet, \&parse_info ],
79 transfer_cancel => [ \&facet, undef ],
80 transfer_query => [ \&facet, undef ],
81 renew => [ \&facet, undef ],
82  
83 create => [ \&create, undef ],
84 update => [ \&update, undef ],
85 delete => [ \&delete, undef ],
86 transfer_request => [ \&transfer_request, undef ],
87 transfer_execute => [
88 \&transfer_execute,
89 \&Net::DRI::Protocol::EPP::Core::Domain::transfer_parse
90 ],
91 withdraw => [ \&withdraw, undef ],
92 );
93 0 return { 'domain' => \%tmp };
94 }
95  
96 ####################################################################################################
97  
98 sub facet {
99 0 ▶ my ( $epp, $o, $rd ) = @_;
Subroutine facet: not called CC=1 SCAR=6.9
Pod undocumented
100  
101 0 return Net::DRI::Protocol::EPP::Extensions::NO::Host::build_facets( $epp, $rd );
102 }
103  
104 sub applicant_dataset {
105 0 ▶ my ( $epp, $command, $rd ) = @_;
Subroutine applicant_dataset: not called CC=10 SCAR=47.0
Pod undocumented
106  
107 0 my @e;
108  
109 0 ▶ return unless ( ref $rd eq 'HASH' && defined $rd->{applicantdataset} && keys %{$rd->{applicantdataset}} );
Branch: 1 branch
BranchTrueFalseTotal
unless ref $rd eq "HASH" and defined $rd->{"applicantdataset"} and keys %{$$rd{"applicantdataset"};} 0 0 0
Condition0%0/6
ref $rd eq "HASH" and defined $rd->{"applicantdataset"} and keys %{$$rd{"applicantdataset"};}
!ll&&!rl&&r
000
ref $rd eq "HASH" and defined $rd->{"applicantdataset"}
!ll&&!rl&&r
000
MC/DC0%0/3
ref $rd eq "HASH" and defined $rd->{"applicantdataset"} and keys %{$$rd{"applicantdataset"};}
ref $rd eq "HASH" defined $rd->{"applicantdataset"} keys %{$$rd{"applicantdataset"};}
Truth table0%0/4
A and B and C
A= ref $rd eq "HASH"B= defined $rd->{"applicantdataset"}C= keys %{$$rd{"applicantdataset"};}
ABCresult
0XX0
10X0
1100
1111
110  
111 0 ▶ return unless ($command eq 'create' || $command eq 'update');
Branch: 1 branch
BranchTrueFalseTotal
unless $command eq "create" or $command eq "update" 0 0 0
Condition0%0/3
$command eq "create" or $command eq "update"
l!l&&r!l&&!r
000
MC/DC0%0/2
$command eq "create" or $command eq "update"
$command eq "create" $command eq "update"
Truth table0%0/3
A or B
A= $command eq "create"B= $command eq "update"
ABresult
1X1
011
000
112  
113 0 my $r = $rd->{applicantdataset};
114  
115 # Check precense of all mandatory elements.
116 # All fields except registrarref are required to have a value.
117 0 foreach my $el ( qw / versionnumber acceptname acceptdate /) {
118 0 ▶ unless ( $r->{$el} ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($r->{$el}) 0 0 0
119 0 Net::DRI::Exception->die(0,'protocol/EPP',1,"applicantdataset is missing a mandatory element: $el");
120 }
121 }
122  
123 0 my $versionnumber = $r->{versionnumber};
124 0 my $acceptname = $r->{acceptname};
125 0 my $acceptdate = $r->{acceptdate};
126  
127 0 my $mes = $epp->message();
128  
129 0 my $eid = $mes->command_extension_register('no-ext-domain', $command);
130  
131 0 my @te;
132 0 push @te, [ "no-ext-domain:versionNumber", $versionnumber ];
133 0 push @te, [ "no-ext-domain:acceptName" , $acceptname ];
134 0 push @te, [ "no-ext-domain:acceptDate" , $acceptdate ];
135  
136 0 ▶ if ($command eq 'create') {
Branch: 2 branches
BranchTrueFalseTotal
if ($command eq 'create') { } 0 0 0
elsif ($command eq 'update') { } 0 0 0
137 0 push @e, [ 'no-ext-domain:applicantDataset', @te ];
138 } elsif ($command eq 'update') {
139 0 push @e, [ 'no-ext-domain:chg', [ 'no-ext-domain:applicantDataset', @te ] ];
140 }
141 0 return $mes->command_extension( $eid, \@e );
142 }
143  
144 sub parse_info {
145 0 ▶ my ( $po, $otype, $oaction, $oname, $rinfo ) = @_;
Subroutine parse_info: not called CC=9 SCAR=45.0
Pod undocumented
146 0 my $mes = $po->message();
147 0 ▶ return unless $mes->is_success();
Branch: 1 branch
BranchTrueFalseTotal
unless $mes->is_success 0 0 0
148  
149 0 my $NS = $mes->ns('no-ext-domain');
150  
151 0 my $c = $rinfo->{domain}->{$oname}->{self};
152  
153 0 my $adata = $mes->get_extension('no-ext-domain','infData');
154  
155 0 ▶ return unless $adata;
Branch: 1 branch
BranchTrueFalseTotal
unless $adata 0 0 0
156  
157 0 for my $t ('versionNumber', 'acceptName', 'acceptDate', 'updateClientID', 'updateDate') {
158 0 my $el = $adata->getElementsByTagNameNS( $NS, $t );
159 0 ▶ my $v = $el ? $el->get_node(1)->getFirstChild()->getData() : undef;
Branch: 1 branch
BranchTrueFalseTotal
$el ? : 0 0 0
160 # Transform the dates to date objects
161 0 ▶ if (defined $v && $v && ($t eq 'acceptDate' || $t eq 'updateDate')) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $v and $v and $t eq "acceptDate" || $t eq "updateDate") 0 0 0
Condition0%0/9
defined $v and $v and $t eq "acceptDate" || $t eq "updateDate"
!ll&&!rl&&r
000
defined $v and $v
!ll&&!rl&&r
000
$t eq "acceptDate" or $t eq "updateDate"
l!l&&r!l&&!r
000
MC/DC0%0/4
defined $v and $v and $t eq "acceptDate" || $t eq "updateDate"
defined $v $v $t eq "acceptDate" $t eq "updateDate"
Truth table0%0/5
A and B and C or D
A= defined $vB= $vC= $t eq "acceptDate"D= $t eq "updateDate"
ABCDresult
0XXX0
10XX0
11000
111X1
11011
162 0 $v = $po->parse_iso8601($v);
163 }
164 0 $rinfo->{domain}->{$oname}->{applicantDataset}->{$t} = $v;
165 }
166 0 return;
167 }
168  
169 sub create {
170 0 ▶ my ( $epp, $domain, $rd ) = @_;
Subroutine create: not called CC=8 SCAR=42.8
Pod undocumented
171  
172 0 my $fs = $rd->{facets};
173 0 my $ds = $rd->{applicantdataset};
174  
175 0 ▶ return unless ( defined($fs) && $fs || defined($ds) && $ds );
Branch: 1 branch
BranchTrueFalseTotal
unless defined $fs and $fs or defined $ds and $ds 0 0 0
Condition0%0/9
defined $fs and $fs or defined $ds and $ds
l!l&&r!l&&!r
000
defined $fs and $fs
!ll&&!rl&&r
000
defined $ds and $ds
!ll&&!rl&&r
000
MC/DC0%0/4
defined $fs and $fs or defined $ds and $ds
defined $fs $fs defined $ds $ds
Truth table0%0/7
A and B or C and D
A= defined $fsB= $fsC= defined $dsD= $ds
ABCDresult
11XX1
0X111
10111
0X0X0
0X100
100X0
10100
176  
177 0 my $r;
178  
179 0 ▶ if (defined($ds) && $ds) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $ds and $ds) 0 0 0
Condition0%0/3
defined $ds and $ds
!ll&&!rl&&r
000
MC/DC0%0/2
defined $ds and $ds
defined $ds $ds
Truth table0%0/3
A and B
A= defined $dsB= $ds
ABresult
0X0
100
111
180 0 $r = applicant_dataset($epp, 'create', $rd);
181 }
182  
183 0 ▶ if ($fs) {
Branch: 1 branch
BranchTrueFalseTotal
if ($fs) 0 0 0
184 0 my $rd;
185 0 $rd->{facets} = $fs;
186 0 $r = facet($epp, $domain, $rd);
187 }
188 0 return $r;
189 }
190  
191  
192 sub update {
193 0 ▶ my ( $epp, $domain, $todo ) = @_;
Subroutine update: not called CC=8 SCAR=42.8
Pod undocumented
194  
195 0 my $fs = $todo->set('facets');
196 0 my $ds = $todo->set('applicantdataset');
197  
198 0 ▶ return unless ( defined($fs) && $fs || defined($ds) && $ds );
Branch: 1 branch
BranchTrueFalseTotal
unless defined $fs and $fs or defined $ds and $ds 0 0 0
Condition0%0/9
defined $fs and $fs or defined $ds and $ds
l!l&&r!l&&!r
000
defined $fs and $fs
!ll&&!rl&&r
000
defined $ds and $ds
!ll&&!rl&&r
000
MC/DC0%0/4
defined $fs and $fs or defined $ds and $ds
defined $fs $fs defined $ds $ds
Truth table0%0/7
A and B or C and D
A= defined $fsB= $fsC= defined $dsD= $ds
ABCDresult
11XX1
0X111
10111
0X0X0
0X100
100X0
10100
199  
200 0 my $r;
201  
202 0 ▶ if (defined($ds) && $ds) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $ds and $ds) 0 0 0
Condition0%0/3
defined $ds and $ds
!ll&&!rl&&r
000
MC/DC0%0/2
defined $ds and $ds
defined $ds $ds
Truth table0%0/3
A and B
A= defined $dsB= $ds
ABresult
0X0
100
111
203 0 my $rd;
204 0 $rd->{applicantdataset} = $ds;
205 0 $r = applicant_dataset($epp, 'update', $rd);
206 }
207  
208 0 ▶ if ($fs) {
Branch: 1 branch
BranchTrueFalseTotal
if ($fs) 0 0 0
209 0 my $rd;
210 0 $rd->{facets} = $fs;
211 0 $r = facet($epp, $domain, $rd);
212 }
213 0 return $r;
214 }
215  
216  
217 sub delete { ## no critic (Subroutines::ProhibitBuiltinHomonyms)
218 0 ▶ my ( $epp, $domain, $rd ) = @_;
Subroutine delete: not called CC=23 SCAR=63.1
Pod undocumented
219 0 my $mes = $epp->message();
220  
221 0 my $ddate = $rd->{deleteDate};
222 0 my $dfd = $rd->{deletefromdns};
223 0 my $dfr = $rd->{deletefromregistry};
224 0 my $fs = $rd->{facets};
225  
226 0 ▶ return unless ( ( defined($dfd) || defined($dfr) || defined($fs) ) && ( $dfd || $dfr || $fs ) );
Branch: 1 branch
BranchTrueFalseTotal
unless defined $dfd || defined $dfr || defined $fs and $dfd || $dfr || $fs 0 0 0
Condition0%0/15
defined $dfd || defined $dfr || defined $fs and $dfd || $dfr || $fs
!ll&&!rl&&r
000
defined $dfd or defined $dfr or defined $fs
l!l&&r!l&&!r
000
defined $dfd or defined $dfr
l!l&&r!l&&!r
000
$dfd or $dfr or $fs
l!l&&r!l&&!r
000
$dfd or $dfr
l!l&&r!l&&!r
000
MC/DC0%0/6
defined $dfd || defined $dfr || defined $fs and $dfd || $dfr || $fs
defined $dfd defined $dfr defined $fs $dfd $dfr $fs
Truth table0%0/13
A or B or C and D or E or F
A= defined $dfdB= defined $dfrC= defined $fsD= $dfdE= $dfrF= $fs
ABCDEFresult
000XXX0
1XX0000
01X0000
0010000
1XX1XX1
1XX01X1
1XX0011
01X1XX1
01X01X1
01X0011
0011XX1
00101X1
0010011
227  
228 0 ▶ if (defined($dfd) && ref($dfd)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $dfd and ref $dfd) 0 0 0
Condition0%0/3
defined $dfd and ref $dfd
!ll&&!rl&&r
000
MC/DC0%0/2
defined $dfd and ref $dfd
defined $dfd ref $dfd
Truth table0%0/3
A and B
A= defined $dfdB= ref $dfd
ABresult
0X0
100
111
229 0 Net::DRI::Util::check_isa($dfd,'DateTime');
230 0 $dfd = $dfd->set_time_zone('CET')->strftime('%Y-%m-%d');
231 }
232 0 ▶ if (defined($dfr) && ref($dfr)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $dfr and ref $dfr) 0 0 0
Condition0%0/3
defined $dfr and ref $dfr
!ll&&!rl&&r
000
MC/DC0%0/2
defined $dfr and ref $dfr
defined $dfr ref $dfr
Truth table0%0/3
A and B
A= defined $dfrB= ref $dfr
ABresult
0X0
100
111
233 0 Net::DRI::Util::check_isa($dfr,'DateTime');
234 0 $dfr = $dfr->set_time_zone('CET')->strftime('%Y-%m-%d');
235 }
236 0 ▶ if (defined($ddate)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $ddate) 0 0 0
237 0 ▶ if (ref($ddate)) {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $ddate) 0 0 0
238 0 Net::DRI::Util::check_isa($ddate,'DateTime');
239 0 $ddate = $ddate->set_time_zone('CET')->strftime('%Y-%m-%d');
240 }
241 0 ▶ $dfd = $ddate if !$dfd;
Branch: 1 branch
BranchTrueFalseTotal
unless $dfd 0 0 0
242 0 ▶ $dfr = $ddate if !$dfr;
Branch: 1 branch
BranchTrueFalseTotal
unless $dfr 0 0 0
243 }
244  
245 0 my $r;
246 0 ▶ if ( $dfd || $dfr ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($dfd or $dfr) 0 0 0
Condition0%0/3
$dfd or $dfr
l!l&&r!l&&!r
000
MC/DC0%0/2
$dfd or $dfr
$dfd $dfr
Truth table0%0/3
A or B
A= $dfdB= $dfr
ABresult
1X1
011
000
247 0 my $eid = $mes->command_extension_register('no-ext-domain', 'delete');
248 0 my @e;
249 0 ▶ push @e, [ 'no-ext-domain:deleteFromDNS', $dfd ] if ( defined($dfd) && $dfd );
Branch: 1 branch
BranchTrueFalseTotal
if defined $dfd and $dfd 0 0 0
Condition0%0/3
defined $dfd and $dfd
!ll&&!rl&&r
000
MC/DC0%0/2
defined $dfd and $dfd
defined $dfd $dfd
Truth table0%0/3
A and B
A= defined $dfdB= $dfd
ABresult
0X0
100
111
250 0 ▶ push @e, [ 'no-ext-domain:deleteFromRegistry', $dfr ] if ( defined($dfr) && $dfr );
Branch: 1 branch
BranchTrueFalseTotal
if defined $dfr and $dfr 0 0 0
Condition0%0/3
defined $dfr and $dfr
!ll&&!rl&&r
000
MC/DC0%0/2
defined $dfr and $dfr
defined $dfr $dfr
Truth table0%0/3
A and B
A= defined $dfrB= $dfr
ABresult
0X0
100
111
251  
252 0 ▶ $r = $mes->command_extension( $eid, \@e ) if (@e);
Branch: 1 branch
BranchTrueFalseTotal
if @e 0 0 0
253 }
254 0 ▶ if ($fs) {
Branch: 1 branch
BranchTrueFalseTotal
if ($fs) 0 0 0
255 0 $r = facet($epp, $domain, $rd);
256 }
257 0 return $r;
258  
259 }
260  
261  
262 sub transfer_request {
263 0 ▶ my ( $epp, $domain, $rd ) = @_;
Subroutine transfer_request: not called CC=14 SCAR=53.5
Pod undocumented
264 0 my $mes = $epp->message();
265  
266 0 my $mp = $rd->{mobilephone};
267 0 my $em = $rd->{email};
268 0 my $fs = $rd->{facets};
269  
270 0 ▶ return unless ( ( defined($mp) || defined($em) || defined($fs) ) && ( $mp || $em || $fs) );
Branch: 1 branch
BranchTrueFalseTotal
unless defined $mp || defined $em || defined $fs and $mp || $em || $fs 0 0 0
Condition0%0/15
defined $mp || defined $em || defined $fs and $mp || $em || $fs
!ll&&!rl&&r
000
defined $mp or defined $em or defined $fs
l!l&&r!l&&!r
000
defined $mp or defined $em
l!l&&r!l&&!r
000
$mp or $em or $fs
l!l&&r!l&&!r
000
$mp or $em
l!l&&r!l&&!r
000
MC/DC0%0/6
defined $mp || defined $em || defined $fs and $mp || $em || $fs
defined $mp defined $em defined $fs $mp $em $fs
Truth table0%0/13
A or B or C and D or E or F
A= defined $mpB= defined $emC= defined $fsD= $mpE= $emF= $fs
ABCDEFresult
000XXX0
1XX0000
01X0000
0010000
1XX1XX1
1XX01X1
1XX0011
01X1XX1
01X01X1
01X0011
0011XX1
00101X1
0010011
271  
272 0 my $r;
273 0 ▶ if ($mp || $em) {
Branch: 1 branch
BranchTrueFalseTotal
if ($mp or $em) 0 0 0
Condition0%0/3
$mp or $em
l!l&&r!l&&!r
000
MC/DC0%0/2
$mp or $em
$mp $em
Truth table0%0/3
A or B
A= $mpB= $em
ABresult
1X1
011
000
274 0 my $eid = $mes->command_extension_register('no-ext-domain', 'transfer');
275  
276 0 my @d;
277 0 ▶ push @d,
Branch: 1 branch
BranchTrueFalseTotal
if defined $mp and $mp 0 0 0
Condition0%0/3
defined $mp and $mp
!ll&&!rl&&r
000
MC/DC0%0/2
defined $mp and $mp
defined $mp $mp
Truth table0%0/3
A and B
A= defined $mpB= $mp
ABresult
0X0
100
111
278 Net::DRI::Protocol::EPP::Util::build_tel(
279 'no-ext-domain:mobilePhone', $mp )
280 if ( defined($mp) && $mp );
281 0 ▶ push @d, [ 'no-ext-domain:email', $em ] if ( defined($em) && $em );
Branch: 1 branch
BranchTrueFalseTotal
if defined $em and $em 0 0 0
Condition0%0/3
defined $em and $em
!ll&&!rl&&r
000
MC/DC0%0/2
defined $em and $em
defined $em $em
Truth table0%0/3
A and B
A= defined $emB= $em
ABresult
0X0
100
111
282  
283 0 my @e;
284 0 push @e, [ 'no-ext-domain:notify', @d ];
285 0 $r = $mes->command_extension( $eid, \@e );
286  
287 }
288 0 ▶ if ($fs) {
Branch: 1 branch
BranchTrueFalseTotal
if ($fs) 0 0 0
289 0 $r = facet($epp, $domain, $rd);
290 }
291  
292 0 return $r;
293  
294 }
295  
296  
297 sub withdraw {
298 0 ▶ my ( $epp, $domain, $rd ) = @_;
Subroutine withdraw: not called CC=8 SCAR=42.8
Pod undocumented
299 0 my $mes = $epp->message();
300  
301 0 my $transaction;
302 0 ▶ $transaction = $rd->{transactionname} if $rd->{transactionname};
Branch: 1 branch
BranchTrueFalseTotal
if $rd->{"transactionname"} 0 0 0
303  
304 0 my $fs = $rd->{facets};
305  
306 0 ▶ return unless ( $transaction && $transaction eq 'withdraw');
Branch: 1 branch
BranchTrueFalseTotal
unless $transaction and $transaction eq "withdraw" 0 0 0
Condition0%0/3
$transaction and $transaction eq "withdraw"
!ll&&!rl&&r
000
MC/DC0%0/2
$transaction and $transaction eq "withdraw"
$transaction $transaction eq "withdraw"
Truth table0%0/3
A and B
A= $transactionB= $transaction eq "withdraw"
ABresult
0X0
100
111
307  
308 0 ▶ Net::DRI::Exception::usererr_insufficient_parameters(
Branch: 1 branch
BranchTrueFalseTotal
unless defined $domain and $domain 0 0 0
Condition0%0/3
defined $domain and $domain
!ll&&!rl&&r
000
MC/DC0%0/2
defined $domain and $domain
defined $domain $domain
Truth table0%0/3
A and B
A= defined $domainB= $domain
ABresult
0X0
100
111
309 'Witdraw command requires a domain name')
310 unless ( defined($domain) && $domain );
311  
312 0 my $r;
313  
314 0 my $eid = $mes->command_extension_register( 'no-ext-epp', 'command');
315  
316 0 $r=$mes->command_extension(
317 $eid,
318 [ [ 'no-ext-epp:withdraw',
319 [ 'domain:withdraw', [ 'domain:name', $domain ],
320 {'xmlns:domain' => $mes->nsattrs('no-ext-domain')}
321 ]
322 ],
323 [ 'no-ext-epp:clTRID', $mes->cltrid() ]
324 ]
325 );
326  
327 0 ▶ if ( defined($fs) && $fs ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $fs and $fs) 0 0 0
Condition0%0/3
defined $fs and $fs
!ll&&!rl&&r
000
MC/DC0%0/2
defined $fs and $fs
defined $fs $fs
Truth table0%0/3
A and B
A= defined $fsB= $fs
ABresult
0X0
100
111
328 0 $r = facet($epp, $domain, $rd);
329 }
330  
331 0 return $r;
332  
333 }
334  
335 sub transfer_execute {
336 0 ▶ my ( $epp, $domain, $rd ) = @_;
Subroutine transfer_execute: not called CC=17 SCAR=57.2
Pod undocumented
337 0 my $mes = $epp->message();
338  
339 0 my $transaction;
340 0 ▶ $transaction = $rd->{transactionname} if $rd->{transactionname};
Branch: 1 branch
BranchTrueFalseTotal
if $rd->{"transactionname"} 0 0 0
341  
342 0 ▶ return unless ( $transaction && $transaction eq 'transfer_execute' );
Branch: 1 branch
BranchTrueFalseTotal
unless $transaction and $transaction eq "transfer_execute" 0 0 0
Condition0%0/3
$transaction and $transaction eq "transfer_execute"
!ll&&!rl&&r
000
MC/DC0%0/2
$transaction and $transaction eq "transfer_execute"
$transaction $transaction eq "transfer_execute"
Truth table0%0/3
A and B
A= $transactionB= $transaction eq "transfer_execute"
ABresult
0X0
100
111
343  
344 0 my ( $auth, $du, $token, $fs );
345 0 ▶ $auth = $rd->{auth} if Net::DRI::Util::has_key($rd,'auth');
Branch: 1 branch
BranchTrueFalseTotal
if Net::DRI::Util::has_key($rd, "auth") 0 0 0
346 0 ▶ $du = $rd->{duration} if Net::DRI::Util::has_key($rd,'duration');
Branch: 1 branch
BranchTrueFalseTotal
if Net::DRI::Util::has_key($rd, "duration") 0 0 0
347 0 ▶ $token = $rd->{token} if Net::DRI::Util::has_key($rd,'token');
Branch: 1 branch
BranchTrueFalseTotal
if Net::DRI::Util::has_key($rd, "token") 0 0 0
348 0 ▶ $fs = $rd->{facets} if Net::DRI::Util::has_key($rd,'facets');
Branch: 1 branch
BranchTrueFalseTotal
if Net::DRI::Util::has_key($rd, "facets") 0 0 0
349  
350 # Duration is optional
351 0 my $dur;
352 0 ▶ if ( defined($du)
Branch: 1 branch
BranchTrueFalseTotal
if (defined $du and $du and Net::DRI::Util::has_duration($rd)) 0 0 0
Condition0%0/6
defined $du and $du and Net::DRI::Util::has_duration($rd)
!ll&&!rl&&r
000
defined $du and $du
!ll&&!rl&&r
000
MC/DC0%0/3
defined $du and $du and Net::DRI::Util::has_duration($rd)
defined $du $du Net::DRI::Util::has_duration($rd)
Truth table0%0/4
A and B and C
A= defined $duB= $duC= Net::DRI::Util::has_duration($rd)
ABCresult
0XX0
10X0
1100
1111
353 && $du
354 && Net::DRI::Util::has_duration( $rd )
355 )
356 {
357 0 Net::DRI::Util::check_isa( $du, 'DateTime::Duration' );
358  
359 0 ▶ Net::DRI::Exception->die( 0, 'DRD::NO', 3, 'Invalid duration' )
Branch: 1 branch
BranchTrueFalseTotal
if "Net::DRI::DRD::NORID"->verify_duration_renew(undef, $du, $domain) 0 0 0
360 if Net::DRI::DRD::NORID->verify_duration_renew(undef, $du, $domain ); ## TODO: this test should be done in Net::DRI::DRD::NORID directly !
361 0 $dur = Net::DRI::Protocol::EPP::Util::build_period($du);
362 }
363  
364 0 my $eid = $mes->command_extension_register( 'no-ext-epp', 'command');
365  
366 0 my $cltrid=$mes->cltrid();
367  
368 0 my %domns = ('xmlns:domain' => 'urn:ietf:params:xml:ns:domain-1.0');
369  
370 0 my $r;
371  
372 0 ▶ if ( Net::DRI::Util::has_auth( $rd )
Branch: 2 branches
BranchTrueFalseTotal
if (Net::DRI::Util::has_auth($rd) and ref $rd->{'auth'} eq 'HASH') { } 0 0 0
elsif ($token) { } 0 0 0
Condition0%0/3
Net::DRI::Util::has_auth($rd) and ref $rd->{"auth"} eq "HASH"
!ll&&!rl&&r
000
MC/DC0%0/2
Net::DRI::Util::has_auth($rd) and ref $rd->{"auth"} eq "HASH"
Net::DRI::Util::has_auth($rd) ref $rd->{"auth"} eq "HASH"
Truth table0%0/3
A and B
A= Net::DRI::Util::has_auth($rd)B= ref $rd->{"auth"} eq "HASH"
ABresult
0X0
100
111
373 && ( ref( $rd->{auth} ) eq 'HASH' ) )
374 {
375 $r=$mes->command_extension(
376 $eid,
377 [ [ 'no-ext-epp:transfer',
378 { 'op' => 'execute' },
379 [ 'domain:transfer',
380 \%domns,
381 [ 'domain:name', $domain ],
382 $dur,
383 Net::DRI::Protocol::EPP::Util::domain_build_authinfo(
384 $epp, $rd->{auth}
385 0 ),
386 ],
387 ],
388 [ 'no-ext-epp:clTRID', $cltrid ]
389 ]
390 );
391 } elsif ($token) {
392 0 $r=$mes->command_extension(
393 $eid,
394 [ [ 'no-ext-epp:transfer',
395 { 'op' => 'execute' },
396 [ 'domain:transfer', \%domns,
397 [ 'domain:name', $domain ], $dur,
398 ],
399 ],
400 [ 'no-ext-epp:extension',
401 [ 'no-ext-domain:transfer', {'xmlns:no-ext-domain' => $mes->nsattrs('no-ext-domain')},
402 [ 'no-ext-domain:token', $token ]
403 ]
404 ],
405 [ 'no-ext-epp:clTRID', $cltrid ]
406 ]
407 );
408 } else {
409 0 $r=$mes->command_extension(
410 $eid,
411 [ [ 'no-ext-epp:transfer',
412 { 'op' => 'execute' },
413 [ 'domain:transfer', \%domns,
414 [ 'domain:name', $domain ], $dur,
415 ],
416 ],
417 [ 'no-ext-epp:clTRID', $cltrid ]
418 ]
419 );
420 }
421  
422 0 ▶ if ( defined($fs) && $fs ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $fs and $fs) 0 0 0
Condition0%0/3
defined $fs and $fs
!ll&&!rl&&r
000
MC/DC0%0/2
defined $fs and $fs
defined $fs $fs
Truth table0%0/3
A and B
A= defined $fsB= $fs
ABresult
0X0
100
111
423 0 $r = facet($epp, $domain, $rd);
424 }
425  
426 0 return $r;
427  
428 }
429  
430 ####################################################################################################
431 1 1;
« DRI/Protocol/EPP/Extensions/ResellerObject.pm ↑ Summary DRI/Data/Contact/BE.pm »