Revision 51583438
Added by Stephen Beaver about 10 years ago
src/usr/local/www/system_camanager.php | ||
---|---|---|
28 | 28 |
POSSIBILITY OF SUCH DAMAGE. |
29 | 29 |
*/ |
30 | 30 |
/* |
31 |
pfSense_MODULE: certificate_manager
|
|
31 |
pfSense_MODULE: certificate_manager
|
|
32 | 32 |
*/ |
33 | 33 |
|
34 | 34 |
##|+PRIV |
... | ... | |
272 | 272 |
$ca['descr'] = $pconfig['descr']; |
273 | 273 |
$ca['refid'] = $pconfig['refid']; |
274 | 274 |
$ca['serial'] = $pconfig['serial']; |
275 |
$ca['crt'] = base64_encode($pconfig['cert']);
|
|
275 |
$ca['crt'] = base64_encode($pconfig['cert']);
|
|
276 | 276 |
if (!empty($pconfig['key'])) { |
277 |
$ca['prv'] = base64_encode($pconfig['key']);
|
|
277 |
$ca['prv'] = base64_encode($pconfig['key']);
|
|
278 | 278 |
} |
279 | 279 |
} else { |
280 | 280 |
$old_err_level = error_reporting(0); /* otherwise openssl_ functions throw warnings directly to a page screwing menu tab */ |
src/usr/local/www/system_certmanager.php | ||
---|---|---|
28 | 28 |
POSSIBILITY OF SUCH DAMAGE. |
29 | 29 |
*/ |
30 | 30 |
/* |
31 |
pfSense_MODULE: certificate_manager
|
|
31 |
pfSense_MODULE: certificate_manager
|
|
32 | 32 |
*/ |
33 | 33 |
|
34 | 34 |
##|+PRIV |
... | ... | |
777 | 777 |
)); |
778 | 778 |
} |
779 | 779 |
|
780 |
print('<br />keylen = ' . $pconfig['keylen'] . '<br />'); |
|
781 |
|
|
782 | 780 |
$section->addInput(new Form_Select( |
783 | 781 |
'keylen', |
784 | 782 |
'Key length', |
... | ... | |
989 | 987 |
$form->add($section); |
990 | 988 |
print $form; |
991 | 989 |
|
990 |
?> |
|
991 |
<script> |
|
992 |
//<![CDATA[ |
|
993 |
events.push(function(){ |
|
994 |
<?php if ($internal_ca_count): ?> |
|
995 |
function internalca_change() { |
|
996 |
|
|
997 |
caref = $('#caref').val(); |
|
998 |
|
|
999 |
switch (caref) { |
|
1000 |
<?php |
|
1001 |
foreach ($a_ca as $ca): |
|
1002 |
if (!$ca['prv']) { |
|
1003 |
continue; |
|
1004 |
} |
|
1005 |
|
|
1006 |
$subject = cert_get_subject_array($ca['crt']); |
|
1007 |
|
|
1008 |
?> |
|
1009 |
case "<?=$ca['refid'];?>": |
|
1010 |
$('#dn_country').val("<?=$subject[0]['v'];?>"); |
|
1011 |
$('#dn_state').val("<?=$subject[1]['v'];?>"); |
|
1012 |
$('#dn_city').val("<?=$subject[2]['v'];?>"); |
|
1013 |
$('#dn_organization').val("<?=$subject[3]['v'];?>"); |
|
1014 |
$('#dn_email').val("<?=$subject[4]['v'];?>"); |
|
1015 |
break; |
|
1016 |
<?php |
|
1017 |
endforeach; |
|
1018 |
?> |
|
1019 |
} |
|
1020 |
} |
|
1021 |
|
|
1022 |
// On click . . |
|
1023 |
$('#caref').on('change', function() { |
|
1024 |
internalca_change(); |
|
1025 |
}); |
|
1026 |
|
|
1027 |
// On page load . . |
|
1028 |
internalca_change(); |
|
1029 |
|
|
1030 |
<?php endif; ?> |
|
1031 |
|
|
1032 |
|
|
1033 |
}); |
|
1034 |
//]]> |
|
1035 |
</script> |
|
1036 |
<?php |
|
992 | 1037 |
include('foot.inc'); |
Also available in: Unified diff
Fixed #5023
Added jQuery to populate the certificate details from the selected CA