Can revoke/generate server certiticate in admin interface

This commit is contained in:
nemunaire 2014-11-20 18:04:39 +01:00
commit 4d1424b29b
6 changed files with 122 additions and 55 deletions

View file

@ -20,20 +20,26 @@ else
if (is_writable($misc_dir) && !is_dir("$misc_dir/pki/"))
mkdir("$misc_dir/pki/");
$wright = is_writable("$misc_dir/pki/");
$template->assign("cert_writable", $wright);
$template->assign("cert_writable", is_writable("$misc_dir/pki/"));
$ca_file = "$misc_dir/pki/cacert.crt";
if (file_exists($ca_file))
{
if (!is_readable($ca_file))
erreur("Impossible de lire le fichier");
else
{
$data = openssl_x509_parse(file_get_contents(ONYX . '../misc/pki/cacert.crt'));
$template->assign("cert", $data);
}
$template->assign("cert_CA",
openssl_x509_parse(file_get_contents($ca_file)));
}
$srv_file = "$misc_dir/server.crt";
if (file_exists($srv_file))
{
if (!is_readable($srv_file))
erreur("Impossible de lire le fichier");
else
$template->assign("cert_srv",
openssl_x509_parse(file_get_contents($srv_file)));
}
return "admin/home";