I am resending this message due to the list failure noted by Charles
Daminato in discuss-list.


I found two more problems with the new renewal code and renewals:

1. If the "auto renewal message" toggle is turned on ($AUTO_RENEWAL_MESSAGE
   in manage.cgi as manage.cgi ships), the banner from base_autoren.html
   stating "Notice: this domain is set to be automatically renewed on
   {{AUTORENDATA}}" even if the domain is *not* set to auto-renew.  The
   patch below fixes this by first checking if the domain is set for
   auto-renewing.  Note, if you are using my early patch from the message
   "2.3: Move options from manage.cgi to OpenSRS.conf", then you'll need to
   change the $AUTO_RENEWAL_MESSAGE in the patch to $auto_renewal_message.

2. The "Warning! Names expiring!" banner in templates/manage/base2.html
   contains an A HREF= link to just the CGI instead of to an action within
   the CGI.  Since this link is already in the "Manage Your Domain", this
   one is superfluous and misleading.  The patch below removes it.

As usual, enjoy!

Index: cgi-bin/secure/manage.cgi
===================================================================
RCS file: 
/usr/local/src/cvsroot/horsey.gshapiro.net/usr/local/www/test.retsiger.com/cgi-bin/secure/manage.cgi,v
retrieving revision 1.7
diff -u -r1.7 manage.cgi
--- cgi-bin/secure/manage.cgi   2001/02/06 02:00:30     1.7
+++ cgi-bin/secure/manage.cgi   2001/02/06 05:08:43
@@ -1626,7 +1626,7 @@
 
     if ($type eq 'framed') {
        $HTML->{AUTORENDATA} = "";
-       if ($AUTO_RENEWAL_MESSAGE){
+       if ($AUTO_RENEWAL_MESSAGE && is_auto_renew_set()){
            my $expiry_epoch = get_expiry_epoch_time($expiredate);
            my $new_epoch = $expiry_epoch - 30 * 86400;
            $HTML->{AUTORENDATA} = get_date_from_epoch($new_epoch, "stripped"); 
@@ -2670,3 +2670,18 @@
     my $response = $XML_Client->send_cmd( $xcp_request );
     return ($response->{response_text});
 } 
+
+sub is_auto_renew_set
+{
+       my $res;
+       my $xcp_req = {
+               action => "get",
+               object => "domain",
+               cookie => $cookie,
+               attributes => { type => "all_info" }
+       };
+
+       $res = $XML_Client->send_cmd( $xcp_req );
+       return undef if (not $res->{is_success});
+       return $res->{attributes}->{auto_renew};
+}
Index: templates/manage/base2.html
===================================================================
RCS file: 
/usr/local/src/cvsroot/horsey.gshapiro.net/usr/local/www/test.retsiger.com/templates/manage/base2.html,v
retrieving revision 1.2
diff -u -r1.2 base2.html
--- templates/manage/base2.html 2001/01/08 06:36:28     1.2
+++ templates/manage/base2.html 2001/02/06 05:08:43
@@ -7,8 +7,7 @@
 
 <center><table BORDER CELLSPACING=0 CELLPADDING=2 WIDTH="550" >
 <tr>
-<td ALIGN=CENTER BGCOLOR="#000080"><b><font face="verdana, arial"><font 
color="#FFFFFF"><font size=-1><a href="{{CGI}}" 
STYLE="color:#FFFFFF;text-decoration:none;">Warning!
-Names expiring!</a></font></font></font></b></td>
+<td ALIGN=CENTER BGCOLOR="#000080"><b><font face="verdana, arial"><font 
+color="#FFFFFF"><font size=-1>Warning! Names expiring!</font></font></font></b></td>
 </tr>
 
 <tr>

Reply via email to