Bug fix for manage.cgi renewal processing

From: Gregory Neil Shapiro (gshapiro+opensrs-dev@gshapiro.net)
Date: Mon Feb 05 2001 - 02:47:17 EST


The bugs:

- The 'Domain Status' table entry would be blank unless the the Auto-Renew
  flag was modified. If the user just renewed the domain, no status would
  be shown.
- If multiple domains were being renewed and one had an error, manage.cgi
  would simply exit so the user would not know which operations succeeded
  and which failed.

The fixes:

- Collect status for changing Auto-Renew and/or Renewing for display in
  expire_domains_result.html.
- If a renewal is unsuccessful don't exit, instead:
- Return results from a renewal attempt to display to the user.

The patch:

Index: 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.5
diff -u -u -r1.5 manage.cgi
--- manage.cgi 2001/02/02 08:19:21 1.5
+++ manage.cgi 2001/02/05 07:43:15
@@ -2248,13 +2248,13 @@
                    # change auto-renew:
                    if (!$auto_renew[$i]) {
                        &change_profile($domains[$i], $encoding_type);
- $status_msg[$i] = renewals_autorenew(1);
+ $status_msg[$i] = "Auto-Renew: " . renewals_autorenew(1);
                        $auto_update_status = 1;
                    }
                } else {
                    if ($auto_renew[$i] ) {
                        &change_profile($domains[$i], $encoding_type);
- $status_msg[$i] = renewals_autorenew(0);
+ $status_msg[$i] = "Auto-Renew: " . renewals_autorenew(0);
                        $auto_update_status = 1;
                    }
                }
@@ -2265,7 +2265,8 @@
                }
                if ( $cb_renew eq "CHECKED") { # renew submitted domains:
                    my ($exp_year) = $expiredate[$i] =~ m/^(\d+)/;
- &renewals_renew($domains[$i], $exp_year, $hterm{$domains[$i]});
+ $status_msg[$i] .= "<BR>" if ($status_msg[$i] ne "");
+ $status_msg[$i] .= "Renew: " . renewals_renew($domains[$i], $exp_year, $hterm{$domains[$i]});
                }
                if (($cb_renew eq "CHECKED") or $auto_update_status){
                    $updated_domain_html .= "<tr><td>$orig_dom_name</td>";
@@ -2672,8 +2673,5 @@
         },
     };
     my $response = $XML_Client->send_cmd( $xcp_request );
- if (not $response->{is_success}) {
- error_out("Failed attempt to renew domain: $response->{response_text}\n");
- exit;
- }
+ return ($response->{response_text});
 }



This archive was generated by hypermail 2.1.3 : Tue Oct 19 2004 - 23:36:15 EDT