certificate.php: delete useless code and add SALT_ADMIN

This commit is contained in:
Li Chen 2013-11-30 13:55:42 +01:00
parent b3fdeb0586
commit c90e41b6b7

View File

@ -48,14 +48,6 @@ if (!empty($p[2]))
putenv("OPENSSL_CONF=$misc_dir/openssl.cnf"); putenv("OPENSSL_CONF=$misc_dir/openssl.cnf");
putenv("TOP_DIR=$misc_dir/pki"); putenv("TOP_DIR=$misc_dir/pki");
$output = shell_exec("$misc_dir/CA.sh -newca"); $output = shell_exec("$misc_dir/CA.sh -newca");
$ca_file = "$misc_dir/pki/cacert.crt";
//TODO check permission ?
if (file_exists($ca_file))
{
$data = openssl_x509_parse(file_get_contents("$misc_dir/pki/cacert.crt"));
$template->assign("cert", $data);
}
} }
elseif ($p[2] == "deleteca") elseif ($p[2] == "deleteca")
@ -66,7 +58,7 @@ if (!empty($p[2]))
if ($p[2] == "deleteca" || $p[2] == "newca") if ($p[2] == "deleteca" || $p[2] == "newca")
{ {
header("Location: /admin/"); header("Location: /".SALT_ADMIN."/");
exit; exit;
} }
} }