| 1 | ## Domain Registry Interface, AFNIC EPP Notifications | ||||||||||||||||||||||||||
| 2 | ## | ||||||||||||||||||||||||||
| 3 | ## Copyright (c) 2008-2010,2012 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::AFNIC::Notifications; | ||||||||||||||||||||||||||
| 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 Net::DRI::Util; | ||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||
| 21 | 1 | ▶ | use Net::DRI::Protocol::EPP::Util; | ||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||
| 22 | 1 | ▶ | use Net::DRI::Protocol::EPP::Extensions::AFNIC::Contact; | ||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||
| 24 | =pod | ||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||
| 26 | =head1 NAME | ||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||
| 28 | Net::DRI::Protocol::EPP::Extensions::AFNIC::Notifications - AFNIC (.FR/.RE/.TF/.WF/.PM/.YT) EPP Notifications 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) 2008-2010,2012 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 | review_zonecheck => [ undef, \&parse_zonecheck ], | ||||||||||||||||||||||||||
| 71 | review_identification => [ undef, \&parse_identification ], | ||||||||||||||||||||||||||
| 72 | review_qualification => [ undef, \&parse_qualification ], | ||||||||||||||||||||||||||
| 73 | ); | ||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||
| 75 | 0 | return { 'message' => \%tmp }; | |||||||||||||||||||||||||
| 76 | } | ||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||
| 78 | #################################################################################################### | ||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||
| 80 | sub parse_zonecheck | ||||||||||||||||||||||||||
| 81 | { | ||||||||||||||||||||||||||
| 82 | 0 | ▶ | my ($po,$otype,$oaction,$oname,$rinfo)=@_; | ||||||||||||||||||||||||
|
Subroutine
parse_zonecheck: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||||||||
| 83 | 0 | my $mes=$po->message(); | |||||||||||||||||||||||||
| 84 | 0 | ▶ | return unless $mes->is_success(); | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 85 | 0 | ▶ | return unless $mes->node_msg(); ## this is the <msg> node in the EPP header | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||
| 87 | ## For now there is no namespace | ||||||||||||||||||||||||||
| 88 | #my $zc=$mes->node_msg()->getChildrenByTagNameNS($mes->ns('frnic'),'resZC'); | ||||||||||||||||||||||||||
| 89 | 0 | my $zc=$mes->node_msg()->getChildrenByTagName('resZC'); | |||||||||||||||||||||||||
| 90 | 0 | ▶ | return unless $zc->size(); | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 91 | 0 | $zc=$zc->shift(); | |||||||||||||||||||||||||
| 92 | 0 | ▶ | return unless ($zc->getAttribute('type') eq 'plain-text'); ## we do not know what to do with other types | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||
| 94 | 0 | $rinfo->{domain}->{$oname}->{review_zonecheck}=$zc->textContent(); ## a blob for now | |||||||||||||||||||||||||
| 95 | 0 | $rinfo->{domain}->{$oname}->{action}='review_zonecheck'; | |||||||||||||||||||||||||
| 96 | 0 | $rinfo->{domain}->{$oname}->{exist}=1; | |||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||
| 98 | 0 | return; | |||||||||||||||||||||||||
| 99 | } | ||||||||||||||||||||||||||
| 100 | |||||||||||||||||||||||||||
| 101 | sub parse_identification | ||||||||||||||||||||||||||
| 102 | { | ||||||||||||||||||||||||||
| 103 | 0 | ▶ | my ($po,$otype,$oaction,$oname,$rinfo)=@_; | ||||||||||||||||||||||||
|
Subroutine
parse_identification: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||||||||
| 104 | 0 | my $mes=$po->message(); | |||||||||||||||||||||||||
| 105 | 0 | ▶ | return unless $mes->is_success(); | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 106 | 0 | my $idt=$mes->get_extension('frnic','ext'); | |||||||||||||||||||||||||
| 107 | 0 | ▶ | return unless defined $idt; | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||
| 109 | 0 | my $ns=$mes->ns('frnic'); | |||||||||||||||||||||||||
| 110 | 0 | $idt=Net::DRI::Util::xml_traverse($idt,$ns,'resData','idtData'); | |||||||||||||||||||||||||
| 111 | 0 | ▶ | return unless defined $idt; | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||
| 113 | 0 | my $c=Net::DRI::Util::xml_traverse($idt,$ns,'domain'); | |||||||||||||||||||||||||
| 114 | 0 | ▶ | return unless defined $c; | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 115 | |||||||||||||||||||||||||||
| 116 | 0 | $oname=lc Net::DRI::Util::xml_child_content($c,$ns,'name'); | |||||||||||||||||||||||||
| 117 | 0 | $rinfo->{domain}->{$oname}->{action}='review_identification'; | |||||||||||||||||||||||||
| 118 | 0 | $rinfo->{domain}->{$oname}->{exist}=1; | |||||||||||||||||||||||||
| 119 | 0 | $rinfo->{domain}->{$oname}->{status}=$po->create_local_object('status')->add(Net::DRI::Protocol::EPP::Util::parse_node_status(Net::DRI::Util::xml_traverse($c,$ns,'status'))); | |||||||||||||||||||||||||
| 120 | 0 | $rinfo->{domain}->{$oname}->{contact}=$po->create_local_object('contactset')->set($po->create_local_object('contact')->srid(Net::DRI::Util::xml_child_content($c,$ns,'registrant')),'registrant'); | |||||||||||||||||||||||||
| 121 | |||||||||||||||||||||||||||
| 122 | 0 | return; | |||||||||||||||||||||||||
| 123 | } | ||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||
| 125 | sub parse_qualification | ||||||||||||||||||||||||||
| 126 | { | ||||||||||||||||||||||||||
| 127 | 0 | ▶ | my ($po,$otype,$oaction,$oname,$rinfo)=@_; | ||||||||||||||||||||||||
|
Subroutine
parse_qualification: not called CC=13 SCAR=52.0
Pod
undocumented
| |||||||||||||||||||||||||||
| 128 | 0 | my $mes=$po->message(); | |||||||||||||||||||||||||
| 129 | 0 | ▶ | return unless $mes->is_success(); | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 130 | 0 | my $qua=$mes->get_extension('frnic','ext'); | |||||||||||||||||||||||||
| 131 | 0 | ▶ | return unless defined $qua; | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 132 | |||||||||||||||||||||||||||
| 133 | 0 | my $ns=$mes->ns('frnic'); | |||||||||||||||||||||||||
| 134 | 0 | $qua=Net::DRI::Util::xml_traverse($qua,$ns,'resData','quaData'); | |||||||||||||||||||||||||
| 135 | 0 | ▶ | return unless defined $qua; | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 136 | |||||||||||||||||||||||||||
| 137 | 0 | my $c=Net::DRI::Util::xml_traverse($qua,$ns,'contact'); | |||||||||||||||||||||||||
| 138 | 0 | ▶ | return unless defined $c; | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||
| 140 | 0 | my ($co,@reasons); | |||||||||||||||||||||||||
| 141 | 0 | my %q; | |||||||||||||||||||||||||
| 142 | 0 | foreach my $el (Net::DRI::Util::xml_list_children($c)) | |||||||||||||||||||||||||
| 143 | { | ||||||||||||||||||||||||||
| 144 | 0 | my ($name,$node)=@$el; | |||||||||||||||||||||||||
| 145 | 0 | ▶ | if ($name eq 'id') | ||||||||||||||||||||||||
|
Branch: 5 branches
| |||||||||||||||||||||||||||
| 146 | { | ||||||||||||||||||||||||||
| 147 | 0 | $oname=$node->textContent(); | |||||||||||||||||||||||||
| 148 | 0 | $rinfo->{contact}->{$oname}->{action}='review_qualification'; | |||||||||||||||||||||||||
| 149 | 0 | $rinfo->{contact}->{$oname}->{exist}=1; | |||||||||||||||||||||||||
| 150 | 0 | $co=$po->create_local_object('contact')->srid($oname); | |||||||||||||||||||||||||
| 151 | 0 | $rinfo->{contact}->{$oname}->{self}=$co; | |||||||||||||||||||||||||
| 152 | } elsif ($name eq 'qualificationProcess') | ||||||||||||||||||||||||||
| 153 | { | ||||||||||||||||||||||||||
| 154 | 0 | $rinfo->{contact}->{$oname}->{qualification_process_status}=$q{'process_status'}=$node->getAttribute('s'); | |||||||||||||||||||||||||
| 155 | } elsif ($name eq 'legalEntityInfos') | ||||||||||||||||||||||||||
| 156 | { | ||||||||||||||||||||||||||
| 157 | 0 | Net::DRI::Protocol::EPP::Extensions::AFNIC::Contact::parse_legalentityinfos($po,$otype,$oaction,$oname,$rinfo,$node,$co,$mes,\%q); | |||||||||||||||||||||||||
| 158 | } elsif ($name eq 'individualInfos') | ||||||||||||||||||||||||||
| 159 | { | ||||||||||||||||||||||||||
| 160 | 0 | Net::DRI::Protocol::EPP::Extensions::AFNIC::Contact::parse_individualinfos($po,$otype,$oaction,$oname,$rinfo,$node,$co,$mes,\%q); | |||||||||||||||||||||||||
| 161 | } elsif ($name eq 'reachability') | ||||||||||||||||||||||||||
| 162 | { | ||||||||||||||||||||||||||
| 163 | 0 | my %r; | |||||||||||||||||||||||||
| 164 | 0 | $r{status}=Net::DRI::Util::xml_child_content($node,$ns,'reStatus'); | |||||||||||||||||||||||||
| 165 | 0 | foreach my $v (qw/voice email/) | |||||||||||||||||||||||||
| 166 | { | ||||||||||||||||||||||||||
| 167 | 0 | my $tmp=Net::DRI::Util::xml_child_content($node,$ns,$v); | |||||||||||||||||||||||||
| 168 | 0 | ▶ | next unless defined $tmp; | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 169 | 0 | $r{$v}=$tmp; | |||||||||||||||||||||||||
| 170 | } | ||||||||||||||||||||||||||
| 171 | 0 | $q{reachable}=\%r; | |||||||||||||||||||||||||
| 172 | } | ||||||||||||||||||||||||||
| 173 | } | ||||||||||||||||||||||||||
| 174 | 0 | $co->qualification(\%q); | |||||||||||||||||||||||||
| 175 | |||||||||||||||||||||||||||
| 176 | 0 | return; | |||||||||||||||||||||||||
| 177 | } | ||||||||||||||||||||||||||
| 178 | |||||||||||||||||||||||||||
| 179 | #################################################################################################### | ||||||||||||||||||||||||||
| 180 | 1 | 1; | |||||||||||||||||||||||||