line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
## Domain Registry Interface, nic.at domain transactions extension |
2
|
|
|
|
|
|
|
## Contributed by Michael Braunoeder from NIC.AT |
3
|
|
|
|
|
|
|
## |
4
|
|
|
|
|
|
|
## Copyright (c) 2006-2008,2013 Patrick Mevzek . 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::AT::Domain; |
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
1
|
|
1097
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
19
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
19
|
|
20
|
|
|
|
|
|
|
|
21
|
1
|
|
|
1
|
|
5
|
use Net::DRI::Util; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
22
|
|
22
|
1
|
|
|
1
|
|
4
|
use Net::DRI::Exception; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
513
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
our $NS = 'http://www.nic.at/xsd/at-ext-domain-1.0'; |
25
|
|
|
|
|
|
|
our $ExtNS = 'http://www.nic.at/xsd/at-ext-epp-1.0'; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=pod |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 NAME |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
Net::DRI::Protocol::EPP::Extensions::AT::Domain - NIC.AT EPP Domain extension for Net::DRI |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 DESCRIPTION |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
Please see the README file for details. |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 SUPPORT |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
For now, support questions should be sent to: |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
Enetdri@dotandco.comE |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
Please also see the SUPPORT file in the distribution. |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 SEE ALSO |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
Ehttp://www.dotandco.com/services/software/Net-DRI/E |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 AUTHOR |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Patrick Mevzek, Enetdri@dotandco.comE |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 COPYRIGHT |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
Copyright (c) 2006-2008,2013 Patrick Mevzek . |
56
|
|
|
|
|
|
|
All rights reserved. |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify |
59
|
|
|
|
|
|
|
it under the terms of the GNU General Public License as published by |
60
|
|
|
|
|
|
|
the Free Software Foundation; either version 2 of the License, or |
61
|
|
|
|
|
|
|
(at your option) any later version. |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
See the LICENSE file that comes with this distribution for more details. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=cut |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
#################################################################################################### |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub register_commands { |
70
|
0
|
|
|
0
|
0
|
|
my ( $class, $version ) = @_; |
71
|
0
|
|
|
|
|
|
my %tmp = ( |
72
|
|
|
|
|
|
|
nocommand => [ \&extonly, undef ], |
73
|
|
|
|
|
|
|
delete => [ \&delete, undef ], |
74
|
|
|
|
|
|
|
transfer_request => [ \&transfer_request, undef ], |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
); |
77
|
|
|
|
|
|
|
|
78
|
0
|
|
|
|
|
|
return { 'domain' => \%tmp }; |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
#################################################################################################### |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
sub extonly { |
84
|
0
|
|
|
0
|
0
|
|
my ( $epp, $domain, $rd ) = @_; |
85
|
|
|
|
|
|
|
|
86
|
0
|
|
|
|
|
|
my $transaction; |
87
|
0
|
0
|
|
|
|
|
$transaction = $rd->{transactionname} if $rd->{transactionname}; |
88
|
|
|
|
|
|
|
|
89
|
0
|
0
|
|
|
|
|
return unless ($transaction); |
90
|
|
|
|
|
|
|
|
91
|
0
|
|
|
|
|
|
my $mes = $epp->message(); |
92
|
|
|
|
|
|
|
|
93
|
0
|
0
|
0
|
|
|
|
Net::DRI::Exception->die(1,'protocol/EPP',2,'Domain name needed') unless defined($domain) && $domain; |
94
|
0
|
0
|
|
|
|
|
Net::DRI::Exception->die(1,'protocol/EPP',10,'Invalid domain name: '.$domain) unless Net::DRI::Util::is_hostname($domain); |
95
|
|
|
|
|
|
|
##$mes->command_body([['domain:name',$domain]]); ## Useless if pure extension |
96
|
|
|
|
|
|
|
|
97
|
0
|
|
|
|
|
|
my $eid = $mes->command_extension_register( 'command', |
98
|
|
|
|
|
|
|
'xmlns="' . $ExtNS |
99
|
|
|
|
|
|
|
. '" xsi:schemaLocation="' |
100
|
|
|
|
|
|
|
. $ExtNS |
101
|
|
|
|
|
|
|
. ' at-ext-epp-1.0.xsd"' ); |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
|
104
|
0
|
|
|
|
|
|
my $cltrid=$mes->cltrid(); |
105
|
|
|
|
|
|
|
|
106
|
0
|
0
|
|
|
|
|
if ( $transaction eq 'withdraw' ) { |
|
|
0
|
|
|
|
|
|
107
|
|
|
|
|
|
|
|
108
|
0
|
|
|
|
|
|
my %domns; |
109
|
0
|
|
|
|
|
|
$domns{'xmlns:domain'} = $NS; |
110
|
0
|
|
|
|
|
|
$domns{'xsi:schemaLocation'} = $NS . ' at-ext-domain-1.0.xsd'; |
111
|
|
|
|
|
|
|
|
112
|
0
|
|
|
|
|
|
my %zdhash; |
113
|
0
|
0
|
|
|
|
|
$zdhash{'value'} = $rd->{zd} ? $rd->{zd} : 0; |
114
|
|
|
|
|
|
|
|
115
|
0
|
|
|
|
|
|
$mes->command_extension( |
116
|
|
|
|
|
|
|
$eid, |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
[ |
119
|
|
|
|
|
|
|
['withdraw', |
120
|
|
|
|
|
|
|
[ 'domain:withdraw', ['domain:name', $domain], \%domns , |
121
|
|
|
|
|
|
|
['domain:zd', \%zdhash], \%domns ]], |
122
|
|
|
|
|
|
|
['clTRID', $cltrid ] |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
] |
125
|
|
|
|
|
|
|
); |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
} |
129
|
|
|
|
|
|
|
elsif ( $transaction eq 'transfer_execute' ) { |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
|
132
|
0
|
|
|
|
|
|
my $token; |
133
|
0
|
0
|
|
|
|
|
$token = $rd->{token} if $rd->{token}; |
134
|
|
|
|
|
|
|
|
135
|
0
|
0
|
|
|
|
|
return unless ( defined($token) ); |
136
|
|
|
|
|
|
|
|
137
|
0
|
|
|
|
|
|
my %domns; |
138
|
0
|
|
|
|
|
|
$domns{'xmlns:domain'} = 'urn:ietf:params:xml:ns:domain-1.0'; |
139
|
0
|
|
|
|
|
|
$domns{'xsi:schemaLocation'} = 'urn:ietf:params:xml:ns:domain-1.0 domain-1.0.xsd'; |
140
|
|
|
|
|
|
|
|
141
|
0
|
|
|
|
|
|
my %domns2; |
142
|
0
|
|
|
|
|
|
$domns2{'xmlns:at-ext-domain'} = $NS; |
143
|
0
|
|
|
|
|
|
$domns2{'xsi:schemaLocation'} = $NS . ' at-ext-domain-1.0.xsd'; |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
|
147
|
0
|
|
|
|
|
|
$mes->command_extension( |
148
|
|
|
|
|
|
|
$eid, |
149
|
|
|
|
|
|
|
[ |
150
|
|
|
|
|
|
|
['transfer', |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
{ 'op' => 'execute' }, |
153
|
|
|
|
|
|
|
[ 'domain:transfer', \%domns, [ 'domain:name', $domain ] |
154
|
|
|
|
|
|
|
] |
155
|
|
|
|
|
|
|
], |
156
|
|
|
|
|
|
|
['extension', |
157
|
|
|
|
|
|
|
['at-ext-domain:transfer' , \%domns2, ['at-ext-domain:token',$token] |
158
|
|
|
|
|
|
|
] |
159
|
|
|
|
|
|
|
], |
160
|
|
|
|
|
|
|
['clTRID', $cltrid] |
161
|
|
|
|
|
|
|
] |
162
|
|
|
|
|
|
|
); |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
} |
165
|
0
|
|
|
|
|
|
return; |
166
|
|
|
|
|
|
|
} |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
sub delete { ## no critic (Subroutines::ProhibitBuiltinHomonyms) |
169
|
|
|
|
|
|
|
|
170
|
0
|
|
|
0
|
0
|
|
my ( $epp, $domain, $rd ) = @_; |
171
|
0
|
|
|
|
|
|
my $mes = $epp->message(); |
172
|
|
|
|
|
|
|
|
173
|
0
|
|
|
|
|
|
my $scheduledate; |
174
|
0
|
0
|
|
|
|
|
$scheduledate = $rd->{scheduledate} if $rd->{scheduledate}; |
175
|
|
|
|
|
|
|
|
176
|
0
|
0
|
|
|
|
|
return unless ( defined($scheduledate) ); |
177
|
|
|
|
|
|
|
|
178
|
0
|
|
|
|
|
|
my $eid = $mes->command_extension_register( 'at-ext-domain:delete', |
179
|
|
|
|
|
|
|
'xmlns:at-ext-domain="' . $NS |
180
|
|
|
|
|
|
|
. '" xsi:schemaLocation="' |
181
|
|
|
|
|
|
|
. $NS |
182
|
|
|
|
|
|
|
. ' at-ext-domain-1.0.xsd"' ); |
183
|
|
|
|
|
|
|
|
184
|
0
|
|
|
|
|
|
$mes->command_extension( $eid, |
185
|
|
|
|
|
|
|
[ 'at-ext-domain:scheduledate', $scheduledate ] ); |
186
|
0
|
|
|
|
|
|
return; |
187
|
|
|
|
|
|
|
} |
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
sub transfer_request { |
190
|
0
|
|
|
0
|
0
|
|
my ( $epp, $domain, $rd ) = @_; |
191
|
0
|
|
|
|
|
|
my $mes = $epp->message(); |
192
|
|
|
|
|
|
|
|
193
|
0
|
|
|
|
|
|
my $registrarinfo; |
194
|
0
|
0
|
|
|
|
|
$registrarinfo = $rd->{registrarinfo} if $rd->{registrarinfo}; |
195
|
|
|
|
|
|
|
|
196
|
0
|
0
|
|
|
|
|
return unless ( defined($registrarinfo) ); |
197
|
|
|
|
|
|
|
|
198
|
0
|
|
|
|
|
|
my $eid = $mes->command_extension_register( 'at-ext-domain:clientdata', |
199
|
|
|
|
|
|
|
'xmlns:at-ext-domain="' . $NS |
200
|
|
|
|
|
|
|
. '" xsi:schemaLocation="' |
201
|
|
|
|
|
|
|
. $NS |
202
|
|
|
|
|
|
|
. ' at-ext-domain-1.0.xsd"' ); |
203
|
|
|
|
|
|
|
|
204
|
0
|
|
|
|
|
|
my %entryname; |
205
|
0
|
|
|
|
|
|
$entryname{name} = 'Registrarinfo'; |
206
|
0
|
|
|
|
|
|
$mes->command_extension( $eid, |
207
|
|
|
|
|
|
|
[ 'at-ext-domain:entry', \%entryname, $registrarinfo ] ); |
208
|
0
|
|
|
|
|
|
return; |
209
|
|
|
|
|
|
|
} |
210
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
#################################################################################################### |
212
|
|
|
|
|
|
|
1; |