| 1 | ## Domain Registry Interface, .PRO domain extensions | ||||||||||||||||||||||||||||||||
| 2 | ## | ||||||||||||||||||||||||||||||||
| 3 | ## Copyright (c) 2008 Tonnerre Lombard <tonnerre.lombard@sygroup.ch>. | ||||||||||||||||||||||||||||||||
| 4 | ## (c) 2010,2013,2016,2019 Patrick Mevzek <netdri@dotandco.com>. | ||||||||||||||||||||||||||||||||
| 5 | ## All rights reserved. | ||||||||||||||||||||||||||||||||
| 6 | ## | ||||||||||||||||||||||||||||||||
| 7 | ## This file is part of Net::DRI | ||||||||||||||||||||||||||||||||
| 8 | ## | ||||||||||||||||||||||||||||||||
| 9 | ## Net::DRI is free software; you can redistribute it and/or modify | ||||||||||||||||||||||||||||||||
| 10 | ## it under the terms of the GNU General Public License as published by | ||||||||||||||||||||||||||||||||
| 11 | ## the Free Software Foundation; either version 2 of the License, or | ||||||||||||||||||||||||||||||||
| 12 | ## (at your option) any later version. | ||||||||||||||||||||||||||||||||
| 13 | ## | ||||||||||||||||||||||||||||||||
| 14 | ## See the LICENSE file that comes with this distribution for more details. | ||||||||||||||||||||||||||||||||
| 15 | #################################################################################################### | ||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||
| 17 | package Net::DRI::Protocol::EPP::Extensions::PRO::Domain; | ||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||
| 19 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 20 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||
| 22 | 1 | ▶ | use Net::DRI::Util; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||
| 24 | =pod | ||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||
| 26 | =head1 NAME | ||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||
| 28 | Net::DRI::Protocol::EPP::Extensions::PRO::Domain - .PRO EPP domain extensions 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>development@sygroup.chE<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> and | ||||||||||||||||||||||||||||||||
| 45 | E<lt>http://oss.bdsprojects.net/projects/netdri/E<gt> | ||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||
| 47 | =head1 AUTHOR | ||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||
| 49 | Tonnerre Lombard E<lt>tonnerre.lombard@sygroup.chE<gt>, | ||||||||||||||||||||||||||||||||
| 50 | Alexander Biehl, E<lt>info@hexonet.netE<gt>, HEXONET Support GmbH, | ||||||||||||||||||||||||||||||||
| 51 | E<lt>http://www.hexonet.net/E<gt>. | ||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||
| 53 | =head1 COPYRIGHT | ||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||
| 55 | Copyright (c) 2008 Tonnerre Lombard <tonnerre.lombard@sygroup.ch>. | ||||||||||||||||||||||||||||||||
| 56 | (c) 2010,2013,2016,2019 Patrick Mevzek <netdri@dotandco.com>. | ||||||||||||||||||||||||||||||||
| 57 | All rights reserved. | ||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||
| 59 | This program is free software; you can redistribute it and/or modify | ||||||||||||||||||||||||||||||||
| 60 | it under the terms of the GNU General Public License as published by | ||||||||||||||||||||||||||||||||
| 61 | the Free Software Foundation; either version 2 of the License, or | ||||||||||||||||||||||||||||||||
| 62 | (at your option) any later version. | ||||||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||||||
| 64 | See the LICENSE file that comes with this distribution for more details. | ||||||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||||||
| 66 | =cut | ||||||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||||||
| 68 | #################################################################################################### | ||||||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||||||
| 70 | sub register_commands | ||||||||||||||||||||||||||||||||
| 71 | 0 | ▶ | { | ||||||||||||||||||||||||||||||
|
Subroutine
register_commands: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 72 | 0 | my ($class,$version)=@_; | |||||||||||||||||||||||||||||||
| 73 | 0 | my %tmp=( | |||||||||||||||||||||||||||||||
| 74 | create => [ \&add_pro_extinfo ], | ||||||||||||||||||||||||||||||||
| 75 | update => [ \&add_pro_extinfo ], | ||||||||||||||||||||||||||||||||
| 76 | info => [ undef, \&parse ] | ||||||||||||||||||||||||||||||||
| 77 | ); | ||||||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||||||
| 79 | 0 | return { 'domain' => \%tmp }; | |||||||||||||||||||||||||||||||
| 80 | } | ||||||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||||||
| 82 | #################################################################################################### | ||||||||||||||||||||||||||||||||
| 83 | ############ Transform commands | ||||||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||||||
| 85 | sub add_pro_extinfo | ||||||||||||||||||||||||||||||||
| 86 | 0 | ▶ | { | ||||||||||||||||||||||||||||||
|
Subroutine
add_pro_extinfo: not called CC=20 SCAR=60.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 87 | 0 | my ($epp, $domain, $rd) = @_; | |||||||||||||||||||||||||||||||
| 88 | 0 | my @prodata; | |||||||||||||||||||||||||||||||
| 89 | my @tmdata; | ||||||||||||||||||||||||||||||||
| 90 | 0 | my $pw; | |||||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||||||
| 92 | 0 | ▶ | $rd = +{ pro => $rd->set('pro') } if Net::DRI::Util::isa_changes($rd); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 93 | 0 | ▶ | return unless (Net::DRI::Util::has_key($rd,'pro') && (ref($rd->{pro}) eq 'HASH')); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
Net::DRI::Util::has_key($rd, "pro") and ref $rd->{"pro"} eq "HASH"
MC/DC0%0/2
Net::DRI::Util::has_key($rd, "pro") and ref $rd->{"pro"} eq "HASH"
Net::DRI::Util::has_key($rd, "pro")
ref $rd->{"pro"} eq "HASH"
Truth table0%0/3
A and B
A= Net::DRI::Util::has_key($rd, "pro")B= ref $rd->{"pro"} eq "HASH"
| |||||||||||||||||||||||||||||||||
| 94 | 0 | my $ph = $rd->{pro}; | |||||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||||||
| 96 | push(@prodata, ['rpro:tradeMarkName', $ph->{tmname}]) | ||||||||||||||||||||||||||||||||
| 97 | 0 | ▶ | if (exists($ph->{tmname})); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 98 | push(@prodata, ['rpro:tradeMarkJurisdiction', $ph->{tmjurisdiction}]) | ||||||||||||||||||||||||||||||||
| 99 | 0 | ▶ | if (exists($ph->{tmjurisdiction})); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 100 | push(@prodata, ['rpro:tradeMarkDate', $ph->{tmdate}->strftime('%Y-%m-%dT%H:%M:%S.%1NZ')]) | ||||||||||||||||||||||||||||||||
| 101 | 0 | ▶ | if (exists($ph->{tmdate}) && Net::DRI::Util::is_class($ph->{tmdate}, 'DateTime')); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
exists $ph->{"tmdate"} and Net::DRI::Util::is_class($ph->{"tmdate"}, "DateTime")
MC/DC0%0/2
exists $ph->{"tmdate"} and Net::DRI::Util::is_class($ph->{"tmdate"}, "DateTime")
exists $ph->{"tmdate"}
Net::DRI::Util::is_class($ph->{"tmdate"}, "DateTime")
Truth table0%0/3
A and B
A= exists $ph->{"tmdate"}B= Net::DRI::Util::is_class($ph->{"tmdate"}, "DateTime")
| |||||||||||||||||||||||||||||||||
| 102 | push(@prodata, ['rpro:tradeMarkNumber', int($ph->{tmnumber})]) | ||||||||||||||||||||||||||||||||
| 103 | 0 | ▶ | if (exists($ph->{tmnumber}) && int($ph->{tmnumber})); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
exists $ph->{"tmnumber"} and int $ph->{"tmnumber"}
MC/DC0%0/2
exists $ph->{"tmnumber"} and int $ph->{"tmnumber"}
exists $ph->{"tmnumber"}
int $ph->{"tmnumber"}
Truth table0%0/3
A and B
A= exists $ph->{"tmnumber"}B= int $ph->{"tmnumber"}
| |||||||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||||||
| 105 | push(@prodata, ['rpro:registrationType', (exists($ph->{activate}) && | ||||||||||||||||||||||||||||||||
| 106 | $ph->{activate} ? +{ activate => 'y' } : +{}), $ph->{type}]) | ||||||||||||||||||||||||||||||||
| 107 | 0 | ▶ | if (exists($ph->{type})); | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/3
exists $ph->{"activate"} and $ph->{"activate"}
MC/DC0%0/2
exists $ph->{"activate"} and $ph->{"activate"}
exists $ph->{"activate"}
$ph->{"activate"}
Truth table0%0/3
A and B
A= exists $ph->{"activate"}B= $ph->{"activate"}
| |||||||||||||||||||||||||||||||||
| 108 | push(@prodata, ['rpro:redirectTarget', $ph->{redirect}]) | ||||||||||||||||||||||||||||||||
| 109 | if (exists($ph->{redirect}) && | ||||||||||||||||||||||||||||||||
| 110 | 0 | ▶ | Net::DRI::Util::is_hostname($ph->{redirect})); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
exists $ph->{"redirect"} and Net::DRI::Util::is_hostname($ph->{"redirect"})
MC/DC0%0/2
exists $ph->{"redirect"} and Net::DRI::Util::is_hostname($ph->{"redirect"})
exists $ph->{"redirect"}
Net::DRI::Util::is_hostname($ph->{"redirect"})
Truth table0%0/3
A and B
A= exists $ph->{"redirect"}B= Net::DRI::Util::is_hostname($ph->{"redirect"})
| |||||||||||||||||||||||||||||||||
| 111 | 0 | ▶ | push(@prodata, ['rpro:tradeMark', @tmdata]) if (@tmdata); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||||||
| 113 | 0 | ▶ | if (Net::DRI::Util::has_auth($ph) && exists($ph->{auth}->{pw})) | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
Net::DRI::Util::has_auth($ph) and exists $ph->{"auth"}{"pw"}
MC/DC0%0/2
Net::DRI::Util::has_auth($ph) and exists $ph->{"auth"}{"pw"}
Net::DRI::Util::has_auth($ph)
exists $ph->{"auth"}{"pw"}
Truth table0%0/3
A and B
A= Net::DRI::Util::has_auth($ph)B= exists $ph->{"auth"}{"pw"}
| |||||||||||||||||||||||||||||||||
| 114 | { | ||||||||||||||||||||||||||||||||
| 115 | 0 | $pw = $ph->{auth}->{pw}; | |||||||||||||||||||||||||||||||
| 116 | 0 | delete($ph->{auth}->{pw}); | |||||||||||||||||||||||||||||||
| 117 | } | ||||||||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||||||
| 119 | push(@prodata, ['rpro:authorization', $ph->{auth}, $pw]) | ||||||||||||||||||||||||||||||||
| 120 | 0 | ▶ | if (exists($ph->{auth})); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 121 | 0 | ▶ | return unless (@prodata); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||||||
| 123 | 0 | $epp->message()->command_extension('rpro', ['proDomain', @prodata]); | |||||||||||||||||||||||||||||||
| 124 | 0 | return; | |||||||||||||||||||||||||||||||
| 125 | } | ||||||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||||||
| 127 | sub parse | ||||||||||||||||||||||||||||||||
| 128 | 0 | ▶ | { | ||||||||||||||||||||||||||||||
|
Subroutine
parse: not called CC=17 SCAR=57.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 129 | 0 | my ($po, $otype, $oaction, $oname, $rinfo) = @_; | |||||||||||||||||||||||||||||||
| 130 | 0 | my $mes = $po->message(); | |||||||||||||||||||||||||||||||
| 131 | 0 | my $infdata = $mes->get_extension('rpro','proDomain'); | |||||||||||||||||||||||||||||||
| 132 | 0 | my $pro = {}; | |||||||||||||||||||||||||||||||
| 133 | 0 | my $c; | |||||||||||||||||||||||||||||||
| 134 | |||||||||||||||||||||||||||||||||
| 135 | 0 | ▶ | return unless ($infdata); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 136 | |||||||||||||||||||||||||||||||||
| 137 | 0 | $c = $infdata->getFirstChild(); | |||||||||||||||||||||||||||||||
| 138 | |||||||||||||||||||||||||||||||||
| 139 | 0 | ▶ | while (defined($c) && $c) | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $c and $c
MC/DC0%0/2
defined $c and $c
defined $c
$c
Truth table0%0/3
A and B
A= defined $cB= $c
| |||||||||||||||||||||||||||||||||
| 140 | { | ||||||||||||||||||||||||||||||||
| 141 | 0 | ▶ | my $name = $c->localname() || $c->nodeName(); | ||||||||||||||||||||||||||||||
|
Condition0%0/3
$c->localname || $c->nodeName
MC/DC0%0/2
$c->localname || $c->nodeName
$c->localname
$c->nodeName
Truth table0%0/3
A || B
A= $c->localnameB= $c->nodeName
| |||||||||||||||||||||||||||||||||
| 142 | 0 | ▶ | next unless $name; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 143 | |||||||||||||||||||||||||||||||||
| 144 | 0 | ▶ | if ($name eq 'registrationType') | ||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||
| 145 | { | ||||||||||||||||||||||||||||||||
| 146 | 0 | $pro->{type} = $c->getFirstChild()->getData(); | |||||||||||||||||||||||||||||||
| 147 | } | ||||||||||||||||||||||||||||||||
| 148 | elsif ($name eq 'redirectTarget') | ||||||||||||||||||||||||||||||||
| 149 | { | ||||||||||||||||||||||||||||||||
| 150 | 0 | $pro->{redirect} = $c->getFirstChild()->getData(); | |||||||||||||||||||||||||||||||
| 151 | } | ||||||||||||||||||||||||||||||||
| 152 | elsif ($name eq 'tradeMark') | ||||||||||||||||||||||||||||||||
| 153 | { | ||||||||||||||||||||||||||||||||
| 154 | 0 | my $to = $c->getFirstChild(); | |||||||||||||||||||||||||||||||
| 155 | |||||||||||||||||||||||||||||||||
| 156 | 0 | ▶ | while (defined($to) && $to) | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $to and $to
MC/DC0%0/2
defined $to and $to
defined $to
$to
Truth table0%0/3
A and B
A= defined $toB= $to
| |||||||||||||||||||||||||||||||||
| 157 | { | ||||||||||||||||||||||||||||||||
| 158 | 0 | ▶ | my $totag = $to->localname() || $to->nodeName(); | ||||||||||||||||||||||||||||||
|
Condition0%0/3
$to->localname || $to->nodeName
MC/DC0%0/2
$to->localname || $to->nodeName
$to->localname
$to->nodeName
Truth table0%0/3
A || B
A= $to->localnameB= $to->nodeName
| |||||||||||||||||||||||||||||||||
| 159 | 0 | ▶ | next unless ($totag); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 160 | |||||||||||||||||||||||||||||||||
| 161 | 0 | ▶ | if ($totag eq 'tradeMarkName') | ||||||||||||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||||||||||||
| 162 | { | ||||||||||||||||||||||||||||||||
| 163 | $pro->{tmname} = | ||||||||||||||||||||||||||||||||
| 164 | 0 | $to->getFirstChild()->getData(); | |||||||||||||||||||||||||||||||
| 165 | } | ||||||||||||||||||||||||||||||||
| 166 | elsif ($totag eq 'tradeMarkJurisdiction') | ||||||||||||||||||||||||||||||||
| 167 | { | ||||||||||||||||||||||||||||||||
| 168 | $pro->{tmjurisdiction} = | ||||||||||||||||||||||||||||||||
| 169 | 0 | $to->getFirstChild()->getData(); | |||||||||||||||||||||||||||||||
| 170 | } | ||||||||||||||||||||||||||||||||
| 171 | elsif ($totag eq 'tradeMarkDate') | ||||||||||||||||||||||||||||||||
| 172 | { | ||||||||||||||||||||||||||||||||
| 173 | 0 | $pro->{tmdate} = $po->parse_iso8601( | |||||||||||||||||||||||||||||||
| 174 | $to->getFirstChild()->getData()); | ||||||||||||||||||||||||||||||||
| 175 | } | ||||||||||||||||||||||||||||||||
| 176 | elsif ($totag eq 'tradeMarkNumber') | ||||||||||||||||||||||||||||||||
| 177 | { | ||||||||||||||||||||||||||||||||
| 178 | 0 | $pro->{tmnumber} = int($to->getFirstChild()-> | |||||||||||||||||||||||||||||||
| 179 | getData()); | ||||||||||||||||||||||||||||||||
| 180 | } | ||||||||||||||||||||||||||||||||
| 181 | 0 | } continue { $to=$to->getNextSibling(); } | |||||||||||||||||||||||||||||||
| 182 | } | ||||||||||||||||||||||||||||||||
| 183 | 0 | } continue { $c=$c->getNextSibling(); } | |||||||||||||||||||||||||||||||
| 184 | |||||||||||||||||||||||||||||||||
| 185 | 0 | $rinfo->{$otype}->{$oname}->{pro} = $pro; | |||||||||||||||||||||||||||||||
| 186 | 0 | return; | |||||||||||||||||||||||||||||||
| 187 | } | ||||||||||||||||||||||||||||||||
| 188 | |||||||||||||||||||||||||||||||||
| 189 | #################################################################################################### | ||||||||||||||||||||||||||||||||
| 190 | 1 | 1; | |||||||||||||||||||||||||||||||