line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package SRS::EPP::Command::Delete::Domain; |
3
|
|
|
|
|
|
|
{ |
4
|
|
|
|
|
|
|
$SRS::EPP::Command::Delete::Domain::VERSION = '0.22'; |
5
|
|
|
|
|
|
|
} |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
3358
|
use Moose; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
9
|
|
8
|
|
|
|
|
|
|
extends 'SRS::EPP::Command::Delete'; |
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
7065
|
use MooseX::Params::Validate; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
9
|
|
11
|
1
|
|
|
1
|
|
496
|
use SRS::EPP::Session; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
use XML::EPP::Domain; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# for plugin system to connect |
15
|
|
|
|
|
|
|
sub xmlns { |
16
|
|
|
|
|
|
|
XML::EPP::Domain::Node::xmlns(); |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub process { |
20
|
|
|
|
|
|
|
my $self = shift; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
my ( $session ) = pos_validated_list( |
23
|
|
|
|
|
|
|
\@_, |
24
|
|
|
|
|
|
|
{ isa => 'SRS::EPP::Session' }, |
25
|
|
|
|
|
|
|
); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
$self->session($session); |
28
|
|
|
|
|
|
|
my $epp = $self->message; |
29
|
|
|
|
|
|
|
my $message = $epp->message; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
my $payload = $message->argument->payload; |
32
|
|
|
|
|
|
|
my $action_id = $self->client_id || $self->server_id; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
return XML::SRS::Domain::Update->new( |
35
|
|
|
|
|
|
|
filter => [$payload->name], |
36
|
|
|
|
|
|
|
action_id => $action_id, |
37
|
|
|
|
|
|
|
cancel => 1, |
38
|
|
|
|
|
|
|
full_result => 0, |
39
|
|
|
|
|
|
|
); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub notify { |
43
|
|
|
|
|
|
|
my $self = shift; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
my ( $rs ) = pos_validated_list( |
46
|
|
|
|
|
|
|
\@_, |
47
|
|
|
|
|
|
|
{ isa => 'ArrayRef[SRS::EPP::SRSResponse]' }, |
48
|
|
|
|
|
|
|
); |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
my $message = $rs->[0]->message; |
51
|
|
|
|
|
|
|
my $response = $message->response; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
if ( !$response ) { |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
# Lets just assume the domain doesn't exist |
56
|
|
|
|
|
|
|
return $self->make_response(code => 2303); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
if ( $response->can("status") ) { |
59
|
|
|
|
|
|
|
if ( $response->status eq "Available" || $response->status eq 'PendingRelease' ) { |
60
|
|
|
|
|
|
|
return $self->make_response(code => 1000); |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
return $self->make_response(code => 2400); |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub make_error_response { |
67
|
|
|
|
|
|
|
my $self = shift; |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
my ( $srs_errors ) = pos_validated_list( |
70
|
|
|
|
|
|
|
\@_, |
71
|
|
|
|
|
|
|
{ isa => 'ArrayRef[XML::SRS::Error]' }, |
72
|
|
|
|
|
|
|
); |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
# If we get an error about a missing UDAI, then this must be a |
76
|
|
|
|
|
|
|
# domain the registrar doesn't own. Return an appropriate |
77
|
|
|
|
|
|
|
# epp error |
78
|
|
|
|
|
|
|
foreach my $srs_error (@$srs_errors) { |
79
|
|
|
|
|
|
|
if ($srs_error->error_id eq 'MISSING_MANDATORY_FIELD') { |
80
|
|
|
|
|
|
|
if ($srs_error->details && $srs_error->details->[0] eq 'UDAI') { |
81
|
|
|
|
|
|
|
return $self->make_error( |
82
|
|
|
|
|
|
|
code => 2201, |
83
|
|
|
|
|
|
|
message => 'Authorization Error', |
84
|
|
|
|
|
|
|
); |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
return $self->SUPER::make_error_response($srs_errors); |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
1; |