line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
## Domain Registry Interface, .CAT Contact EPP extension commands |
2
|
|
|
|
|
|
|
## |
3
|
|
|
|
|
|
|
## Copyright (c) 2006,2008,2013 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::CAT::Contact; |
16
|
|
|
|
|
|
|
|
17
|
1
|
|
|
1
|
|
1417
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
18
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
483
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=pod |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 NAME |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
Net::DRI::Protocol::EPP::Extensions::CAT::Contact - .CAT EPP Contact extension commands for Net::DRI |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 DESCRIPTION |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
Please see the README file for details. |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 SUPPORT |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
For now, support questions should be sent to: |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
Enetdri@dotandco.comE |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
Please also see the SUPPORT file in the distribution. |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 SEE ALSO |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
Ehttp://www.dotandco.com/services/software/Net-DRI/E |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 AUTHOR |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
Patrick Mevzek, Enetdri@dotandco.comE |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 COPYRIGHT |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
Copyright (c) 2006,2008,2013 Patrick Mevzek . |
49
|
|
|
|
|
|
|
All rights reserved. |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify |
52
|
|
|
|
|
|
|
it under the terms of the GNU General Public License as published by |
53
|
|
|
|
|
|
|
the Free Software Foundation; either version 2 of the License, or |
54
|
|
|
|
|
|
|
(at your option) any later version. |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
See the LICENSE file that comes with this distribution for more details. |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=cut |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
#################################################################################################### |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub register_commands |
63
|
|
|
|
|
|
|
{ |
64
|
0
|
|
|
0
|
0
|
|
my ($class,$version)=@_; |
65
|
0
|
|
|
|
|
|
my %tmp=( |
66
|
|
|
|
|
|
|
create => [ \&create, undef ], |
67
|
|
|
|
|
|
|
update => [ \&update, undef ], |
68
|
|
|
|
|
|
|
info => [ undef, \&info_parse ], |
69
|
|
|
|
|
|
|
); |
70
|
|
|
|
|
|
|
|
71
|
0
|
|
|
|
|
|
return { 'contact' => \%tmp }; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
#################################################################################################### |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
sub build_command_extension |
77
|
|
|
|
|
|
|
{ |
78
|
0
|
|
|
0
|
0
|
|
my ($mes,$epp,$tag)=@_; |
79
|
0
|
|
|
|
|
|
return $mes->command_extension_register($tag,sprintf('xmlns:cx="%s" xsi:schemaLocation="%s %s"',$mes->nsattrs('puntcat_contact'))); |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
sub add_puntcat_extension |
83
|
|
|
|
|
|
|
{ |
84
|
0
|
|
|
0
|
0
|
|
my ($contact)=@_; |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
## Everything is optional |
87
|
0
|
|
|
|
|
|
my @n; |
88
|
0
|
0
|
|
|
|
|
push @n,['cx:language',$contact->lang()] if $contact->lang(); |
89
|
0
|
0
|
|
|
|
|
push @n,['cx:maintainer',$contact->maintainer()] if $contact->maintainer(); |
90
|
0
|
0
|
|
|
|
|
push @n,['cx:sponsorEmail',$contact->email_sponsor()] if $contact->email_sponsor(); |
91
|
|
|
|
|
|
|
|
92
|
0
|
|
|
|
|
|
return @n; |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
sub create |
96
|
|
|
|
|
|
|
{ |
97
|
0
|
|
|
0
|
0
|
|
my ($epp,$contact)=@_; |
98
|
0
|
|
|
|
|
|
my $mes=$epp->message(); |
99
|
|
|
|
|
|
|
|
100
|
0
|
|
|
|
|
|
my @n=add_puntcat_extension($contact); |
101
|
0
|
0
|
|
|
|
|
return unless @n; |
102
|
|
|
|
|
|
|
|
103
|
0
|
|
|
|
|
|
my $eid=build_command_extension($mes,$epp,'cx:create'); |
104
|
0
|
|
|
|
|
|
$mes->command_extension($eid,\@n); |
105
|
0
|
|
|
|
|
|
return; |
106
|
|
|
|
|
|
|
} |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
sub update |
109
|
|
|
|
|
|
|
{ |
110
|
0
|
|
|
0
|
0
|
|
my ($epp,$domain,$todo)=@_; |
111
|
0
|
|
|
|
|
|
my $mes=$epp->message(); |
112
|
|
|
|
|
|
|
|
113
|
0
|
|
|
|
|
|
my $newc=$todo->set('info'); |
114
|
0
|
0
|
|
|
|
|
return unless $newc; ## if there already verified in Core |
115
|
|
|
|
|
|
|
|
116
|
0
|
|
|
|
|
|
my @n=add_puntcat_extension($newc); |
117
|
0
|
0
|
|
|
|
|
return unless @n; |
118
|
|
|
|
|
|
|
|
119
|
0
|
|
|
|
|
|
my $eid=build_command_extension($mes,$epp,'cx:update'); |
120
|
0
|
|
|
|
|
|
$mes->command_extension($eid,['cx: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('puntcat_contact','infData'); |
131
|
0
|
0
|
|
|
|
|
return unless $infdata; |
132
|
|
|
|
|
|
|
|
133
|
0
|
|
|
|
|
|
my $s=$rinfo->{contact}->{$oname}->{self}; |
134
|
|
|
|
|
|
|
|
135
|
0
|
|
|
|
|
|
my $el=$infdata->getChildrenByTagNameNS($mes->ns('puntcat_contact'),'language'); |
136
|
0
|
0
|
|
|
|
|
$s->lang($el->get_node(1)->getFirstChild()->getData()) if $el; |
137
|
0
|
|
|
|
|
|
$el=$infdata->getChildrenByTagNameNS($mes->ns('puntcat_contact'),'maintainer'); |
138
|
0
|
0
|
|
|
|
|
$s->maintainer($el->get_node(1)->getFirstChild()->getData()) if $el; |
139
|
0
|
|
|
|
|
|
$el=$infdata->getChildrenByTagNameNS($mes->ns('puntcat_contact'),'sponsorEmail'); |
140
|
0
|
0
|
|
|
|
|
$s->email_sponsor($el->get_node(1)->getFirstChild()->getData()) if $el; |
141
|
0
|
|
|
|
|
|
return; |
142
|
|
|
|
|
|
|
} |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
#################################################################################################### |
145
|
|
|
|
|
|
|
1; |