2013-11-08 18:15:17 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
if(!defined('ONYX')) exit;
|
|
|
|
|
2013-11-25 14:38:06 +00:00
|
|
|
if (is_writable(ONYX."../misc/") && !is_dir(ONYX."../misc/pki/"))
|
|
|
|
mkdir(ONYX."../misc/pki/");
|
|
|
|
|
|
|
|
$wright = is_writable(ONYX."../misc/pki/");
|
|
|
|
$template->assign("cert_writable", $wright);
|
|
|
|
|
2013-11-12 19:24:34 +00:00
|
|
|
//TODO handle the path ?
|
2013-11-25 14:38:06 +00:00
|
|
|
$ca_file = ONYX . '../misc/pki/cacert.crt';
|
2013-11-12 19:24:34 +00:00
|
|
|
|
|
|
|
//TODO check permission ?
|
2013-11-12 20:21:06 +00:00
|
|
|
if (file_exists($ca_file))
|
2013-11-12 19:24:34 +00:00
|
|
|
{
|
2013-11-25 14:38:06 +00:00
|
|
|
$data = openssl_x509_parse(file_get_contents(ONYX . '../misc/pki/cacert.crt'));
|
2013-11-12 19:24:34 +00:00
|
|
|
$template->assign("cert", $data);
|
|
|
|
}
|
|
|
|
|
|
|
|
return "admin/home";
|