Example #1
0
<?php

include "_config.php";
$ce = new \App\CertificateHandler();
$certificate = $ce->findByDomain($_GET['domain']);
if (!$certificate) {
    e404();
}
try {
    header("Content-Type: text/plain");
    echo $certificate->showCertificateFile($_GET['file']);
    exit;
} catch (\Exception $e) {
    e500($e);
}
Example #2
0
<?php

include "_config.php";
$ce = new \App\CertificateHandler();
$domain = $ce->findByDomain($_GET['domain']);
if (!$domain) {
    e404();
}
try {
    $ce = new \App\CertificateHandler();
    $ce->issueNewCertificate($domain->getName(), $domain->getSAN());
    redirect("detail?domain=" . $domain->getName());
} catch (\Exception $e) {
    $error = $e->getMessage();
    include "detail.php";
}