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

filter: Statementstmt 10.7% 16 / 149 Branchbran 0.0% 0 / 120 Conditioncond 0.0% 0 / 57 MC/DCmcdc 0.0% 0 / 35 Subroutinesub 33.3% 5 / 15 Podpod 0.0% 0 / 10 totaltotal 5.4% 21 / 386 CC 84 SCAR 66.3
CC
84
Cov
5%
add_puntcat_extension
1640.0
info_parse
272.0
update
240.0
CRAP 756.4
« DRI/Protocol/EPP/Extensions/AT/Message.pm ↑ Summary DRI/Data/Contact.pm »
1 ## Domain Registry Interface, .CAT Domain EPP extension commands
2 ##
3 ## Copyright (c) 2006-2008,2012-2014,2016 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::CAT::Domain;
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  
20 1 ▶use Email::Valid;
Subroutine BEGIN: called CC=1 SCAR=0.0
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  
24 =pod
25  
26 =head1 NAME
27  
28 Net::DRI::Protocol::EPP::Extensions::CAT::Domain - .CAT EPP Domain extension commands for Net::DRI
29  
30 =head1 DESCRIPTION
31  
32 Please see the README file for details.
33  
34 =head1 SUPPORT
35  
36 For now, support questions should be sent to:
37  
38 E<lt>netdri@dotandco.comE<gt>
39  
40 Please also see the SUPPORT file in the distribution.
41  
42 =head1 SEE ALSO
43  
44 E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt>
45  
46 =head1 AUTHOR
47  
48 Patrick Mevzek, E<lt>netdri@dotandco.comE<gt>
49  
50 =head1 COPYRIGHT
51  
52 Copyright (c) 2006-2008,2012-2014,2016 Patrick Mevzek <netdri@dotandco.com>.
53 All rights reserved.
54  
55 This program is free software; you can redistribute it and/or modify
56 it under the terms of the GNU General Public License as published by
57 the Free Software Foundation; either version 2 of the License, or
58 (at your option) any later version.
59  
60 See the LICENSE file that comes with this distribution for more details.
61  
62 =cut
63  
64 ####################################################################################################
65  
66 sub register_commands
67 {
68 0 ▶ my ($class,$version)=@_;
Subroutine register_commands: not called CC=1 SCAR=6.9
Pod undocumented
69 0 my %tmp=(
70 create => [ \&create, undef ],
71 update => [ \&update, undef ],
72 info => [ undef, \&info_parse ],
73 );
74  
75 0 return { 'domain' => \%tmp };
76 }
77  
78 ####################################################################################################
79  
80 sub add_name_variant
81 {
82 0 ▶ my ($d)=@_;
Subroutine add_name_variant: not called CC=4 SCAR=30.0
Pod undocumented
83 0 my @n;
84  
85 0 ▶ foreach my $n ((ref($d) eq 'ARRAY')? @{$d} : ($d))
Branch: 1 branch
BranchTrueFalseTotal
ref $d eq 'ARRAY' ? : 0 0 0
86 {
87 0 ▶ Net::DRI::Exception::usererr_invalid_parameters($n.' in name_variant attribute must be an XML token between 1 & 255 chars in length') unless Net::DRI::Util::xml_is_token($n,1,255);
Branch: 1 branch
BranchTrueFalseTotal
unless Net::DRI::Util::xml_is_token($n, 1, 255) 0 0 0
88 0 push @n,['dx:nameVariant',$n];
89 }
90  
91 0 return @n;
92 }
93  
94 sub add_lang
95 {
96 0 ▶ my ($d)=@_;
Subroutine add_lang: not called CC=3 SCAR=24.8
Pod undocumented
97 0 ▶ Net::DRI::Exception::usererr_invalid_parameters('lang attribute must be an XML language') unless (($d eq '') || Net::DRI::Util::xml_is_language($d));
Branch: 1 branch
BranchTrueFalseTotal
unless $d eq "" or Net::DRI::Util::xml_is_language($d) 0 0 0
Condition0%0/3
$d eq "" or Net::DRI::Util::xml_is_language($d)
l!l&&r!l&&!r
000
MC/DC0%0/2
$d eq "" or Net::DRI::Util::xml_is_language($d)
$d eq "" Net::DRI::Util::xml_is_language($d)
Truth table0%0/3
A or B
A= $d eq ""B= Net::DRI::Util::xml_is_language($d)
ABresult
1X1
011
000
98 0 return ['dx:language',$d];
99 }
100  
101 sub add_maintainer
102 {
103 0 ▶ my ($d)=@_;
Subroutine add_maintainer: not called CC=2 SCAR=17.9
Pod undocumented
104 0 ▶ Net::DRI::Exception::usererr_invalid_parameters('maintainer attribute must be an XML token not more than 128 chars long') unless Net::DRI::Util::xml_is_token($d,undef,128);
Branch: 1 branch
BranchTrueFalseTotal
unless Net::DRI::Util::xml_is_token($d, undef, 128) 0 0 0
105 0 return ['dx:maintainer',$d];
106 }
107  
108 sub add_intended_use
109 {
110 0 ▶ my ($d)=@_;
Subroutine add_intended_use: not called CC=3 SCAR=24.8
Pod undocumented
111 0 ▶ Net::DRI::Exception::usererr_invalid_parameters('intended_use must be a string between 1 and 1000 chars long') unless (''.$d && (length $d <= 1000));
Branch: 1 branch
BranchTrueFalseTotal
unless '' . $d and length $d <= 1000 0 0 0
Condition0%0/3
'' . $d and length $d <= 1000
!ll&&!rl&&r
000
MC/DC0%0/2
'' . $d and length $d <= 1000
'' . $d length $d <= 1000
Truth table0%0/3
A and B
A= '' . $dB= length $d <= 1000
ABresult
0X0
100
111
112 0 return ['dx:intendedUse',$d];
113 }
114  
115 sub add_disclose
116 {
117 0 ▶ my ($rd)=@_;
Subroutine add_disclose: not called CC=7 SCAR=40.3
Pod undocumented
118 0 ▶ Net::DRI::Exception::usererr_invalid_parameters('registrant_disclosure must be a ref hash') unless ref $rd eq 'HASH';
Branch: 1 branch
BranchTrueFalseTotal
unless ref $rd eq "HASH" 0 0 0
119 0 ▶ Net::DRI::Exception::usererr_invalid_parameters('registrant_disclosure must have a type key') unless exists $rd->{type};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $rd->{"type"} 0 0 0
120 0 ▶ Net::DRI::Exception::usererr_invalid_parameters('registrant_disclosure type key must have value "natural" or "legal"') unless $rd->{type}=~m/^(?:natural|legal)$/;
Branch: 1 branch
BranchTrueFalseTotal
unless $rd->{"type"} =~ /^(?:natural|legal)$/ 0 0 0
121 0 ▶ if ($rd->{type} eq 'natural')
Branch: 1 branch
BranchTrueFalseTotal
if ($rd->{'type'} eq 'natural') { } 0 0 0
122 {
123 0 ▶ Net::DRI::Exception::usererr_invalid_parameters('registrant_disclosure must have a disclose key when type=natural') unless exists $rd->{disclose};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $rd->{"disclose"} 0 0 0
124 0 ▶ return ['dx:disclosure',['dx:natural',{disclose => $rd->{disclose} ? 'true' : 'false' }]];
Branch: 1 branch
BranchTrueFalseTotal
$rd->{'disclose'} ? : 0 0 0
125 } else
126 {
127 0 return ['dx:disclosure',['dx:legal']];
128 }
129 }
130  
131 sub add_puntcat_extension
132 {
133 0 ▶ my ($rd)=@_;
Subroutine add_puntcat_extension: not called CC=40 SCAR=74.0
Pod undocumented
134 0 my @n;
135 0 ▶ return @n unless (defined $rd && ref $rd eq 'HASH' && keys %$rd);
Branch: 1 branch
BranchTrueFalseTotal
unless defined $rd and ref $rd eq "HASH" and keys %$rd 0 0 0
Condition0%0/6
defined $rd and ref $rd eq "HASH" and keys %$rd
!ll&&!rl&&r
000
defined $rd and ref $rd eq "HASH"
!ll&&!rl&&r
000
MC/DC0%0/3
defined $rd and ref $rd eq "HASH" and keys %$rd
defined $rd ref $rd eq "HASH" keys %$rd
Truth table0%0/4
A and B and C
A= defined $rdB= ref $rd eq "HASH"C= keys %$rd
ABCresult
0XX0
10X0
1100
1111
136  
137 0 ▶ if (exists $rd->{name_variant} && defined $rd->{name_variant})
Branch: 1 branch
BranchTrueFalseTotal
if (exists $rd->{"name_variant"} and defined $rd->{"name_variant"}) 0 0 0
Condition0%0/3
exists $rd->{"name_variant"} and defined $rd->{"name_variant"}
!ll&&!rl&&r
000
MC/DC0%0/2
exists $rd->{"name_variant"} and defined $rd->{"name_variant"}
exists $rd->{"name_variant"} defined $rd->{"name_variant"}
Truth table0%0/3
A and B
A= exists $rd->{"name_variant"}B= defined $rd->{"name_variant"}
ABresult
0X0
100
111
138 {
139 0 push @n,add_name_variant($rd->{name_variant});
140 }
141  
142 0 ▶ push @n,add_lang($rd->{lang}) if (exists $rd->{lang} && defined $rd->{lang});
Branch: 1 branch
BranchTrueFalseTotal
if exists $rd->{"lang"} and defined $rd->{"lang"} 0 0 0
Condition0%0/3
exists $rd->{"lang"} and defined $rd->{"lang"}
!ll&&!rl&&r
000
MC/DC0%0/2
exists $rd->{"lang"} and defined $rd->{"lang"}
exists $rd->{"lang"} defined $rd->{"lang"}
Truth table0%0/3
A and B
A= exists $rd->{"lang"}B= defined $rd->{"lang"}
ABresult
0X0
100
111
143 0 ▶ push @n,add_maintainer($rd->{maintainer}) if (exists $rd->{maintainer} && defined $rd->{maintainer});
Branch: 1 branch
BranchTrueFalseTotal
if exists $rd->{"maintainer"} and defined $rd->{"maintainer"} 0 0 0
Condition0%0/3
exists $rd->{"maintainer"} and defined $rd->{"maintainer"}
!ll&&!rl&&r
000
MC/DC0%0/2
exists $rd->{"maintainer"} and defined $rd->{"maintainer"}
exists $rd->{"maintainer"} defined $rd->{"maintainer"}
Truth table0%0/3
A and B
A= exists $rd->{"maintainer"}B= defined $rd->{"maintainer"}
ABresult
0X0
100
111
144  
145 0 ▶ Net::DRI::Exception::usererr_insufficient_parameters('ens block is mandatory, since intendeduse are mandatory') unless (exists $rd->{ens} && defined $rd->{ens} && (ref $rd->{ens} eq 'HASH'));
Branch: 1 branch
BranchTrueFalseTotal
unless exists $rd->{"ens"} and defined $rd->{"ens"} and ref $rd->{"ens"} eq "HASH" 0 0 0
Condition0%0/6
exists $rd->{"ens"} and defined $rd->{"ens"} and ref $rd->{"ens"} eq "HASH"
!ll&&!rl&&r
000
exists $rd->{"ens"} and defined $rd->{"ens"}
!ll&&!rl&&r
000
MC/DC0%0/3
exists $rd->{"ens"} and defined $rd->{"ens"} and ref $rd->{"ens"} eq "HASH"
exists $rd->{"ens"} defined $rd->{"ens"} ref $rd->{"ens"} eq "HASH"
Truth table0%0/4
A and B and C
A= exists $rd->{"ens"}B= defined $rd->{"ens"}C= ref $rd->{"ens"} eq "HASH"
ABCresult
0XX0
10X0
1100
1111
146 0 my %ens=%{$rd->{ens}};
147 0 my @ens;
148  
149 0 ▶ if (exists $ens{auth} && defined $ens{auth})
Branch: 1 branch
BranchTrueFalseTotal
if (exists $ens{"auth"} and defined $ens{"auth"}) 0 0 0
Condition0%0/3
exists $ens{"auth"} and defined $ens{"auth"}
!ll&&!rl&&r
000
MC/DC0%0/2
exists $ens{"auth"} and defined $ens{"auth"}
exists $ens{"auth"} defined $ens{"auth"}
Truth table0%0/3
A and B
A= exists $ens{"auth"}B= defined $ens{"auth"}
ABresult
0X0
100
111
150 {
151 0 ▶ my %auth=(ref $ens{auth} eq 'HASH')? (key => $ens{auth}->{key}, id => $ens{auth}->{id} ) : (id => $ens{auth});
Branch: 1 branch
BranchTrueFalseTotal
ref $ens{'auth'} eq 'HASH' ? : 0 0 0
152 0 ▶ Net::DRI::Exception::usererr_insufficient_parameters('in ens auth block, id is mandatory') unless (exists $auth{id} && defined $auth{id});
Branch: 1 branch
BranchTrueFalseTotal
unless exists $auth{"id"} and defined $auth{"id"} 0 0 0
Condition0%0/3
exists $auth{"id"} and defined $auth{"id"}
!ll&&!rl&&r
000
MC/DC0%0/2
exists $auth{"id"} and defined $auth{"id"}
exists $auth{"id"} defined $auth{"id"}
Truth table0%0/3
A and B
A= exists $auth{"id"}B= defined $auth{"id"}
ABresult
0X0
100
111
153 0 ▶ Net::DRI::Exception::usererr_invalid_parameters('id in ens auth block must be XML token between 1 and 20 chars long') if !Net::DRI::Util::xml_is_token($auth{id},1,20);
Branch: 1 branch
BranchTrueFalseTotal
unless Net::DRI::Util::xml_is_token($auth{"id"}, 1, 20) 0 0 0
154 0 ▶ Net::DRI::Exception::usererr_invalid_parameters('key in ens auth block must be XML token between 1 and 20 chars long') if (exists $auth{key} && !Net::DRI::Util::xml_is_token($auth{key},1,20));
Branch: 1 branch
BranchTrueFalseTotal
if exists $auth{"key"} and not Net::DRI::Util::xml_is_token($auth{"key"}, 1, 20) 0 0 0
Condition0%0/3
exists $auth{"key"} and not Net::DRI::Util::xml_is_token($auth{"key"}, 1, 20)
!ll&&!rl&&r
000
MC/DC0%0/2
exists $auth{"key"} and not Net::DRI::Util::xml_is_token($auth{"key"}, 1, 20)
exists $auth{"key"} not Net::DRI::Util::xml_is_token($auth{"key"}, 1, 20)
Truth table0%0/3
A and not(B)
A= exists $auth{"key"}B= not Net::DRI::Util::xml_is_token($auth{"key"}, 1, 20)
ABresult
0X0
100
111
155 0 push @ens,['dx:auth',\%auth];
156 }
157  
158 0 ▶ if (exists $ens{sponsor} && defined $ens{sponsor})
Branch: 1 branch
BranchTrueFalseTotal
if (exists $ens{"sponsor"} and defined $ens{"sponsor"}) 0 0 0
Condition0%0/3
exists $ens{"sponsor"} and defined $ens{"sponsor"}
!ll&&!rl&&r
000
MC/DC0%0/2
exists $ens{"sponsor"} and defined $ens{"sponsor"}
exists $ens{"sponsor"} defined $ens{"sponsor"}
Truth table0%0/3
A and B
A= exists $ens{"sponsor"}B= defined $ens{"sponsor"}
ABresult
0X0
100
111
159 {
160 0 my @e;
161 0 ▶ foreach my $e ((ref $ens{sponsor} eq 'ARRAY')? @{$ens{sponsor}} : ($ens{sponsor}))
Branch: 1 branch
BranchTrueFalseTotal
ref $ens{'sponsor'} eq 'ARRAY' ? : 0 0 0
162 {
163 0 ▶ Net::DRI::Exception::usererr_invalid_parameters("sponsor value $e in ens block must be a valid email address") unless (defined($e) && Net::DRI::Util::xml_is_token($e,1,undef) && Email::Valid->rfc822($e));
Branch: 1 branch
BranchTrueFalseTotal
unless defined $e and Net::DRI::Util::xml_is_token($e, 1, undef) and "Email::Valid"->rfc822($e) 0 0 0
Condition0%0/6
defined $e and Net::DRI::Util::xml_is_token($e, 1, undef) and "Email::Valid"->rfc822($e)
!ll&&!rl&&r
000
defined $e and Net::DRI::Util::xml_is_token($e, 1, undef)
!ll&&!rl&&r
000
MC/DC0%0/3
defined $e and Net::DRI::Util::xml_is_token($e, 1, undef) and "Email::Valid"->rfc822($e)
defined $e Net::DRI::Util::xml_is_token($e, 1, undef) "Email::Valid"->rfc822($e)
Truth table0%0/4
A and B and C
A= defined $eB= Net::DRI::Util::xml_is_token($e, 1, undef)C= "Email::Valid"->rfc822($e)
ABCresult
0XX0
10X0
1100
1111
164 0 push @e,['dx:sponsor',$e];
165 }
166 0 ▶ Net::DRI::Exception::usererr_invalid_parameters('there must be either 1 or 3 sponsors') unless (@e==1 || @e==3);
Branch: 1 branch
BranchTrueFalseTotal
unless @e == 1 or @e == 3 0 0 0
Condition0%0/3
@e == 1 or @e == 3
l!l&&r!l&&!r
000
MC/DC0%0/2
@e == 1 or @e == 3
@e == 1 @e == 3
Truth table0%0/3
A or B
A= @e == 1B= @e == 3
ABresult
1X1
011
000
167 0 push @ens,['dx:sponsoring',@e];
168 }
169  
170 0 ▶ if (exists $ens{ref_url} && defined $ens{ref_url})
Branch: 1 branch
BranchTrueFalseTotal
if (exists $ens{"ref_url"} and defined $ens{"ref_url"}) 0 0 0
Condition0%0/3
exists $ens{"ref_url"} and defined $ens{"ref_url"}
!ll&&!rl&&r
000
MC/DC0%0/2
exists $ens{"ref_url"} and defined $ens{"ref_url"}
exists $ens{"ref_url"} defined $ens{"ref_url"}
Truth table0%0/3
A and B
A= exists $ens{"ref_url"}B= defined $ens{"ref_url"}
ABresult
0X0
100
111
171 {
172 0 ▶ Net::DRI::Exception::usererr_invalid_parameters('ref_url in ens auth block must be XML token between 1 and 255 chars long') unless Net::DRI::Util::xml_is_token($ens{ref_url},1,255);
Branch: 1 branch
BranchTrueFalseTotal
unless Net::DRI::Util::xml_is_token($ens{"ref_url"}, 1, 255) 0 0 0
173 0 push @ens,['dx:refURL',$ens{ref_url}];
174 }
175  
176 0 ▶ if (exists $ens{registration_type} && defined $ens{registration_type})
Branch: 1 branch
BranchTrueFalseTotal
if (exists $ens{"registration_type"} and defined $ens{"registration_type"}) 0 0 0
Condition0%0/3
exists $ens{"registration_type"} and defined $ens{"registration_type"}
!ll&&!rl&&r
000
MC/DC0%0/2
exists $ens{"registration_type"} and defined $ens{"registration_type"}
exists $ens{"registration_type"} defined $ens{"registration_type"}
Truth table0%0/3
A and B
A= exists $ens{"registration_type"}B= defined $ens{"registration_type"}
ABresult
0X0
100
111
177 {
178 0 ▶ Net::DRI::Exception::usererr_invalid_parameters('registration_type in ens auth block must be XML token between 1 and 128 chars long') unless Net::DRI::Util::xml_is_token($ens{registration_type},1,128);
Branch: 1 branch
BranchTrueFalseTotal
unless Net::DRI::Util::xml_is_token($ens{"registration_type"}, 1, 128) 0 0 0
179 0 push @ens,['dx:registrationType',$ens{registration_type}];
180 }
181  
182 0 ▶ Net::DRI::Exception::usererr_insufficient_parameters('intended_use in ens auth block is mandatory') unless (exists $ens{intended_use} && defined $ens{intended_use});
Branch: 1 branch
BranchTrueFalseTotal
unless exists $ens{"intended_use"} and defined $ens{"intended_use"} 0 0 0
Condition0%0/3
exists $ens{"intended_use"} and defined $ens{"intended_use"}
!ll&&!rl&&r
000
MC/DC0%0/2
exists $ens{"intended_use"} and defined $ens{"intended_use"}
exists $ens{"intended_use"} defined $ens{"intended_use"}
Truth table0%0/3
A and B
A= exists $ens{"intended_use"}B= defined $ens{"intended_use"}
ABresult
0X0
100
111
183 0 push @ens,add_intended_use($ens{intended_use});
184  
185 0 ▶ push @n,['dx:ens',@ens] if @ens;
Branch: 1 branch
BranchTrueFalseTotal
if @ens 0 0 0
186  
187 0 ▶ push @n,add_disclose($rd->{registrant_disclosure}) if Net::DRI::Util::has_key($rd,'registrant_disclosure');
Branch: 1 branch
BranchTrueFalseTotal
if Net::DRI::Util::has_key($rd, "registrant_disclosure") 0 0 0
188 0 return @n;
189 }
190  
191 sub create
192 {
193 0 ▶ my ($epp,$domain,$rd)=@_;
Subroutine create: not called CC=2 SCAR=17.9
Pod undocumented
194 0 my $mes=$epp->message();
195  
196 0 my @n=add_puntcat_extension($rd);
197 0 ▶ return unless @n;
Branch: 1 branch
BranchTrueFalseTotal
unless @n 0 0 0
198  
199 0 my $eid=$mes->command_extension_register('dx', 'create');
200 0 $mes->command_extension($eid,\@n);
201 0 return;
202 }
203  
204 sub update
205 {
206 0 ▶ my ($epp,$domain,$todo)=@_;
Subroutine update: not called CC=15 SCAR=54.8
Pod undocumented
207 0 my $mes=$epp->message();
208 0 my (@tmp,@n);
209  
210 0 ▶ if ($todo->types('name_variant'))
Branch: 1 branch
BranchTrueFalseTotal
if ($todo->types("name_variant")) 0 0 0
211 {
212 0 ▶ Net::DRI::Exception->die(0,'protocol/EPP',11,'Only name_variant add/del available for domain') if grep { ! /^(?:add|del)$/ } $todo->types('name_variant');
Branch: 1 branch
BranchTrueFalseTotal
if grep {not /^(?:add|del)$/;} $todo->types("name_variant") 0 0 0
213  
214 0 @tmp=add_name_variant($todo->add('name_variant'));
215 0 ▶ push @n,['dx:add',@tmp] if @tmp;
Branch: 1 branch
BranchTrueFalseTotal
if @tmp 0 0 0
216 0 @tmp=add_name_variant($todo->del('name_variant'));
217 0 ▶ push @n,['dx:rem',@tmp] if @tmp;
Branch: 1 branch
BranchTrueFalseTotal
if @tmp 0 0 0
218 }
219  
220 0 @tmp=();
221  
222 0 ▶ if ($todo->types('lang'))
Branch: 1 branch
BranchTrueFalseTotal
if ($todo->types("lang")) 0 0 0
223 {
224 0 ▶ Net::DRI::Exception->die(0,'protocol/EPP',11,'Only lang set available for domain') if grep { $_ ne 'set' } $todo->types('lang');
Branch: 1 branch
BranchTrueFalseTotal
if grep {$_ ne "set";} $todo->types("lang") 0 0 0
225 0 push @tmp,add_lang($todo->set('lang'));
226 }
227 0 ▶ if ($todo->types('maintainer'))
Branch: 1 branch
BranchTrueFalseTotal
if ($todo->types("maintainer")) 0 0 0
228 {
229 0 ▶ Net::DRI::Exception->die(0,'protocol/EPP',11,'Only maintainer set available for domain') if grep { $_ ne 'set' } $todo->types('maintainer');
Branch: 1 branch
BranchTrueFalseTotal
if grep {$_ ne "set";} $todo->types("maintainer") 0 0 0
230 0 push @tmp,add_maintainer($todo->set('maintainer'));
231 }
232 0 ▶ if ($todo->types('intended_use'))
Branch: 1 branch
BranchTrueFalseTotal
if ($todo->types("intended_use")) 0 0 0
233 {
234 0 ▶ Net::DRI::Exception->die(0,'protocol/EPP',11,'Only intended_use set available for domain') if grep { $_ ne 'set' } $todo->types('intended_use');
Branch: 1 branch
BranchTrueFalseTotal
if grep {$_ ne "set";} $todo->types("intended_use") 0 0 0
235 0 push @tmp,add_intended_use($todo->set('intended_use'));
236 }
237 0 ▶ if ($todo->types('registrant_disclosure'))
Branch: 1 branch
BranchTrueFalseTotal
if ($todo->types("registrant_disclosure")) 0 0 0
238 {
239 0 ▶ Net::DRI::Exception->die(0,'protocol/EPP',11,'Only registrant_disclosure set available for domain') if grep { $_ ne 'set' } $todo->types('registrant_disclosure');
Branch: 1 branch
BranchTrueFalseTotal
if grep {$_ ne "set";} $todo->types("registrant_disclosure") 0 0 0
240 0 push @tmp,add_disclose($todo->set('registrant_disclosure'));
241 }
242 0 ▶ push @n,['dx:chg',@tmp] if @tmp;
Branch: 1 branch
BranchTrueFalseTotal
if @tmp 0 0 0
243  
244 0 ▶ return unless @n;
Branch: 1 branch
BranchTrueFalseTotal
unless @n 0 0 0
245 0 my $eid=$mes->command_extension_register('dx', 'update');
246 0 $mes->command_extension($eid,\@n);
247 0 return;
248 }
249  
250 sub info_parse
251 {
252 0 ▶ my ($po,$otype,$oaction,$oname,$rinfo)=@_;
Subroutine info_parse: not called CC=16 SCAR=56.1
Pod undocumented
253 0 my $mes=$po->message();
254 0 ▶ return unless $mes->is_success();
Branch: 1 branch
BranchTrueFalseTotal
unless $mes->is_success 0 0 0
255  
256 0 my $infdata=$mes->get_extension('dx','infData');
257 0 ▶ return unless $infdata;
Branch: 1 branch
BranchTrueFalseTotal
unless $infdata 0 0 0
258  
259 0 my $ns=$mes->ns('dx');
260 0 foreach my $el (Net::DRI::Util::xml_list_children($infdata))
261 {
262 0 my ($name,$c)=@$el;
263 0 ▶ if ($name eq 'nameVariant')
Branch: 5 branches
BranchTrueFalseTotal
if ($name eq 'nameVariant') { } 0 0 0
elsif ($name eq 'language') { } 0 0 0
elsif ($name eq 'maintainer') { } 0 0 0
elsif ($name eq 'ens') { } 0 0 0
elsif ($name eq 'disclosure') { } 0 0 0
264 {
265 0 push @{$rinfo->{domain}->{$oname}->{name_variant}},$c->textContent();
266 } elsif ($name eq 'language')
267 {
268 0 $rinfo->{domain}->{$oname}->{lang}=$c->textContent();
269 } elsif ($name eq 'maintainer')
270 {
271 0 $rinfo->{domain}->{$oname}->{maintainer}=$c->textContent();
272 } elsif ($name eq 'ens')
273 {
274 0 my %ens;
275 0 foreach my $ell (Net::DRI::Util::xml_list_children($c))
276 {
277 0 my ($name2,$cc)=@$ell;
278 0 ▶ if ($name2 eq 'auth')
Branch: 5 branches
BranchTrueFalseTotal
if ($name2 eq 'auth') { } 0 0 0
elsif ($name2 eq 'sponsoring') { } 0 0 0
elsif ($name2 eq 'refURL') { } 0 0 0
elsif ($name2 eq 'registrationType') { } 0 0 0
elsif ($name2 eq 'intendedUse') { } 0 0 0
279 {
280 0 $ens{auth}={ id => $cc->getAttribute('id') };
281 } elsif ($name2 eq 'sponsoring')
282 {
283 0 $ens{sponsor}=[ map { $_->textContent() } $cc->getChildrenByTagNameNS($ns,'sponsor') ];
284 } elsif ($name2 eq 'refURL')
285 {
286 0 $ens{ref_url}=$cc->textContent();
287 } elsif ($name2 eq 'registrationType')
288 {
289 0 $ens{registration_type}=$cc->textContent();
290 } elsif ($name2 eq 'intendedUse')
291 {
292 0 $ens{intended_use}=$cc->textContent();
293 }
294 }
295 0 $rinfo->{domain}->{$oname}->{ens}=\%ens;
296 } elsif ($name eq 'disclosure')
297 {
298 0 my @d=@{(Net::DRI::Util::xml_list_children($c))[0]};
299 0 my %e;
300 0 $e{type}=$d[0]; ## natural or legal
301 0 ▶ $e{disclose}=Net::DRI::Util::xml_parse_boolean($d[1]->getAttribute('disclose')) if ($e{type} eq 'natural');
Branch: 1 branch
BranchTrueFalseTotal
if $e{"type"} eq "natural" 0 0 0
302 0 $rinfo->{domain}->{$oname}->{registrant_disclosure}=\%e;
303 }
304 }
305 0 return;
306 }
307  
308 ####################################################################################################
309 1 1;
« DRI/Protocol/EPP/Extensions/AT/Message.pm ↑ Summary DRI/Data/Contact.pm »