| 1 | ## Domain Registry Interface, .IT message extensions | ||||||||||
| 2 | ## | ||||||||||
| 3 | ## Copyright (C) 2009-2010,2013,2016 Tower Technologies. All rights reserved. | ||||||||||
| 4 | ## | ||||||||||
| 5 | ## This program free software; you can redistribute it and/or modify | ||||||||||
| 6 | ## it under the terms of the GNU General Public License v2. | ||||||||||
| 7 | ## | ||||||||||
| 8 | |||||||||||
| 9 | package Net::DRI::Protocol::EPP::Extensions::IT::Notifications; | ||||||||||
| 10 | |||||||||||
| 11 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | |||||||||||
| 14 | =pod | ||||||||||
| 15 | |||||||||||
| 16 | =head1 NAME | ||||||||||
| 17 | |||||||||||
| 18 | Net::DRI::Protocol::EPP::Extensions::IT::Notifications - .IT EPP Notifications Parsing for Net::DRI | ||||||||||
| 19 | |||||||||||
| 20 | =head1 SUPPORT | ||||||||||
| 21 | |||||||||||
| 22 | For now, support questions should be sent to: | ||||||||||
| 23 | |||||||||||
| 24 | E<lt>noc@towertech.itE<gt> | ||||||||||
| 25 | |||||||||||
| 26 | Please also see the SUPPORT file in the distribution. | ||||||||||
| 27 | |||||||||||
| 28 | =head1 AUTHOR | ||||||||||
| 29 | |||||||||||
| 30 | Alessandro Zummo, E<lt>a.zummo@towertech.itE<gt> | ||||||||||
| 31 | |||||||||||
| 32 | =head1 COPYRIGHT | ||||||||||
| 33 | |||||||||||
| 34 | Copyright (C) 2009-2010,2013,2016 Tower Technologies. | ||||||||||
| 35 | All rights reserved. | ||||||||||
| 36 | |||||||||||
| 37 | This program is free software; you can redistribute it and/or modify | ||||||||||
| 38 | it under the terms of the GNU General Public License v2 as published by | ||||||||||
| 39 | the Free Software Foundation. | ||||||||||
| 40 | |||||||||||
| 41 | See the LICENSE file that comes with this distribution for more details. | ||||||||||
| 42 | |||||||||||
| 43 | |||||||||||
| 44 | =cut | ||||||||||
| 45 | |||||||||||
| 46 | sub register_commands | ||||||||||
| 47 | { | ||||||||||
| 48 | 0 | ▶ | my ($class, $version) = @_; | ||||||||
|
Subroutine
register_commands: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 49 | |||||||||||
| 50 | 0 | my $ops = { | |||||||||
| 51 | 'review_credit' => [ undef, \&parse_credit ], | ||||||||||
| 52 | 'review_passwd' => [ undef, \&parse_reminder ], | ||||||||||
| 53 | 'review_simple' => [ undef, \&parse_simple ], | ||||||||||
| 54 | 'review_change' => [ undef, \&parse_chgstatus ], | ||||||||||
| 55 | 'review_dnserror' => [ undef, \&parse_dnserror ], | ||||||||||
| 56 | }; | ||||||||||
| 57 | |||||||||||
| 58 | return { | ||||||||||
| 59 | 0 | 'message' => $ops, | |||||||||
| 60 | }; | ||||||||||
| 61 | } | ||||||||||
| 62 | |||||||||||
| 63 | sub retrieve_ext | ||||||||||
| 64 | { | ||||||||||
| 65 | 0 | ▶ | my ($po,$ns,$node)=@_; | ||||||||
|
Subroutine
retrieve_ext: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||
| 66 | 0 | my $msg = $po->message; | |||||||||
| 67 | 0 | ▶ | return unless $msg->is_success; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 68 | 0 | my $ext = $msg->get_extension($ns,$node); | |||||||||
| 69 | 0 | ▶ | return unless defined $ext; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 70 | 0 | my $id = $msg->msg_id; | |||||||||
| 71 | 0 | return ($ext,$id); | |||||||||
| 72 | } | ||||||||||
| 73 | |||||||||||
| 74 | sub parse_credit | ||||||||||
| 75 | { | ||||||||||
| 76 | 0 | ▶ | my ($po, $type, $action, $name, $rinfo) = @_; | ||||||||
|
Subroutine
parse_credit: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 77 | 0 | my ($ext,$id)=retrieve_ext($po,'it_epp','creditMsgData'); | |||||||||
| 78 | 0 | ▶ | return unless defined $ext; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 79 | |||||||||||
| 80 | 0 | $rinfo->{'message'}->{$id}->{credit}=($ext->getElementsByTagName('extepp:credit'))[0]->textContent; ## TODO: use xml_child_content() instead | |||||||||
| 81 | 0 | return; | |||||||||
| 82 | } | ||||||||||
| 83 | |||||||||||
| 84 | sub parse_reminder | ||||||||||
| 85 | { | ||||||||||
| 86 | 0 | ▶ | my ($po, $type, $action, $name, $rinfo) = @_; | ||||||||
|
Subroutine
parse_reminder: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 87 | 0 | my ($ext,$id)=retrieve_ext($po,'it_epp','passwdReminder'); | |||||||||
| 88 | 0 | ▶ | return unless defined $ext; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 89 | |||||||||||
| 90 | 0 | $rinfo->{'message'}->{$id}->{'passwd_expires_on'}= ($ext->getElementsByTagName('extepp:exDate'))[0]->textContent; ## TODO: use xml_child_content() instead + convert date to DateTime object ? | |||||||||
| 91 | 0 | return; | |||||||||
| 92 | } | ||||||||||
| 93 | |||||||||||
| 94 | sub parse_simple | ||||||||||
| 95 | { | ||||||||||
| 96 | 0 | ▶ | my ($po, $type, $action, $name, $rinfo) = @_; | ||||||||
|
Subroutine
parse_simple: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 97 | 0 | my ($ext,$id)=retrieve_ext($po,'extdom','simpleMsgData'); | |||||||||
| 98 | 0 | ▶ | return unless defined $ext; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 99 | |||||||||||
| 100 | 0 | $rinfo->{'message'}->{$id}->{'domain'}=($ext->getElementsByTagName('extdom:name'))[0]->textContent; ## TODO: use xml_child_content() instead | |||||||||
| 101 | 0 | return; | |||||||||
| 102 | } | ||||||||||
| 103 | |||||||||||
| 104 | sub parse_chgstatus | ||||||||||
| 105 | { | ||||||||||
| 106 | 0 | ▶ | my ($po, $type, $action, $name, $rinfo) = @_; | ||||||||
|
Subroutine
parse_chgstatus: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||
| 107 | 0 | my ($ext,$id)=retrieve_ext($po,'extdom','chgStatusMsgData'); | |||||||||
| 108 | 0 | ▶ | return unless defined $ext; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 109 | |||||||||||
| 110 | 0 | $rinfo->{'message'}->{$id}->{'domain'}=($ext->getElementsByTagName('extdom:name'))[0]->textContent; ## TODO: use xml_child_content() instead | |||||||||
| 111 | |||||||||||
| 112 | 0 | foreach ($ext->findnodes('//extdom:targetStatus/*')) { | |||||||||
| 113 | |||||||||||
| 114 | 0 | ▶ | $rinfo->{'message'}->{$id}->{'status'} = $_->getAttribute('s') | ||||||||
|
Branch: 1 branch
| |||||||||||
| 115 | if $_->nodeName eq 'domain:status'; | ||||||||||
| 116 | |||||||||||
| 117 | 0 | ▶ | $rinfo->{'message'}->{$id}->{'own_status'} = $_->getAttribute('s') | ||||||||
|
Branch: 1 branch
| |||||||||||
| 118 | if $_->nodeName eq 'extdom:ownStatus'; ## TODO : what is the difference between the two statuses ? + create a true StatusList object | ||||||||||
| 119 | } | ||||||||||
| 120 | 0 | return; | |||||||||
| 121 | } | ||||||||||
| 122 | |||||||||||
| 123 | sub parse_dnserror | ||||||||||
| 124 | { | ||||||||||
| 125 | 0 | ▶ | my ($po, $type, $action, $name, $rinfo) = @_; | ||||||||
|
Subroutine
parse_dnserror: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||
| 126 | 0 | my ($ext,$id)=retrieve_ext($po,'extdom','dnsErrorMsgData'); | |||||||||
| 127 | 0 | ▶ | return unless defined $ext; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 128 | |||||||||||
| 129 | 0 | $rinfo->{'message'}->{$id}->{'domain'} | |||||||||
| 130 | = ($ext->getElementsByTagName('extdom:domain'))[0] | ||||||||||
| 131 | ->getAttribute('name'); ## TODO: use xml_child_content() instead | ||||||||||
| 132 | |||||||||||
| 133 | 0 | $rinfo->{'message'}->{$id}->{'status'} | |||||||||
| 134 | = ($ext->getElementsByTagName('extdom:domain'))[0] | ||||||||||
| 135 | ->getAttribute('status'); ## TODO: use xml_child_content() instead | ||||||||||
| 136 | |||||||||||
| 137 | 0 | $rinfo->{'message'}->{$id}->{'response_id'} | |||||||||
| 138 | = ($ext->getElementsByTagName('extdom:responseId'))[0]->textContent; ## TODO: use xml_child_content() instead | ||||||||||
| 139 | |||||||||||
| 140 | 0 | $rinfo->{'message'}->{$id}->{'validation_date'} | |||||||||
| 141 | = ($ext->getElementsByTagName('extdom:validationDate'))[0]->textContent; ## TODO: use xml_child_content() instead | ||||||||||
| 142 | |||||||||||
| 143 | 0 | foreach my $test ($ext->findnodes('//extdom:test')) { | |||||||||
| 144 | |||||||||||
| 145 | 0 | my $name = $test->getAttribute('name'); | |||||||||
| 146 | |||||||||||
| 147 | 0 | $rinfo->{'message'}->{$id}->{'test'}{$name}{'status'} = $test->getAttribute('status'); | |||||||||
| 148 | |||||||||||
| 149 | 0 | foreach my $dns ($test->findnodes('./extdom:dns')) { | |||||||||
| 150 | |||||||||||
| 151 | 0 | $rinfo->{'message'}->{$id}->{'test'}{$name}{'dns'}{$dns->getAttribute('name')} | |||||||||
| 152 | = $dns->getAttribute('status'); | ||||||||||
| 153 | } | ||||||||||
| 154 | } | ||||||||||
| 155 | 0 | return; | |||||||||
| 156 | } | ||||||||||
| 157 | |||||||||||
| 158 | 1 | 1; | |||||||||