« DRI/Protocol/EPP/Extensions/AT/Result.pm
↑ Summary
DRI/Protocol/EPP/Extensions/Afilias/Association.pm »
| 1 | ## Domain Registry Interface, .SE EPP Domain/Contact Extensions for Net::DRI | ||||||||||||||||||||||||||||||||||||||||||
| 2 | ## Contributed by Elias Sidenbladh and Ulrich Wisser from NIC SE | ||||||||||||||||||||||||||||||||||||||||||
| 3 | ## | ||||||||||||||||||||||||||||||||||||||||||
| 4 | ## Copyright (c) 2006,2008-2011,2013,2019 Patrick Mevzek <netdri@dotandco.com>. All rights reserved. | ||||||||||||||||||||||||||||||||||||||||||
| 5 | ## | ||||||||||||||||||||||||||||||||||||||||||
| 6 | ## This file is part of Net::DRI | ||||||||||||||||||||||||||||||||||||||||||
| 7 | ## | ||||||||||||||||||||||||||||||||||||||||||
| 8 | ## Net::DRI is free software; you can redistribute it and/or modify | ||||||||||||||||||||||||||||||||||||||||||
| 9 | ## it under the terms of the GNU General Public License as published by | ||||||||||||||||||||||||||||||||||||||||||
| 10 | ## the Free Software Foundation; either version 2 of the License, or | ||||||||||||||||||||||||||||||||||||||||||
| 11 | ## (at your option) any later version. | ||||||||||||||||||||||||||||||||||||||||||
| 12 | ## | ||||||||||||||||||||||||||||||||||||||||||
| 13 | ## See the LICENSE file that comes with this distribution for more details. | ||||||||||||||||||||||||||||||||||||||||||
| 14 | #################################################################################################### | ||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||
| 16 | package Net::DRI::Protocol::EPP::Extensions::SE::Extensions; | ||||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||
| 18 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 19 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
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 | =pod | ||||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||||
| 27 | =head1 NAME | ||||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||
| 29 | Net::DRI::Protocol::EPP::Extensions::SE::Extensions - .SE EPP Domain/Contact Extensions for Net::DRI | ||||||||||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||||||||||
| 31 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||||
| 33 | Please see the README file for details. | ||||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||
| 35 | =head1 SUPPORT | ||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||
| 37 | For now, support questions should be sent to: | ||||||||||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||||||||
| 39 | E<lt>netdri@dotandco.comE<gt> | ||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||
| 41 | Please also see the SUPPORT file in the distribution. | ||||||||||||||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||||||||||||
| 43 | =head1 SEE ALSO | ||||||||||||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||||||||||||
| 45 | E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt> | ||||||||||||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||||||||||||
| 47 | =head1 AUTHOR | ||||||||||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||||||||||
| 49 | Patrick Mevzek, E<lt>netdri@dotandco.comE<gt> | ||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||
| 51 | =head1 COPYRIGHT | ||||||||||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||||||||||
| 53 | Copyright (c) 2006,2008-2011,2013,2019 Patrick Mevzek <netdri@dotandco.com>. | ||||||||||||||||||||||||||||||||||||||||||
| 54 | All rights reserved. | ||||||||||||||||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||||||||||||||||
| 56 | This program is free software; you can redistribute it and/or modify | ||||||||||||||||||||||||||||||||||||||||||
| 57 | it under the terms of the GNU General Public License as published by | ||||||||||||||||||||||||||||||||||||||||||
| 58 | the Free Software Foundation; either version 2 of the License, or | ||||||||||||||||||||||||||||||||||||||||||
| 59 | (at your option) any later version. | ||||||||||||||||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||||||||||||||
| 61 | See the LICENSE file that comes with this distribution for more details. | ||||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||
| 63 | =cut | ||||||||||||||||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||||||||||||||||
| 65 | ################################################################################################### | ||||||||||||||||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||||||||||||||||
| 67 | 0 | ▶ | sub register_commands { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
register_commands: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 68 | 0 | my ( $class, $version ) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 69 | 0 | my $domain = { | |||||||||||||||||||||||||||||||||||||||||
| 70 | info => [ undef, \&domain_parse ], | ||||||||||||||||||||||||||||||||||||||||||
| 71 | create => [ undef, \&domain_parse ], | ||||||||||||||||||||||||||||||||||||||||||
| 72 | update => [ \&domain_update, \&domain_parse ], | ||||||||||||||||||||||||||||||||||||||||||
| 73 | transfer_request => [ \&domain_transfer, \&domain_transfer_parse ], | ||||||||||||||||||||||||||||||||||||||||||
| 74 | notifyDelete => [ undef, \&delete_parse ], | ||||||||||||||||||||||||||||||||||||||||||
| 75 | }; | ||||||||||||||||||||||||||||||||||||||||||
| 76 | 0 | my $contact = { | |||||||||||||||||||||||||||||||||||||||||
| 77 | info => [ undef, \&contact_parse ], | ||||||||||||||||||||||||||||||||||||||||||
| 78 | create => [ \&contact_create, undef ], | ||||||||||||||||||||||||||||||||||||||||||
| 79 | update => [ \&contact_update, undef ], | ||||||||||||||||||||||||||||||||||||||||||
| 80 | transfer_request => [ undef, \&contact_transfer_parse ], | ||||||||||||||||||||||||||||||||||||||||||
| 81 | }; | ||||||||||||||||||||||||||||||||||||||||||
| 82 | 0 | my $host = { | |||||||||||||||||||||||||||||||||||||||||
| 83 | info => [ undef, \&host_parse ], | ||||||||||||||||||||||||||||||||||||||||||
| 84 | transfer_request => [ undef, \&host_transfer_parse ], | ||||||||||||||||||||||||||||||||||||||||||
| 85 | }; | ||||||||||||||||||||||||||||||||||||||||||
| 86 | 0 | my %session=( | |||||||||||||||||||||||||||||||||||||||||
| 87 | 'connect' => [ undef, \&parse_greeting ], | ||||||||||||||||||||||||||||||||||||||||||
| 88 | 'noop' => [ undef, \&parse_greeting ], | ||||||||||||||||||||||||||||||||||||||||||
| 89 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 90 | 0 | return { 'domain' => $domain, 'contact' => $contact, 'host' => $host, session => \%session }; | |||||||||||||||||||||||||||||||||||||||||
| 91 | } | ||||||||||||||||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||||||||||||||||
| 93 | 0 | ▶ | sub capabilities_add { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
capabilities_add: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 94 | 0 | return ( [ 'domain_update', 'client_delete', [ 'set', ] ], ); | |||||||||||||||||||||||||||||||||||||||||
| 95 | } | ||||||||||||||||||||||||||||||||||||||||||
| 96 | ################################################################################################### | ||||||||||||||||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||||||||||||||||
| 98 | ## This was previously basically Extensions/SE/Message/_get_content | ||||||||||||||||||||||||||||||||||||||||||
| 99 | ## but since anyway it should be done properly by walking the XML tree inside of poking like this, | ||||||||||||||||||||||||||||||||||||||||||
| 100 | ## put it here to remove the SE/Message module | ||||||||||||||||||||||||||||||||||||||||||
| 101 | sub find_node | ||||||||||||||||||||||||||||||||||||||||||
| 102 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
find_node: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 103 | 0 | my ($mes,$nstag,$nodename)=@_; | |||||||||||||||||||||||||||||||||||||||||
| 104 | 0 | my $node=$mes->node_resdata(); | |||||||||||||||||||||||||||||||||||||||||
| 105 | 0 | ▶ | return unless defined $node; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 106 | 0 | my $ns=$mes->ns($nstag); | |||||||||||||||||||||||||||||||||||||||||
| 107 | 0 | ▶ | $ns=$nstag unless defined $ns && $ns; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $ns and $ns
MC/DC0%0/2
defined $ns and $ns
defined $ns
$ns
Truth table0%0/3
A and B
A= defined $nsB= $ns
| |||||||||||||||||||||||||||||||||||||||||||
| 108 | 0 | my @tmp=$node->getElementsByTagNameNS($ns,$nodename); | |||||||||||||||||||||||||||||||||||||||||
| 109 | 0 | ▶ | return unless @tmp; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 110 | 0 | return $tmp[0]; | |||||||||||||||||||||||||||||||||||||||||
| 111 | } | ||||||||||||||||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||||||||||||||||
| 113 | 0 | ▶ | sub get_notify { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_notify: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 114 | 0 | my $mes = shift; | |||||||||||||||||||||||||||||||||||||||||
| 115 | 0 | my $ns=$mes->ns('iis'); | |||||||||||||||||||||||||||||||||||||||||
| 116 | # only one of these will be given, but we can't know which in advance | ||||||||||||||||||||||||||||||||||||||||||
| 117 | 0 | ▶ | return 'create' if defined find_node($mes,$ns,'createNotify'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 118 | 0 | ▶ | return 'update' if defined find_node($mes,$ns,'updateNotify'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 119 | 0 | ▶ | return 'delete' if defined find_node($mes,$ns,'deleteNotify'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 120 | 0 | ▶ | return 'transfer' if defined find_node($mes,$ns,'transferNotify'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 121 | |||||||||||||||||||||||||||||||||||||||||||
| 122 | # done, no notify found | ||||||||||||||||||||||||||||||||||||||||||
| 123 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 124 | } | ||||||||||||||||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||||||||||||||||
| 126 | ################################################################################################## | ||||||||||||||||||||||||||||||||||||||||||
| 127 | ########### Query commands | ||||||||||||||||||||||||||||||||||||||||||
| 128 | |||||||||||||||||||||||||||||||||||||||||||
| 129 | # parse domain info | ||||||||||||||||||||||||||||||||||||||||||
| 130 | 0 | ▶ | sub domain_parse { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
domain_parse: not called CC=11 SCAR=48.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 131 | 0 | my ( $po, $otype, $oaction, $oname, $rinfo ) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 132 | 0 | my $mes = $po->message(); | |||||||||||||||||||||||||||||||||||||||||
| 133 | 0 | ▶ | return unless $mes->is_success(); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 134 | |||||||||||||||||||||||||||||||||||||||||||
| 135 | # only domain info should be parsed | ||||||||||||||||||||||||||||||||||||||||||
| 136 | 0 | ▶ | return if ( ( !defined $otype ) || ( $otype ne 'domain' ) ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
not defined $otype or $otype ne "domain"
MC/DC0%0/2
not defined $otype or $otype ne "domain"
not defined $otype
$otype ne "domain"
Truth table0%0/3
not(A) or B
A= not defined $otypeB= $otype ne "domain"
| |||||||||||||||||||||||||||||||||||||||||||
| 137 | |||||||||||||||||||||||||||||||||||||||||||
| 138 | # check for notify | ||||||||||||||||||||||||||||||||||||||||||
| 139 | 0 | my $notify = get_notify($mes); | |||||||||||||||||||||||||||||||||||||||||
| 140 | 0 | ▶ | $rinfo->{domain}->{$oname}->{notify} = $notify if defined $notify; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 141 | |||||||||||||||||||||||||||||||||||||||||||
| 142 | # get <iis:infData/> from <extension/> | ||||||||||||||||||||||||||||||||||||||||||
| 143 | 0 | my $infData = $mes->get_extension( $mes->ns('iis'), 'infData' ); | |||||||||||||||||||||||||||||||||||||||||
| 144 | 0 | ▶ | return unless defined $infData; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 145 | |||||||||||||||||||||||||||||||||||||||||||
| 146 | # parse deleteDate (optional) | ||||||||||||||||||||||||||||||||||||||||||
| 147 | 0 | foreach my $el ( $infData->getElementsByTagNameNS( $mes->ns('iis'), 'delDate' ) ) { | |||||||||||||||||||||||||||||||||||||||||
| 148 | 0 | $rinfo->{domain}->{$oname}->{delDate} = $po->parse_iso8601( $el->textContent() ); | |||||||||||||||||||||||||||||||||||||||||
| 149 | } | ||||||||||||||||||||||||||||||||||||||||||
| 150 | |||||||||||||||||||||||||||||||||||||||||||
| 151 | # parse deactDate (optional) | ||||||||||||||||||||||||||||||||||||||||||
| 152 | 0 | foreach my $el ( $infData->getElementsByTagNameNS( $mes->ns('iis'), 'deactDate' ) ) { | |||||||||||||||||||||||||||||||||||||||||
| 153 | 0 | $rinfo->{domain}->{$oname}->{deactDate} = $po->parse_iso8601( $el->textContent() ); | |||||||||||||||||||||||||||||||||||||||||
| 154 | } | ||||||||||||||||||||||||||||||||||||||||||
| 155 | |||||||||||||||||||||||||||||||||||||||||||
| 156 | # parse relDate (optional) | ||||||||||||||||||||||||||||||||||||||||||
| 157 | 0 | foreach my $el ( $infData->getElementsByTagNameNS( $mes->ns('iis'), 'relDate' ) ) { | |||||||||||||||||||||||||||||||||||||||||
| 158 | 0 | $rinfo->{domain}->{$oname}->{relDate} = $po->parse_iso8601( $el->textContent() ); | |||||||||||||||||||||||||||||||||||||||||
| 159 | } | ||||||||||||||||||||||||||||||||||||||||||
| 160 | |||||||||||||||||||||||||||||||||||||||||||
| 161 | # parse state | ||||||||||||||||||||||||||||||||||||||||||
| 162 | 0 | foreach my $el ( $infData->getElementsByTagNameNS( $mes->ns('iis'), 'state' ) ) { | |||||||||||||||||||||||||||||||||||||||||
| 163 | 0 | $rinfo->{domain}->{$oname}->{state} = $el->textContent(); | |||||||||||||||||||||||||||||||||||||||||
| 164 | } | ||||||||||||||||||||||||||||||||||||||||||
| 165 | |||||||||||||||||||||||||||||||||||||||||||
| 166 | # parse clientDelete | ||||||||||||||||||||||||||||||||||||||||||
| 167 | 0 | foreach my $el ( $infData->getElementsByTagNameNS( $mes->ns('iis'), 'clientDelete' ) ) { | |||||||||||||||||||||||||||||||||||||||||
| 168 | 0 | $rinfo->{domain}->{$oname}->{clientDelete} = $el->textContent(); | |||||||||||||||||||||||||||||||||||||||||
| 169 | } | ||||||||||||||||||||||||||||||||||||||||||
| 170 | |||||||||||||||||||||||||||||||||||||||||||
| 171 | # done | ||||||||||||||||||||||||||||||||||||||||||
| 172 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 173 | } | ||||||||||||||||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||||||||||||||||
| 175 | # parse contact info | ||||||||||||||||||||||||||||||||||||||||||
| 176 | 0 | ▶ | sub contact_parse { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
contact_parse: not called CC=8 SCAR=42.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 177 | 0 | my ( $po, $otype, $oaction, $oname, $rinfo ) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 178 | 0 | my $mes = $po->message(); | |||||||||||||||||||||||||||||||||||||||||
| 179 | 0 | ▶ | return unless $mes->is_success(); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 180 | |||||||||||||||||||||||||||||||||||||||||||
| 181 | # only contact info should be parsed | ||||||||||||||||||||||||||||||||||||||||||
| 182 | 0 | ▶ | return if ( ( !defined $otype ) || ( $otype ne 'contact' ) ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
not defined $otype or $otype ne "contact"
MC/DC0%0/2
not defined $otype or $otype ne "contact"
not defined $otype
$otype ne "contact"
Truth table0%0/3
not(A) or B
A= not defined $otypeB= $otype ne "contact"
| |||||||||||||||||||||||||||||||||||||||||||
| 183 | |||||||||||||||||||||||||||||||||||||||||||
| 184 | # check for notify | ||||||||||||||||||||||||||||||||||||||||||
| 185 | 0 | my $notify = get_notify($mes); | |||||||||||||||||||||||||||||||||||||||||
| 186 | 0 | ▶ | $rinfo->{contact}->{$oname}->{notify} = $notify if defined $notify; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 187 | |||||||||||||||||||||||||||||||||||||||||||
| 188 | # get <iis:infData/> from <extension/> | ||||||||||||||||||||||||||||||||||||||||||
| 189 | 0 | my $result = $mes->get_extension( $mes->ns('iis'), 'infData' ); | |||||||||||||||||||||||||||||||||||||||||
| 190 | 0 | ▶ | return unless defined $result; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 191 | |||||||||||||||||||||||||||||||||||||||||||
| 192 | # parse orgno (mandatory) | ||||||||||||||||||||||||||||||||||||||||||
| 193 | 0 | foreach my $el ( $result->getElementsByTagNameNS( $mes->ns('iis'), 'orgno' ) ) { | |||||||||||||||||||||||||||||||||||||||||
| 194 | 0 | $rinfo->{contact}->{$oname}->{self}->orgno( $el->textContent() ); | |||||||||||||||||||||||||||||||||||||||||
| 195 | } | ||||||||||||||||||||||||||||||||||||||||||
| 196 | |||||||||||||||||||||||||||||||||||||||||||
| 197 | # parse vatno (optional) | ||||||||||||||||||||||||||||||||||||||||||
| 198 | 0 | foreach my $el ( $result->getElementsByTagNameNS( $mes->ns('iis'), 'vatno' ) ) { | |||||||||||||||||||||||||||||||||||||||||
| 199 | 0 | $rinfo->{contact}->{$oname}->{self}->vatno( $el->textContent() ); | |||||||||||||||||||||||||||||||||||||||||
| 200 | } | ||||||||||||||||||||||||||||||||||||||||||
| 201 | |||||||||||||||||||||||||||||||||||||||||||
| 202 | # done | ||||||||||||||||||||||||||||||||||||||||||
| 203 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 204 | } | ||||||||||||||||||||||||||||||||||||||||||
| 205 | |||||||||||||||||||||||||||||||||||||||||||
| 206 | 0 | ▶ | sub host_parse { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
host_parse: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 207 | 0 | my ( $po, $otype, $oaction, $oname, $rinfo ) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 208 | 0 | my $mes = $po->message(); | |||||||||||||||||||||||||||||||||||||||||
| 209 | 0 | ▶ | return unless $mes->is_success(); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 210 | |||||||||||||||||||||||||||||||||||||||||||
| 211 | # only contact info should be parsed | ||||||||||||||||||||||||||||||||||||||||||
| 212 | 0 | ▶ | return if ( ( !defined $otype ) || ( $otype ne 'host' ) ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
not defined $otype or $otype ne "host"
MC/DC0%0/2
not defined $otype or $otype ne "host"
not defined $otype
$otype ne "host"
Truth table0%0/3
not(A) or B
A= not defined $otypeB= $otype ne "host"
| |||||||||||||||||||||||||||||||||||||||||||
| 213 | |||||||||||||||||||||||||||||||||||||||||||
| 214 | # check for notify | ||||||||||||||||||||||||||||||||||||||||||
| 215 | 0 | my $notify = get_notify($mes); | |||||||||||||||||||||||||||||||||||||||||
| 216 | 0 | ▶ | $rinfo->{host}->{$oname}->{notify} = $notify if defined $notify; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 217 | |||||||||||||||||||||||||||||||||||||||||||
| 218 | # done | ||||||||||||||||||||||||||||||||||||||||||
| 219 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 220 | } | ||||||||||||||||||||||||||||||||||||||||||
| 221 | |||||||||||||||||||||||||||||||||||||||||||
| 222 | # parse <dom:trnData/> | ||||||||||||||||||||||||||||||||||||||||||
| 223 | 0 | ▶ | sub domain_transfer_parse { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
domain_transfer_parse: not called CC=9 SCAR=45.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 224 | 0 | my ( $po, $otype, $oaction, $oname, $rinfo ) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 225 | 0 | my $mes = $po->message(); | |||||||||||||||||||||||||||||||||||||||||
| 226 | 0 | ▶ | return unless $mes->is_success(); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 227 | |||||||||||||||||||||||||||||||||||||||||||
| 228 | 0 | my $trndata = find_node($mes,$mes->ns('domain'),'infData'); | |||||||||||||||||||||||||||||||||||||||||
| 229 | 0 | ▶ | $trndata = find_node($mes,$mes->ns('domain'), 'trnData' ) if !defined($trndata); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 230 | 0 | ▶ | return unless defined $trndata; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 231 | |||||||||||||||||||||||||||||||||||||||||||
| 232 | 0 | foreach my $el (Net::DRI::Util::xml_list_children($trndata)) | |||||||||||||||||||||||||||||||||||||||||
| 233 | { | ||||||||||||||||||||||||||||||||||||||||||
| 234 | 0 | my ($name,$c)=@$el; | |||||||||||||||||||||||||||||||||||||||||
| 235 | 0 | ▶ | if ( $name eq 'name' ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 236 | 0 | $oname = $c->textContent(); | |||||||||||||||||||||||||||||||||||||||||
| 237 | 0 | $rinfo->{domain}->{$oname}->{action} = 'transfer'; | |||||||||||||||||||||||||||||||||||||||||
| 238 | 0 | $rinfo->{domain}->{$oname}->{exist} = 1; | |||||||||||||||||||||||||||||||||||||||||
| 239 | } | ||||||||||||||||||||||||||||||||||||||||||
| 240 | elsif ( $name =~ m/^(trStatus|reID|acID)$/ ) { | ||||||||||||||||||||||||||||||||||||||||||
| 241 | 0 | $rinfo->{domain}->{$oname}->{$1} = $c->textContent(); | |||||||||||||||||||||||||||||||||||||||||
| 242 | } | ||||||||||||||||||||||||||||||||||||||||||
| 243 | elsif ( $name =~ m/^(reDate|acDate|exDate)$/ ) { | ||||||||||||||||||||||||||||||||||||||||||
| 244 | 0 | $rinfo->{domain}->{$oname}->{$1} = $po->parse_iso8601( $c->textContent() ); | |||||||||||||||||||||||||||||||||||||||||
| 245 | } | ||||||||||||||||||||||||||||||||||||||||||
| 246 | } | ||||||||||||||||||||||||||||||||||||||||||
| 247 | |||||||||||||||||||||||||||||||||||||||||||
| 248 | # check for notify | ||||||||||||||||||||||||||||||||||||||||||
| 249 | 0 | my $notify = get_notify($mes, 'domain_transfer_parse'); | |||||||||||||||||||||||||||||||||||||||||
| 250 | 0 | ▶ | $rinfo->{domain}->{$oname}->{notify} = $notify if defined $notify; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 251 | |||||||||||||||||||||||||||||||||||||||||||
| 252 | # done | ||||||||||||||||||||||||||||||||||||||||||
| 253 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 254 | } | ||||||||||||||||||||||||||||||||||||||||||
| 255 | |||||||||||||||||||||||||||||||||||||||||||
| 256 | |||||||||||||||||||||||||||||||||||||||||||
| 257 | # parse <host:trnData/> | ||||||||||||||||||||||||||||||||||||||||||
| 258 | # copied from Net::DRI::Protocol::EPP::Core::Domain | ||||||||||||||||||||||||||||||||||||||||||
| 259 | 0 | ▶ | sub host_transfer_parse { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
host_transfer_parse: not called CC=9 SCAR=45.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 260 | 0 | my ( $po, $otype, $oaction, $oname, $rinfo ) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 261 | 0 | my $mes = $po->message(); | |||||||||||||||||||||||||||||||||||||||||
| 262 | 0 | ▶ | return unless $mes->is_success(); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 263 | |||||||||||||||||||||||||||||||||||||||||||
| 264 | 0 | my $trndata = find_node($mes,$mes->ns('host'), 'infData' ); | |||||||||||||||||||||||||||||||||||||||||
| 265 | 0 | ▶ | $trndata = find_node($mes,$mes->ns('host'), 'trnData' ) if !defined($trndata); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 266 | 0 | ▶ | return unless defined $trndata; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 267 | |||||||||||||||||||||||||||||||||||||||||||
| 268 | 0 | foreach my $el (Net::DRI::Util::xml_list_children($trndata)) | |||||||||||||||||||||||||||||||||||||||||
| 269 | { | ||||||||||||||||||||||||||||||||||||||||||
| 270 | 0 | my ($name,$c)=@$el; | |||||||||||||||||||||||||||||||||||||||||
| 271 | 0 | ▶ | if ( $name eq 'name' ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 272 | 0 | $oname = $c->textContent(); | |||||||||||||||||||||||||||||||||||||||||
| 273 | 0 | $rinfo->{host}->{$oname}->{action} = 'transfer'; | |||||||||||||||||||||||||||||||||||||||||
| 274 | 0 | $rinfo->{host}->{$oname}->{exist} = 1; | |||||||||||||||||||||||||||||||||||||||||
| 275 | } | ||||||||||||||||||||||||||||||||||||||||||
| 276 | elsif ( $name =~ m/^(trStatus|reID|acID)$/ ) { | ||||||||||||||||||||||||||||||||||||||||||
| 277 | 0 | $rinfo->{host}->{$oname}->{$1} = $c->textContent(); | |||||||||||||||||||||||||||||||||||||||||
| 278 | } | ||||||||||||||||||||||||||||||||||||||||||
| 279 | elsif ( $name =~ m/^(reDate|acDate|exDate)$/ ) { | ||||||||||||||||||||||||||||||||||||||||||
| 280 | 0 | $rinfo->{host}->{$oname}->{$1} = $po->parse_iso8601( $c->textContent() ); | |||||||||||||||||||||||||||||||||||||||||
| 281 | } | ||||||||||||||||||||||||||||||||||||||||||
| 282 | } | ||||||||||||||||||||||||||||||||||||||||||
| 283 | |||||||||||||||||||||||||||||||||||||||||||
| 284 | # check for notify | ||||||||||||||||||||||||||||||||||||||||||
| 285 | 0 | my $notify = get_notify($mes); | |||||||||||||||||||||||||||||||||||||||||
| 286 | 0 | ▶ | $rinfo->{host}->{$oname}->{notify} = $notify if defined $notify; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 287 | |||||||||||||||||||||||||||||||||||||||||||
| 288 | # done | ||||||||||||||||||||||||||||||||||||||||||
| 289 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 290 | } | ||||||||||||||||||||||||||||||||||||||||||
| 291 | |||||||||||||||||||||||||||||||||||||||||||
| 292 | 0 | ▶ | sub contact_transfer_parse { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
contact_transfer_parse: not called CC=9 SCAR=45.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 293 | 0 | my ( $po, $otype, $oaction, $oname, $rinfo ) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 294 | 0 | my $mes = $po->message(); | |||||||||||||||||||||||||||||||||||||||||
| 295 | 0 | ▶ | return unless $mes->is_success(); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 296 | |||||||||||||||||||||||||||||||||||||||||||
| 297 | 0 | my $trndata = find_node($mes,$mes->ns('contact'), 'infData' ); | |||||||||||||||||||||||||||||||||||||||||
| 298 | 0 | ▶ | $trndata = find_node($mes,$mes->ns('contact'), 'trnData' ) if !defined($trndata); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 299 | 0 | ▶ | return unless defined $trndata; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 300 | |||||||||||||||||||||||||||||||||||||||||||
| 301 | 0 | foreach my $el (Net::DRI::Util::xml_list_children($trndata)) | |||||||||||||||||||||||||||||||||||||||||
| 302 | { | ||||||||||||||||||||||||||||||||||||||||||
| 303 | 0 | my ($name,$c)=@$el; | |||||||||||||||||||||||||||||||||||||||||
| 304 | 0 | ▶ | if ( $name eq 'id' ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 305 | 0 | $oname = $c->textContent(); | |||||||||||||||||||||||||||||||||||||||||
| 306 | 0 | $rinfo->{contact}->{$oname}->{action} = 'transfer'; | |||||||||||||||||||||||||||||||||||||||||
| 307 | 0 | $rinfo->{contact}->{$oname}->{exist} = 1; | |||||||||||||||||||||||||||||||||||||||||
| 308 | } | ||||||||||||||||||||||||||||||||||||||||||
| 309 | elsif ( $name =~ m/^(trStatus|reID|acID)$/ ) { | ||||||||||||||||||||||||||||||||||||||||||
| 310 | 0 | $rinfo->{contact}->{$oname}->{$1} = $c->textContent(); | |||||||||||||||||||||||||||||||||||||||||
| 311 | } | ||||||||||||||||||||||||||||||||||||||||||
| 312 | elsif ( $name =~ m/^(reDate|acDate|exDate)$/ ) { | ||||||||||||||||||||||||||||||||||||||||||
| 313 | 0 | $rinfo->{contact}->{$oname}->{$1} = $po->parse_iso8601( $c->textContent() ); | |||||||||||||||||||||||||||||||||||||||||
| 314 | } | ||||||||||||||||||||||||||||||||||||||||||
| 315 | } | ||||||||||||||||||||||||||||||||||||||||||
| 316 | |||||||||||||||||||||||||||||||||||||||||||
| 317 | # check for notify | ||||||||||||||||||||||||||||||||||||||||||
| 318 | 0 | my $notify = get_notify($mes); | |||||||||||||||||||||||||||||||||||||||||
| 319 | 0 | ▶ | $rinfo->{contact}->{$oname}->{notify} = $notify if defined $notify; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 320 | |||||||||||||||||||||||||||||||||||||||||||
| 321 | # done | ||||||||||||||||||||||||||||||||||||||||||
| 322 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 323 | } | ||||||||||||||||||||||||||||||||||||||||||
| 324 | |||||||||||||||||||||||||||||||||||||||||||
| 325 | # parse delete message | ||||||||||||||||||||||||||||||||||||||||||
| 326 | 0 | ▶ | sub delete_parse { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
delete_parse: not called CC=8 SCAR=42.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 327 | 0 | my ( $po, $otype, $oaction, $oname, $rinfo ) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 328 | 0 | my $nametag; | |||||||||||||||||||||||||||||||||||||||||
| 329 | 0 | my $mes = $po->message(); | |||||||||||||||||||||||||||||||||||||||||
| 330 | 0 | ▶ | return unless $mes->is_success(); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 331 | |||||||||||||||||||||||||||||||||||||||||||
| 332 | # check for notify | ||||||||||||||||||||||||||||||||||||||||||
| 333 | 0 | my $notify = get_notify($mes); | |||||||||||||||||||||||||||||||||||||||||
| 334 | 0 | ▶ | return if ( ( !defined $notify ) || ( ( $notify ne 'delete' ) && ( $notify ne 'transfer' ) ) ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
not defined $notify or $notify ne "delete" and $notify ne "transfer"
$notify ne "delete" and $notify ne "transfer"
MC/DC0%0/3
not defined $notify or $notify ne "delete" and $notify ne "transfer"
not defined $notify
$notify ne "delete"
$notify ne "transfer"
Truth table0%0/4
not(A) or B and C
A= not defined $notifyB= $notify ne "delete"C= $notify ne "transfer"
| |||||||||||||||||||||||||||||||||||||||||||
| 335 | |||||||||||||||||||||||||||||||||||||||||||
| 336 | # check for host | ||||||||||||||||||||||||||||||||||||||||||
| 337 | 0 | my $host = find_node($mes,$mes->ns('host'), 'name' ); | |||||||||||||||||||||||||||||||||||||||||
| 338 | 0 | ▶ | if ( defined $host ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 339 | 0 | $oname = $host->textContent(); | |||||||||||||||||||||||||||||||||||||||||
| 340 | 0 | $otype = 'host'; | |||||||||||||||||||||||||||||||||||||||||
| 341 | } | ||||||||||||||||||||||||||||||||||||||||||
| 342 | |||||||||||||||||||||||||||||||||||||||||||
| 343 | # check for contact | ||||||||||||||||||||||||||||||||||||||||||
| 344 | 0 | my $contact = find_node($mes, $mes->ns('contact'), 'id' ); | |||||||||||||||||||||||||||||||||||||||||
| 345 | 0 | ▶ | if ( defined $contact ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 346 | 0 | $oname = $contact->textContent(); | |||||||||||||||||||||||||||||||||||||||||
| 347 | 0 | $otype = 'contact'; | |||||||||||||||||||||||||||||||||||||||||
| 348 | } | ||||||||||||||||||||||||||||||||||||||||||
| 349 | |||||||||||||||||||||||||||||||||||||||||||
| 350 | # check for domain | ||||||||||||||||||||||||||||||||||||||||||
| 351 | 0 | my $domain = find_node($mes, $mes->ns('domain'), 'name' ); | |||||||||||||||||||||||||||||||||||||||||
| 352 | 0 | ▶ | if ( defined $domain ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 353 | 0 | $oname = $domain->textContent(); | |||||||||||||||||||||||||||||||||||||||||
| 354 | 0 | $otype = 'domain'; | |||||||||||||||||||||||||||||||||||||||||
| 355 | } | ||||||||||||||||||||||||||||||||||||||||||
| 356 | |||||||||||||||||||||||||||||||||||||||||||
| 357 | 0 | $rinfo->{$otype}->{$oname}->{notify} = $notify; | |||||||||||||||||||||||||||||||||||||||||
| 358 | 0 | $rinfo->{$otype}->{$oname}->{action} = $notify; | |||||||||||||||||||||||||||||||||||||||||
| 359 | 0 | $rinfo->{$otype}->{$oname}->{exist} = 0; | |||||||||||||||||||||||||||||||||||||||||
| 360 | |||||||||||||||||||||||||||||||||||||||||||
| 361 | # done | ||||||||||||||||||||||||||||||||||||||||||
| 362 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 363 | } | ||||||||||||||||||||||||||||||||||||||||||
| 364 | |||||||||||||||||||||||||||||||||||||||||||
| 365 | # domain update command extension | ||||||||||||||||||||||||||||||||||||||||||
| 366 | 0 | ▶ | sub domain_update { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
domain_update: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 367 | 0 | my ( $epp, $domain, $rd ) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 368 | 0 | my @data = (); | |||||||||||||||||||||||||||||||||||||||||
| 369 | |||||||||||||||||||||||||||||||||||||||||||
| 370 | # iis:clientDelete | ||||||||||||||||||||||||||||||||||||||||||
| 371 | 0 | ▶ | if ( exists $rd->{client_delete} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 372 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters("client_delete can only be '1' or '0'") if ( $rd->{client_delete}[2] !~ /^(0|1)$/ ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 373 | 0 | push @data, [ 'iis:clientDelete', $rd->{client_delete}[2] ]; | |||||||||||||||||||||||||||||||||||||||||
| 374 | } | ||||||||||||||||||||||||||||||||||||||||||
| 375 | |||||||||||||||||||||||||||||||||||||||||||
| 376 | # only add extension if any data gets added | ||||||||||||||||||||||||||||||||||||||||||
| 377 | 0 | ▶ | return unless @data; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 378 | |||||||||||||||||||||||||||||||||||||||||||
| 379 | # create <iis:update/> and add extension to message | ||||||||||||||||||||||||||||||||||||||||||
| 380 | 0 | $epp->message()->command_extension('iis', ['update', @data]); | |||||||||||||||||||||||||||||||||||||||||
| 381 | |||||||||||||||||||||||||||||||||||||||||||
| 382 | # done | ||||||||||||||||||||||||||||||||||||||||||
| 383 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 384 | } | ||||||||||||||||||||||||||||||||||||||||||
| 385 | |||||||||||||||||||||||||||||||||||||||||||
| 386 | 0 | ▶ | sub domain_transfer { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
domain_transfer: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 387 | 0 | my ( $epp, $domain, $rd ) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 388 | 0 | my @data = (); | |||||||||||||||||||||||||||||||||||||||||
| 389 | |||||||||||||||||||||||||||||||||||||||||||
| 390 | # new nameservers (optional) | ||||||||||||||||||||||||||||||||||||||||||
| 391 | 0 | ▶ | push @data, [ 'iis:ns', map { [ 'iis:hostObj', $_ ] } $rd->{ns}->get_names() ] if Net::DRI::Util::has_ns($rd); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 392 | |||||||||||||||||||||||||||||||||||||||||||
| 393 | # only add body if any data gets added | ||||||||||||||||||||||||||||||||||||||||||
| 394 | 0 | ▶ | return unless @data; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 395 | |||||||||||||||||||||||||||||||||||||||||||
| 396 | # create <iis:transfer/> and add extension to message | ||||||||||||||||||||||||||||||||||||||||||
| 397 | 0 | $epp->message()->command_extension('iis', ['transfer', @data]); | |||||||||||||||||||||||||||||||||||||||||
| 398 | |||||||||||||||||||||||||||||||||||||||||||
| 399 | # done | ||||||||||||||||||||||||||||||||||||||||||
| 400 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 401 | } | ||||||||||||||||||||||||||||||||||||||||||
| 402 | |||||||||||||||||||||||||||||||||||||||||||
| 403 | # contact create command extension | ||||||||||||||||||||||||||||||||||||||||||
| 404 | 0 | ▶ | sub contact_create { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
contact_create: not called CC=11 SCAR=48.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 405 | 0 | my ( $epp, $contact, $rd ) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 406 | 0 | my @data = (); | |||||||||||||||||||||||||||||||||||||||||
| 407 | |||||||||||||||||||||||||||||||||||||||||||
| 408 | # iis:orgno (mandatory) | ||||||||||||||||||||||||||||||||||||||||||
| 409 | 0 | my $orgno; | |||||||||||||||||||||||||||||||||||||||||
| 410 | 0 | ▶ | $orgno = $rd->{orgno} if exists( $rd->{orgno} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 411 | 0 | ▶ | $orgno = $contact->{orgno} if exists( $contact->{orgno} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 412 | 0 | ▶ | $orgno = $contact->orgno if $contact->can('orgno'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 413 | |||||||||||||||||||||||||||||||||||||||||||
| 414 | 0 | ▶ | Net::DRI::Exception::usererr_insufficient_parameters('Attribute orgno must exist') unless defined $orgno; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 415 | 0 | push @data, [ 'iis:orgno', $orgno ]; | |||||||||||||||||||||||||||||||||||||||||
| 416 | |||||||||||||||||||||||||||||||||||||||||||
| 417 | # iis:vatno (optional) | ||||||||||||||||||||||||||||||||||||||||||
| 418 | 0 | my $vatno; | |||||||||||||||||||||||||||||||||||||||||
| 419 | 0 | ▶ | $vatno = $rd->{orgno} if exists( $rd->{vatno} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 420 | 0 | ▶ | $vatno = $contact->{vatno} if exists( $contact->{vatno} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 421 | 0 | ▶ | $vatno = $contact->vatno if $contact->can('vatno'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 422 | 0 | ▶ | if ( exists( $rd->{vatno} ) && $vatno ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
exists $rd->{"vatno"} and $vatno
MC/DC0%0/2
exists $rd->{"vatno"} and $vatno
exists $rd->{"vatno"}
$vatno
Truth table0%0/3
A and B
A= exists $rd->{"vatno"}B= $vatno
| |||||||||||||||||||||||||||||||||||||||||||
| 423 | 0 | push @data, [ 'iis:vatno', $vatno ]; | |||||||||||||||||||||||||||||||||||||||||
| 424 | } | ||||||||||||||||||||||||||||||||||||||||||
| 425 | |||||||||||||||||||||||||||||||||||||||||||
| 426 | # only add extension if any data gets added | ||||||||||||||||||||||||||||||||||||||||||
| 427 | 0 | ▶ | return unless @data; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 428 | |||||||||||||||||||||||||||||||||||||||||||
| 429 | # create <iis:create/> and add extension to message | ||||||||||||||||||||||||||||||||||||||||||
| 430 | 0 | $epp->message()->command_extension('iis', ['create', @data]); | |||||||||||||||||||||||||||||||||||||||||
| 431 | |||||||||||||||||||||||||||||||||||||||||||
| 432 | # done | ||||||||||||||||||||||||||||||||||||||||||
| 433 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 434 | } | ||||||||||||||||||||||||||||||||||||||||||
| 435 | |||||||||||||||||||||||||||||||||||||||||||
| 436 | # contact update command extension | ||||||||||||||||||||||||||||||||||||||||||
| 437 | 0 | ▶ | sub contact_update { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
contact_update: not called CC=7 SCAR=40.3
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 438 | 0 | my ( $epp, $contact, $rd ) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 439 | 0 | my @data = (); | |||||||||||||||||||||||||||||||||||||||||
| 440 | |||||||||||||||||||||||||||||||||||||||||||
| 441 | # get the new contact information | ||||||||||||||||||||||||||||||||||||||||||
| 442 | 0 | my $newc = $rd->set('info'); | |||||||||||||||||||||||||||||||||||||||||
| 443 | 0 | ▶ | return unless defined $newc && ref $newc; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $newc and ref $newc
MC/DC0%0/2
defined $newc and ref $newc
defined $newc
ref $newc
Truth table0%0/3
A and B
A= defined $newcB= ref $newc
| |||||||||||||||||||||||||||||||||||||||||||
| 444 | |||||||||||||||||||||||||||||||||||||||||||
| 445 | # iis:orgno (mandatory) | ||||||||||||||||||||||||||||||||||||||||||
| 446 | 0 | ▶ | Net::DRI::Exception::usererr_insufficient_parameters('Attribute orgno can not be updated') if exists( $newc->{orgno} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 447 | |||||||||||||||||||||||||||||||||||||||||||
| 448 | # iis:vatno (optional) | ||||||||||||||||||||||||||||||||||||||||||
| 449 | 0 | ▶ | if ( exists( $newc->{vatno} ) && defined $newc->{vatno} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
exists $newc->{"vatno"} and defined $newc->{"vatno"}
MC/DC0%0/2
exists $newc->{"vatno"} and defined $newc->{"vatno"}
exists $newc->{"vatno"}
defined $newc->{"vatno"}
Truth table0%0/3
A and B
A= exists $newc->{"vatno"}B= defined $newc->{"vatno"}
| |||||||||||||||||||||||||||||||||||||||||||
| 450 | 0 | push @data, [ 'iis:vatno', $newc->{vatno} ]; | |||||||||||||||||||||||||||||||||||||||||
| 451 | } | ||||||||||||||||||||||||||||||||||||||||||
| 452 | |||||||||||||||||||||||||||||||||||||||||||
| 453 | # only add extension if any data gets added | ||||||||||||||||||||||||||||||||||||||||||
| 454 | 0 | ▶ | return unless @data; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 455 | |||||||||||||||||||||||||||||||||||||||||||
| 456 | # create <iis:update/> and add extension to message | ||||||||||||||||||||||||||||||||||||||||||
| 457 | 0 | $epp->message()->command_extension('iis', ['update', @data]); | |||||||||||||||||||||||||||||||||||||||||
| 458 | |||||||||||||||||||||||||||||||||||||||||||
| 459 | # done | ||||||||||||||||||||||||||||||||||||||||||
| 460 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 461 | } | ||||||||||||||||||||||||||||||||||||||||||
| 462 | |||||||||||||||||||||||||||||||||||||||||||
| 463 | #################################################################################################### | ||||||||||||||||||||||||||||||||||||||||||
| 464 | ## Session commands, adapt to server greeting | ||||||||||||||||||||||||||||||||||||||||||
| 465 | |||||||||||||||||||||||||||||||||||||||||||
| 466 | sub parse_greeting | ||||||||||||||||||||||||||||||||||||||||||
| 467 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_greeting: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 468 | 0 | my ($po,$otype,$oaction,$oname,$rinfo)=@_; | |||||||||||||||||||||||||||||||||||||||||
| 469 | 0 | my $mes=$po->message(); | |||||||||||||||||||||||||||||||||||||||||
| 470 | |||||||||||||||||||||||||||||||||||||||||||
| 471 | 0 | ▶ | return unless defined $mes->node_greeting(); ## only work here for true greeting reply handling, not for all polling responses ! | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 472 | |||||||||||||||||||||||||||||||||||||||||||
| 473 | 0 | $po->switch_to_highest_namespace_version('iis'); | |||||||||||||||||||||||||||||||||||||||||
| 474 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 475 | } | ||||||||||||||||||||||||||||||||||||||||||
| 476 | |||||||||||||||||||||||||||||||||||||||||||
| 477 | #################################################################################################### | ||||||||||||||||||||||||||||||||||||||||||
| 478 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||