r43553 - in /trunk/libwww-cnic-perl: debian/changelog debian/compat debian/control debian/copyright debian/examples debian/rules debian/watch lib/WWW/CNic.pm lib/WWW/CNic/Cookbook.pm lib/WWW/CNic/Response/Search.pm

nhandler-guest at users.alioth.debian.org nhandler-guest at users.alioth.debian.org
Thu Sep 3 04:24:44 UTC 2009


Author: nhandler-guest
Date: Thu Sep  3 04:24:16 2009
New Revision: 43553

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=43553
Log:
TODO: Needs a Test Build
* New upstream release
* debian/control:
  - Added: Vcs-Svn field (source stanza)
  - Added  Vcs-Browser field (source stanza)
  - Added ${misc:Depends} to Depends: field.
  - Set Maintainer to Debian Perl Group <pkg-perl-
  - Add myself to list of Uploaders
  - Bump Standards-Version to 3.8.3
  - Bump debhelper Build-Depends version to >= 7
* debian/compat:
  - Bump to 7
* debian/copyright:
  - Switch to new format
  - Add myself to debian/* copyright
* debian/rules:
  - Switch to shorter format
* debian/examples:
  - Add to install examples/search.cgi
* debian/watch:
  - Bump version to 3

Added:
    trunk/libwww-cnic-perl/debian/examples
Modified:
    trunk/libwww-cnic-perl/debian/changelog
    trunk/libwww-cnic-perl/debian/compat
    trunk/libwww-cnic-perl/debian/control
    trunk/libwww-cnic-perl/debian/copyright
    trunk/libwww-cnic-perl/debian/rules
    trunk/libwww-cnic-perl/debian/watch
    trunk/libwww-cnic-perl/lib/WWW/CNic.pm
    trunk/libwww-cnic-perl/lib/WWW/CNic/Cookbook.pm
    trunk/libwww-cnic-perl/lib/WWW/CNic/Response/Search.pm

Modified: trunk/libwww-cnic-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-cnic-perl/debian/changelog?rev=43553&op=diff
==============================================================================
--- trunk/libwww-cnic-perl/debian/changelog (original)
+++ trunk/libwww-cnic-perl/debian/changelog Thu Sep  3 04:24:16 2009
@@ -1,19 +1,38 @@
-libwww-cnic-perl (0.25-2) UNRELEASED; urgency=low
+libwww-cnic-perl (0.30-1) UNRELEASED; urgency=low
+
+  TODO: Needs a Test Build
 
   [ Salvatore Bonaccorso ]
   * debian/control: Changed: Replace versioned (build-)dependency on
     perl (>= 5.6.0-{12,16}) with an unversioned dependency on perl (as
     permitted by Debian Policy 3.8.3).
 
-  [ Live session user ]
-  * debian/control: Added: Vcs-Svn field (source stanza); Vcs-Browser
-    field (source stanza); ${misc:Depends} to Depends: field. Changed:
-    Maintainer set to Debian Perl Group <pkg-perl-
-    maintainers at lists.alioth.debian.org> (was: Jonathan McDowell
-    <noodles at earth.li>); Jonathan McDowell <noodles at earth.li> moved to
-    Uploaders.
+  [ Nathan Handler ]
+  * New upstream release
+  * debian/control:
+    - Added: Vcs-Svn field (source stanza)
+    - Added  Vcs-Browser field (source stanza)
+    - Added ${misc:Depends} to Depends: field.
+    - Set Maintainer to Debian Perl Group <pkg-perl-
+      maintainers at lists.alioth.debian.org> (was: Jonathan McDowell
+      <noodles at earth.li>); Jonathan McDowell <noodles at earth.li> moved to
+      Uploaders.
+    - Add myself to list of Uploaders
+    - Bump Standards-Version to 3.8.3
+    - Bump debhelper Build-Depends version to >= 7
+  * debian/compat:
+    - Bump to 7
+  * debian/copyright:
+    - Switch to new format
+    - Add myself to debian/* copyright
+  * debian/rules:
+    - Switch to shorter format
+  * debian/examples:
+    - Add to install examples/search.cgi
+  * debian/watch:
+    - Bump version to 3
 
- -- Salvatore Bonaccorso <salvatore.bonaccorso at gmail.com>  Sun, 16 Aug 2009 20:16:24 +0200
+ -- Nathan Handler <nhandler at ubuntu.com>  Thu, 03 Sep 2009 04:02:29 +0000
 
 libwww-cnic-perl (0.25-1) unstable; urgency=low
 

Modified: trunk/libwww-cnic-perl/debian/compat
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-cnic-perl/debian/compat?rev=43553&op=diff
==============================================================================
--- trunk/libwww-cnic-perl/debian/compat (original)
+++ trunk/libwww-cnic-perl/debian/compat Thu Sep  3 04:24:16 2009
@@ -1,1 +1,1 @@
-4
+7

Modified: trunk/libwww-cnic-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-cnic-perl/debian/control?rev=43553&op=diff
==============================================================================
--- trunk/libwww-cnic-perl/debian/control (original)
+++ trunk/libwww-cnic-perl/debian/control Thu Sep  3 04:24:16 2009
@@ -1,13 +1,14 @@
 Source: libwww-cnic-perl
 Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
-Uploaders: Jonathan McDowell <noodles at earth.li>
+Uploaders: Jonathan McDowell <noodles at earth.li>,
+ Nathan Handler <nhandler at ubuntu.com>
 Priority: optional
 Section: perl
-Standards-Version: 3.7.3.0
+Standards-Version: 3.8.3
 Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libwww-cnic-perl/
 Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libwww-cnic-perl/
 Build-Depends-Indep: perl
-Build-Depends: debhelper (>= 4)
+Build-Depends: debhelper (>= 7)
 
 Package: libwww-cnic-perl
 Architecture: all

Modified: trunk/libwww-cnic-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-cnic-perl/debian/copyright?rev=43553&op=diff
==============================================================================
--- trunk/libwww-cnic-perl/debian/copyright (original)
+++ trunk/libwww-cnic-perl/debian/copyright Thu Sep  3 04:24:16 2009
@@ -1,22 +1,31 @@
-This is Debian GNU/Linux's prepackaged version of WWW:CNic (renamed
-to be libwww-cnic-perl).
+Format-Specification:
+    http://wiki.debian.org/Proposals/CopyrightFormat?action=recall&rev=196
+Upstream-Maintainer: CentralNic <toolkit at centralnic.com>
+Upstream-Source: http://search.cpan.org/dist/WWW-CNic/
+Upstream-Name: WWW-CNic
 
-This package was put together by Jonathan McDowell <noodles at earth.li>.
-The library was downloaded from http://toolkit.centralnic.com/downloads
+Files: *
+Copyright: 2007, CentrlNic Ltd.
+License-Alias: Perl
+License: Artistic | GPL-1+
 
-The only change for the Debian package was the addition of the debian/
-files.
+Files: debian/*
+Copyright: 2004-2008, Jonathan McDowell <noodles at earth.li>
+ 2009, Nathan Handler <nhandler at ubuntu.com>
+License: Artistic | GPL-1+
+X-Comment: It is assumed that package maintainers have licensed their work
+ under terms compatible with upstream licensing terms.
 
-Upstream Authors: CentralNic <toolkit at centralnic.com>
+License: Artistic
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the Artistic License, which comes with Perl.
+    On Debian GNU/Linux systems, the complete text of the Artistic License
+    can be found in /usr/share/common-licenses/Artistic
 
-Copyright: 2007 CentralNic Ltd.
-
- Copyright (c) 2007 CentralNic Ltd. All rights reserved. This program is
- free software; you can redistribute it and/or modify it under the same
- terms as Perl itself.
-
-Perl is distributed under your choice of the GNU General Public License
-or the Artistic License. On Debian GNU/Linux systems, the complete text
-of the GNU General Public License can be found in
-`/usr/share/common-licenses/GPL' and the Artistic Licence in
-`/usr/share/common-licenses/Artistic'.
+License: GPL-1+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by 
+    the Free Software Foundation; either version 1, or (at your option)
+    any later version.
+    On Debian GNU/Linux systems, the complete text of the GNU General
+    Public License can be found in `/usr/share/common-licenses/GPL'

Added: trunk/libwww-cnic-perl/debian/examples
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-cnic-perl/debian/examples?rev=43553&op=file
==============================================================================
--- trunk/libwww-cnic-perl/debian/examples (added)
+++ trunk/libwww-cnic-perl/debian/examples Thu Sep  3 04:24:16 2009
@@ -1,0 +1,1 @@
+examples/search.cgi

Modified: trunk/libwww-cnic-perl/debian/rules
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-cnic-perl/debian/rules?rev=43553&op=diff
==============================================================================
--- trunk/libwww-cnic-perl/debian/rules (original)
+++ trunk/libwww-cnic-perl/debian/rules Thu Sep  3 04:24:16 2009
@@ -1,67 +1,4 @@
 #!/usr/bin/make -f
-# -*- Makefile -*-
 
-# Make sure perl is defined (allow overriding from the command line
-PERL ?= /usr/bin/perl
-
-# Set our build directory
-b := $(shell pwd)/debian/libwww-cnic-perl
-
-arrange: arrange-stamp
-arrange-stamp: install
-	dh_testdir
-	touch arrange-stamp
-
-binary: binary-stamp
-binary-stamp: binary-indep binary-arch
-	dh_testdir
-	touch binary-stamp
-
-binary-arch: binary-arch-stamp
-binary-arch-stamp: arrange
-	dh_testdir
-	touch binary-arch-stamp
-
-binary-indep: binary-indep-stamp
-binary-indep-stamp: arrange
-	dh_testdir
-	dh_testroot
-	dh_installdocs
-	dh_installchangelogs
-	dh_installexamples examples/search.cgi
-	dh_fixperms
-	dh_installdeb
-	dh_perl
-	dh_strip
-	dh_shlibdeps
-	dh_link
-	dh_compress
-	dh_gencontrol
-	dh_builddeb
-	touch binary-indep-stamp
-
-build: build-stamp
-build-stamp: config
-	dh_testdir
-	$(MAKE) OPTIMIZE="-O2 -g -Wall"
-	touch build-stamp
-
-clean:
-	dh_testdir
-	dh_testroot
-	if [ -e Makefile ]; then $(MAKE) -i distclean; fi
-	dh_clean arrange-stamp binary-stamp binary-arch-stamp binary-indep-stamp build-stamp config-stamp install-stamp
-
-config: config-stamp
-config-stamp:
-	dh_testdir
-	$(PERL) Makefile.PL INSTALLDIRS=vendor
-	touch config-stamp
-
-install: install-stamp
-install-stamp: build
-	dh_testdir
-	$(MAKE) install PREFIX=$(b)/usr
-	touch install-stamp
-
-.PHONY: binary binary-arch binary-indep clean
+%:
+	dh $@

Modified: trunk/libwww-cnic-perl/debian/watch
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-cnic-perl/debian/watch?rev=43553&op=diff
==============================================================================
--- trunk/libwww-cnic-perl/debian/watch (original)
+++ trunk/libwww-cnic-perl/debian/watch Thu Sep  3 04:24:16 2009
@@ -1,2 +1,2 @@
-version=2
+version=3
 http://toolkit.centralnic.com/dist/WWW-CNic-([\d.]+)\.tar\.gz

Modified: trunk/libwww-cnic-perl/lib/WWW/CNic.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-cnic-perl/lib/WWW/CNic.pm?rev=43553&op=diff
==============================================================================
--- trunk/libwww-cnic-perl/lib/WWW/CNic.pm (original)
+++ trunk/libwww-cnic-perl/lib/WWW/CNic.pm Thu Sep  3 04:24:16 2009
@@ -1,7 +1,7 @@
 # Copyright (c) 2007 CentralNic Ltd. All rights reserved. This program is
 # free software; you can redistribute it and/or modify it under the same
 # terms as Perl itself.
-# $Id: CNic.pm,v 1.49 2008/02/05 11:07:48 gavin Exp $
+# $Id: CNic.pm,v 1.59 2009/08/28 11:59:53 oliver Exp $
 package WWW::CNic;
 use LWP;
 use LWP::ConnCache;
@@ -11,7 +11,7 @@
 use vars qw($VERSION $CONNECTION_CACHE);
 use strict;
 
-our $VERSION = '0.25';
+our $VERSION = '0.30';
 
 =pod
 
@@ -48,7 +48,7 @@
 
 =head1 DESCRIPTION
 
-C<WWW::CNic> provides a powerful object-oriented Perl interface to the CentralNic Toolkit system. This system provides a way for CentralNic resellers to automate all Reseller-Registry communication and provides a far more flexible and efficient solution than the combination of whois + e-mail automaton that most registries operate.
+C<WWW::CNic> provides a powerful object-oriented Perl interface to the CentralNic Toolkit system.
 
 The design of C<WWW::CNic> is inspired greatly by C<LWP>, which is a prerequisite. Essentially, making a transaction requires building a I<request> object, which is then executed and returns a I<response> object. While each transaction type (search, registration, modification...) requires a different set of data to be sent by the client, all the response objects have common properties, inherited from the C<WWW::CNic::Response> base class, with just a few extra methods for accessing specific information.
 
@@ -64,8 +64,7 @@
 	make
 	make install
 
-=head1 PREREQUISITES		$self->{_command} eq 'list_outstanding_domains'	&& return $self->_list_outstanding_domains();
-
+=head1 PREREQUISITES
 
 =over
 
@@ -79,7 +78,7 @@
 
 =item 4
 
-C<Digest::MD5> is needed for encrypting passwords.
+C<Digest::MD5> is needed for hashing passwords.
 
 =back
 
@@ -97,15 +96,11 @@
 
 =item 1
 
-C<username> - only needed for doing domain registrations and modifications. This is the User ID of your Reseller Handle.
+C<username> - only needed for doing domain registrations and modifications. This is the User ID of your Registrar Handle.
 
 =item 1
 
-C<password> - the password for your Reseller Handle.
-
-=item 2
-
-C<use_ssl> - when set to C<1>, causes all transactions to take place over a Secure Sockets Layer (SSL) connection. This is highly recommended for domain registration and modification transactions, although it's probably not needed for the other commands. In order to take advantage of this you need to have either the C<Crypt::SSLeay> or C<IO::Socket::SSL> modules installed. More information is available in the C<lwpcook> manpage.
+C<password> - the password for your Registrar Handle.
 
 =item 3
 
@@ -184,7 +179,7 @@
 	$self->{_agent}->timeout($self->{_timeout} || 10);
 	$self->{_agent}->agent(sprintf('%s/%s (LWP %s, Perl %vd, %s)', $package, $VERSION, $LWP::VERSION, $^V, ucfirst($^O)));
 	$self->{_agent}->conn_cache($CONNECTION_CACHE) unless (!$self->{_keep_alive});
-	$self->{_base} = (defined($self->{_use_ssl}) && $self->{_use_ssl} == 1 ? 'https' : 'http').'://'.(defined($self->{_host}) ? $self->{_host} : 'toolkit.centralnic.com').'/srv';
+	$self->{_base} = 'http://' . (defined($self->{_host}) ? $self->{_host} : 'toolkit.centralnic.com').'/srv';
 	# bless into this package:
 	bless($self, $package);
 	return $self;
@@ -202,9 +197,11 @@
 sub execute {
 	my $self = shift;
 	SWITCH: {
+		# No SSL/authentication required
 		$self->{_command} eq 'whois'			&& return $self->_whois();
 		$self->{_command} eq 'search'			&& return $self->_search();
 		$self->{_command} eq 'suffixes'			&& return $self->_suffixes();
+		# SSL/authentication required
 		$self->{_command} eq 'create_handle'		&& return $self->_create_handle();
 		$self->{_command} eq 'handle_info'		&& return $self->_handle_info();
 		$self->{_command} eq 'register'			&& return $self->_register();
@@ -234,8 +231,13 @@
 	}
 }
 
+#
+# No SSL/authentication required
+#
+
 sub _whois {
 	my $self = shift;
+	$self->{_base} =~ s/^https:/http:/g;	# No SSL required
 	die("Missing domain name") if $self->{_domain} eq '';
 	$self->{_response}->{_raw} = $self->_get(GET("$self->{_base}/wwwhois?domain=$self->{_domain}&test=$self->{_test}"));
 	use WWW::CNic::Response::Whois;
@@ -244,6 +246,7 @@
 
 sub _search {
 	my $self = shift;
+	$self->{_base} =~ s/^https:/http:/g;	# No SSL required
 	die("Missing domain name") if $self->{_domain} eq '';
 	my $url = "$self->{_base}/search?domain=$self->{_domain}";
 	if (defined(@{$self->{_params}->{suffixlist}})) {
@@ -256,13 +259,19 @@
 
 sub _suffixes {
 	my $self = shift;
+	$self->{_base} =~ s/^https:/http:/g;	# No SSL required
 	$self->{_response}->{_raw} = $self->_get(GET("$self->{_base}/suffixes?test=$self->{_test}"));
 	use WWW::CNic::Response::Suffixes;
 	return WWW::CNic::Response::Suffixes->new($self->{_response}->{_raw});
 }
 
+#
+# SSL/authentication required
+#
+
 sub _create_handle {
 	my $self = shift;
+	$self->{_base} =~ s/^http:/https:/g;	# Requires SSL
 	die("Invalid type for handle") unless (ref($self->{_params}->{handle}) eq 'HASH');
 	my %params =  (
 		user		=> $self->{_username},
@@ -309,6 +318,7 @@
 
 sub _handle_info {
 	my $self = shift;
+	$self->{_base} =~ s/^http:/https:/g;	# Requires SSL
 	my %params =  (
 		user		=> $self->{_username},
 		password	=> $self->_crypt_md5($self->{_password}),
@@ -323,6 +333,7 @@
 
 sub _register {
 	my $self = shift;
+	$self->{_base} =~ s/^http:/https:/g;	# Requires SSL
 	my %args = @_;
 	die("Missing domain name") if $self->{_domain} eq '';
 	die("Missing username") if $self->{_username} eq '';
@@ -357,6 +368,9 @@
 		$dns_param	=> $dns,
 	);
 
+	$params{ahandle} = $self->{_params}->{ahandle} if (defined($self->{_params}->{ahandle}));
+	$params{bhandle} = $self->{_params}->{bhandle} if (defined($self->{_params}->{bhandle}));
+
 	$params{url} = $self->{_params}->{url} if ($self->{_params}->{url} ne '');
 
 	my $POST_URL = $self->{_base}.'/'.($args{idn} == 1 ? 'register_idn' : 'register');
@@ -380,6 +394,7 @@
 
 sub _register_atgb {
 	my $self = shift;
+	$self->{_base} =~ s/^http:/https:/g;	# Requires SSL
 	die("Missing domain name") if $self->{_domain} eq '';
 	die("Missing username") if $self->{_username} eq '';
 	die("Missing password") if $self->{_password} eq '';
@@ -411,6 +426,7 @@
 
 sub _modify {
 	my $self = shift;
+	$self->{_base} =~ s/^http:/https:/g;	# Requires SSL
 	die("Missing domain name") if $self->{_domain} eq '';
 	die("Missing username") if $self->{_username} eq '';
 	die("Missing password") if $self->{_password} eq '';
@@ -426,8 +442,14 @@
 	if (defined($self->{_params}->{chandle})) {
 		$params{chandle} = (ref($self->{_params}->{chandle}) eq 'HASH' ? $self->_build_handle_string($self->{_params}->{chandle}) : $self->{_params}->{chandle});
 	}
+	if (defined($self->{_params}->{ahandle})) {
+		$params{ahandle} = $self->{_params}->{ahandle};
+	}
 	if (defined($self->{_params}->{thandle})) {
 		$params{thandle} = (ref($self->{_params}->{thandle}) eq 'HASH' ? $self->_build_handle_string($self->{_params}->{thandle}) : $self->{_params}->{thandle});
+	}
+	if (defined($self->{_params}->{bhandle})) {
+		$params{bhandle} = $self->{_params}->{bhandle};
 	}
 	$params{ttl} = int($self->{_params}->{ttl}) if (defined($self->{_params}->{ttl}));
 
@@ -468,6 +490,7 @@
 
 sub _modify_handle {
 	my $self = shift;
+	$self->{_base} =~ s/^http:/https:/g;	# Requires SSL
 	die("Missing username") if $self->{_username} eq '';
 	die("Missing password") if $self->{_password} eq '';
 	die("Missing handle ID") if ($self->{_params}->{handle} eq '');
@@ -497,10 +520,22 @@
 
 sub _upcoming_renewals {
 	my $self = shift;
-	die("Missing username") if $self->{_username} eq '';
-	die("Missing password") if $self->{_password} eq '';
-	my $url = "$self->{_base}/upcoming_renewals?user=$self->{_username}&months=$self->{_months}&password=".$self->_crypt_md5($self->{_password}).'&test='.$self->{_test};
-	my $req = HTTP::Request->new(GET => $url);
+	$self->{_base} =~ s/^http:/https:/g;	# Requires SSL
+	die("Missing username") if $self->{_username} eq '';
+	die("Missing password") if $self->{_password} eq '';
+
+	my %params = (
+		user		=> $self->{_username},
+		password	=> $self->_crypt_md5($self->{_password}),
+		test		=> $self->{_test},
+		months		=> $self->{_months},
+	);
+
+	foreach my $key (keys(%{$self->{_params}})) {
+		$params{$key} = $self->{_params}->{$key};
+	}
+
+	my $req = POST("$self->{_base}/upcoming_renewals", \%params);
 	$self->{_response}->{_raw} = $self->_get($req);
 	use WWW::CNic::Response::Renewals;
 	return WWW::CNic::Response::Renewals->new($self->{_response}->{_raw});
@@ -508,6 +543,7 @@
 
 sub _list_domains {
 	my $self = shift;
+	$self->{_base} =~ s/^http:/https:/g;	# Requires SSL
 	die("Missing username") if $self->{_username} eq '';
 	die("Missing password") if $self->{_password} eq '';
 	my %params = 	(
@@ -526,6 +562,7 @@
 
 sub _issue_renewals {
 	my $self = shift;
+	$self->{_base} =~ s/^http:/https:/g;	# Requires SSL
 	die("Missing username") if $self->{_username} eq '';
 	die("Missing password") if $self->{_password} eq '';
 	die("Missing domains") if scalar(@{$self->{_params}->{domains}}) < 1;
@@ -549,6 +586,7 @@
 
 sub _get_pricing {
 	my $self = shift;
+	$self->{_base} =~ s/^http:/https:/g;	# Requires SSL
 	die("Missing username") if $self->{_username} eq '';
 	die("Missing password") if $self->{_password} eq '';
 	my %params = (
@@ -566,6 +604,7 @@
 
 sub _delete_domain {
 	my $self = shift;
+	$self->{_base} =~ s/^http:/https:/g;	# Requires SSL
 	die("Missing username") if $self->{_username} eq '';
 	die("Missing password") if $self->{_password} eq '';
 	die("Missing domain")	if $self->{_domain}   eq '';
@@ -575,6 +614,7 @@
 				test		=> $self->{_test},
 				domain		=> $self->{_domain},
 				reason		=> $self->{_reason} || $self->{_params}->{reason},
+				immediate	=> $self->{_immediate},
 	);
 	die("Missing reason") if ($params{reason}  eq '');
 	$params{immediate} = 1 if ($self->{_params}->{immediate});
@@ -587,6 +627,7 @@
 
 sub _decline_domain {
 	my $self = shift;
+	$self->{_base} =~ s/^http:/https:/g;	# Requires SSL
 	die("Missing username") if $self->{_username} eq '';
 	die("Missing password") if $self->{_password} eq '';
 	die("Missing domain")	if $self->{_domain}   eq '';
@@ -605,6 +646,7 @@
 
 sub _undecline_domain {
 	my $self = shift;
+	$self->{_base} =~ s/^http:/https:/g;	# Requires SSL
 	die("Missing username") if $self->{_username} eq '';
 	die("Missing password") if $self->{_password} eq '';
 	die("Missing domain")	if $self->{_domain}   eq '';
@@ -623,6 +665,7 @@
 
 sub _start_transfer {
 	my $self = shift;
+	$self->{_base} =~ s/^http:/https:/g;	# Requires SSL
 	die("Missing username") if $self->{_username} eq '';
 	die("Missing password") if $self->{_password} eq '';
 	die("Missing domains") if scalar(@{$self->{_params}->{domains}}) < 1;
@@ -636,6 +679,11 @@
 		$params{"domains[$i]"} = $domain;
 		$i++;
 	}
+	$i = 0;
+	foreach my $info(@{$self->{_params}->{authinfo}}) {
+		$params{"authinfo[$i]"} = $info;
+		$i++;
+	}
 	my $url = "$self->{_base}/start_transfer";
 	my $req = POST($url, \%params);
 	$self->{_response}->{_raw} = $self->_get($req);
@@ -645,6 +693,7 @@
 
 sub _check_transfer {
 	my $self = shift;
+	$self->{_base} =~ s/^http:/https:/g;	# Requires SSL
 	die("Missing username") if $self->{_username} eq '';
 	die("Missing password") if $self->{_password} eq '';
 	die("Missing domain")	if $self->{_domain}   eq '';
@@ -663,6 +712,7 @@
 
 sub _cancel_transfer {
 	my $self = shift;
+	$self->{_base} =~ s/^http:/https:/g;	# Requires SSL
 	die("Missing username") if $self->{_username} eq '';
 	die("Missing password") if $self->{_password} eq '';
 	die("Missing domain")	if $self->{_domain}   eq '';
@@ -681,6 +731,7 @@
 
 sub _reactivate_domain {
 	my $self = shift;
+	$self->{_base} =~ s/^http:/https:/g;	# Requires SSL
 	die("Missing username") if $self->{_username} eq '';
 	die("Missing password") if $self->{_password} eq '';
 	die("Missing domain")	if $self->{_domain}   eq '';
@@ -690,7 +741,8 @@
 				test		=> $self->{_test},
 				domain		=> $self->{_domain},
 	);
-	$params{email} = $self->{_email} if (defined($self->{email}));
+	$params{email} = $self->{_email} if (defined($self->{_email}));
+	$params{period} = $self->{_period} if (defined($self->{_period}));
 	my $url = "$self->{_base}/reactivation_request";
 	my $req = POST($url, \%params);
 	$self->{_response}->{_raw} = $self->_get($req);
@@ -700,6 +752,7 @@
 
 sub _push_domain {
 	my $self = shift;
+	$self->{_base} =~ s/^http:/https:/g;	# Requires SSL
 	die("Missing username") if $self->{_username} eq '';
 	die("Missing password") if $self->{_password} eq '';
 	die("Missing domain")	if $self->{_domain}   eq '';
@@ -720,6 +773,7 @@
 
 sub _auth_info {
 	my $self = shift;
+	$self->{_base} =~ s/^http:/https:/g;	# Requires SSL
 	die("Missing username") if $self->{_username} eq '';
 	die("Missing password") if $self->{_password} eq '';
 	die("Missing domain")	if $self->{_domain}   eq '';
@@ -738,6 +792,7 @@
 
 sub _poll_transfers {
 	my $self = shift;
+	$self->{_base} =~ s/^http:/https:/g;	# Requires SSL
 	die("Missing username") if $self->{_username} eq '';
 	die("Missing password") if $self->{_password} eq '';
 	my %params = (
@@ -754,6 +809,7 @@
 
 sub _approve_transfer {
 	my $self = shift;
+	$self->{_base} =~ s/^http:/https:/g;	# Requires SSL
 	die("Missing username") if $self->{_username} eq '';
 	die("Missing password") if $self->{_password} eq '';
 	die("Missing domain")	if $self->{_domain}   eq '';
@@ -772,6 +828,7 @@
 
 sub _reject_transfer {
 	my $self = shift;
+	$self->{_base} =~ s/^http:/https:/g;	# Requires SSL
 	die("Missing username") if $self->{_username} eq '';
 	die("Missing password") if $self->{_password} eq '';
 	die("Missing domain")	if $self->{_domain}   eq '';
@@ -790,6 +847,7 @@
 
 sub _list_outstanding_domains {
 	my $self = shift;
+	$self->{_base} =~ s/^http:/https:/g;	# Requires SSL
 	die("Missing username") if $self->{_username} eq '';
 	die("Missing password") if $self->{_password} eq '';
 	my %params = (
@@ -806,6 +864,7 @@
 
 sub _submit_payment_batch {
 	my $self = shift;
+	$self->{_base} =~ s/^http:/https:/g;	# Requires SSL
 	die("Missing username") if $self->{_username} eq '';
 	die("Missing password") if $self->{_password} eq '';
 	die("Missing domains") if scalar(@{$self->{_params}->{domains}}) < 1;

Modified: trunk/libwww-cnic-perl/lib/WWW/CNic/Cookbook.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-cnic-perl/lib/WWW/CNic/Cookbook.pm?rev=43553&op=diff
==============================================================================
--- trunk/libwww-cnic-perl/lib/WWW/CNic/Cookbook.pm (original)
+++ trunk/libwww-cnic-perl/lib/WWW/CNic/Cookbook.pm Thu Sep  3 04:24:16 2009
@@ -1,7 +1,7 @@
 # Copyright (c) 2007 CentralNic Ltd. All rights reserved. This program is
 # free software; you can redistribute it and/or modify it under the same
 # terms as Perl itself.
-# $Id: Cookbook.pm,v 1.42 2008/02/05 11:07:48 gavin Exp $
+# $Id: Cookbook.pm,v 1.46 2009/08/28 11:59:54 oliver Exp $
 
 package WWW::CNic::Cookbook;
 use vars qw($VERSION);
@@ -14,7 +14,7 @@
 
 =head1 Description
 
-This document provides a fairly complete explanation of how to implement basic Reseller-Registry functions with CentralNic using C<WWW::CNic>.
+This document provides a fairly complete explanation of how to implement basic Registrar-Registry functions with CentralNic using C<WWW::CNic>.
 
 This document is a work in progress, if you want to see something in it that isn't, or find an error, please let us know by e-mailing L<toolkit at centralnic.com>.
 
@@ -39,7 +39,6 @@
 	# create a request object:
 	my $query = WWW::CNic->new(
 		command	=> 'suffixes',
-		use_ssl	=> 0,
 	);
 
 	# execute the query to return a response object:
@@ -69,7 +68,6 @@
 
 	my $query = WWW::CNic->new(
 		command	=> 'search',
-		use_ssl	=> 0,
 		domain	=> $domain,
 	);
 
@@ -102,7 +100,6 @@
 	my $query = WWW::CNic->new(
 		command	=> 'whois',
 		domain	=> $domain,
-		use_ssl	=> 0,
 	);
 
 	my $response = $query->execute;
@@ -170,7 +167,6 @@
 	use WWW::CNic;
 
 	my $query = WWW::CNic->new(
-		use_ssl		=> 1,
 		command		=> 'auth_info',
 		domain		=> 'example.uk.com',
 		username	=> $handle,
@@ -187,7 +183,7 @@
 
 	}
 
-This command is used to retrieve the transfer code for a domain name. Those registrars who use our EPP system are required to provide a security code when they initiate a transfer request, which they get from the registrant, who in turn gets it from the losing registrar. Resellers are required to provide this code to registrants upon request.
+This command is used to retrieve the transfer code for a domain name. Those registrars who use our EPP system are required to provide a security code when they initiate a transfer request, which they get from the registrant, who in turn gets it from the losing registrar. Registrars are required to provide this code to registrants upon request.
 
 =head2 Getting Detailed Information About a Handle
 
@@ -197,7 +193,6 @@
 
 	my $query = WWW::CNic->new(
 		command		=> 'handle_info',
-		use_ssl		=> 0,
 		username	=> $handle,
 		password	=> $passwd,
 	);
@@ -231,7 +226,6 @@
 	use WWW::CNic;
 
 	my $query = WWW::CNic->new(
-		use_ssl		=> 1,
 		command		=> 'create_handle',
 		username	=> $handle,
 		password	=> $passwd,
@@ -295,14 +289,11 @@
 
 =head2 Registering a Domain Name
 
-You can register a domain using C<WWW::CNic> in real-time - no waiting for automaton responses to come through!
-
-We recommend that you enable SSL when making registration and modification requests. This is to protect your password when it's sent. WWW::CNic supports SSL communications transparently, since it uses C<LWP> to do all HTTP communication. C<LWP> will handle SSL if the C<Crypt::SSLeay> or C<IO::Socket::SSL> modules have been installed.
+We require that you use SSL when making registration and modification requests. WWW::CNic supports SSL communications transparently, since it uses C<LWP> to do all HTTP communication. C<LWP> will handle SSL if the C<Crypt::SSLeay> or C<IO::Socket::SSL> modules have been installed.
 
 	use WWW::CNic;
 
 	my $query =	WWW::CNic->new(
-		use_ssl		=> 1,
 		command		=> 'register',
 		domain		=> 'example.uk.com',
 		username	=> $handle,
@@ -336,7 +327,7 @@
 
 IMPORTANT NOTE: the details you enter for the Client Handle (C<chandle>) should be the contact details of your customer.
 
-In order to make a registration transaction, you need to supply the C<username> and C<password> parameters - these correspond to your Reseller Handle's ID and password. Your password is C<crypt()>ed before it is sent to provide a minimum of security if you can't use SSL.
+In order to make a registration transaction, you need to supply the C<username> and C<password> parameters - these correspond to your Registrar Handle's ID and password. Your password is C<crypt()>ed before it is sent.
 
 You need to set a range of extra parameters to register a domain. These are explained below.
 
@@ -388,7 +379,6 @@
 	use WWW::CNic;
 
 	my $query =	WWW::CNic->new(
-		use_ssl		=> 1,
 		command		=> 'modify',
 		domain		=> 'example.uk.com',
 		username	=> $handle,
@@ -438,14 +428,13 @@
 
 =head2 Modifying a Handle
 
-When a handle is created by the C<create_handle> or C<register> commands, or via other interfaces such as the Reseller Console, it is associated with your account. This allows you to update the contact details for that handle.
+When a handle is created by the C<create_handle> or C<register> commands, or via other interfaces such as the Registrar Console, it is associated with your account. This allows you to update the contact details for that handle.
 
 B<IMPORTANT>: this command B<must not> be used to completely change the contact details for a handle for a domain name. Instead you should use the C<modify> function to change the ID of the handle on the domain name (see above). This function is only for incremental changes to contact details.
 
 	use WWW::CNic;
 
 	my $query = WWW::CNic->new(
-		use_ssl		=> 1,
 		command		=> 'modify_handle',
 		username	=> $handle,
 		password	=> $passwd,
@@ -501,7 +490,6 @@
 	use strict;
 
 	my $query = WWW::CNic->new(
-		use_ssl		=> 0,
 		command		=> 'issue_renewals',
 		username	=> $handle,
 		password	=> $passwd
@@ -545,7 +533,6 @@
 =head2 Deleting a Domain Name
 
 	my $query = WWW::CNic->new(
-		use_ssl		=> 1,
 		command		=> 'delete',
 		domain		=> $domain,
 		username	=> $handle,
@@ -575,7 +562,6 @@
 =head2 Declining Renewal for a Domain Name
 
 	my $query = WWW::CNic->new(
-		use_ssl		=> 1,
 		command		=> 'decline',
 		domain		=> $domain,
 		username	=> $handle,
@@ -597,7 +583,6 @@
 =head2 Reversing a Declined Renewal
 
 	my $query = WWW::CNic->new(
-		use_ssl		=> 1,
 		command		=> 'undecline',
 		domain		=> $domain,
 		username	=> $handle,
@@ -625,7 +610,6 @@
 status, and a registration or renewal invoice will be re-issed.
 
 	my $query = WWW::CNic->new(
-		use_ssl		=> 1,
 		command		=> 'reactivate',
 		domain		=> $domain,
 		username	=> $handle,
@@ -633,6 +617,7 @@
 	);
 
 	$query->set('email', 'yourname at example.com');
+	$query->set('period', 1); # renewal period in years
 
 	my $response = $query->execute;
 
@@ -645,12 +630,12 @@
 	}
 
 If you specify an C<email> parameter, our administrators will send a notification
-to that address.
-
-=head2 Pushing a Domain Name To Another Reseller
+to that address. C<period> may be any integer between 1 and 10.
+
+=head2 Pushing a Domain Name To Another Registrar
 
 You may request that a domain name on your account be "pushed" to another
-reseller account. A domain name may only be pushed if:
+registrar account. A domain name may only be pushed if:
 
 =over
 
@@ -658,12 +643,11 @@
 
 =item the domain name's status is "Live"
 
-=item the "gaining" reseller has not opted-out of the "push" system
+=item the "gaining" registrar has not opted-out of the "push" system
 
 =back
 
 	my $query = WWW::CNic->new(
-		use_ssl		=> 1,
 		command		=> 'push_domain',
 		username	=> $handle,
 		password	=> $password,
@@ -686,14 +670,14 @@
 re-issued to the gaining account.
 
 If you are also listed as Technical Contact for the domain name, then this
-handle will also be changed to the gaining reseller account.
+handle will also be changed to the gaining registrar account.
 
 This command will also transfer sponsorship of the client and/or technical
 handles for the domain name, but only if these handles are not associated with
 any other domains on your account. Where a handle is associated with domains on
-multiple reseller accounts, the handle becomes "unsponsored".
-
-We will send an e-mail to the gaining reseller notifying them of the domain
+multiple registrar accounts, the handle becomes "unsponsored".
+
+We will send an e-mail to the gaining registrar notifying them of the domain
 transfer.
 
 =head1 Transferring Domain Names
@@ -715,7 +699,6 @@
 6. If the transfer is not explicitly I<approved> or I<rejected> by the B<losing> registrar B<within five calendar days>, then the transfer is automatically marked as C<rejected>. The transfer may still be actioned if the B<gaining> registrar can acquire written authorisation (ideally on company letterhead) from the Registrant.
 
 	my $query = WWW::CNic->new(
-		use_ssl		=> 1,
 		command		=> 'start_transfer',
 		username	=> $handle,
 		password	=> $password,
@@ -793,7 +776,7 @@
 
 	}
 
-If you are the gaining reseller for a domain transfer, you can cancel the request before it is approved or rejected by the losing reseller. If the transfer has already been approved or rejected, then the server will return an error.
+If you are the gaining registrar for a domain transfer, you can cancel the request before it is approved or rejected by the losing registrar. If the transfer has already been approved or rejected, then the server will return an error.
 
 =head2 Checking the Status of a Domain Transfer
 
@@ -959,7 +942,7 @@
 
 	}
 
-This command allows you to retrieve pricing information for your reseller account. You must specify a C<type> parameter, which can be either 'C<registration>' (the default) or 'C<renewal>'.
+This command allows you to retrieve pricing information for your registrar account. You must specify a C<type> parameter, which can be either 'C<registration>' (the default) or 'C<renewal>'.
 
 =head2 Listing Outstanding Domains
 

Modified: trunk/libwww-cnic-perl/lib/WWW/CNic/Response/Search.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-cnic-perl/lib/WWW/CNic/Response/Search.pm?rev=43553&op=diff
==============================================================================
--- trunk/libwww-cnic-perl/lib/WWW/CNic/Response/Search.pm (original)
+++ trunk/libwww-cnic-perl/lib/WWW/CNic/Response/Search.pm Thu Sep  3 04:24:16 2009
@@ -1,7 +1,7 @@
 # Copyright (c) 2007 CentralNic Ltd. All rights reserved. This program is
 # free software; you can redistribute it and/or modify it under the same
 # terms as Perl itself.
-# $Id: Search.pm,v 1.10 2007/01/09 14:23:32 gavin Exp $
+# $Id: Search.pm,v 1.11 2008/03/10 14:07:41 gavin Exp $
 
 package WWW::CNic::Response::Search;
 use vars qw($VERSION);
@@ -68,7 +68,8 @@
 sub is_registered {
 	my ($self, $suffix) = @_;
 	my $domain = (grep { /$suffix$/i } keys %{$self->{_response}})[0];
-	return undef unless (@{$self->response($domain)}[0] == 1);
+	my $r = $self->response($domain);
+	return ($r == 0 ? undef : (@{$r}[0] == 1));	
 }
 
 sub registrant {
@@ -84,4 +85,4 @@
 	return @{$self->response($domain)}[2];
 }
 
-1;
+1;




More information about the Pkg-perl-cvs-commits mailing list