Jeremy,

I don't think 10 year renewals will ever work, except possibly if you are
renewing a domain on the day of its expiry or after. The maximum reg. period
is 10 years, so if you are renewing a domain before its expiry you will
probably get this error.

It is probably better to set a renewal term max as 9 years. Of course, this
will still return an error if the domain name expires next year, for
example, and the user tries to renew for the 9 year term.

It's a better idea to pull the current expiration year from the domain
record, and derive the possible renewal terms programmatically. In Perl, you
might do something like this (ugly - but works):

my %termlist;
my %hterm;
my $exp_raw = $domain_info->{attributes}->{expiredate};
my ($exp_date,$exp_time) = split(/ /,$exp_raw);
my ($exp_year,$exp_month,$exp_day) = split(/-/,$exp_date);
my $maxYears = $exp_year - ((localtime)[5] + 1900);
$maxYears = 9 - $maxYears;

Now you have a safe value for the maximum number of years this domain can be
renewed. (I used 9 as the maximum renewal period just to be doubly safe.)
Now use this number to create a select menu:

for my $termYear (1..$maxYears)
{
    if ($termYear > 1)
        {
            $termlist {$termYear} = "$termYear years";
        }
    else
        {
            $termlist {$termYear} = "$termYear year";
        }
}

my $option_data = "";
$option_data = get_select_content($hterm{$reg_domain}, \%termlist);
$HTML{option_data} = $option_data;


Now put this into your renewal menu:

<select name="renewal_period">
{{option_data}}
</select>

instead of a hard-wired list of renewal periods, and you should always be
safe in terms of renewal periods.

Hope this is of use to someone out there. And if anyone wants to help by
streamlining my bad Perl, I will always listen to advice...

-- 
John Keegan
[EMAIL PROTECTED]
http://RackShare.com


> From: Jeremy Kinsey <[EMAIL PROTECTED]>
> Date: Tue, 15 Oct 2002 11:11:02 -0500
> To: [EMAIL PROTECTED]
> Subject: 10 Year Renewal - will it ever work?
> 
>> 
> 
> Ok, every time I have a customer that decides they want to renew for 10
> years, I try it and I get the following:
> 
> Renewal domain command status: Maximum registration period exceeded
> 
> The domain in question expires on the 28th of this month.. I simply
> went into my resellers interface and manually selected from the pop up
> to renew for 10 years..  This NEVER works..
> 
> Any ideas why?  I have 5 domains that need to be renewed for 10 years
> today.. Anyone?

Reply via email to