server/onyx/include/admin/home.php

41 lines
1.0 KiB
PHP
Raw Normal View History

2013-11-08 18:15:17 +00:00
<?php
if(!defined('ONYX')) exit;
if (empty($VAR['misc_dir']))
{
erreur("Please add <var>misc_dir</var> variable into <code>root.xml</code> configuration.");
return "admin/home";
}
$misc_dir = $VAR['misc_dir'];
if (!is_dir("$misc_dir/shared") || !is_writable("$misc_dir/shared"))
2013-11-25 17:24:46 +00:00
{
erreur("<code>$misc_dir/shared/</code> directory not writable.");
return "admin/home";
2013-11-25 17:24:46 +00:00
}
$template->assign("cert_writable", is_writable("$misc_dir/shared/") && is_writable("$misc_dir/PKI/"));
2013-11-25 14:38:06 +00:00
$ca_file = "$misc_dir/shared/cacert.crt";
if (file_exists($ca_file))
{
2013-11-25 17:24:46 +00:00
if (!is_readable($ca_file))
erreur("Impossible de lire le fichier");
else
$template->assign("cert_CA",
openssl_x509_parse(file_get_contents($ca_file)));
}
$srv_file = "$misc_dir/shared/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";