DRI/Protocol/EPP/Extensions/ResellerObject.pm

filter: Statementstmt 9.4% 19 / 201 Branchbran 0.0% 0 / 112 Conditioncond 0.0% 0 / 27 MC/DCmcdc 0.0% 0 / 16 Subroutinesub 31.5% 6 / 19 Podpod 0.0% 0 / 12 totaltotal 6.4% 25 / 387 CC 71 SCAR 54.5
CC
71
Cov
6%
update_build
506.0
create_build
272.0
info_parse
240.0
CRAP 233.1
« DRI/Data/Contact/COZA.pm ↑ Summary DRI/Data/Contact/BE.pm »
1 ## Domain Registry Interface, Reseller Extension Mapping for EPP
2 ##
3 ## Copyright (c) 2015,2016,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::Extensions::ResellerObject;
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 1 ▶use feature 'state';
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 ####################################################################################################
26  
27 sub register_commands
28 0 ▶{
Subroutine register_commands: not called CC=1 SCAR=6.9
Pod undocumented
29 0 my ($class,$version)=@_;
30  
31 0 state $rops = { 'reseller' => { check => [ \&check_build, \&check_parse ],
32 info => [ \&info_build, \&info_parse ],
33 create => [ \&create_build, \&create_parse ],
34 delete => [ \&delete_build, undef ],
35 update => [ \&update_build, undef ],
36 }
37 };
38  
39 0 return $rops;
40 }
41  
42 sub setup
43 0 ▶{
Subroutine setup: not called CC=1 SCAR=6.9
Pod undocumented
44 0 my ($class,$po,$version)=@_;
45 0 $po->ns({ 'reseller' => 'urn:ietf:params:xml:ns:reseller-1.0' });
46 0 return;
47 }
48  
49 sub capabilities_add
50 0 ▶{
Subroutine capabilities_add: not called CC=1 SCAR=6.9
Pod undocumented
51 0 state $c = [ [ 'reseller_update', 'contact', [qw/add del set/] ],
52 [ 'reseller_update', 'status', ['set'] ],
53 [ 'reseller_update', 'parent_id', ['set'] ],
54 [ 'reseller_update', 'url', ['set'] ],
55 ];
56 0 return $c;
57 }
58  
59 0 ▶sub implements { return 'https://tools.ietf.org/html/draft-zhou-eppext-reseller-mapping-03'; }
Subroutine implements: not called CC=1 SCAR=6.9
Pod undocumented
60  
61 ####################################################################################################
62  
63 sub _add_id
64 0 ▶{
Subroutine _add_id: not called CC=9 SCAR=45.0
65 0 my ($mes,$command,$reseller)=@_;
66 0 my @r;
67  
68 0 ▶ Net::DRI::Exception::usererr_insufficient_parameters('Missing reseller id') unless defined $reseller && (!ref $reseller || ref $reseller eq 'ARRAY');
Branch: 1 branch
BranchTrueFalseTotal
unless defined $reseller and !ref($reseller) || ref $reseller eq "ARRAY" 0 0 0
Condition0%0/6
defined $reseller and !ref($reseller) || ref $reseller eq "ARRAY"
!ll&&!rl&&r
000
not ref $reseller or ref $reseller eq "ARRAY"
l!l&&r!l&&!r
000
MC/DC0%0/3
defined $reseller and !ref($reseller) || ref $reseller eq "ARRAY"
defined $reseller not ref $reseller ref $reseller eq "ARRAY"
Truth table0%0/4
A and not(B) or C
A= defined $resellerB= not ref $resellerC= ref $reseller eq "ARRAY"
ABCresult
0XX0
1000
11X1
1011
69 0 ▶ Net::DRI::Exception::usererr_invalid_parameters('Only one reseller id allowed for command '.$command) if $command ne 'check' && ref $reseller;
Branch: 1 branch
BranchTrueFalseTotal
if $command ne "check" and ref $reseller 0 0 0
Condition0%0/3
$command ne "check" and ref $reseller
!ll&&!rl&&r
000
MC/DC0%0/2
$command ne "check" and ref $reseller
$command ne "check" ref $reseller
Truth table0%0/3
A and B
A= $command ne "check"B= ref $reseller
ABresult
0X0
100
111
70 0 ▶ foreach my $id (ref $reseller ? @$reseller : ($reseller))
Branch: 1 branch
BranchTrueFalseTotal
ref $reseller ? : 0 0 0
71 {
72 0 ▶ Net::DRI::Exception::usererr_invalid_parameters('Invalid syntax for reseller id: '.$id) unless Net::DRI::Util::xml_is_token($id,3,16);
Branch: 1 branch
BranchTrueFalseTotal
unless Net::DRI::Util::xml_is_token($id, 3, 16) 0 0 0
73 0 push @r,['reseller:id',$id];
74 }
75  
76 0 $mes->command([$command,'reseller:'.$command, $mes->nsattrs('reseller')]);
77  
78 0 return @r;
79 }
80  
81 sub check_build
82 0 ▶{
Subroutine check_build: not called CC=1 SCAR=6.9
Pod undocumented
83 0 my ($epp,$reseller,$rd)=@_;
84 0 my $mes=$epp->message();
85  
86 0 my @d=_add_id($mes,'check',$reseller);
87 0 $mes->command_body(\@d);
88 0 return;
89 }
90  
91 sub check_parse
92 0 ▶{
Subroutine check_parse: not called CC=8 SCAR=42.8
Pod undocumented
93 0 my ($po,$otype,$oaction,$oname,$rinfo)=@_;
94 0 my $mes=$po->message();
95 0 ▶ return unless $mes->is_success();
Branch: 1 branch
BranchTrueFalseTotal
unless $mes->is_success 0 0 0
96  
97 0 my $chkdata=$mes->get_response('reseller','chkData');
98 0 ▶ return unless defined $chkdata;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $chkdata 0 0 0
99  
100 0 foreach my $cd ($chkdata->getChildrenByTagNameNS($mes->ns('reseller'),'cd'))
101 {
102 0 my $id;
103 0 foreach my $el (Net::DRI::Util::xml_list_children($cd))
104 {
105 0 my ($n,$c)=@$el;
106 0 ▶ if ($n eq 'id')
Branch: 2 branches
BranchTrueFalseTotal
if ($n eq 'id') { } 0 0 0
elsif ($n eq 'reason') { } 0 0 0
107 {
108 0 $id=$c->textContent();
109 0 $rinfo->{reseller}->{$id}->{action}='check';
110 0 $rinfo->{reseller}->{$id}->{exist}=1-Net::DRI::Util::xml_parse_boolean($c->getAttribute('avail'));
111 } elsif ($n eq 'reason')
112 {
113 0 ▶ $rinfo->{reseller}->{$id}->{exist_reason}=$c->hasAttribute('lang') ? { lang => $c->getAttribute('lang'), reason => $c->textContent() } : $c->textContent();
Branch: 1 branch
BranchTrueFalseTotal
$c->hasAttribute('lang') ? : 0 0 0
114 }
115 }
116 }
117 0 return;
118 }
119  
120 sub info_build
121 0 ▶{
Subroutine info_build: not called CC=1 SCAR=6.9
Pod undocumented
122 0 my ($epp,$reseller,$rd)=@_;
123 0 my $mes=$epp->message();
124  
125 0 my @d=_add_id($mes,'info',$reseller);
126 0 $mes->command_body(\@d);
127 0 return;
128 }
129  
130 sub info_parse
131 0 ▶{
Subroutine info_parse: not called CC=15 SCAR=54.8
Pod undocumented
132 0 my ($po,$otype,$oaction,$oname,$rinfo)=@_;
133 0 my $mes=$po->message();
134 0 ▶ return unless $mes->is_success();
Branch: 1 branch
BranchTrueFalseTotal
unless $mes->is_success 0 0 0
135  
136 0 my $data=$mes->get_response('reseller','infData');
137 0 ▶ return unless defined $data;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $data 0 0 0
138  
139 0 my %r=(action => 'info', exist => 1);
140 0 my $cs=$po->create_local_object('contactset');
141 0 my %ccache;
142 0 my %cd=map { $_ => [] } qw/name org city sp pc cc/;
143 0 $cd{street}=[[],[]];
144 0 my $contact=$po->create_local_object('contact');
145  
146 0 foreach my $el (Net::DRI::Util::xml_list_children($data))
147 {
148 0 my ($name,$node)=@$el;
149 0 ▶ if ($name=~m/^(?:id|roid|state|parentId|url)$/)
Branch: 8 branches
BranchTrueFalseTotal
if ($name =~ /^(?:id|roid|state|parentId|url)$/) { } 0 0 0
elsif ($name =~ /^(email)$/) { } 0 0 0
elsif ($name eq 'postalInfo') { } 0 0 0
elsif ($name eq 'voice' or $name eq 'fax') { } 0 0 0
elsif ($name eq 'contact') { } 0 0 0
elsif ($name =~ /^(clID|crID|upID)$/) { } 0 0 0
elsif ($name =~ /^(crDate|upDate)$/) { } 0 0 0
elsif ($name eq 'disclose') { } 0 0 0
150 {
151 0 my $key=Net::DRI::Util::remcam($name);
152 0 ▶ $key='status' if $key eq 'state';
Branch: 1 branch
BranchTrueFalseTotal
if $key eq "state" 0 0 0
153 0 $r{$key}=$node->textContent();
154 } elsif ($name=~m/^(email)$/) ## TODO: url should be there too
155 {
156 0 $contact->$name($node->textContent());
157 } elsif ($name eq 'postalInfo')
158 {
159 0 Net::DRI::Protocol::EPP::Util::parse_postalinfo($po,$node,\%cd);
160 ▶ } elsif ($name eq 'voice' || $name eq 'fax')
Condition0%0/3
$name eq "voice" or $name eq "fax"
l!l&&r!l&&!r
000
MC/DC0%0/2
$name eq "voice" or $name eq "fax"
$name eq "voice" $name eq "fax"
Truth table0%0/3
A or B
A= $name eq "voice"B= $name eq "fax"
ABresult
1X1
011
000
161 {
162 0 $contact->$name(Net::DRI::Protocol::EPP::Util::parse_tel($node));
163 } elsif ($name eq 'contact')
164 {
165 0 my $id=$node->textContent();
166 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
167 0 $cs->add($ccache{$id},$node->getAttribute('type'));
168 } elsif ($name=~m/^(clID|crID|upID)$/)
169 {
170 0 $r{$1}=$node->textContent();
171 } elsif ($name=~m/^(crDate|upDate)$/)
172 {
173 0 $r{$1}=$po->parse_iso8601($node->textContent());
174 } elsif ($name eq 'disclose')
175 {
176 0 $contact->disclose(Net::DRI::Protocol::EPP::Util::parse_disclose($node));
177 }
178 }
179  
180 0 $contact->name(@{$cd{name}});
181 0 $contact->org(@{$cd{org}});
182 0 $contact->street(@{$cd{street}});
183 0 $contact->city(@{$cd{city}});
184 0 $contact->sp(@{$cd{sp}});
185 0 $contact->pc(@{$cd{pc}});
186 0 $contact->cc(@{$cd{cc}});
187 0 $cs->set($contact,'main');
188 0 $r{contact}=$cs;
189 0 $rinfo->{$otype}->{$r{id}}=\%r;
190  
191 0 return;
192 }
193  
194 sub create_build
195 0 ▶{
Subroutine create_build: not called CC=16 SCAR=56.1
Pod undocumented
196 0 my ($epp,$reseller,$rd)=@_;
197 0 my $mes=$epp->message();
198  
199 0 my @d=_add_id($mes,'create',$reseller);
200  
201 0 ▶ Net::DRI::Exception::usererr_insufficient_parameters('Missing mandatory reseller state') unless Net::DRI::Util::has_key($rd,'status');
Branch: 1 branch
BranchTrueFalseTotal
unless Net::DRI::Util::has_key($rd, "status") 0 0 0
202 0 ▶ Net::DRI::Exception::usererr_invalid_parameters('Invalid reseller state: '.$rd->{status}) unless $rd->{status}=~m/^(?:ok|readonly|terminated)$/;
Branch: 1 branch
BranchTrueFalseTotal
unless $rd->{"status"} =~ /^(?:ok|readonly|terminated)$/ 0 0 0
203 0 push @d,['reseller:state',$rd->{status}];
204  
205 0 ▶ if (Net::DRI::Util::has_key($rd,'parent_id'))
Branch: 1 branch
BranchTrueFalseTotal
if (Net::DRI::Util::has_key($rd, "parent_id")) 0 0 0
206 {
207 0 ▶ Net::DRI::Exception::usererr_invalid_parameters('Invalid syntax for reseller parent_id: '.$rd->{parent_id}) unless Net::DRI::Util::xml_is_token($rd->{parent_id},3,16);
Branch: 1 branch
BranchTrueFalseTotal
unless Net::DRI::Util::xml_is_token($rd->{"parent_id"}, 3, 16) 0 0 0
208 0 push @d,['reseller:parentId',$rd->{parent_id}];
209 }
210  
211 0 my $cs=$rd->{contact};
212 0 ▶ Net::DRI::Exception::usererr_invalid_parameters('Missing mandatory contact structure') unless Net::DRI::Util::has_contact($rd);
Branch: 1 branch
BranchTrueFalseTotal
unless Net::DRI::Util::has_contact($rd) 0 0 0
213 0 ▶ Net::DRI::Exception::usererr_invalid_parameters('Missing mandatory contact "main"') unless $cs->has_type('main');
Branch: 1 branch
BranchTrueFalseTotal
unless $cs->has_type("main") 0 0 0
214 0 my $co=$cs->get('main');
215 ## Fake data to pass validate
216 0 $co->auth('FAKE');
217 0 $co->srid('FAKE');
218 0 $co->validate();
219 0 push @d,Net::DRI::Protocol::EPP::Util::build_postalinfo($co,$epp->{contacti18n},'reseller');
220 0 ▶ push @d,Net::DRI::Protocol::EPP::Util::build_tel('reseller:voice',$co->voice()) if defined $co->voice();
Branch: 1 branch
BranchTrueFalseTotal
if defined $co->voice 0 0 0
221 0 ▶ push @d,Net::DRI::Protocol::EPP::Util::build_tel('reseller:fax',$co->fax()) if defined $co->fax();
Branch: 1 branch
BranchTrueFalseTotal
if defined $co->fax 0 0 0
222 0 push @d,['reseller:email',$co->email()];
223  
224 0 ▶ Net::DRI::Exception::usererr_insufficient_parameters('Missing mandatory reseller url') unless Net::DRI::Util::has_key($rd,'url');
Branch: 1 branch
BranchTrueFalseTotal
unless Net::DRI::Util::has_key($rd, "url") 0 0 0
225 0 ▶ Net::DRI::Exception::usererr_invalid_parameters('Invalid reseller url: '.$rd->{url}) unless Net::DRI::Util::xml_is_token($rd->{url},1,undef) && $rd->{url}=~m|(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?|; ## regexp taken from URI Perl module
Branch: 1 branch
BranchTrueFalseTotal
unless Net::DRI::Util::xml_is_token($rd->{"url"}, 1, undef) and $rd->{"url"} =~ m[(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?] 0 0 0
Condition0%0/3
Net::DRI::Util::xml_is_token($rd->{"url"}, 1, undef) and $rd->{"url"} =~ m[(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?]
!ll&&!rl&&r
000
MC/DC0%0/2
Net::DRI::Util::xml_is_token($rd->{"url"}, 1, undef) and $rd->{"url"} =~ m[(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?]
Net::DRI::Util::xml_is_token($rd->{"url"}, 1, undef) $rd->{"url"} =~ m[(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?]
Truth table0%0/3
A and B
A= Net::DRI::Util::xml_is_token($rd->{"url"}, 1, undef)B= $rd->{"url"} =~ m[(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?]
ABresult
0X0
100
111
226 0 push @d,['reseller:url',$rd->{url}];
227  
228 0 ▶ if (Net::DRI::Util::has_contact($rd))
Branch: 1 branch
BranchTrueFalseTotal
if (Net::DRI::Util::has_contact($rd)) 0 0 0
229 {
230 0 push @d,Net::DRI::Protocol::EPP::Util::build_core_contacts($epp,$rd->{contact},'reseller');
231 }
232  
233 0 my $d=$co->disclose();
234 0 ▶ if (defined $d)
Branch: 1 branch
BranchTrueFalseTotal
if (defined $d) 0 0 0
235 {
236 0 ▶ Net::DRI::Exception::usererr_invalid_parameters('Invalid reseller disclose item: '.$d) unless ref $d eq 'HASH';
Branch: 1 branch
BranchTrueFalseTotal
unless ref $d eq "HASH" 0 0 0
237 0 my @dd=Net::DRI::Protocol::EPP::Util::build_disclose($d,'reseller',qw/url contact/);
238 0 ▶ Net::DRI::Exception::usererr_invalid_parameters('Invalid reseller disclose item: '.$d) unless @dd;
Branch: 1 branch
BranchTrueFalseTotal
unless @dd 0 0 0
239 0 push @d,@dd;
240 }
241  
242 0 $mes->command_body(\@d);
243 0 return;
244 }
245  
246 sub create_parse
247 0 ▶{
Subroutine create_parse: not called CC=6 SCAR=37.4
Pod undocumented
248 0 my ($po,$otype,$oaction,$oname,$rinfo)=@_;
249 0 my $mes=$po->message();
250 0 ▶ return unless $mes->is_success();
Branch: 1 branch
BranchTrueFalseTotal
unless $mes->is_success 0 0 0
251  
252 0 my $credata=$mes->get_response('reseller','creData');
253 0 ▶ return unless defined $credata;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $credata 0 0 0
254  
255 0 my %r=(action => 'create', exist => 1);
256 0 foreach my $el (Net::DRI::Util::xml_list_children($credata))
257 {
258 0 my ($name,$node)=@$el;
259 0 ▶ if ($name eq 'id')
Branch: 2 branches
BranchTrueFalseTotal
if ($name eq 'id') { } 0 0 0
elsif ($name eq 'crDate') { } 0 0 0
260 {
261 0 $r{id}=$node->textContent();
262 } elsif ($name eq 'crDate')
263 {
264 0 $r{crDate}=$po->parse_iso8601($node->textContent());
265 }
266 }
267  
268 0 $rinfo->{reseller}->{$r{id}}=\%r;
269 0 return;
270 }
271  
272 sub delete_build
273 0 ▶{
Subroutine delete_build: not called CC=1 SCAR=6.9
Pod undocumented
274 0 my ($epp,$reseller,$rd)=@_;
275 0 my $mes=$epp->message();
276  
277 0 my @d=_add_id($mes,'delete',$reseller);
278 0 $mes->command_body(\@d);
279 0 return;
280 }
281  
282 sub update_build
283 0 ▶{
Subroutine update_build: not called CC=22 SCAR=62.3
Pod undocumented
284 0 my ($epp,$reseller,$todo,$rp)=@_;
285  
286 0 my (@add,@del,@set);
287 0 my $cs;
288  
289 0 $cs=$todo->add('contact');
290 0 ▶ if (Net::DRI::Util::isa_contactset($cs))
Branch: 1 branch
BranchTrueFalseTotal
if (Net::DRI::Util::isa_contactset($cs)) 0 0 0
291 {
292 0 push @add,Net::DRI::Protocol::EPP::Util::build_core_contacts($epp,$cs,'reseller');
293 }
294  
295 0 $cs=$todo->del('contact');
296 0 ▶ if (Net::DRI::Util::isa_contactset($cs))
Branch: 1 branch
BranchTrueFalseTotal
if (Net::DRI::Util::isa_contactset($cs)) 0 0 0
297 {
298 0 push @del,Net::DRI::Protocol::EPP::Util::build_core_contacts($epp,$cs,'reseller');
299 }
300  
301 0 my $e;
302  
303 0 $e=$todo->set('status');
304 0 ▶ push @set,['reseller:state',$e] if defined $e;
Branch: 1 branch
BranchTrueFalseTotal
if defined $e 0 0 0
305  
306 0 $e=$todo->set('parent_id');
307 0 ▶ push @set,['reseller:parentId',$e] if defined $e;
Branch: 1 branch
BranchTrueFalseTotal
if defined $e 0 0 0
308  
309 0 my $co;
310 0 $cs=$todo->set('contact');
311 0 ▶ if (Net::DRI::Util::isa_contactset($cs))
Branch: 1 branch
BranchTrueFalseTotal
if (Net::DRI::Util::isa_contactset($cs)) 0 0 0
312 {
313 0 $co=$cs->get('main');
314 0 ▶ if (defined $co && Net::DRI::Util::isa_contact($co))
Branch: 1 branch
BranchTrueFalseTotal
if (defined $co and Net::DRI::Util::isa_contact($co)) { } 0 0 0
Condition0%0/3
defined $co and Net::DRI::Util::isa_contact($co)
!ll&&!rl&&r
000
MC/DC0%0/2
defined $co and Net::DRI::Util::isa_contact($co)
defined $co Net::DRI::Util::isa_contact($co)
Truth table0%0/3
A and B
A= defined $coB= Net::DRI::Util::isa_contact($co)
ABresult
0X0
100
111
315 {
316 ## Fake data to pass validate
317 0 $co->auth('FAKE');
318 0 $co->srid('FAKE');
319 0 $co->validate(1);
320 0 push @set,Net::DRI::Protocol::EPP::Util::build_postalinfo($co,$epp->{contacti18n},'reseller');
321 0 ▶ push @set,Net::DRI::Protocol::EPP::Util::build_tel('reseller:voice',$co->voice()) if defined $co->voice();
Branch: 1 branch
BranchTrueFalseTotal
if defined $co->voice 0 0 0
322 0 ▶ push @set,Net::DRI::Protocol::EPP::Util::build_tel('reseller:fax',$co->fax()) if defined $co->fax();
Branch: 1 branch
BranchTrueFalseTotal
if defined $co->fax 0 0 0
323 0 ▶ push @set,['reseller:email',$co->email()] if defined $co->email();
Branch: 1 branch
BranchTrueFalseTotal
if defined $co->email 0 0 0
324 } else
325 {
326 0 $co=undef;
327 }
328 }
329  
330 0 $e=$todo->set('url');
331 0 ▶ push @set,['reseller:url',$e] if defined $e;
Branch: 1 branch
BranchTrueFalseTotal
if defined $e 0 0 0
332  
333 0 my $d;
334 0 ▶ if (defined $co && defined($d=$co->disclose()))
Branch: 1 branch
BranchTrueFalseTotal
if (defined $co and defined($d = $co->disclose)) 0 0 0
Condition0%0/3
defined $co and defined($d = $co->disclose)
!ll&&!rl&&r
000
MC/DC0%0/2
defined $co and defined($d = $co->disclose)
defined $co defined($d = $co->disclose)
Truth table0%0/3
A and B
A= defined $coB= defined($d = $co->disclose)
ABresult
0X0
100
111
335 {
336 0 ▶ Net::DRI::Exception::usererr_invalid_parameters('Invalid reseller disclose item: '.$d) unless ref $d eq 'HASH';
Branch: 1 branch
BranchTrueFalseTotal
unless ref $d eq "HASH" 0 0 0
337 0 my @dd=Net::DRI::Protocol::EPP::Util::build_disclose($d,'reseller',qw/url contact/);
338 0 ▶ Net::DRI::Exception::usererr_invalid_parameters('Invalid reseller disclose item: '.$d) unless @dd;
Branch: 1 branch
BranchTrueFalseTotal
unless @dd 0 0 0
339 0 push @set,@dd;
340 }
341  
342 0 ▶ return unless @add || @del || @set;
Branch: 1 branch
BranchTrueFalseTotal
unless @add or @del or @set 0 0 0
Condition0%0/6
@add or @del or @set
l!l&&r!l&&!r
000
@add or @del
l!l&&r!l&&!r
000
MC/DC0%0/3
@add or @del or @set
@add @del @set
Truth table0%0/4
A or B or C
A= @addB= @delC= @set
ABCresult
1XX1
01X1
0011
0000
343  
344 0 my $mes=$epp->message();
345 0 my @d=_add_id($mes,'update',$reseller);
346 0 ▶ push @d,['reseller:add',@add] if @add;
Branch: 1 branch
BranchTrueFalseTotal
if @add 0 0 0
347 0 ▶ push @d,['reseller:rem',@del] if @del;
Branch: 1 branch
BranchTrueFalseTotal
if @del 0 0 0
348 0 ▶ push @d,['reseller:chg',@set] if @set;
Branch: 1 branch
BranchTrueFalseTotal
if @set 0 0 0
349  
350 0 $mes->command_body(\@d);
351 0 return;
352 }
353  
354 ####################################################################################################
355 1 1;
356  
357 __END__
« DRI/Data/Contact/COZA.pm ↑ Summary DRI/Data/Contact/BE.pm »