Changeset 489


Ignore:
Timestamp:
09/23/10 18:45:58 (14 years ago)
Author:
Kris Deugau
Message:

/branches/htmlform

Remove use of printError() in admin.cgi. See #15, #26

Location:
branches/htmlform
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/htmlform/cgi-bin/admin.cgi

    r488 r489  
    124124
    125125## Non-default actions.
     126
    126127elsif ($webvar{action} eq 'alloc') {
    127   # OK, we know what we're allocating.
    128128
    129129  if ($webvar{cidr} !~ /^\s*(\d{1,3}\.){3}\d{1,3}(\/\d{2})?\s*$/) {
     
    142142      my $status = CustIDCK->custid_exist($webvar{custid});
    143143      if ($CustIDCK::Error) {
    144         printError("Error verifying customer ID: ".$CustIDCK::ErrMsg);
    145         return;
     144        $page->param(errmsg => "Error verifying customer ID: ".$CustIDCK::ErrMsg);
     145        goto ERRJUMP;
    146146      }
    147147      if (!$status) {
    148         printError("Customer ID not valid.  Make sure the Customer ID ".
     148        $page->param(errmsg => "Customer ID not valid.  Make sure the Customer ID ".
    149149          "is correct.<br>\nUse STAFF for staff static IPs, and $IPDB::defcustid for any other ".
    150150          "non-customer assignments.");
    151         return;
     151        goto ERRJUMP;
    152152      }
    153153    }
     
    208208  # Only need to check city here.
    209209  if ($webvar{city} eq '-') {
    210     printError("Invalid customer location!  Go back and select customer's location.");
     210    $page->param(locerr => "Invalid customer location!  Go back and select customer's location.");
     211    goto ERRJUMP;
    211212  } else {
    212213    if ($webvar{alloctype} =~ /^.i$/) {
     
    497498}
    498499
    499 print "Content-type: text/html\n\n".$header->output;
     500ERRJUMP: print "Content-type: text/html\n\n".$header->output;
    500501print $page->output;
    501502
  • branches/htmlform/templates/admin/alloc.tmpl

    r487 r489  
     1<TMPL_IF errmsg>
     2<TMPL_VAR NAME=errmsg>
     3<TMPL_ELSE>
    14<form method="POST" action="admin.cgi">
    25<fieldset><legend></legend>
     
    4548<input type="hidden" name="action" value="confirm">
    4649</fieldset></form>
    47 
     50</TMPL_IF>
  • branches/htmlform/templates/admin/confirm.tmpl

    r487 r489  
     1<TMPL_IF locerr>
     2<TMPL_VAR NAME=locerr>
     3<TMPL_ELSE>
    14Assigning <TMPL_VAR NAME=cidr> to <TMPL_VAR NAME=custid> ("<TMPL_VAR NAME=desc>") as
    25<TMPL_VAR NAME=disptype>...<br>
     
    69Allocation OK!
    710</TMPL_IF>
     11</TMPL_IF>
Note: See TracChangeset for help on using the changeset viewer.