Dieter,
Thank you for offering to look at the code, which follows.
I am faily sure that my problem is in the handling of the evaluation logic...I just cannot see the way to handle it, but have tried using what is already there as a template of sorts.
Could it be possible that other sub routines (like Sub: Display an Closed Item) also requires modification because of the additional fields in the Reg Form?
Regards,
mars
Code:#-#############################################
# Sub: Change Registration
# This allows a user to change his reg-data
# Released by: EverySoft (Matt Hahnfeld)
# Modifications by: Dieter Werner
#-#############################################
sub creg {
print <<EO_HTML;
<div align="center">
<form action="$ENV{'SCRIPT_NAME'}" method="POST">
<input type="HIDDEN" name="action" value="proccreg">
<input type="HIDDEN" name="lang" value="$form{'lang'}">
<h4>$txt{'Change Registration Data'}</h4>
<table width="550" border="0" bgcolor="$config{'colortablehead'}" cellpadding="3" cellspacing="1">
<tr bgcolor="$config{'colortablebody'}">
<td valign="top"><b>$txt{'Your Username'}:<br></b>$txt{'Required for verification'}</td>
<td><input name="Username" type="TEXT" size="30" maxlength="30"></td>
</tr>
<tr bgcolor="$config{'colortablebody'}">
<td valign="top"><b>$txt{'Your Current Password'}:<br></b>$txt{'Required for verification'}</td>
<td><input name="OLDPASS" type="PASSWORD" size="30"></td>
</tr>
<tr bgcolor="$config{'colortablebody'}">
<td valign="top"><b>$txt{'Your New Password'}:<br></b>$txt{'Leave blank if unchanged'}</td>
<td><input name="NEWPASS1" type="PASSWORD" size="30"></td>
</tr>
<tr bgcolor="$config{'colortablebody'}">
<td valign="top"><b>$txt{'Your New Password Again'}:<br></b>$txt{'Leave blank if unchanged'}</td>
<td><input name="NEWPASS2" type="PASSWORD" size="30"></td>
</tr>
<tr bgcolor="$config{'colortablebody'}">
<td valign="top"><b>$txt{'Contact Information'}:<br></b>$txt{'Leave blank if unchanged'}</td>
<td><tt>$txt{'Full Name'}:</tt><br>
<input name="ADDRESS1" type="TEXT" size="30" value=""><br>
<tt>$txt{'Street Address'}:</tt><br>
<input name="ADDRESS2" type="TEXT" size="30" value=""><br>
<tt>$txt{'City'}, $txt{'State'}, $txt{'ZIP'}:</tt><br>
<input name="ADDRESS3" type="TEXT" size="30" value=""><br>
<tt>$txt{'Phone'}:</tt><br>
<input name="PHONE" type="TEXT" size="30" value=""><br>
<tt>$txt{'Fax'}:</tt><br>
<input name="FAX" type="TEXT" size="30" value="">
</td>
</tr>
<td valign="top"><b>$txt{'Credit Card Information'}:<br></b>$txt{'-----'}</td>
<td>
<tt>$txt{'Name on the Card'}:</tt><br>
<input name="CCNAME" type="TEXT" size="30"><br>
<tt>$txt{'Credit Card Type'}:</tt><br>
<select name="CCTYPE" size="1">
<option value="">$txt{''}</option>
<option value="MASTERCARD">$txt{'MASTERCARD'}</option>
<option value="VISA">$txt{'VISA'}</option>
</select><BR>
<tt>$txt{'Credit Card Number'}:</tt><br>
<input name="CCINFO" type="TEXT" size="20"><br>
<tt>$txt{'Expiration date-Month'}:</tt><br>
<select name="CCEXPMONTH" size="1">
<option value="">$txt{''}</option>
<option value="01">$txt{'01'}</option>
<option value="02">$txt{'02'}</option>
<option value="03">$txt{'03'}</option>
<option value="04">$txt{'04'}</option>
<option value="05">$txt{'05'}</option>
<option value="06">$txt{'06'}</option>
<option value="07">$txt{'07'}</option>
<option value="08">$txt{'08'}</option>
<option value="09">$txt{'09'}</option>
<option value="10">$txt{'10'}</option>
<option value="11">$txt{'11'}</option>
<option value="12">$txt{'12'}</option>
</select><BR>
<tt>$txt{'Expiration date-Year'}:</tt><br>
<select name="CCEXPYEAR" size="1">
<option value="">$txt{''}</option>
<option value="2005">$txt{'2005'}</option>
<option value="2006">$txt{'2006'}</option>
<option value="2007">$txt{'2007'}</option>
<option value="2008">$txt{'2008'}</option>
<option value="2009">$txt{'2009'}</option>
<option value="2010">$txt{'2010'}</option>
<option value="2011">$txt{'2011'}</option>
<option value="2012">$txt{'2012'}</option>
</select><BR>
</td>
</tr>
</table>
<br>
<center><input type="SUBMIT" value="$txt{'Change Registration'}"></center>
</form>
<br>
@{[disp_banner('tbl')]}
</div>
<br>
EO_HTML
}
#-#############################################
# Sub: Process Changed Registration
# Contributed by: Dieter Werner
#-#############################################
sub proc_creg {
my (
$password, $email, $add1, $add2, $add3,
$phone, $fax, $ccname, $CCTYPE, $CCINFO, $CCEXPMONTH, $CCEXPYEAR, $bid_data,
@past_bids
);
oops($txt{'User Registration is Not Implemented on This Server'})
unless $config{'regdir'};
oops($txt{'You must enter your Username'})
unless $form{'Username'};
oops($txt{'You must enter your old password so we can validate your account'})
unless $form{'OLDPASS'};
oops($txt{'Your new passwords does not match up'})
if $form{'NEWPASS1'} ne $form{'NEWPASS2'};
oops($txt{'Please enter your street address'})
if $form{'ADDRESS1'} and !$form{'ADDRESS2'};
oops($txt{'Please enter your city, state, and zip'})
if $form{'ADDRESS1'} and !$form{'ADDRESS3'};
oops($txt{'Please enter your phone number'})
if $form{'ADDRESS1'} and !$form{'PHONE'};
oops($txt{'You must enter the Name on The Credit Card'})
unless $form{'CCNAME'};
oops($txt{'You must enter your Credit card Type'})
unless $form{'CCTYPE'};
oops($txt{'You must enter the Credit Card Number'})
unless $form{'CCINFO'};
oops($txt{'You must indicate the MONTH the Credit Card Expires'})
unless $form{'CCEXPMONTH'};
oops($txt{'You must indicate the YEAR the Credit Card Expires'})
unless $form{'CCEXPYEAR'};
(
$password,
$email,
$add1,
$add2,
$add3,
$phone,
$fax,
$ccname,
$CCTYPE,
$CCINFO,
$CCEXPMONTH,
$CCEXPYEAR,
@past_bids
) = @{read_reg_file($form{'Username'})};
oops($txt{'Your old password does not match up'})
unless (lc $password) eq (lc $form{'OLDPASS'});
$fax = '--' unless $fax;
$form{'NEWPASS1'} = $password unless $form{'NEWPASS1'};
$form{'ADDRESS1'} = $add1 unless $form{'ADDRESS1'};
$form{'ADDRESS2'} = $add2 unless $form{'ADDRESS2'};
$form{'ADDRESS3'} = $add3 unless $form{'ADDRESS3'};
$form{'PHONE'} = $phone unless $form{'PHONE'};
$form{'FAX'} = $fax unless $form{'FAX'};
$form{'$CCNAME'} = $ccname unless $form{'$CCNAME'};
$form{'$CCTYPE'} = $CCTYPE unless $form{'$CCTYPE'};
$form{'$CCINFO'} = $CCINFO unless $form{'$CCINFO'};
$form{'$CCEXPMONTH'} = $CCEXPMONTH unless $form{'$CCEXPMONTH'};
$form{'$CCEXPYEAR'} = $CCEXPYEAR unless $form{'$CCEXPYEAR'};
$bid_data = join "\n", @past_bids;
refresh_reg_file(
$form{'Username'},
$form{'NEWPASS1'},
$email,
$form{'ADDRESS1'},
$form{'ADDRESS2'},
$form{'ADDRESS3'},
$form{'PHONE'},
$form{'FAX'},
$form{'CCNAME'},
$form{'CCTYPE'},
$form{'CCINFO'},
$form{'CCEXPMONTH'},
$form{'CCEXPYEAR'},
$bid_data
);
print <<EO_HTML;
<div align="center">
<p><b>
$txt{'Hello'} $form{'Username'}<br>
$txt{'your personal data has been successfully changed'}.
</b></p>
<br>
@{[disp_banner('tbl')]}
</div>
<br>
EO_HTML
}
#-#############################################
# Sub: Check User-Data
# Checks for valid user information
# Released by: EverySoft (Matt Hahnfeld)
# Modifications by: Dieter Werner
#-#############################################
sub check_user_data {
oops($txt{'You must enter an Username to track your item'})
unless $form{'Username'};
oops($txt{'You must enter an Username that consists of alphanumeric characters'})
unless $form{'Username'} !~ /\W/;
oops($txt{'You must enter a valid e-mail address'})
unless check_email();
oops($txt{'You must enter your full name'})
unless $form{'ADDRESS1'};
oops($txt{'You must enter your street address'})
unless $form{'ADDRESS2'};
oops($txt{'You must enter your city, state, and zip code'})
unless $form{'ADDRESS3'};
oops($txt{'You must enter your phone number'})
unless $form{'PHONE'};
oops($txt{'You must enter the Name on The Credit Card'})
unless $form{'CCNAME'};
oops($txt{'You must enter your Credit Card Type'})
unless $form{'CCTYPE'};
oops($txt{'You must enter the Credit Card Number'})
unless $form{'CCINFO'};
oops($txt{'You must indicate the MONTH the Credit Card Expires'})
unless $form{'CCEXPMONTH'};
oops($txt{'You must indicate the YEAR the Credit Card Expires'})
unless $form{'CCEXPYEAR'};
}