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';
|
||||
|
|
Reference in a new issue