line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
## Domain Registry Interface, EURid Contact EPP extension commands |
2
|
|
|
|
|
|
|
## (based on EURid registration_guidelines_v1_0E-epp.pdf) |
3
|
|
|
|
|
|
|
## |
4
|
|
|
|
|
|
|
## Copyright (c) 2005,2008,2012,2013 Patrick Mevzek . All rights reserved. |
5
|
|
|
|
|
|
|
## 2014 Michael Kefeder . All rights reserved. |
6
|
|
|
|
|
|
|
## |
7
|
|
|
|
|
|
|
## This file is part of Net::DRI |
8
|
|
|
|
|
|
|
## |
9
|
|
|
|
|
|
|
## Net::DRI is free software; you can redistribute it and/or modify |
10
|
|
|
|
|
|
|
## it under the terms of the GNU General Public License as published by |
11
|
|
|
|
|
|
|
## the Free Software Foundation; either version 2 of the License, or |
12
|
|
|
|
|
|
|
## (at your option) any later version. |
13
|
|
|
|
|
|
|
## |
14
|
|
|
|
|
|
|
## See the LICENSE file that comes with this distribution for more details. |
15
|
|
|
|
|
|
|
#################################################################################################### |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
package Net::DRI::Protocol::EPP::Extensions::EURid::Contact; |
18
|
|
|
|
|
|
|
|
19
|
1
|
|
|
1
|
|
934
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
24
|
|
20
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
19
|
|
21
|
|
|
|
|
|
|
|
22
|
1
|
|
|
1
|
|
3
|
use Net::DRI::Util; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
442
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=pod |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 NAME |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
Net::DRI::Protocol::EPP::Extensions::EURid::Contact - EURid EPP Contact extension commands 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
|
|
|
|
|
|
|
Enetdri@dotandco.comE |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
Please also see the SUPPORT file in the distribution. |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 SEE ALSO |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
Ehttp://www.dotandco.com/services/software/Net-DRI/E |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 AUTHOR |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
Patrick Mevzek, Enetdri@dotandco.comE |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 COPYRIGHT |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
Copyright (c) 2005,2008,2012,2013 Patrick Mevzek . |
53
|
|
|
|
|
|
|
2014 Michael Kefeder . |
54
|
|
|
|
|
|
|
All rights reserved. |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify |
57
|
|
|
|
|
|
|
it under the terms of the GNU General Public License as published by |
58
|
|
|
|
|
|
|
the Free Software Foundation; either version 2 of the License, or |
59
|
|
|
|
|
|
|
(at your option) any later version. |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
See the LICENSE file that comes with this distribution for more details. |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=cut |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
#################################################################################################### |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub register_commands |
68
|
|
|
|
|
|
|
{ |
69
|
0
|
|
|
0
|
0
|
|
my ($class,$version)=@_; |
70
|
0
|
|
|
|
|
|
my %tmp=( |
71
|
|
|
|
|
|
|
create => [ \&create, undef ], |
72
|
|
|
|
|
|
|
update => [ \&update, undef ], |
73
|
|
|
|
|
|
|
info => [ undef, \&info_parse ], |
74
|
|
|
|
|
|
|
); |
75
|
|
|
|
|
|
|
|
76
|
0
|
|
|
|
|
|
return { 'contact' => \%tmp }; |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
sub setup |
80
|
|
|
|
|
|
|
{ |
81
|
0
|
|
|
0
|
0
|
|
my ($class,$po,$version)=@_; |
82
|
0
|
|
|
|
|
|
foreach my $ns (qw/contact-ext/) |
83
|
|
|
|
|
|
|
{ |
84
|
0
|
|
|
|
|
|
$po->ns({ $ns => [ 'http://www.eurid.eu/xml/epp/'.$ns.'-1.1',$ns.'-1.1.xsd' ] }); |
85
|
|
|
|
|
|
|
} |
86
|
0
|
|
|
|
|
|
return; |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
#################################################################################################### |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
sub create |
92
|
|
|
|
|
|
|
{ |
93
|
0
|
|
|
0
|
0
|
|
my ($epp,$contact)=@_; |
94
|
0
|
|
|
|
|
|
my $mes=$epp->message(); |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
## validate() has been called, we are sure that type & lang exists |
97
|
0
|
|
|
|
|
|
my @n; |
98
|
0
|
|
|
|
|
|
push @n,['contact-ext:type',$contact->type()]; |
99
|
0
|
0
|
|
|
|
|
push @n,['contact-ext:vat',$contact->vat()] if $contact->vat(); |
100
|
0
|
|
|
|
|
|
push @n,['contact-ext:lang',$contact->lang()]; |
101
|
|
|
|
|
|
|
|
102
|
0
|
|
|
|
|
|
my $eid=$mes->command_extension_register('contact-ext','create'); |
103
|
0
|
|
|
|
|
|
$mes->command_extension($eid,\@n); |
104
|
0
|
|
|
|
|
|
return; |
105
|
|
|
|
|
|
|
} |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
sub update |
108
|
|
|
|
|
|
|
{ |
109
|
0
|
|
|
0
|
0
|
|
my ($epp,$domain,$todo)=@_; |
110
|
0
|
|
|
|
|
|
my $mes=$epp->message(); |
111
|
|
|
|
|
|
|
|
112
|
0
|
|
|
|
|
|
my $newc=$todo->set('info'); |
113
|
0
|
0
|
0
|
|
|
|
return unless ($newc && (defined($newc->vat()) || defined($newc->lang()))); |
|
|
|
0
|
|
|
|
|
114
|
|
|
|
|
|
|
|
115
|
0
|
|
|
|
|
|
my @n; |
116
|
0
|
0
|
|
|
|
|
push @n,['contact-ext:vat',$newc->vat()] if defined($newc->vat()); |
117
|
0
|
0
|
|
|
|
|
push @n,['contact-ext:lang',$newc->lang()] if defined($newc->lang()); |
118
|
|
|
|
|
|
|
|
119
|
0
|
|
|
|
|
|
my $eid=$mes->command_extension_register('contact-ext','update'); |
120
|
0
|
|
|
|
|
|
$mes->command_extension($eid,['contact-ext:chg',@n]); |
121
|
0
|
|
|
|
|
|
return; |
122
|
|
|
|
|
|
|
} |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
sub info_parse |
125
|
|
|
|
|
|
|
{ |
126
|
0
|
|
|
0
|
0
|
|
my ($po,$otype,$oaction,$oname,$rinfo)=@_; |
127
|
0
|
|
|
|
|
|
my $mes=$po->message(); |
128
|
0
|
0
|
|
|
|
|
return unless $mes->is_success(); |
129
|
|
|
|
|
|
|
|
130
|
0
|
|
|
|
|
|
my $infdata=$mes->get_extension('contact-ext','infData'); |
131
|
0
|
0
|
|
|
|
|
return unless $infdata; |
132
|
|
|
|
|
|
|
|
133
|
0
|
|
|
|
|
|
my $s=$rinfo->{contact}->{$oname}->{self}; |
134
|
0
|
|
|
|
|
|
foreach my $el (Net::DRI::Util::xml_list_children($infdata)) |
135
|
|
|
|
|
|
|
{ |
136
|
0
|
|
|
|
|
|
my ($name,$c)=@$el; |
137
|
0
|
0
|
|
|
|
|
if ($name=~m/^(type|vat|lang)$/) |
138
|
|
|
|
|
|
|
{ |
139
|
0
|
|
|
|
|
|
$s->$1($c->textContent()); |
140
|
|
|
|
|
|
|
} |
141
|
|
|
|
|
|
|
} |
142
|
0
|
|
|
|
|
|
return; |
143
|
|
|
|
|
|
|
} |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
#################################################################################################### |
146
|
|
|
|
|
|
|
1; |