Fix various paths (misc remove related)

This commit is contained in:
nemunaire 2015-01-14 11:10:55 +01:00 committed by Nemunaire
parent b8708408c0
commit 428a1def46
3 changed files with 15 additions and 20 deletions

View File

@ -26,13 +26,13 @@ function new_client($name, $misc_dir)
{
//TODO handle if already exist
putenv("PKI_BASEDIR=$misc_dir");
return shell_exec("$misc_dir/../pki/CA.sh -newclient $name");
return shell_exec("$misc_dir/pki/CA.sh -newclient $name");
}
function revoke_client($name, $misc_dir)
{
putenv("PKI_BASEDIR=$misc_dir");
return shell_exec("$misc_dir/../pki/CA.sh -revoke $name");
return shell_exec("$misc_dir/pki/CA.sh -revoke $name");
}
if (!empty($p[2]))
@ -49,7 +49,7 @@ if (!empty($p[2]))
{
putenv("PKI_BASEDIR=$misc_dir");
$template->assign("output",
shell_exec("$misc_dir/../pki/CA.sh -newca"));
shell_exec("$misc_dir/pki/CA.sh -newca"));
return "admin/shell";
}
@ -63,7 +63,7 @@ if (!empty($p[2]))
{
putenv("PKI_BASEDIR=$misc_dir");
$template->assign("output",
shell_exec("$misc_dir/../pki/CA.sh -newserver"));
shell_exec("$misc_dir/pki/CA.sh -newserver"));
return "admin/shell";
}
@ -71,7 +71,7 @@ if (!empty($p[2]))
{
putenv("PKI_BASEDIR=$misc_dir");
$template->assign("output",
shell_exec("$misc_dir/../pki/CA.sh -revokeserver"));
shell_exec("$misc_dir/pki/CA.sh -revokeserver"));
return "admin/shell";
}
@ -108,7 +108,7 @@ if (!empty($p[2]))
$name = $_GET['name'];
if (isset($name))
{
$path = "$misc_dir/pki/pkcs/$name.p12";
$path = "$misc_dir/PKI/pkcs/$name.p12";
if (file_exists($path) && is_readable($path))
{
header("Content-Type: application/force-download");

View File

@ -2,25 +2,20 @@
if(!defined('ONYX')) exit;
if (isset($VAR['misc_dir']))
if (empty($VAR['misc_dir']))
{
$misc_dir = $VAR['misc_dir'];
if (!is_writable("$misc_dir/shared"))
{
erreur("Dossier shared/ non accessible en écriture. (<i>$misc_dir</i>)");
erreur("Please add <var>misc_dir</var> variable into <code>root.xml</code> configuration.");
return "admin/home";
}
}
else
$misc_dir = $VAR['misc_dir'];
if (!is_dir("$misc_dir/shared") || !is_writable("$misc_dir/shared"))
{
erreur("Merci d'ajouter la variable misc_dir dans root.xml");
return "admin/home";
erreur("<code>$misc_dir/shared/</code> directory not writable.");
return "admin/home";
}
if (is_writable($misc_dir) && !is_dir("$misc_dir/pki/"))
mkdir("$misc_dir/pki/");
$template->assign("cert_writable", is_writable("$misc_dir/pki/"));
$template->assign("cert_writable", is_writable("$misc_dir/shared/") && is_writable("$misc_dir/PKI/"));
$ca_file = "$misc_dir/shared/cacert.crt";
if (file_exists($ca_file))

View File

@ -16,7 +16,7 @@ if (!empty($_FILES["inputFile"]['tmp_name']))
if (!file_exists("$misc_dir/shared/cacert.crt"))
{
erreur("The root certificate file not found, please create this first");
erreur("Root certificate not found, please create it first");
return "admin/import_users";
}