| 1 | ## Domain Registry Interface, EURid Contact EPP extension commands | ||||||||||||||||||||||||||||||||||||||||||
| 2 | ## (based on EURid registration_guidelines_v1_0E-epp.pdf) | ||||||||||||||||||||||||||||||||||||||||||
| 3 | ## | ||||||||||||||||||||||||||||||||||||||||||
| 4 | ## Copyright (c) 2005,2008,2012,2013,2018-2019 Patrick Mevzek <netdri@dotandco.com>. All rights reserved. | ||||||||||||||||||||||||||||||||||||||||||
| 5 | ## 2014 Michael Kefeder <michael.kefeder@world4you.com>. All rights reserved. | ||||||||||||||||||||||||||||||||||||||||||
| 6 | ## | ||||||||||||||||||||||||||||||||||||||||||
| 7 | ## This file is part of Net::DRI | ||||||||||||||||||||||||||||||||||||||||||
| 8 | ## | ||||||||||||||||||||||||||||||||||||||||||
| 9 | ## Net::DRI is free software; you can redistribute it and/or modify | ||||||||||||||||||||||||||||||||||||||||||
| 10 | ## it under the terms of the GNU General Public License as published by | ||||||||||||||||||||||||||||||||||||||||||
| 11 | ## the Free Software Foundation; either version 2 of the License, or | ||||||||||||||||||||||||||||||||||||||||||
| 12 | ## (at your option) any later version. | ||||||||||||||||||||||||||||||||||||||||||
| 13 | ## | ||||||||||||||||||||||||||||||||||||||||||
| 14 | ## See the LICENSE file that comes with this distribution for more details. | ||||||||||||||||||||||||||||||||||||||||||
| 15 | #################################################################################################### | ||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||
| 17 | package Net::DRI::Protocol::EPP::Extensions::EURid::Contact; | ||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||
| 19 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 20 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||||||
| 22 | 1 | ▶ | use Net::DRI::Util; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||||||||||
| 24 | =pod | ||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||
| 26 | =head1 NAME | ||||||||||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||||||||||
| 28 | Net::DRI::Protocol::EPP::Extensions::EURid::Contact - EURid EPP Contact extension commands for Net::DRI | ||||||||||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||||||||||
| 30 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||
| 32 | Please see the README file for details. | ||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||
| 34 | =head1 SUPPORT | ||||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||
| 36 | For now, support questions should be sent to: | ||||||||||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||||||||||
| 38 | E<lt>netdri@dotandco.comE<gt> | ||||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||
| 40 | Please also see the SUPPORT file in the distribution. | ||||||||||||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||||||||||||
| 42 | =head1 SEE ALSO | ||||||||||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||||||||||
| 44 | E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt> | ||||||||||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||||||||||
| 46 | =head1 AUTHOR | ||||||||||||||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||||||||||||
| 48 | Patrick Mevzek, E<lt>netdri@dotandco.comE<gt> | ||||||||||||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||||||||||||
| 50 | =head1 COPYRIGHT | ||||||||||||||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||||||||||||||
| 52 | Copyright (c) 2005,2008,2012,2013,2018-2019 Patrick Mevzek <netdri@dotandco.com>. | ||||||||||||||||||||||||||||||||||||||||||
| 53 | 2014 Michael Kefeder <michael.kefeder@world4you.com>. | ||||||||||||||||||||||||||||||||||||||||||
| 54 | All rights reserved. | ||||||||||||||||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||||||||||||||||
| 56 | This program is free software; you can redistribute it and/or modify | ||||||||||||||||||||||||||||||||||||||||||
| 57 | it under the terms of the GNU General Public License as published by | ||||||||||||||||||||||||||||||||||||||||||
| 58 | the Free Software Foundation; either version 2 of the License, or | ||||||||||||||||||||||||||||||||||||||||||
| 59 | (at your option) any later version. | ||||||||||||||||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||||||||||||||
| 61 | See the LICENSE file that comes with this distribution for more details. | ||||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||
| 63 | =cut | ||||||||||||||||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||||||||||||||||
| 65 | #################################################################################################### | ||||||||||||||||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||||||||||||||||
| 67 | sub register_commands | ||||||||||||||||||||||||||||||||||||||||||
| 68 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
register_commands: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 69 | 0 | my ($class,$version)=@_; | |||||||||||||||||||||||||||||||||||||||||
| 70 | 0 | my %tmp=( | |||||||||||||||||||||||||||||||||||||||||
| 71 | create => [ \&create, undef ], | ||||||||||||||||||||||||||||||||||||||||||
| 72 | update => [ \&update, undef ], | ||||||||||||||||||||||||||||||||||||||||||
| 73 | info => [ undef, \&info_parse ], | ||||||||||||||||||||||||||||||||||||||||||
| 74 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||||||||||||||||
| 76 | 0 | return { 'contact' => \%tmp }; | |||||||||||||||||||||||||||||||||||||||||
| 77 | } | ||||||||||||||||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||||||||||||||||
| 79 | sub setup | ||||||||||||||||||||||||||||||||||||||||||
| 80 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
setup: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 81 | 0 | my ($class,$po,$version)=@_; | |||||||||||||||||||||||||||||||||||||||||
| 82 | 0 | foreach my $ns (qw/contact-ext/) | |||||||||||||||||||||||||||||||||||||||||
| 83 | { | ||||||||||||||||||||||||||||||||||||||||||
| 84 | 0 | $po->ns({ $ns => 'http://www.eurid.eu/xml/epp/'.$ns.'-1.1' }); | |||||||||||||||||||||||||||||||||||||||||
| 85 | } | ||||||||||||||||||||||||||||||||||||||||||
| 86 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 87 | } | ||||||||||||||||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||||||||||||||||
| 89 | #################################################################################################### | ||||||||||||||||||||||||||||||||||||||||||
| 90 | |||||||||||||||||||||||||||||||||||||||||||
| 91 | sub create | ||||||||||||||||||||||||||||||||||||||||||
| 92 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
create: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 93 | 0 | my ($epp,$contact)=@_; | |||||||||||||||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||||||||||||||||
| 95 | ## validate() has been called, we are sure that type & lang exists | ||||||||||||||||||||||||||||||||||||||||||
| 96 | 0 | my @n; | |||||||||||||||||||||||||||||||||||||||||
| 97 | 0 | push @n,['contact-ext:type',$contact->type()]; | |||||||||||||||||||||||||||||||||||||||||
| 98 | 0 | ▶ | push @n,['contact-ext:vat',$contact->vat()] if $contact->vat(); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 99 | 0 | push @n,['contact-ext:lang',$contact->lang()]; | |||||||||||||||||||||||||||||||||||||||||
| 100 | |||||||||||||||||||||||||||||||||||||||||||
| 101 | 0 | $epp->message()->command_extension('contact-ext', ['create', @n]); | |||||||||||||||||||||||||||||||||||||||||
| 102 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 103 | } | ||||||||||||||||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||||||||||||||||
| 105 | sub update | ||||||||||||||||||||||||||||||||||||||||||
| 106 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
update: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 107 | 0 | my ($epp,$domain,$todo)=@_; | |||||||||||||||||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||||||||||||||||||
| 109 | 0 | my $newc=$todo->set('info'); | |||||||||||||||||||||||||||||||||||||||||
| 110 | 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
| |||||||||||||||||||||||||||||||||||||||||||
| 111 | |||||||||||||||||||||||||||||||||||||||||||
| 112 | 0 | my @n; | |||||||||||||||||||||||||||||||||||||||||
| 113 | 0 | ▶ | push @n,['contact-ext:vat',$newc->vat()] if defined($newc->vat()); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 114 | 0 | ▶ | push @n,['contact-ext:lang',$newc->lang()] if defined($newc->lang()); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 115 | |||||||||||||||||||||||||||||||||||||||||||
| 116 | 0 | $epp->message()->command_extension('contact-ext', ['update', ['chg', @n]]); | |||||||||||||||||||||||||||||||||||||||||
| 117 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 118 | } | ||||||||||||||||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||||||||||||||||
| 120 | sub info_parse | ||||||||||||||||||||||||||||||||||||||||||
| 121 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
info_parse: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 122 | 0 | my ($po,$otype,$oaction,$oname,$rinfo)=@_; | |||||||||||||||||||||||||||||||||||||||||
| 123 | 0 | my $mes=$po->message(); | |||||||||||||||||||||||||||||||||||||||||
| 124 | 0 | ▶ | return unless $mes->is_success(); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||||||||||||||||
| 126 | 0 | my $infdata=$mes->get_extension('contact-ext','infData'); | |||||||||||||||||||||||||||||||||||||||||
| 127 | 0 | ▶ | return unless $infdata; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 128 | |||||||||||||||||||||||||||||||||||||||||||
| 129 | 0 | my $s=$rinfo->{contact}->{$oname}->{self}; | |||||||||||||||||||||||||||||||||||||||||
| 130 | 0 | foreach my $el (Net::DRI::Util::xml_list_children($infdata)) | |||||||||||||||||||||||||||||||||||||||||
| 131 | { | ||||||||||||||||||||||||||||||||||||||||||
| 132 | 0 | my ($name,$c)=@$el; | |||||||||||||||||||||||||||||||||||||||||
| 133 | 0 | ▶ | if ($name=~m/^(type|vat|lang)$/) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 134 | { | ||||||||||||||||||||||||||||||||||||||||||
| 135 | 0 | $s->$1($c->textContent()); | |||||||||||||||||||||||||||||||||||||||||
| 136 | } | ||||||||||||||||||||||||||||||||||||||||||
| 137 | } | ||||||||||||||||||||||||||||||||||||||||||
| 138 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 139 | } | ||||||||||||||||||||||||||||||||||||||||||
| 140 | |||||||||||||||||||||||||||||||||||||||||||
| 141 | #################################################################################################### | ||||||||||||||||||||||||||||||||||||||||||
| 142 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||