<?php include "_config.php"; $error = ''; // create new if (!empty($_POST)) { try { $domain = $_POST['domain']; $sans = explode("\n", $_POST['san']); $ce = new \App\CertificateHandler(); $ce->issueNewCertificate($domain, $sans); redirect("detail?domain={$domain}"); } catch (\Exception $e) { $error = $e->getMessage(); } } $title = "Issue new certificate"; include "_header.php"; ?> <div class="head"> <h1>Issue new certificate</h1> <p><a href="index">← Back to the certificates list</a></p> </div> <div class="card"> <form method="post" action=""> <?php if (!empty($error)) { ?>
<?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); }
<?php include "_config.php"; $ce = new \App\CertificateHandler(); $domain = $ce->findByDomain($_GET['domain']); if (!$domain) { e404(); } try { $ce->delete($domain); redirect("index.php"); } catch (\Exception $e) { e500($e); }
<?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"; }
<?php include "_config.php"; $ch = new \App\CertificateHandler(); $title = "Certificates list"; include "_header.php"; ?> <div class="head"> <h1>Certificates list</h1> <p><a href="create" class="btn-new">Issue new certificate</a></p> </div> <table> <thead> <tr> <th>Domain (CN)</th> <th>Other domains (SAN)</th> <th>Expiration</th> <th></th> </tr> </thead> <tbody> <?php foreach ($ch->getAll() as $certificate) { ?> <tr> <th> <a href="detail?domain=<?php e($certificate->getName()); ?>