Add some checks on directories
This commit is contained in:
parent
b6792f3b72
commit
861b644b9e
7 changed files with 81 additions and 38 deletions
|
@ -2,13 +2,19 @@
|
|||
|
||||
if(!defined('ONYX')) exit;
|
||||
|
||||
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);
|
||||
|
||||
//TODO handle the path ?
|
||||
$ca_file = ONYX . '../misc/fic_pki/cacert.crt';
|
||||
$ca_file = ONYX . '../misc/pki/cacert.crt';
|
||||
|
||||
//TODO check permission ?
|
||||
if (file_exists($ca_file))
|
||||
{
|
||||
$data = openssl_x509_parse(file_get_contents(ONYX . '../misc/fic_pki/cacert.crt'));
|
||||
$data = openssl_x509_parse(file_get_contents(ONYX . '../misc/pki/cacert.crt'));
|
||||
$template->assign("cert", $data);
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue