Formatting tidy

This commit is contained in:
John Crisp
2020-03-06 12:55:50 +01:00
parent dcc5f75e90
commit b4c1219bd5

View File

@@ -32,25 +32,27 @@ if ( !($show_valid.$show_revoked.$show_expired) ) {
$show_expired = 'E';
}
$qstr_filter = 'search='.htvar($search).'&'.
"show_valid=$show_valid&".
"show_revoked=$show_revoked&".
"show_expired=$show_expired&";
$qstr_filter = 'search='.htvar($search) . '&' . "show_valid=$show_valid&" . "show_revoked=$show_revoked&" . "show_expired=$show_expired&";
$qstr_sort = "sortfield=$sortfield&ascdec=$ascdec";
switch ($stage) {
case 'goaway':
printHeader(false);
?> <p><center><h1><font color=red>YOU ARE A VERY BAD BOY!</font></h2></center> <?php
?>
<p><center><h1><font color="red">YOU ARE A VERY BAD BOY!</font></h2></center>
<?php
break;
case 'display':
printHeader(false);
?>
<center><h2>Certificate Details</h2></center>
<center><font color=#0000AA><h3>(#<?php echo $serial?>)<br><?php echo htvar(CA_cert_cname($serial).' <'.CA_cert_email($serial).'>')?> </h3></font></center>
<center><font color="#0000AA"><h3>(#<?php echo $serial?>)<br><?php echo htvar(CA_cert_cname($serial).' <'.CA_cert_email($serial).'>')?> </h3></font></center>
<?php
if ($revoke_date = CAdb_is_revoked($serial)) {
@@ -67,19 +69,19 @@ case 'dl-confirm':
?>
<h3>You are about to download the <font color=red>PRIVATE</font> certificate key for <?php echo $rec['common_name'].' &lt;'.$rec['email'].'&gt; '?></h3>
<h3><font color=red>DO NOT DISTRIBUTE THIS FILE TO THE PUBLIC!</font></h3>
<form action="<?php echo $PHP_SELF.'?stage=download&serial='.$serial.'&'.$qstr_sort.'&'.$qstr_filter?>" method=post>
<h3><font color="red">DO NOT DISTRIBUTE THIS FILE TO THE PUBLIC!</font></h3>
<form action="<?php echo $PHP_SELF.'?stage=download&serial='.$serial.'&'.$qstr_sort.'&'.$qstr_filter?>" method="post">
<strong>File type: </strong>
<select name=dl_type>
<select name="dl_type">
<option value="PKCS#12">PKCS#12 Bundle</option>
<option value="PEMCERT">PEM Certificate</option>
<option value="PEMKEY">PEM Key</option>
<option value="PEMBUNDLE">PEM Bundle</option>
<option value="PEMCABUNDLE">PEM Bundle w/Root</option>
</select>
<input type=submit name=submit value="Download">
<input type="submit" name="submit" value="Download">
&nbsp; or &nbsp;
<input type=submit name=submit value="Go Back">
<input type="submit" name="submit" value="Go Back">
</form>
<?php
@@ -118,11 +120,12 @@ case 'revoke-form':
printHeader('ca');
?>
<h4>You are about to <font color=red>REVOKE</font> the following certificate:<hr>
<table width=500><tr>
<td width=25% style='white-space: nowrap'>
<p align=right>
Serial Number<br>
<h4>You are about to <font color=red>REVOKE</font> the following certificate:
<hr>
<table width="500px"><tr>
<td width="25%" style="white-space: nowrap">
<p align="right">
Serial Number<br>
User's Name<br>
Email Address<br>
Organization<br>
@@ -130,7 +133,7 @@ case 'revoke-form':
Locality<br>
State/Province<br>
Country<br>
</p>
</p>
</td>
<?php
@@ -145,8 +148,8 @@ case 'revoke-form':
'.htvar($rec[province]).'<br>
'.htvar($rec[country]).'<br>
</td>
</tr></table>
<h4>Are you sure?</h4>
</tr></table>
<h4>Are you sure?</h4>
<form action="'.$PHP_SELF.'?'.$qstr_sort.'&'.$qstr_filter.'" method=post>
<input type=hidden name=stage value=revoke >
<input type=hidden name=serial value='.$serial.' >
@@ -188,9 +191,9 @@ case 'renew-form':
# need the expiry value, but the old cert values will override
# the rest.
#
if (! $submit and file_exists("config/user-${PHPki_user}.php"))
if (! $submit and file_exists("config/user-${PHPki_user}.php")) {
include("config/user-${PHPki_user}.php");
}
#
# Get values from the old certificate.
#
@@ -212,44 +215,44 @@ case 'renew-form':
<th colspan="2"><h3>Certificate Renewal Form</h3></th>
<tr>
<td colspan="2" style="text-align:center"><h4>This will Revoke the old Certificate and Create a new one<br>You can add a password if required</h4></td>
<td colspan="2" style="text-align:center">This will Revoke the old Certificate and Create a new one<br>You can add a password if required</td>
</tr>
<tr>
<td width="25%">Common Name </td>
<td><input type=text name=common_name value="<?php echo htvar($common_name)?>" size=50 maxlength=60 disabled></td>
<td><input type="text"" name="common_name" value="<?php echo htvar($common_name)?>" size="50" maxlength="60" disabled></td>
</tr>
<tr>
<td>E-mail Address </td>
<td><input type=text name=email value="<?php echo htvar($email)?>" size=50 maxlength=60 disabled></td>
<td><input type="text" name="email" value="<?php echo htvar($email)?>" size="50" maxlength="60" disabled></td>
</tr>
<tr>
<td>Organization </td>
<td><input type=text name=organization value="<?php echo htvar($organization)?>" size=60 maxlength=60 disabled></td>
<td><input type="text" name="organization" value="<?php echo htvar($organization)?>" size="60" maxlength="60" disabled></td>
</tr>
<tr>
<td>Department/Unit </td><td><input type=text name=unit value="<?php echo htvar($unit) ?>" size=40 maxlength=60 disabled></td>
<td>Department/Unit </td><td><input type="text" name="unit" value="<?php echo htvar($unit) ?>" size="40" maxlength="60" disabled></td>
</tr>
<tr>
<td>Locality</td><td><input type=text name=locality value="<?php echo htvar($locality) ?>" size=30 maxlength=30 disabled></td>
<td>Locality</td><td><input type="text" name="locality" value="<?php echo htvar($locality) ?>" size="30" maxlength="30" disabled></td>
</tr>
<tr>
<td>State/Province</td><td><input type=text name=province value="<?php echo htvar($province) ?>" size=30 maxlength=30 disabled></td>
<td>State/Province</td><td><input type="text" name="province" value="<?php echo htvar($province) ?>" size="30" maxlength="30" disabled></td>
</tr>
<tr>
<td>Country</td>
<td><input type=text name=country value="<?php echo htvar($country) ?>" size=2 maxlength=2 disabled></td>
<td><input type="text" name="country" value="<?php echo htvar($country) ?>" size="2" maxlength="2" disabled></td>
</tr>
<tr>
<td>Certificate Password </td>
<td><input type=password name=passwd value="<?php echo htvar($passwd) ?>" size=30></td>
<td><input type="password" name="passwd" value="<?php echo htvar($passwd) ?>" size="30"></td>
</tr>
<tr>
@@ -272,14 +275,15 @@ case 'renew-form':
<tr>
<td>&nbsp</td>
<td>
<input type=submit name=submit value="Submit Request">&nbsp
<input type=submit name=submit value="Back">
<input type=hidden name=stage value=renew>
<input type=hidden name=serial value="<?php echo $serial ?>" >
<input type="submit" name="submit" value="Submit Request">&nbsp
<input type="submit" name="submit" value="Back">
<input type="hidden" name="stage" value="renew">
<input type="hidden" name="serial" value="<?php echo $serial ?>" >
</td>
</tr>
</table>
</form>
<?php
printFooter();
@@ -287,9 +291,10 @@ case 'renew-form':
case 'renew':
$ret = true;
if ($submit == "Submit Request")
if ($submit == "Submit Request") {
list($ret, $errtxt) = CA_renew_cert($serial, $expiry, $passwd);
}
if (! $ret) {
printHeader('ca');
@@ -303,7 +308,7 @@ case 'renew':
<pre><?php echo $errtxt?></pre>
</blockquote>
<p>
<input type=submit name=submit value=Back>
<input type="submit" name="submit" value="Back">
<p>
</form>
<?php
@@ -320,15 +325,19 @@ default:
?>
<body onLoad="self.focus();document.filter.search.focus();">
<table>
<table style="margin:0 auto">
<tr><th colspan=9><big>CERTIFICATE MANAGEMENT CONTROL PANEL</big></th></tr>
<tr><td colspan=9><center>
<form action="<?php echo "$PHP_SELF?$qstr_sort"?>" method=get name=filter>
Search: <input type=text name=search value="<?php echo htvar($search)?>" style="font-size: 11px;" maxlength=60 size=30>
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type=checkbox name=show_valid value="V" <?php echo ($show_valid?'checked':'')?>>Valid
&nbsp&nbsp<input type=checkbox name=show_revoked value="R" <?php echo ($show_revoked?'checked':'')?>>Revoked
&nbsp&nbsp<input type=checkbox name=show_expired value="E" <?php echo ($show_expired?'checked':'')?>>Expired
&nbsp&nbsp&nbsp&nbsp&nbsp<input type=submit name=submit value="Apply Filter" style="font-size: 11px;">
<form action="<?php echo "$PHP_SELF?$qstr_sort"?>" method="get" name="filter">
Search: <input type="text" name=search" value="<?php echo htvar($search)?>" style="font-size: 11px;" maxlength="60" size="30">
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
<input type="checkbox" name="show_valid" value="V" <?php echo ($show_valid?'checked':'')?>>Valid
&nbsp&nbsp
<input type="checkbox" name="show_revoked" value="R" <?php echo ($show_revoked?'checked':'')?>>Revoked
&nbsp&nbsp
<input type="checkbox" name="show_expired" value="E" <?php echo ($show_expired?'checked':'')?>>Expired
&nbsp&nbsp&nbsp&nbsp&nbsp
<input type="submit" name="submit" value="Apply Filter" style="font-size: 11px;">
</form>
</center></td>
</tr>
@@ -349,6 +358,7 @@ default:
}
print '<tr>';
$headings = array(
'status'=>"Status", 'issued'=>"Issued", 'expires'=>"Expires",
'common_name'=>"User's Name", 'email'=>"E-mail",
@@ -385,27 +395,27 @@ default:
foreach($db as $rec) {
print '<tr style="font-size: 11px;">
<td><font color='.$stcolor[$rec['status']].'><b>' .$rec[status].'</b></font></td>
<td style="white-space: nowrap">'.$rec[issued].'</td>
<td style="white-space: nowrap">'.$rec[expires].'</td>
<td>'.$rec[common_name].'</td>
<td style="white-space: nowrap">'.$rec['issued'].'</td>
<td style="white-space: nowrap">'.$rec['expires'].'</td>
<td>'.$rec['common_name'].'</td>
<td style="white-space: nowrap"><a href="mailto:' . htvar($rec['common_name']) . ' <' . htvar($rec['email']) . '>" >' . htvar($rec['email']) . '</a></td>
<td>'.htvar($rec[organization]).'</td>
<td>'.htvar($rec[unit]).'</td>
<td>'.htvar($rec[locality]).'</td>
<td><a href="'.$PHP_SELF.'?stage=display&serial='.$rec[serial].'" target=_certdisp>'.
<td>'.htvar($rec['organization']).'</td>
<td>'.htvar($rec['unit']).'</td>
<td>'.htvar($rec['locality']).'</td>
<td><a href="'.$PHP_SELF.'?stage=display&serial='.$rec['serial'].'" target=_certdisp>'.
'<img src=../images/display.png alt="Display" title="Display complete certificate details."></a>';
if ($rec['status'] == 'Valid') {
print '
<a href="'.$PHP_SELF.'?stage=dl-confirm&serial='.$rec[serial].'&'.$qstr_sort.'&'.$qstr_filter.'">'.
<a href="'.$PHP_SELF.'?stage=dl-confirm&serial='.$rec['serial'].'&'.$qstr_sort.'&'.$qstr_filter.'">'.
'<img src=../images/download.png alt="Download" title="Download the PRIVATE certificate. DO NOT DISTRIBUTE THIS TO THE PUBLIC!"></a>
<a href="'.$PHP_SELF.'?stage=revoke-form&serial='.$rec[serial].'&'.$qstr_sort.'&'.$qstr_filter.'">'.
<a href="'.$PHP_SELF.'?stage=revoke-form&serial='.$rec['serial'].'&'.$qstr_sort.'&'.$qstr_filter.'">'.
'<img src=../images/revoke.png alt="Revoke" title="Revoke the certificate when the e-mail address is no longer valid or the certificate password or private key has been compromised."></a>';
}
print '
<a href="'.$PHP_SELF.'?stage=renew-form&serial='.$rec[serial].'&'.$qstr_sort.'&'.$qstr_filter.'">'.
'<img src=../images/renew.png alt="Renew" title="Renew the certificate by revoking it, if necessary, and creating a replacement with a new expiration date."></a></td></tr>';
<a href="'.$PHP_SELF.'?stage=renew-form&serial='.$rec['serial'].'&'.$qstr_sort.'&'.$qstr_filter.'">'.
'<img src=../images/renew.png alt="Renew" title="Renew the certificate by revoking it, if necessary, and creating a replacement with a new expiration date."></a>
</td></tr>';
}
print '</table>';