| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# Copyright (c) 2016 CentralNic Ltd. All rights reserved. This program is |
|
2
|
|
|
|
|
|
|
# free software; you can redistribute it and/or modify it under the same |
|
3
|
|
|
|
|
|
|
# terms as Perl itself. |
|
4
|
|
|
|
|
|
|
# |
|
5
|
|
|
|
|
|
|
# $Id: Contact.pm,v 1.3 2011/12/03 11:44:52 gavin Exp $ |
|
6
|
|
|
|
|
|
|
package Net::EPP::Frame::Command::Update::Contact; |
|
7
|
1
|
|
|
1
|
|
4
|
use base qw(Net::EPP::Frame::Command::Update); |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
57
|
|
|
8
|
1
|
|
|
1
|
|
3
|
use Net::EPP::Frame::ObjectSpec; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
12
|
|
|
9
|
1
|
|
|
1
|
|
3
|
use strict; |
|
|
1
|
|
|
|
|
0
|
|
|
|
1
|
|
|
|
|
461
|
|
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=pod |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 NAME |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
Net::EPP::Frame::Command::Update::Contact - an instance of L |
|
16
|
|
|
|
|
|
|
for contact objects. |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
use Net::EPP::Frame::Command::Update::Contact; |
|
21
|
|
|
|
|
|
|
use strict; |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
my $info = Net::EPP::Frame::Command::Update::Contact->new; |
|
24
|
|
|
|
|
|
|
$info->setContact('REG-12345'); |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
print $info->toString(1); |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
This results in an XML document like this: |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|
33
|
|
|
|
|
|
|
xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0 |
|
34
|
|
|
|
|
|
|
epp-1.0.xsd"> |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
REG-12345 |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
xmlns:contact="urn:ietf:params:xml:ns:contact-1.0" |
|
39
|
|
|
|
|
|
|
xsi:schemaLocation="urn:ietf:params:xml:ns:contact-1.0 |
|
40
|
|
|
|
|
|
|
contact-1.0.xsd"> |
|
41
|
|
|
|
|
|
|
example-1.tldE/contact:id> |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
0cf1b8f7e14547d26f03b7641660c641d9e79f45 |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 OBJECT HIERARCHY |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
L |
|
51
|
|
|
|
|
|
|
+----L |
|
52
|
|
|
|
|
|
|
+----L |
|
53
|
|
|
|
|
|
|
+----L |
|
54
|
|
|
|
|
|
|
+----L |
|
55
|
|
|
|
|
|
|
+----L |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=cut |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub new { |
|
60
|
0
|
|
|
0
|
0
|
|
my $package = shift; |
|
61
|
0
|
|
|
|
|
|
my $self = bless($package->SUPER::new('update'), $package); |
|
62
|
|
|
|
|
|
|
|
|
63
|
0
|
|
|
|
|
|
my $contact = $self->addObject(Net::EPP::Frame::ObjectSpec->spec('contact')); |
|
64
|
|
|
|
|
|
|
|
|
65
|
0
|
|
|
|
|
|
foreach my $grp (qw(add rem chg)) { |
|
66
|
0
|
|
|
|
|
|
my $el = $self->createElement(sprintf('contact:%s', $grp)); |
|
67
|
0
|
|
|
|
|
|
$self->getNode('update')->getChildNodes->shift->appendChild($el); |
|
68
|
|
|
|
|
|
|
} |
|
69
|
|
|
|
|
|
|
|
|
70
|
0
|
|
|
|
|
|
return $self; |
|
71
|
|
|
|
|
|
|
} |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=pod |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head1 METHODS |
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
$frame->setContact($id); |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
This specifies the contact object to be updated. |
|
80
|
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=cut |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
sub setContact { |
|
84
|
0
|
|
|
0
|
0
|
|
my ($self, $id) = @_; |
|
85
|
|
|
|
|
|
|
|
|
86
|
0
|
|
|
|
|
|
my $el = $self->createElement('contact:id'); |
|
87
|
0
|
|
|
|
|
|
$el->appendText($id); |
|
88
|
|
|
|
|
|
|
|
|
89
|
0
|
|
|
|
|
|
my $n = $self->getNode('update')->getChildNodes->shift; |
|
90
|
0
|
|
|
|
|
|
$n->insertBefore( $el, $n->firstChild ); |
|
91
|
|
|
|
|
|
|
|
|
92
|
0
|
|
|
|
|
|
return 1; |
|
93
|
|
|
|
|
|
|
} |
|
94
|
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=pod |
|
96
|
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
$frame->addStatus($type, $info); |
|
98
|
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
Add a status of $type with the optional extra $info. |
|
100
|
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=cut |
|
102
|
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
sub addStatus { |
|
104
|
0
|
|
|
0
|
0
|
|
my ($self, $type, $info) = @_; |
|
105
|
0
|
|
|
|
|
|
my $status = $self->createElement('contact:status'); |
|
106
|
0
|
|
|
|
|
|
$status->setAttribute('s', $type); |
|
107
|
0
|
|
|
|
|
|
$status->setAttribute('lang', 'en'); |
|
108
|
0
|
0
|
|
|
|
|
if ($info) { |
|
109
|
0
|
|
|
|
|
|
$status->appendText($info); |
|
110
|
|
|
|
|
|
|
} |
|
111
|
0
|
|
|
|
|
|
$self->getElementsByLocalName('contact:add')->shift->appendChild($status); |
|
112
|
0
|
|
|
|
|
|
return 1; |
|
113
|
|
|
|
|
|
|
} |
|
114
|
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=pod |
|
116
|
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
$frame->remStatus($type); |
|
118
|
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
Remove a status of $type. |
|
120
|
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
=cut |
|
122
|
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
sub remStatus { |
|
124
|
0
|
|
|
0
|
0
|
|
my ($self, $type) = @_; |
|
125
|
0
|
|
|
|
|
|
my $status = $self->createElement('contact:status'); |
|
126
|
0
|
|
|
|
|
|
$status->setAttribute('s', $type); |
|
127
|
0
|
|
|
|
|
|
$self->getElementsByLocalName('contact:rem')->shift->appendChild($status); |
|
128
|
0
|
|
|
|
|
|
return 1; |
|
129
|
|
|
|
|
|
|
} |
|
130
|
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
sub chgPostalInfo { |
|
132
|
0
|
|
|
0
|
0
|
|
my ($self, $type, $name, $org, $addr) = @_; |
|
133
|
|
|
|
|
|
|
|
|
134
|
0
|
|
|
|
|
|
my $el = $self->createElement('contact:postalInfo'); |
|
135
|
0
|
|
|
|
|
|
$el->setAttribute('type', $type); |
|
136
|
|
|
|
|
|
|
|
|
137
|
0
|
|
|
|
|
|
my $nel = $self->createElement('contact:name'); |
|
138
|
0
|
|
|
|
|
|
$nel->appendText($name); |
|
139
|
|
|
|
|
|
|
|
|
140
|
0
|
|
|
|
|
|
my $oel = $self->createElement('contact:org'); |
|
141
|
0
|
|
|
|
|
|
$oel->appendText($org); |
|
142
|
|
|
|
|
|
|
|
|
143
|
0
|
|
|
|
|
|
my $ael = $self->createElement('contact:addr'); |
|
144
|
|
|
|
|
|
|
|
|
145
|
0
|
0
|
|
|
|
|
if (ref($addr->{street}) eq 'ARRAY') { |
|
146
|
0
|
|
|
|
|
|
foreach my $street (@{$addr->{street}}) { |
|
|
0
|
|
|
|
|
|
|
|
147
|
0
|
|
|
|
|
|
my $sel = $self->createElement('contact:street'); |
|
148
|
0
|
|
|
|
|
|
$sel->appendText($street); |
|
149
|
0
|
|
|
|
|
|
$ael->appendChild($sel); |
|
150
|
|
|
|
|
|
|
} |
|
151
|
|
|
|
|
|
|
} |
|
152
|
|
|
|
|
|
|
|
|
153
|
0
|
|
|
|
|
|
foreach my $name (qw(city sp pc cc)) { |
|
154
|
0
|
|
|
|
|
|
my $vel = $self->createElement('contact:'.$name); |
|
155
|
0
|
|
|
|
|
|
$vel->appendText($addr->{$name}); |
|
156
|
0
|
|
|
|
|
|
$ael->appendChild($vel); |
|
157
|
|
|
|
|
|
|
} |
|
158
|
|
|
|
|
|
|
|
|
159
|
0
|
|
|
|
|
|
$el->appendChild($nel); |
|
160
|
0
|
0
|
|
|
|
|
$el->appendChild($oel) if $org; |
|
161
|
0
|
|
|
|
|
|
$el->appendChild($ael); |
|
162
|
|
|
|
|
|
|
|
|
163
|
0
|
|
|
|
|
|
$self->getElementsByLocalName('contact:chg')->shift->appendChild($el); |
|
164
|
|
|
|
|
|
|
|
|
165
|
0
|
|
|
|
|
|
return $el; |
|
166
|
|
|
|
|
|
|
} |
|
167
|
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
=pod |
|
170
|
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
$frame->chgAuthinfo($auth); |
|
172
|
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
Change the authinfo. |
|
174
|
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
=cut |
|
176
|
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
sub chgAuthInfo { |
|
178
|
0
|
|
|
0
|
0
|
|
my ($self,$authInfo) = @_; |
|
179
|
|
|
|
|
|
|
|
|
180
|
0
|
|
|
|
|
|
my $el = $self->createElement('contact:authInfo'); |
|
181
|
0
|
|
|
|
|
|
my $pw = $self->createElement('contact:pw'); |
|
182
|
0
|
|
|
|
|
|
$pw->appendText($authInfo); |
|
183
|
0
|
|
|
|
|
|
$el->appendChild($pw); |
|
184
|
|
|
|
|
|
|
|
|
185
|
0
|
|
|
|
|
|
$self->getElementsByLocalName('contact:chg')->shift->appendChild($el); |
|
186
|
0
|
|
|
|
|
|
return 1; |
|
187
|
|
|
|
|
|
|
} |
|
188
|
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
=pod |
|
191
|
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
=head1 AUTHOR |
|
193
|
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
CentralNic Ltd (http://www.centralnic.com/). |
|
195
|
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
=head1 COPYRIGHT |
|
197
|
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
This module is (c) 2016 CentralNic Ltd. This module is free software; you can |
|
199
|
|
|
|
|
|
|
redistribute it and/or modify it under the same terms as Perl itself. |
|
200
|
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
202
|
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
=over |
|
204
|
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
=item * L |
|
206
|
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
=back |
|
208
|
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
=cut |
|
210
|
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
1; |