| 1 | ## Domain Registry Interface, DNSBE Contact EPP extension commands | ||||||||||||||||||||||||||||||||||||||||||
| 2 | ## (based on Registration_guidelines_v4_7_2-Part_4-epp.pdf) | ||||||||||||||||||||||||||||||||||||||||||
| 3 | ## | ||||||||||||||||||||||||||||||||||||||||||
| 4 | ## Copyright (c) 2006,2008,2013,2016 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::DNSBE::Contact; | ||||||||||||||||||||||||||||||||||||||||||
| 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 | |||||||||||||||||||||||||||||||||||||||||||
| 21 | =pod | ||||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||
| 23 | =head1 NAME | ||||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||
| 25 | Net::DRI::Protocol::EPP::Extensions::DNSBE::Contact - DNSBE EPP Contact extension commands for Net::DRI | ||||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||||
| 27 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||
| 29 | Please see the README file for details. | ||||||||||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||||||||||
| 31 | =head1 SUPPORT | ||||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||||
| 33 | For now, support questions should be sent to: | ||||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||
| 35 | E<lt>netdri@dotandco.comE<gt> | ||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||
| 37 | Please also see the SUPPORT file in the distribution. | ||||||||||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||||||||
| 39 | =head1 SEE ALSO | ||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||
| 41 | E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt> | ||||||||||||||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||||||||||||
| 43 | =head1 AUTHOR | ||||||||||||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||||||||||||
| 45 | Patrick Mevzek, E<lt>netdri@dotandco.comE<gt> | ||||||||||||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||||||||||||
| 47 | =head1 COPYRIGHT | ||||||||||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||||||||||
| 49 | Copyright (c) 2006,2008,2013,2016 Patrick Mevzek <netdri@dotandco.com>. | ||||||||||||||||||||||||||||||||||||||||||
| 50 | All rights reserved. | ||||||||||||||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||||||||||||||
| 52 | This program is free software; you can redistribute it and/or modify | ||||||||||||||||||||||||||||||||||||||||||
| 53 | it under the terms of the GNU General Public License as published by | ||||||||||||||||||||||||||||||||||||||||||
| 54 | the Free Software Foundation; either version 2 of the License, or | ||||||||||||||||||||||||||||||||||||||||||
| 55 | (at your option) any later version. | ||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||
| 57 | See the LICENSE file that comes with this distribution for more details. | ||||||||||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||||||||||
| 59 | =cut | ||||||||||||||||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||||||||||||||
| 61 | #################################################################################################### | ||||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||
| 63 | sub register_commands | ||||||||||||||||||||||||||||||||||||||||||
| 64 | { | ||||||||||||||||||||||||||||||||||||||||||
| 65 | 0 | ▶ | my ($class,$version)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
register_commands: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 66 | 0 | my %tmp=( | |||||||||||||||||||||||||||||||||||||||||
| 67 | create => [ \&create, undef ], | ||||||||||||||||||||||||||||||||||||||||||
| 68 | update => [ \&update, undef ], | ||||||||||||||||||||||||||||||||||||||||||
| 69 | info => [ undef, \&info_parse ], | ||||||||||||||||||||||||||||||||||||||||||
| 70 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||||||||||||||||
| 72 | 0 | return { 'contact' => \%tmp }; | |||||||||||||||||||||||||||||||||||||||||
| 73 | } | ||||||||||||||||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||||||||||||||||
| 75 | #################################################################################################### | ||||||||||||||||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||||||||||||||||
| 77 | sub create | ||||||||||||||||||||||||||||||||||||||||||
| 78 | { | ||||||||||||||||||||||||||||||||||||||||||
| 79 | 0 | ▶ | my ($epp,$contact)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
create: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||||||||||||||||
| 81 | ## validate() has been called, we are sure that type & lang exists | ||||||||||||||||||||||||||||||||||||||||||
| 82 | 0 | my @n; | |||||||||||||||||||||||||||||||||||||||||
| 83 | 0 | ▶ | push @n,['dnsbe:type',($contact->type() eq 'registrant')? 'licensee' : $contact->type()]; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 84 | 0 | ▶ | push @n,['dnsbe:vat',$contact->vat()] if $contact->vat(); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 85 | 0 | push @n,['dnsbe:lang',$contact->lang()]; | |||||||||||||||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||||||||||||||||
| 87 | 0 | my $mes=$epp->message(); | |||||||||||||||||||||||||||||||||||||||||
| 88 | 0 | my $eid=$mes->command_extension_register('dnsbe', 'ext'); | |||||||||||||||||||||||||||||||||||||||||
| 89 | 0 | $mes->command_extension($eid,['dnsbe:create',['dnsbe:contact',@n]]); | |||||||||||||||||||||||||||||||||||||||||
| 90 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 91 | } | ||||||||||||||||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||||||||||||||||
| 93 | sub update | ||||||||||||||||||||||||||||||||||||||||||
| 94 | { | ||||||||||||||||||||||||||||||||||||||||||
| 95 | 0 | ▶ | my ($epp,$domain,$todo)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
update: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 96 | |||||||||||||||||||||||||||||||||||||||||||
| 97 | 0 | my $newc=$todo->set('info'); | |||||||||||||||||||||||||||||||||||||||||
| 98 | 0 | ▶ | return unless ($newc && (defined($newc->vat()) || defined($newc->lang()))); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$newc and defined $newc->vat || defined $newc->lang
defined $newc->vat or defined $newc->lang
MC/DC0%0/3
$newc and defined $newc->vat || defined $newc->lang
$newc
defined $newc->vat
defined $newc->lang
Truth table0%0/4
A and B or C
A= $newcB= defined $newc->vatC= defined $newc->lang
| |||||||||||||||||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||||||||||||||||
| 100 | 0 | my @n; | |||||||||||||||||||||||||||||||||||||||||
| 101 | 0 | ▶ | push @n,['dnsbe:vat',$newc->vat()] if defined($newc->vat()); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 102 | 0 | ▶ | push @n,['dnsbe:lang',$newc->lang()] if defined($newc->lang()); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||||||||||||||||
| 104 | 0 | my $mes=$epp->message(); | |||||||||||||||||||||||||||||||||||||||||
| 105 | 0 | my $eid=$mes->command_extension_register('dnsbe', 'ext'); | |||||||||||||||||||||||||||||||||||||||||
| 106 | 0 | $mes->command_extension($eid,['dnsbe:update',['dnsbe:contact',['dnsbe:chg',@n]]]); | |||||||||||||||||||||||||||||||||||||||||
| 107 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 108 | } | ||||||||||||||||||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||||||||||||||||||
| 110 | sub info_parse | ||||||||||||||||||||||||||||||||||||||||||
| 111 | { | ||||||||||||||||||||||||||||||||||||||||||
| 112 | 0 | ▶ | my ($po,$otype,$oaction,$oname,$rinfo)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
info_parse: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 113 | 0 | my $mes=$po->message(); | |||||||||||||||||||||||||||||||||||||||||
| 114 | 0 | ▶ | return unless $mes->is_success(); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 115 | |||||||||||||||||||||||||||||||||||||||||||
| 116 | 0 | my $infdata=$mes->get_extension('dnsbe','infData'); | |||||||||||||||||||||||||||||||||||||||||
| 117 | 0 | ▶ | return unless $infdata; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||||||||||||||||
| 119 | 0 | my $s=$rinfo->{contact}->{$oname}->{self}; | |||||||||||||||||||||||||||||||||||||||||
| 120 | |||||||||||||||||||||||||||||||||||||||||||
| 121 | 0 | my $el=$infdata->getChildrenByTagNameNS($mes->ns('dnsbe'),'type'); | |||||||||||||||||||||||||||||||||||||||||
| 122 | 0 | $s->type($el->get_node(1)->getFirstChild()->getData()); | |||||||||||||||||||||||||||||||||||||||||
| 123 | 0 | $el=$infdata->getChildrenByTagNameNS($mes->ns('dnsbe'),'vat'); | |||||||||||||||||||||||||||||||||||||||||
| 124 | 0 | ▶ | $s->vat($el->get_node(1)->getFirstChild()->getData()) if defined($el->get_node(1)); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 125 | 0 | $el=$infdata->getChildrenByTagNameNS($mes->ns('dnsbe'),'lang'); | |||||||||||||||||||||||||||||||||||||||||
| 126 | 0 | $s->lang($el->get_node(1)->getFirstChild()->getData()); | |||||||||||||||||||||||||||||||||||||||||
| 127 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 128 | } | ||||||||||||||||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||||||||||||||||
| 130 | #################################################################################################### | ||||||||||||||||||||||||||||||||||||||||||
| 131 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||