line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
## Domain Registry Interface, Change Poll Extension Mapping for EPP |
2
|
|
|
|
|
|
|
## |
3
|
|
|
|
|
|
|
## Copyright (c) 2015,2016 Patrick Mevzek . 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::ChangePoll; |
16
|
|
|
|
|
|
|
|
17
|
1
|
|
|
1
|
|
707
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
23
|
|
18
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
37
|
|
19
|
1
|
|
|
1
|
|
5
|
use feature 'state'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
52
|
|
20
|
|
|
|
|
|
|
|
21
|
1
|
|
|
1
|
|
3
|
use Net::DRI::Util; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
358
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
#################################################################################################### |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub register_commands |
26
|
|
|
|
|
|
|
{ |
27
|
0
|
|
|
0
|
0
|
|
my ($class,$version)=@_; |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
|
state $rops = { 'session' => { change_poll => [ undef, \&parse ] } }; |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
|
|
|
return $rops; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub setup |
35
|
|
|
|
|
|
|
{ |
36
|
0
|
|
|
0
|
0
|
|
my ($class,$po,$version)=@_; |
37
|
0
|
|
|
|
|
|
state $ns = { 'changepoll' => [ 'urn:ietf:params:xml:ns:changePoll-1.0','changePoll-1.0.xsd' ] }; |
38
|
0
|
|
|
|
|
|
$po->ns($ns); |
39
|
0
|
|
|
|
|
|
return; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
0
|
0
|
|
sub implements { return 'https://tools.ietf.org/html/draft-gould-change-poll-04'; } |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
#################################################################################################### |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub parse |
47
|
|
|
|
|
|
|
{ |
48
|
0
|
|
|
0
|
0
|
|
my ($po,$otype,$oaction,$oname,$rinfo)=@_; |
49
|
0
|
|
|
|
|
|
my $mes=$po->message(); |
50
|
0
|
0
|
|
|
|
|
return unless $mes->is_success(); |
51
|
|
|
|
|
|
|
|
52
|
0
|
|
|
|
|
|
my $data=$mes->get_extension('changepoll','changeData'); |
53
|
0
|
0
|
|
|
|
|
return unless defined $data; |
54
|
|
|
|
|
|
|
|
55
|
0
|
0
|
|
|
|
|
my %r=('state' => $data->hasAttribute('state') ? $data->getAttribute('state') : 'after'); |
56
|
0
|
|
|
|
|
|
foreach my $el (Net::DRI::Util::xml_list_children($data)) |
57
|
|
|
|
|
|
|
{ |
58
|
0
|
|
|
|
|
|
my ($name,$node)=@$el; |
59
|
0
|
0
|
|
|
|
|
if ($name eq 'operation') |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
60
|
|
|
|
|
|
|
{ |
61
|
0
|
|
|
|
|
|
my $value=$node->textContent(); |
62
|
0
|
0
|
|
|
|
|
$r{$name}=$node->hasAttribute('op') ? [ $value, $node->getAttribute('op') ] : $value; |
63
|
|
|
|
|
|
|
} elsif ($name=~m/^(who|svTRID)$/) |
64
|
|
|
|
|
|
|
{ |
65
|
0
|
|
|
|
|
|
$r{$name}=$node->textContent(); |
66
|
|
|
|
|
|
|
} elsif ($name eq 'date') |
67
|
|
|
|
|
|
|
{ |
68
|
0
|
|
|
|
|
|
$r{$name}=$po->parse_iso8601($node->textContent()); |
69
|
|
|
|
|
|
|
} elsif ($name eq 'caseId') |
70
|
|
|
|
|
|
|
{ |
71
|
0
|
|
|
|
|
|
my $type=$node->getAttribute('type'); |
72
|
0
|
0
|
|
|
|
|
$type=$node->getAttribute('name') if $type eq 'custom'; |
73
|
0
|
|
|
|
|
|
$r{case}={ type => $type, id => $node->textContent() }; |
74
|
|
|
|
|
|
|
} elsif ($name eq 'reason') |
75
|
|
|
|
|
|
|
{ |
76
|
0
|
0
|
0
|
|
|
|
$r{reason} = $node->hasAttribute('lang') ? { lang => $node->getAttribute('lang') // 'en', msg => $node->textContent() } : $node->textContent(); |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
0
|
|
|
|
|
|
my $msgid=$mes->msg_id(); |
81
|
0
|
|
|
|
|
|
$rinfo->{message}->{$msgid}->{change}=\%r; |
82
|
0
|
|
|
|
|
|
return; |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
#################################################################################################### |
86
|
|
|
|
|
|
|
1; |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
__END__ |