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

filter: Statementstmt 8.5% 16 / 188 Branchbran 0.0% 0 / 116 Conditioncond 0.0% 0 / 165 MC/DCmcdc 0.0% 0 / 74 Subroutinesub 41.6% 5 / 12 Podpod 0.0% 0 / 7 totaltotal 3.7% 21 / 562 CC 120 SCAR 75.1
CC
120
Cov
3%
update
3192.0
add_no_extensions
1190.0
parse_info
756.0
CRAP 1831.2
« DRI/Data/Contact/AT.pm ↑ Summary DRI/Shell.pm »
1 ## Domain Registry Interface, .NO Contact extensions
2 ##
3 ## Copyright (c) 2008,2010 UNINETT Norid AS, E<lt>http://www.norid.noE<gt>,
4 ## Trond Haugen E<lt>info@norid.noE<gt>
5 ## (c) 2016 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::Contact;
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::Util;
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 1 ▶use Net::DRI::Protocol::EPP::Extensions::NO::Host;
Subroutine BEGIN: called CC=1 SCAR=0.0
26  
27 =pod
28  
29 =head1 NAME
30  
31 Net::DRI::Protocol::EPP::Extensions::NO::Contact - .NO Contact Extensions for Net::DRI
32  
33 =head1 DESCRIPTION
34  
35 Please see the README file for details.
36  
37 =head1 SUPPORT
38  
39 For now, support questions should be sent to:
40  
41 E<lt>netdri@dotandco.comE<gt>
42  
43 Please also see the SUPPORT file in the distribution.
44  
45 =head1 SEE ALSO
46  
47 E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt>
48  
49 =head1 AUTHOR
50  
51 Trond Haugen, E<lt>info@norid.noE<gt>
52  
53 =head1 COPYRIGHT
54  
55 Copyright (c) 2008,2010 UNINETT Norid AS, E<lt>http://www.norid.noE<gt>,
56 Trond Haugen E<lt>info@norid.noE<gt>
57 Copyright (c) 2016 Patrick Mevzek E<lt>netdri@dotandco.comE<gt>
58 All rights reserved.
59  
60 This program is free software; you can redistribute it and/or modify
61 it under the terms of the GNU General Public License as published by
62 the Free Software Foundation; either version 2 of the License, or
63 (at your option) any later version.
64  
65 See the LICENSE file that comes with this distribution for more details.
66  
67 =cut
68  
69 ####################################################################################################
70  
71 sub register_commands {
72 0 ▶ my ( $class, $version ) = @_;
Subroutine register_commands: not called CC=1 SCAR=6.9
Pod undocumented
73 0 my %tmp = (
74 check => [ \&facet, undef ],
75 info => [ \&facet, \&parse_info ],
76 delete => [ \&facet, undef ],
77 create => [ \&create, undef ],
78 update => [ \&update, undef ],
79  
80 );
81  
82 0 return { 'contact' => \%tmp };
83 }
84  
85 ####################################################################################################
86 # parsing by XML::LibXML::Element methods
87  
88 sub parse_xdisclose {
89 0 ▶ my $c = shift;
Subroutine parse_xdisclose: not called CC=6 SCAR=37.4
Pod undocumented
90  
91 0 my $flag = Net::DRI::Util::xml_parse_boolean( $c->getAttribute('flag') );
92  
93 0 my %tmp;
94 0 my $n = $c->getFirstChild();
95 0 ▶ while ($n) {
Branch: 1 branch
BranchTrueFalseTotal
if ($n) 0 0 0
96 0 ▶ next unless ( $n->nodeType() == 1 );
Branch: 1 branch
BranchTrueFalseTotal
unless $n->nodeType == 1 0 0 0
97 0 ▶ my $name = $n->localname() || $n->nodeName();
Condition0%0/3
$n->localname || $n->nodeName
l!l&&r!l&&!r
000
MC/DC0%0/2
$n->localname || $n->nodeName
$n->localname $n->nodeName
Truth table0%0/3
A || B
A= $n->localnameB= $n->nodeName
ABresult
1X1
011
000
98 0 ▶ next unless $name;
Branch: 1 branch
BranchTrueFalseTotal
unless $name 0 0 0
99 0 ▶ if ( $name =~ m/^(mobilePhone)$/mx ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($name =~ /^(mobilePhone)$/mx) 0 0 0
100 0 $tmp{$1} = $flag;
101 }
102 } continue {
103 0 $n = $n->getNextSibling();
104 }
105 0 return \%tmp;
106 }
107  
108 sub parse_info {
109 0 ▶ my ( $po, $otype, $oaction, $oname, $rinfo ) = @_;
Subroutine parse_info: not called CC=27 SCAR=66.3
Pod undocumented
110 0 my $mes = $po->message();
111 0 ▶ return unless $mes->is_success();
Branch: 1 branch
BranchTrueFalseTotal
unless $mes->is_success 0 0 0
112  
113 0 my $NS = $mes->ns('no-ext-contact');
114  
115 0 my $c = $rinfo->{contact}->{$oname}->{self};
116  
117 # This method is called also on a message_retrieve, so make sure we have a contact info
118 # before checking the email value.
119 0 ▶ $c->email(undef)
Branch: 1 branch
BranchTrueFalseTotal
if $otype eq "contact" and $oaction eq "info" and $c->email eq "n/a" 0 0 0
Condition0%0/6
$otype eq "contact" and $oaction eq "info" and $c->email eq "n/a"
!ll&&!rl&&r
000
$otype eq "contact" and $oaction eq "info"
!ll&&!rl&&r
000
MC/DC0%0/3
$otype eq "contact" and $oaction eq "info" and $c->email eq "n/a"
$otype eq "contact" $oaction eq "info" $c->email eq "n/a"
Truth table0%0/4
A and B and C
A= $otype eq "contact"B= $oaction eq "info"C= $c->email eq "n/a"
ABCresult
0XX0
10X0
1100
1111
120 if ( $otype eq 'contact'
121 && $oaction eq 'info'
122 && $c->email() eq 'n/a' );
123  
124 0 my $condata = $mes->get_extension('no-ext-contact','infData');
125 0 ▶ return unless $condata;
Branch: 1 branch
BranchTrueFalseTotal
unless $condata 0 0 0
126  
127 # type
128 0 my $el = $condata->getElementsByTagNameNS( $NS, 'type' )
129 ; # XML::LibXML::NodeList back
130 0 ▶ my $type = $el ? $el->get_node(1)->getFirstChild()->getData() : undef;
Branch: 1 branch
BranchTrueFalseTotal
$el ? : 0 0 0
131 0 ▶ $c->type($type) if ( defined($type) && $type );
Branch: 1 branch
BranchTrueFalseTotal
if defined $type and $type 0 0 0
Condition0%0/3
defined $type and $type
!ll&&!rl&&r
000
MC/DC0%0/2
defined $type and $type
defined $type $type
Truth table0%0/3
A and B
A= defined $typeB= $type
ABresult
0X0
100
111
132 0 $rinfo->{contact}->{$oname}->{type} = $c->type();
133  
134 # identity, type and value
135 0 my @e = $condata->getElementsByTagNameNS( $NS, 'identity' );
136 0 ▶ if ( @e && $e[0] ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@e and $e[0]) 0 0 0
Condition0%0/3
@e and $e[0]
!ll&&!rl&&r
000
MC/DC0%0/2
@e and $e[0]
@e $e[0]
Truth table0%0/3
A and B
A= @eB= $e[0]
ABresult
0X0
100
111
137 0 my $t = $e[0];
138 0 my $tv = $t->getAttribute('type');
139 0 $c->identity(
140 { type => $tv, value => $t->getFirstChild()->getData() } );
141 0 $rinfo->{contact}->{$oname}->{identity} = $c->identity();
142 }
143  
144 # mobilePhone
145 0 @e = $condata->getElementsByTagNameNS( $NS, 'mobilePhone' );
146 0 ▶ if ( @e && $e[0] ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@e and $e[0]) 0 0 0
Condition0%0/3
@e and $e[0]
!ll&&!rl&&r
000
MC/DC0%0/2
@e and $e[0]
@e $e[0]
Truth table0%0/3
A and B
A= @eB= $e[0]
ABresult
0X0
100
111
147 0 $c->mobilephone(
148 Net::DRI::Protocol::EPP::Util::parse_tel( $e[0] ) );
149 0 $rinfo->{contact}->{$oname}->{identity} = $c->mobilephone();
150 }
151  
152 ############
153 0 my @ema;
154 0 foreach my $el ( $condata->getElementsByTagNameNS( $NS, 'email' ) ) {
155 0 my $c = $el->getFirstChild();
156  
157 0 my $v;
158 0 ▶ $v = $c->getData() if ($c);
Branch: 1 branch
BranchTrueFalseTotal
if $c 0 0 0
159 0 ▶ push @ema, $v if ($v);
Branch: 1 branch
BranchTrueFalseTotal
if $v 0 0 0
160 }
161 0 ▶ if ( @ema > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@ema > 0) 0 0 0
162 0 $c->xemail( \@ema );
163 0 $rinfo->{contact}->{$oname}->{xemail} = $c->xemail();
164 }
165  
166 # organization
167 0 my @oa;
168 0 foreach my $el ( $condata->getElementsByTagNameNS( $NS, 'organization' ) )
169 {
170 0 my $c = $el->getFirstChild();
171 0 my $v;
172 0 ▶ $v = $c->getData() if ($c);
Branch: 1 branch
BranchTrueFalseTotal
if $c 0 0 0
173 0 ▶ push @oa, $v if ($v);
Branch: 1 branch
BranchTrueFalseTotal
if $v 0 0 0
174 }
175 0 ▶ if ( @oa > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@oa > 0) 0 0 0
176 0 $c->organization( \@oa );
177 0 $rinfo->{contact}->{$oname}->{organization} = $c->organization();
178 }
179  
180 # roleContact
181 0 my @rca;
182 0 foreach my $el ( $condata->getElementsByTagNameNS( $NS, 'roleContact' ) )
183 {
184 0 my $c = $el->getFirstChild();
185 0 my $v;
186 0 ▶ $v = $c->getData() if ($c);
Branch: 1 branch
BranchTrueFalseTotal
if $c 0 0 0
187 0 ▶ push @rca, $v if ($v);
Branch: 1 branch
BranchTrueFalseTotal
if $v 0 0 0
188 }
189 0 ▶ if ( @rca > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@rca > 0) 0 0 0
190 0 $c->rolecontact( \@rca );
191 0 $rinfo->{contact}->{$oname}->{rolecontact} = $c->rolecontact();
192 }
193  
194 ########
195 # xtra, disclose flag for mobilephone
196 0 @e = ();
197 0 @e = $condata->getElementsByTagNameNS( $NS, 'disclose' );
198 0 ▶ if ( @e && $e[0] ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@e and $e[0]) 0 0 0
Condition0%0/3
@e and $e[0]
!ll&&!rl&&r
000
MC/DC0%0/2
@e and $e[0]
@e $e[0]
Truth table0%0/3
A and B
A= @eB= $e[0]
ABresult
0X0
100
111
199 0 my $t = $e[0];
200 0 $c->xdisclose( parse_xdisclose($t) );
201 0 $rinfo->{contact}->{$oname}->{xdisclose} = $c->xdisclose();
202 }
203 0 return;
204 }
205  
206 sub facet {
207 0 ▶ my ( $epp, $o, $rd ) = @_;
Subroutine facet: not called CC=1 SCAR=6.9
Pod undocumented
208  
209 0 return Net::DRI::Protocol::EPP::Extensions::NO::Host::build_facets( $epp, $rd );
210 }
211  
212 sub add_no_extensions {
213 0 ▶ my ( $epp, $contact, $op ) = @_;
Subroutine add_no_extensions: not called CC=34 SCAR=70.8
Pod undocumented
214 0 my $mes = $epp->message();
215  
216 0 my $ty = $contact->type();
217 0 my $id = $contact->identity();
218 0 my $mp = $contact->mobilephone();
219 0 my $org = $contact->organization();
220 0 my $rc = $contact->rolecontact();
221 0 my $aem = $contact->xemail();
222 0 my $xd = $contact->xdisclose();
223 0 my $fs = $contact->facets();
224  
225 return
226 0 ▶ unless ( defined($ty)
Branch: 1 branch
BranchTrueFalseTotal
unless defined $ty or defined $id or defined $mp or defined $org or defined $rc or defined $aem or defined $fs 0 0 0
Condition0%0/18
defined $ty or defined $id or defined $mp or defined $org or defined $rc or defined $aem or defined $fs
l!l&&r!l&&!r
000
defined $ty or defined $id or defined $mp or defined $org or defined $rc or defined $aem
l!l&&r!l&&!r
000
defined $ty or defined $id or defined $mp or defined $org or defined $rc
l!l&&r!l&&!r
000
defined $ty or defined $id or defined $mp or defined $org
l!l&&r!l&&!r
000
defined $ty or defined $id or defined $mp
l!l&&r!l&&!r
000
defined $ty or defined $id
l!l&&r!l&&!r
000
MC/DC0%0/7
defined $ty or defined $id or defined $mp or defined $org or defined $rc or defined $aem or defined $fs
defined $ty defined $id defined $mp defined $org defined $rc defined $aem defined $fs
Truth table0%0/8
A or B or C or D or E or F or G
A= defined $tyB= defined $idC= defined $mpD= defined $orgE= defined $rcF= defined $aemG= defined $fs
ABCDEFGresult
1XXXXXX1
01XXXXX1
001XXXX1
0001XXX1
00001XX1
000001X1
00000011
00000000
227 || defined($id)
228 || defined($mp)
229 || defined($org)
230 || defined($rc)
231 || defined($aem)
232 || defined($fs)
233 );
234  
235  
236 0 my $eid = $mes->command_extension_register('no-ext-contact', $op );
237 0 my @e;
238  
239 0 ▶ push @e, [ 'no-ext-contact:type', $ty ] if ( defined($ty) && $ty );
Branch: 1 branch
BranchTrueFalseTotal
if defined $ty and $ty 0 0 0
Condition0%0/3
defined $ty and $ty
!ll&&!rl&&r
000
MC/DC0%0/2
defined $ty and $ty
defined $ty $ty
Truth table0%0/3
A and B
A= defined $tyB= $ty
ABresult
0X0
100
111
240  
241 # Add identity extension if present.
242 0 ▶ if ( defined($id) && ($id)
Branch: 1 branch
BranchTrueFalseTotal
if (defined $id and $id and ref $id eq "HASH" and exists $id->{"type"} and exists $id->{"value"}) 0 0 0
Condition0%0/12
defined $id and $id and ref $id eq "HASH" and exists $id->{"type"} and exists $id->{"value"}
!ll&&!rl&&r
000
defined $id and $id and ref $id eq "HASH" and exists $id->{"type"}
!ll&&!rl&&r
000
defined $id and $id and ref $id eq "HASH"
!ll&&!rl&&r
000
defined $id and $id
!ll&&!rl&&r
000
MC/DC0%0/5
defined $id and $id and ref $id eq "HASH" and exists $id->{"type"} and exists $id->{"value"}
defined $id $id ref $id eq "HASH" exists $id->{"type"} exists $id->{"value"}
Truth table0%0/6
A and B and C and D and E
A= defined $idB= $idC= ref $id eq "HASH"D= exists $id->{"type"}E= exists $id->{"value"}
ABCDEresult
0XXXX0
10XXX0
110XX0
1110X0
111100
111111
243 && ( ref($id) eq 'HASH' )
244 && exists( $id->{type} )
245 && exists( $id->{value} ) )
246 {
247 push @e,
248 [
249 'no-ext-contact:identity', { type => $id->{type} },
250 $id->{value}
251 0 ];
252 }
253  
254 #mobile is an e164 number
255 0 ▶ push @e,
Branch: 1 branch
BranchTrueFalseTotal
if defined $mp 0 0 0
256 Net::DRI::Protocol::EPP::Util::build_tel(
257 'no-ext-contact:mobilePhone', $mp )
258 if defined($mp);
259  
260 # email
261 0 ▶ if ( defined($aem) && $aem ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $aem and $aem) 0 0 0
Condition0%0/3
defined $aem and $aem
!ll&&!rl&&r
000
MC/DC0%0/2
defined $aem and $aem
defined $aem $aem
Truth table0%0/3
A and B
A= defined $aemB= $aem
ABresult
0X0
100
111
262 0 ▶ if (ref($aem) eq 'ARRAY' ) {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $aem eq 'ARRAY') { } 0 0 0
263 0 foreach my $c (@$aem) {
264 0 push @e, [ 'no-ext-contact:email', $c ];
265 }
266 } else {
267
268 # scalar
269 0 push @e, [ 'no-ext-contact:email', $aem ];
270 }
271 }
272  
273 #organization is a clID
274 0 ▶ if ( defined($org) && $org ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $org and $org) 0 0 0
Condition0%0/3
defined $org and $org
!ll&&!rl&&r
000
MC/DC0%0/2
defined $org and $org
defined $org $org
Truth table0%0/3
A and B
A= defined $orgB= $org
ABresult
0X0
100
111
275 0 ▶ if ( ref($org) eq 'ARRAY' ) {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $org eq 'ARRAY') { } 0 0 0
276 0 foreach my $c (@$org) {
277 0 push @e, [ 'no-ext-contact:organization', $c ];
278 }
279 } else {
280  
281 # scalar
282 0 push @e, [ 'no-ext-contact:organization', $org ];
283  
284 }
285 }
286  
287 #roleContact is a clID
288 0 ▶ if ( defined($rc) && $rc ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $rc and $rc) 0 0 0
Condition0%0/3
defined $rc and $rc
!ll&&!rl&&r
000
MC/DC0%0/2
defined $rc and $rc
defined $rc $rc
Truth table0%0/3
A and B
A= defined $rcB= $rc
ABresult
0X0
100
111
289 0 ▶ if ( ref($rc) eq 'ARRAY' ) {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $rc eq 'ARRAY') { } 0 0 0
290 0 foreach my $c (@$rc) {
291 0 push @e, [ 'no-ext-contact:roleContact', $c ];
292 }
293 } else {
294
295 # scalar
296 0 push @e, [ 'no-ext-contact:roleContact', $rc ];
297
298 }
299 }
300  
301 # xdisclose
302 0 ▶ if ( defined ($xd) && $xd && (ref($xd) eq 'HASH') && exists( $xd->{mobilePhone} ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $xd and $xd and ref $xd eq "HASH" and exists $xd->{"mobilePhone"}) 0 0 0
Condition0%0/9
defined $xd and $xd and ref $xd eq "HASH" and exists $xd->{"mobilePhone"}
!ll&&!rl&&r
000
defined $xd and $xd and ref $xd eq "HASH"
!ll&&!rl&&r
000
defined $xd and $xd
!ll&&!rl&&r
000
MC/DC0%0/4
defined $xd and $xd and ref $xd eq "HASH" and exists $xd->{"mobilePhone"}
defined $xd $xd ref $xd eq "HASH" exists $xd->{"mobilePhone"}
Truth table0%0/5
A and B and C and D
A= defined $xdB= $xdC= ref $xd eq "HASH"D= exists $xd->{"mobilePhone"}
ABCDresult
0XXX0
10XX0
110X0
11100
11111
303 0 my @d;
304 0 my %v = map { $_ => 1 } values(%$xd);
305 0 ▶ if (keys(%v) == 1) {
Branch: 1 branch
BranchTrueFalseTotal
if (keys %v == 1) 0 0 0
306 ## 1 or 0 as values, not both at same time
307 0 push @d, ['no-ext-contact:mobilePhone'];
308  
309 0 push @e,
310 [ 'no-ext-contact:disclose', @d, { flag => ( keys(%v) )[0] } ];
311 }
312 }
313 0 my $r = $mes->command_extension( $eid, \@e );
314  
315 # Add facet if any is set
316 0 ▶ if ($fs) {
Branch: 1 branch
BranchTrueFalseTotal
if ($fs) 0 0 0
317 0 my $rd;
318 0 $rd->{facets} = $fs;
319 0 $r = facet($epp, $contact, $rd);
320 }
321  
322 0 return $r;
323 }
324  
325 sub create {
326 0 ▶ my ( $epp, $contact ) = @_;
Subroutine create: not called CC=1 SCAR=6.9
Pod undocumented
327 0 return add_no_extensions( $epp, $contact, 'create' );
328 }
329  
330 sub update {
331 0 ▶ my ( $epp, $co, $todo ) = @_;
Subroutine update: not called CC=56 SCAR=80.7
Pod undocumented
332 0 my $mes = $epp->message();
333  
334 0 my $r;
335 0 my $mp = $todo->set('mobilephone');
336 0 my $id = $todo->set('identity');
337 0 my $xd = $todo->set('xdisclose');
338 0 my $fs = $todo->set('facets');
339  
340 0 my $orgtoadd = $todo->add('organization');
341 0 my $orgtodel = $todo->del('organization');
342  
343 0 my $rctoadd = $todo->add('rolecontact');
344 0 my $rctodel = $todo->del('rolecontact');
345  
346 0 my $xetoadd = $todo->add('xemail');
347 0 my $xetodel = $todo->del('xemail');
348  
349 0 ▶ return unless ( defined($mp)
Branch: 1 branch
BranchTrueFalseTotal
unless defined $mp or $id or $orgtoadd or $orgtodel or $rctoadd or $rctodel or $xetoadd or $xetodel or $xd or $fs 0 0 0
Condition0%0/27
defined $mp or $id or $orgtoadd or $orgtodel or $rctoadd or $rctodel or $xetoadd or $xetodel or $xd or $fs
l!l&&r!l&&!r
000
defined $mp or $id or $orgtoadd or $orgtodel or $rctoadd or $rctodel or $xetoadd or $xetodel or $xd
l!l&&r!l&&!r
000
defined $mp or $id or $orgtoadd or $orgtodel or $rctoadd or $rctodel or $xetoadd or $xetodel
l!l&&r!l&&!r
000
defined $mp or $id or $orgtoadd or $orgtodel or $rctoadd or $rctodel or $xetoadd
l!l&&r!l&&!r
000
defined $mp or $id or $orgtoadd or $orgtodel or $rctoadd or $rctodel
l!l&&r!l&&!r
000
defined $mp or $id or $orgtoadd or $orgtodel or $rctoadd
l!l&&r!l&&!r
000
defined $mp or $id or $orgtoadd or $orgtodel
l!l&&r!l&&!r
000
defined $mp or $id or $orgtoadd
l!l&&r!l&&!r
000
defined $mp or $id
l!l&&r!l&&!r
000
MC/DC0%0/10
defined $mp or $id or $orgtoadd or $orgtodel or $rctoadd or $rctodel or $xetoadd or $xetodel or $xd or $fs
defined $mp $id $orgtoadd $orgtodel $rctoadd $rctodel $xetoadd $xetodel $xd $fs
Truth table0%0/11
A or B or C or D or E or F or G or H or I or J
A= defined $mpB= $idC= $orgtoaddD= $orgtodelE= $rctoaddF= $rctodelG= $xetoaddH= $xetodelI= $xdJ= $fs
ABCDEFGHIJresult
1XXXXXXXXX1
01XXXXXXXX1
001XXXXXXX1
0001XXXXXX1
00001XXXXX1
000001XXXX1
0000001XXX1
00000001XX1
000000001X1
00000000011
00000000000
350 || $id
351 || $orgtoadd
352 || $orgtodel
353 || $rctoadd
354 || $rctodel
355 || $xetoadd
356 || $xetodel
357 || $xd
358 || $fs);
359  
360 0 ▶ if ( defined($mp)
Branch: 1 branch
BranchTrueFalseTotal
if (defined $mp or $id or $orgtoadd or $orgtodel or $rctoadd or $rctodel or $xetoadd or $xetodel or $xd) 0 0 0
Condition0%0/24
defined $mp or $id or $orgtoadd or $orgtodel or $rctoadd or $rctodel or $xetoadd or $xetodel or $xd
l!l&&r!l&&!r
000
defined $mp or $id or $orgtoadd or $orgtodel or $rctoadd or $rctodel or $xetoadd or $xetodel
l!l&&r!l&&!r
000
defined $mp or $id or $orgtoadd or $orgtodel or $rctoadd or $rctodel or $xetoadd
l!l&&r!l&&!r
000
defined $mp or $id or $orgtoadd or $orgtodel or $rctoadd or $rctodel
l!l&&r!l&&!r
000
defined $mp or $id or $orgtoadd or $orgtodel or $rctoadd
l!l&&r!l&&!r
000
defined $mp or $id or $orgtoadd or $orgtodel
l!l&&r!l&&!r
000
defined $mp or $id or $orgtoadd
l!l&&r!l&&!r
000
defined $mp or $id
l!l&&r!l&&!r
000
MC/DC0%0/9
defined $mp or $id or $orgtoadd or $orgtodel or $rctoadd or $rctodel or $xetoadd or $xetodel or $xd
defined $mp $id $orgtoadd $orgtodel $rctoadd $rctodel $xetoadd $xetodel $xd
Truth table0%0/10
A or B or C or D or E or F or G or H or I
A= defined $mpB= $idC= $orgtoaddD= $orgtodelE= $rctoaddF= $rctodelG= $xetoaddH= $xetodelI= $xd
ABCDEFGHIresult
1XXXXXXXX1
01XXXXXXX1
001XXXXXX1
0001XXXXX1
00001XXXX1
000001XXX1
0000001XX1
00000001X1
0000000011
0000000000
361 || $id
362 || $orgtoadd
363 || $orgtodel
364 || $rctoadd
365 || $rctodel
366 || $xetoadd
367 || $xetodel
368 || $xd) {
369  
370 0 my $eid = $mes->command_extension_register('no-ext-contact', 'update' );
371  
372 0 my ( @n, @s );
373  
374 0 ▶ if ( defined($mp) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $mp) 0 0 0
375 0 push @s,
376 Net::DRI::Protocol::EPP::Util::build_tel(
377 'no-ext-contact:mobilePhone', $mp );
378 }
379 0 ▶ if ( defined($id)
Branch: 1 branch
BranchTrueFalseTotal
if (defined $id and ref $id eq "HASH" and exists $id->{"type"} and exists $id->{"value"}) 0 0 0
Condition0%0/9
defined $id and ref $id eq "HASH" and exists $id->{"type"} and exists $id->{"value"}
!ll&&!rl&&r
000
defined $id and ref $id eq "HASH" and exists $id->{"type"}
!ll&&!rl&&r
000
defined $id and ref $id eq "HASH"
!ll&&!rl&&r
000
MC/DC0%0/4
defined $id and ref $id eq "HASH" and exists $id->{"type"} and exists $id->{"value"}
defined $id ref $id eq "HASH" exists $id->{"type"} exists $id->{"value"}
Truth table0%0/5
A and B and C and D
A= defined $idB= ref $id eq "HASH"C= exists $id->{"type"}D= exists $id->{"value"}
ABCDresult
0XXX0
10XX0
110X0
11100
11111
380 && ( ref($id) eq 'HASH' )
381 && exists( $id->{type} )
382 && exists( $id->{value} ) )
383 {
384 push @s,
385 [
386 'no-ext-contact:identity', { type => $id->{type} },
387 $id->{value}
388 0 ];
389 }
390  
391 # xdisclose
392 0 ▶ if ( ref($xd) && $xd ) {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $xd and $xd) 0 0 0
Condition0%0/3
ref $xd and $xd
!ll&&!rl&&r
000
MC/DC0%0/2
ref $xd and $xd
ref $xd $xd
Truth table0%0/3
A and B
A= ref $xdB= $xd
ABresult
0X0
100
111
393 0 my @d;
394 0 my %v = map { $_ => 1 } values(%$xd);
395 push @d, ['no-ext-contact:mobilePhone']
396 0 ▶ if exists( $xd->{mobilePhone} );
Branch: 1 branch
BranchTrueFalseTotal
if exists $xd->{"mobilePhone"} 0 0 0
397 0 push @s,
398 [ 'no-ext-contact:disclose', @d, { flag => ( keys(%v) )[0] } ];
399 }
400 0 ▶ push @n, [ 'no-ext-contact:chg', @s ] if ( @s > 0 );
Branch: 1 branch
BranchTrueFalseTotal
if @s > 0 0 0 0
401  
402 0 @s = undef;
403 0 ▶ if ( ( defined($orgtoadd) || defined($rctoadd) || defined($xetoadd) )
Branch: 1 branch
BranchTrueFalseTotal
if (defined $orgtoadd || defined $rctoadd || defined $xetoadd and $rctoadd || $orgtoadd || $xetoadd) 0 0 0
Condition0%0/15
defined $orgtoadd || defined $rctoadd || defined $xetoadd and $rctoadd || $orgtoadd || $xetoadd
!ll&&!rl&&r
000
defined $orgtoadd or defined $rctoadd or defined $xetoadd
l!l&&r!l&&!r
000
defined $orgtoadd or defined $rctoadd
l!l&&r!l&&!r
000
$rctoadd or $orgtoadd or $xetoadd
l!l&&r!l&&!r
000
$rctoadd or $orgtoadd
l!l&&r!l&&!r
000
MC/DC0%0/6
defined $orgtoadd || defined $rctoadd || defined $xetoadd and $rctoadd || $orgtoadd || $xetoadd
defined $orgtoadd defined $rctoadd defined $xetoadd $rctoadd $orgtoadd $xetoadd
Truth table0%0/13
A or B or C and D or E or F
A= defined $orgtoaddB= defined $rctoaddC= defined $xetoaddD= $rctoaddE= $orgtoaddF= $xetoadd
ABCDEFresult
000XXX0
1XX0000
01X0000
0010000
1XX1XX1
1XX01X1
1XX0011
01X1XX1
01X01X1
01X0011
0011XX1
00101X1
0010011
404 && ( $rctoadd || $orgtoadd || $xetoadd ) )
405 {
406 push @s,
407 0 ▶ map { [ 'no-ext-contact:email', $_ ] }
Branch: 2 branches
BranchTrueFalseTotal
if $xetoadd 0 0 0
ref $xetoadd eq 'ARRAY' ? : 0 0 0
408 ( ref($xetoadd) eq 'ARRAY' ) ? @$xetoadd : ($xetoadd)
409 if ($xetoadd);
410 push @s,
411 0 ▶ map { [ 'no-ext-contact:organization', $_ ] }
Branch: 2 branches
BranchTrueFalseTotal
if $orgtoadd 0 0 0
ref $orgtoadd eq 'ARRAY' ? : 0 0 0
412 ( ref($orgtoadd) eq 'ARRAY' ) ? @$orgtoadd : ($orgtoadd)
413 if ($orgtoadd);
414 push @s,
415 0 ▶ map { [ 'no-ext-contact:roleContact', $_ ] }
Branch: 2 branches
BranchTrueFalseTotal
if $rctoadd 0 0 0
ref $rctoadd eq 'ARRAY' ? : 0 0 0
416 ( ref($rctoadd) eq 'ARRAY' ) ? @$rctoadd : ($rctoadd)
417 if ($rctoadd);
418 0 ▶ push @n, [ 'no-ext-contact:add', @s ] if ( @s > 0 );
Branch: 1 branch
BranchTrueFalseTotal
if @s > 0 0 0 0
419 }
420 0 @s = undef;
421 0 ▶ if ( defined($orgtodel)
Branch: 1 branch
BranchTrueFalseTotal
if (defined $orgtodel or defined($rctodel || defined $xetoadd) and $rctodel || $orgtodel || $xetodel) 0 0 0
Condition0%0/15
defined $orgtodel or defined($rctodel || defined $xetoadd) and $rctodel || $orgtodel || $xetodel
l!l&&r!l&&!r
000
defined($rctodel || defined $xetoadd) and $rctodel || $orgtodel || $xetodel
!ll&&!rl&&r
000
$rctodel || defined $xetoadd
l!l&&r!l&&!r
000
$rctodel or $orgtodel or $xetodel
l!l&&r!l&&!r
000
$rctodel or $orgtodel
l!l&&r!l&&!r
000
MC/DC0%0/6
defined $orgtodel or defined($rctodel || defined $xetoadd) and $rctodel || $orgtodel || $xetodel
defined $orgtodel $rctodel defined $xetoadd $rctodel $orgtodel $xetodel
Truth table0%0/10
A or B || C and D or E or F
A= defined $orgtodelB= $rctodelC= defined $xetoaddD= $rctodelE= $orgtodelF= $xetodel
ABCDEFresult
1XXXXX1
01X1XX1
01X01X1
01X0011
0011XX1
00101X1
0010011
000XXX0
01X0000
0010000
422 || defined( $rctodel || defined($xetoadd) )
423 && ( $rctodel || $orgtodel || $xetodel ) )
424 {
425 push @s,
426 0 ▶ map { [ 'no-ext-contact:email', $_ ] }
Branch: 2 branches
BranchTrueFalseTotal
if $xetodel 0 0 0
ref $xetodel eq 'ARRAY' ? : 0 0 0
427 ( ref($xetodel) eq 'ARRAY' ) ? @$xetodel : ($xetodel)
428 if ($xetodel);
429 push @s,
430 0 ▶ map { [ 'no-ext-contact:organization', $_ ] }
Branch: 2 branches
BranchTrueFalseTotal
if $orgtodel 0 0 0
ref $orgtodel eq 'ARRAY' ? : 0 0 0
431 ( ref($orgtodel) eq 'ARRAY' ) ? @$orgtodel : ($orgtodel)
432 if ($orgtodel);
433 push @s,
434 0 ▶ map { [ 'no-ext-contact:roleContact', $_ ] }
Branch: 2 branches
BranchTrueFalseTotal
if $rctodel 0 0 0
ref $rctodel eq 'ARRAY' ? : 0 0 0
435 ( ref($rctodel) eq 'ARRAY' ) ? @$rctodel : ($rctodel)
436 if ($rctodel);
437 0 ▶ push @n, [ 'no-ext-contact:rem', @s ] if ( @s > 0 );
Branch: 1 branch
BranchTrueFalseTotal
if @s > 0 0 0 0
438 }
439 0 $r = $mes->command_extension( $eid, \@n );
440 }
441  
442 0 ▶ if ($fs) {
Branch: 1 branch
BranchTrueFalseTotal
if ($fs) 0 0 0
443 0 my $rd;
444 0 $rd->{facets} = $fs;
445 0 $r = facet($epp, $co, $rd);
446
447 }
448 0 return $r;
449 }
450  
451 ####################################################################################################
452 1 1;
« DRI/Data/Contact/AT.pm ↑ Summary DRI/Shell.pm »