line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
## Domain Registry Interface, .CO.ZA Domain EPP extension commands |
2
|
|
|
|
|
|
|
## From http://registry.coza.net.za/doku.php?id=eppdomainextension |
3
|
|
|
|
|
|
|
## |
4
|
|
|
|
|
|
|
## Copyright (c) 2011,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::COZA::Domain; |
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
1
|
|
652
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
22
|
|
19
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
18
|
|
20
|
|
|
|
|
|
|
|
21
|
1
|
|
|
1
|
|
3
|
use Net::DRI::Util; |
|
1
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
13
|
|
22
|
1
|
|
|
1
|
|
3
|
use Net::DRI::Exception; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
415
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
#################################################################################################### |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub register_commands |
27
|
|
|
|
|
|
|
{ |
28
|
0
|
|
|
0
|
0
|
|
my ($class,$version)=@_; |
29
|
0
|
|
|
|
|
|
my %tmp=( |
30
|
|
|
|
|
|
|
update => [ \&update , \&update_parse ], |
31
|
|
|
|
|
|
|
info => [ \&info , \&info_parse ], |
32
|
|
|
|
|
|
|
); |
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
|
|
|
return { 'domain' => \%tmp }; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub setup |
38
|
|
|
|
|
|
|
{ |
39
|
0
|
|
|
0
|
0
|
|
my ($class,$po,$version)=@_; |
40
|
0
|
|
|
|
|
|
$po->ns({ 'cozadomain' => [ 'http://co.za/epp/extensions/cozadomain-1-0','coza-domain-1.0.xsd' ] }); |
41
|
0
|
|
|
|
|
|
return; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
#################################################################################################### |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub update |
47
|
|
|
|
|
|
|
{ |
48
|
0
|
|
|
0
|
0
|
|
my ($epp,$domain,$todo)=@_; |
49
|
0
|
|
|
|
|
|
my $mes=$epp->message(); |
50
|
|
|
|
|
|
|
|
51
|
0
|
|
|
|
|
|
my $autorenew=$todo->set('auto_renew'); |
52
|
0
|
0
|
|
|
|
|
if (defined $autorenew) |
53
|
|
|
|
|
|
|
{ |
54
|
0
|
|
|
|
|
|
my $eid=$mes->command_extension_register('cozadomain','update'); |
55
|
0
|
0
|
|
|
|
|
$mes->command_extension($eid,[['cozadomain:chg',['cozadomain:autorenew',$autorenew ? 'true' : 'false']]]); |
56
|
0
|
|
|
|
|
|
return; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
0
|
|
|
|
|
|
my $cancel=$todo->set('cancel_action'); |
60
|
0
|
0
|
|
|
|
|
if (defined $cancel) |
61
|
|
|
|
|
|
|
{ |
62
|
0
|
0
|
|
|
|
|
Net::DRI::Exception::usererr_invalid_parameters('cancel_action parameter must be PendingUpdate or PendingSuspension') unless $cancel=~m/^Pending(?:Update|Suspension)$/; |
63
|
0
|
|
|
|
|
|
my $eid=$mes->command_extension_register('cozadomain','update',{cancelPendingAction=>$cancel}); |
64
|
|
|
|
|
|
|
} |
65
|
0
|
|
|
|
|
|
return; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub update_parse |
69
|
|
|
|
|
|
|
{ |
70
|
0
|
|
|
0
|
0
|
|
my ($po,$otype,$oaction,$oname,$rinfo)=@_; |
71
|
0
|
|
|
|
|
|
my $mes=$po->message(); |
72
|
0
|
0
|
|
|
|
|
return unless $mes->is_success(); |
73
|
|
|
|
|
|
|
|
74
|
0
|
|
|
|
|
|
my $updata=$mes->get_extension('cozadomain','cozaData'); |
75
|
0
|
0
|
|
|
|
|
return unless defined $updata; |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
## We do not parse the AutoRenew 'False' successful |
78
|
0
|
|
|
|
|
|
return; |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
sub info |
82
|
|
|
|
|
|
|
{ |
83
|
0
|
|
|
0
|
0
|
|
my ($epp,$domain,$rp)=@_; |
84
|
0
|
|
|
|
|
|
my $mes=$epp->message(); |
85
|
|
|
|
|
|
|
|
86
|
0
|
0
|
0
|
|
|
|
return unless Net::DRI::Util::has_key($rp,'transfer_cost') && $rp->{transfer_cost}; |
87
|
|
|
|
|
|
|
|
88
|
0
|
|
|
|
|
|
my $eid=$mes->command_extension_register('cozadomain','info'); |
89
|
0
|
|
|
|
|
|
$mes->command_extension($eid,[['cozadomain:transferQuote','true']]); |
90
|
0
|
|
|
|
|
|
return; |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
sub info_parse |
94
|
|
|
|
|
|
|
{ |
95
|
0
|
|
|
0
|
0
|
|
my ($po,$otype,$oaction,$oname,$rinfo)=@_; |
96
|
0
|
|
|
|
|
|
my $mes=$po->message(); |
97
|
0
|
0
|
|
|
|
|
return unless $mes->is_success(); |
98
|
|
|
|
|
|
|
|
99
|
0
|
|
|
|
|
|
my $infdata=$mes->get_extension('cozadomain','infData'); |
100
|
0
|
0
|
|
|
|
|
return unless defined $infdata; |
101
|
|
|
|
|
|
|
|
102
|
0
|
|
|
|
|
|
my $ns=$mes->ns('cozadomain'); |
103
|
0
|
|
|
|
|
|
my $autorenew=Net::DRI::Util::xml_traverse($infdata,$ns,'autorenew'); |
104
|
0
|
0
|
|
|
|
|
$rinfo->{domain}->{$oname}->{auto_renew}=Net::DRI::Util::xml_parse_boolean($autorenew->textContent()) if defined $autorenew; |
105
|
|
|
|
|
|
|
|
106
|
0
|
|
|
|
|
|
my $cost=Net::DRI::Util::xml_traverse($infdata,$ns,'transferQuoteRes','cost'); |
107
|
0
|
0
|
|
|
|
|
$rinfo->{domain}->{$oname}->{transfer_cost}=0+$cost->textContent() if defined $cost; |
108
|
0
|
|
|
|
|
|
return; |
109
|
|
|
|
|
|
|
} |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
#################################################################################################### |
112
|
|
|
|
|
|
|
1; |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
__END__ |