Project

General

Profile

« Previous | Next » 

Revision 53f5b15f

Added by Jim Pingle over 9 years ago

Some more adjustments to CSR handling for ticket #5561
  • Change the order of the actions for CSR so edit is first
  • Change the edit icon to a pencil to be more obvious
  • Change the export action for a CSR to export the request data

View differences:

src/usr/local/www/system_certmanager.php
174 174
	exit;
175 175
}
176 176

  
177
if ($act == "req") {
178

  
179
	if (!$a_cert[$id]) {
180
		pfSenseHeader("system_certmanager.php");
181
		exit;
182
	}
183

  
184
	$exp_name = urlencode("{$a_cert[$id]['descr']}.req");
185
	$exp_data = base64_decode($a_cert[$id]['csr']);
186
	$exp_size = strlen($exp_data);
187

  
188
	header("Content-Type: application/octet-stream");
189
	header("Content-Disposition: attachment; filename={$exp_name}");
190
	header("Content-Length: $exp_size");
191
	echo $exp_data;
192
	exit;
193
}
194

  
177 195
if ($act == "key") {
178 196

  
179 197
	if (!$a_cert[$id]) {
......
1057 1075
				<?php endif?>
1058 1076
			</td>
1059 1077
			<td>
1060
				<?php if (! $cert['csr']): ?>
1061
				<a href="system_certmanager.php?act=exp&amp;id=<?=$i?>" class="fa fa-sign-in" title="<?=gettext("Export")?>"></a>
1062
				<a href="system_certmanager.php?act=key&amp;id=<?=$i?>" class="fa fa-key" title="<?=gettext("Export key")?>"></a>
1063
				<a href="system_certmanager.php?act=p12&amp;id=<?=$i?>" class="fa fa-key" title="<?=gettext("Export P12")?>"> P12</a>
1078
				<?php if (!$cert['csr']): ?>
1079
					<a href="system_certmanager.php?act=exp&amp;id=<?=$i?>" class="fa fa-sign-in" title="<?=gettext("Export Certificate")?>"></a>
1080
					<a href="system_certmanager.php?act=key&amp;id=<?=$i?>" class="fa fa-key" title="<?=gettext("Export Key")?>"></a>
1081
					<a href="system_certmanager.php?act=p12&amp;id=<?=$i?>" class="fa fa-key" title="<?=gettext("Export P12")?>"> P12</a>
1082
				<?php else: ?>
1083
					<a href="system_certmanager.php?act=csr&amp;id=<?=$i?>" class="fa fa-pencil" title="<?=gettext("Update CSR")?>"></a>
1084
					<a href="system_certmanager.php?act=req&amp;id=<?=$i?>" class="fa fa-sign-in" title="<?=gettext("Export Request")?>"></a>
1085
					<a href="system_certmanager.php?act=key&amp;id=<?=$i?>" class="fa fa-key" title="<?=gettext("Export Key")?>"></a>
1064 1086
				<?php endif?>
1065 1087
				<?php if (!cert_in_use($cert['refid'])): ?>
1066 1088
					<a href="system_certmanager.php?act=del&amp;id=<?=$i?>" class="fa fa-trash" title="<?=gettext("Delete")?>"></a>
1067 1089
				<?php endif?>
1068
				<?php if ($cert['csr']): ?>
1069
					<a href="system_certmanager.php?act=csr&amp;id=<?=$i?>" class="fa fa-refresh" title="<?=gettext("Update csr")?>"></a>
1070
				<?php endif?>
1071 1090
			</td>
1072 1091
		</tr>
1073 1092
<?php endforeach; ?>

Also available in: Unified diff