Generate newca, disable the output
This commit is contained in:
parent
cd6d3f9328
commit
ecd35df7af
2 changed files with 14 additions and 20 deletions
|
|
@ -2,13 +2,21 @@
|
|||
|
||||
if (!defined('ONYX')) exit;
|
||||
|
||||
if (isset($_GET['generate']))
|
||||
if (isset($_GET['newca']))
|
||||
{
|
||||
//TODO handle if already exist
|
||||
putenv("OPENSSL_CONF=".ONYX. '../misc/openssl.cnf');
|
||||
putenv("TOP_DIR=".ONYX. '../misc/fic_pki');
|
||||
$output = shell_exec(ONYX . '../misc/CA.sh -newca 2> toto');
|
||||
$template->assign("output", $output);
|
||||
$output = shell_exec(ONYX . '../misc/CA.sh -newca');
|
||||
|
||||
//TODO handle the path ?
|
||||
$ca_file = ONYX . '../misc/fic_pki/cacert.crt';
|
||||
//TODO check permission ?
|
||||
if (file_exists($ca_file))
|
||||
{
|
||||
$data = openssl_x509_parse(file_get_contents(ONYX . '../misc/fic_pki/cacert.crt'));
|
||||
$template->assign("cert", $data);
|
||||
}
|
||||
}
|
||||
|
||||
function remove_directory($dir)
|
||||
|
|
@ -31,7 +39,7 @@ function remove_directory($dir)
|
|||
}
|
||||
}
|
||||
|
||||
if (isset($_GET['delete']))
|
||||
if (isset($_GET['deleteca']))
|
||||
{
|
||||
//TODO handle var path
|
||||
$dir = ONYX . '../misc/fic_pki';
|
||||
|
|
|
|||
|
|
@ -6,19 +6,6 @@
|
|||
|
||||
{block name=content}
|
||||
|
||||
{if isset($output)}
|
||||
<div class="panel panel-info">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">Output</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<pre>
|
||||
{$output}
|
||||
</pre>
|
||||
<a href="/{$SALT_ADMIN}" class="btn btn-primary">OK</a>
|
||||
</div>
|
||||
</div>
|
||||
{else}
|
||||
<div class="panel panel-info">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">Certificat racine FIC 2014</h3>
|
||||
|
|
@ -33,12 +20,11 @@
|
|||
<li><strong>[CN] :</strong> {$cert['subject']['CN']}</li>
|
||||
<li><strong>[emailAddress] :</strong> {$cert['subject']['emailAddress']}</li>
|
||||
</ul>
|
||||
<a href="/{$SALT_ADMIN}/certificate?delete" class="btn btn-danger">Supprimer</a>
|
||||
<a href="/{$SALT_ADMIN}/certificate?deleteca" class="btn btn-danger">Supprimer</a>
|
||||
{else}
|
||||
<a href="/{$SALT_ADMIN}/certificate?generate" class="btn btn-primary">Nouveau</a>
|
||||
<a href="/{$SALT_ADMIN}/certificate?newca" class="btn btn-primary">Nouveau</a>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{/block}
|
||||
|
|
|
|||
Reference in a new issue