| 1 | ## Domain Registry Interface, CentralNic Web Forwarding EPP extension | ||||||||||||||||||||||||||||
| 2 | ## (http://labs.centralnic.com/epp/ext/wf.php) | ||||||||||||||||||||||||||||
| 3 | ## | ||||||||||||||||||||||||||||
| 4 | ## Copyright (c) 2007,2008,2013,2016,2019 Patrick Mevzek <netdri@dotandco.com>. 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::CentralNic::WebForwarding; | ||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 19 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 20 | 1 | ▶ | use feature 'state'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | =pod | ||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | =head1 NAME | ||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | Net::DRI::Protocol::EPP::Extensions::CentralNic::WebForwarding - EPP WebForwarding CentralNic extension commands for Net::DRI | ||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | Please see the README file for details. | ||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | =head1 SUPPORT | ||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | For now, support questions should be sent to: | ||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | E<lt>netdri@dotandco.comE<gt> | ||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | Please also see the SUPPORT file in the distribution. | ||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | =head1 SEE ALSO | ||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt> | ||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | =head1 AUTHOR | ||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | Patrick Mevzek, E<lt>netdri@dotandco.comE<gt> | ||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | =head1 COPYRIGHT | ||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | Copyright (c) 2007,2008,2013,2016,2019 Patrick Mevzek <netdri@dotandco.com>. | ||||||||||||||||||||||||||||
| 51 | All rights reserved. | ||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | This program is free software; you can redistribute it and/or modify | ||||||||||||||||||||||||||||
| 54 | it under the terms of the GNU General Public License as published by | ||||||||||||||||||||||||||||
| 55 | the Free Software Foundation; either version 2 of the License, or | ||||||||||||||||||||||||||||
| 56 | (at your option) any later version. | ||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | See the LICENSE file that comes with this distribution for more details. | ||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||
| 60 | =cut | ||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||
| 62 | #################################################################################################### | ||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||
| 64 | sub register_commands | ||||||||||||||||||||||||||||
| 65 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
register_commands: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 66 | 0 | my ($class,$version)=@_; | |||||||||||||||||||||||||||
| 67 | 0 | state $domain = { | |||||||||||||||||||||||||||
| 68 | create => [ \&create ], | ||||||||||||||||||||||||||||
| 69 | update => [ \&update ], | ||||||||||||||||||||||||||||
| 70 | info => [ undef, \&info_parse ], | ||||||||||||||||||||||||||||
| 71 | }; | ||||||||||||||||||||||||||||
| 72 | 0 | state $commands = { 'domain' => $domain }; | |||||||||||||||||||||||||||
| 73 | 0 | return $commands; | |||||||||||||||||||||||||||
| 74 | } | ||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||
| 76 | #################################################################################################### | ||||||||||||||||||||||||||||
| 77 | ########### Query commands | ||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||
| 79 | sub info_parse | ||||||||||||||||||||||||||||
| 80 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
info_parse: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 81 | 0 | my ($po,$otype,$oaction,$oname,$rinfo)=@_; | |||||||||||||||||||||||||||
| 82 | 0 | my $mes=$po->message(); | |||||||||||||||||||||||||||
| 83 | 0 | ▶ | return unless $mes->is_success(); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||
| 85 | 0 | my $infdata=$mes->get_extension('wf','infData'); | |||||||||||||||||||||||||||
| 86 | 0 | ▶ | return unless $infdata; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||
| 88 | 0 | my @c=$infdata->getChildrenByTagNameNS($mes->ns('wf'),'url'); | |||||||||||||||||||||||||||
| 89 | 0 | ▶ | return unless @c; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 90 | |||||||||||||||||||||||||||||
| 91 | 0 | $rinfo->{domain}->{$oname}->{web_forwarding}=$c[0]->getFirstChild()->getData(); | |||||||||||||||||||||||||||
| 92 | 0 | return; | |||||||||||||||||||||||||||
| 93 | } | ||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||
| 95 | ############ Transform commands | ||||||||||||||||||||||||||||
| 96 | |||||||||||||||||||||||||||||
| 97 | sub create | ||||||||||||||||||||||||||||
| 98 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
create: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 99 | 0 | my ($epp,$domain,$rd)=@_; | |||||||||||||||||||||||||||
| 100 | |||||||||||||||||||||||||||||
| 101 | 0 | ▶ | return unless (exists($rd->{web_forwarding}) && defined($rd->{web_forwarding})); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
exists $rd->{"web_forwarding"} and defined $rd->{"web_forwarding"}
MC/DC0%0/2
exists $rd->{"web_forwarding"} and defined $rd->{"web_forwarding"}
exists $rd->{"web_forwarding"}
defined $rd->{"web_forwarding"}
Truth table0%0/3
A and B
A= exists $rd->{"web_forwarding"}B= defined $rd->{"web_forwarding"}
| |||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||
| 103 | 0 | $epp->message()->command_extension('wf', ['create', ['url', $rd->{web_forwarding}]]); | |||||||||||||||||||||||||||
| 104 | 0 | return; | |||||||||||||||||||||||||||
| 105 | } | ||||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||
| 107 | sub update | ||||||||||||||||||||||||||||
| 108 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
update: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 109 | 0 | my ($epp,$domain,$todo)=@_; | |||||||||||||||||||||||||||
| 110 | |||||||||||||||||||||||||||||
| 111 | 0 | my $toset=$todo->set('web_forwarding'); | |||||||||||||||||||||||||||
| 112 | 0 | ▶ | return unless defined($toset); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 113 | |||||||||||||||||||||||||||||
| 114 | 0 | $epp->message()->command_extension('wf', ['update', ['url',$toset]]); | |||||||||||||||||||||||||||
| 115 | 0 | return; | |||||||||||||||||||||||||||
| 116 | } | ||||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||||
| 118 | #################################################################################################### | ||||||||||||||||||||||||||||
| 119 | 1 | 1; | |||||||||||||||||||||||||||