Browse Source

adding #32

release/0.2
Björn 4 years ago
parent
commit
b64343012a
2 changed files with 18 additions and 4 deletions
  1. +13
    -1
      app/Factories/NginxVhostFactory.php
  2. +5
    -3
      app/Helpers/NginxVhostHelper.php

+ 13
- 1
app/Factories/NginxVhostFactory.php View File

@ -134,7 +134,19 @@ class NginxVhostFactory
}) })
->addLineBreak('-') ->addLineBreak('-')
->addMenuItem($checkbox) ->addMenuItem($checkbox)
->addLineBreak('-')
->addLineBreak('-');
if ($vhost['ssl']) {
if ($vhost['ssl_certificate_exists']) {
$builder->addStaticItem('expired_at: '.$vhost['ssl_certificate_expired_at']);
} else {
$builder->addStaticItem('no certificate');
}
$builder->addLineBreak('-');
}
$builder
->addItem('Back', new NginxVhostGoBackAction()) ->addItem('Back', new NginxVhostGoBackAction())
->addItem('Exit', new ExitAction()); ->addItem('Exit', new ExitAction());


+ 5
- 3
app/Helpers/NginxVhostHelper.php View File

@ -73,8 +73,11 @@ class NginxVhostHelper
$content = file_get_contents($path); $content = file_get_contents($path);
// check for path of sites // check for path of sites
preg_match(self::REGEX_SSL_CERTIFICATE, $content, $matches);
preg_match(self::REGEX_SSL_CERTIFICATE_KEY, $content, $matches);
preg_match(self::REGEX_SSL_CERTIFICATE, $content, $certificates);
$matches = array_merge([], $certificates);
preg_match(self::REGEX_SSL_CERTIFICATE_KEY, $content, $certificates);
$matches = array_merge($matches, $certificates);
// check ssl certificates // check ssl certificates
if (count($matches) >= 2) { if (count($matches) >= 2) {
@ -89,7 +92,6 @@ class NginxVhostHelper
if (isset($openssl[1])) { if (isset($openssl[1])) {
$openssl = str_replace('notAfter=', '', $openssl[1]); $openssl = str_replace('notAfter=', '', $openssl[1]);
} }
} }


Loading…
Cancel
Save