From fb54b887f245e00fea2f1f9cb1435f236d4d299a Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Thu, 10 Oct 2019 16:42:32 +0200 Subject: [PATCH] remove unneeded apihelp-page code in admin/customer_index; set explicit version to api-doc URL; check for acme.sh cronjob and uninstall it, as froxlor manages that itself Signed-off-by: Michael Kaufmann --- admin_index.php | 2 -- customer_index.php | 2 -- lib/Froxlor/Cron/Http/LetsEncrypt/AcmeSh.php | 4 +++- lib/navigation/00.froxlor.main.php | 4 ++-- templates/Sparkle/header.tpl | 2 +- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/admin_index.php b/admin_index.php index 25e3fba0..3415d14f 100644 --- a/admin_index.php +++ b/admin_index.php @@ -387,8 +387,6 @@ if ($page == 'overview') { } } elseif ($page == 'apikeys' && Settings::Get('api.enabled') == 1) { require_once __DIR__ . '/api_keys.php'; -} elseif ($page == 'apihelp' && Settings::Get('api.enabled') == 1) { - require_once __DIR__ . '/apihelp.php'; } elseif ($page == '2fa' && Settings::Get('2fa.enabled') == 1) { require_once __DIR__ . '/2fa.php'; } diff --git a/customer_index.php b/customer_index.php index 6912b86a..784a3fc3 100644 --- a/customer_index.php +++ b/customer_index.php @@ -359,8 +359,6 @@ if ($page == 'overview') { } } elseif ($page == 'apikeys' && Settings::Get('api.enabled') == 1) { require_once __DIR__ . '/api_keys.php'; -} elseif ($page == 'apihelp' && Settings::Get('api.enabled') == 1) { - require_once __DIR__ . '/apihelp.php'; } elseif ($page == '2fa' && Settings::Get('2fa.enabled') == 1) { require_once __DIR__ . '/2fa.php'; } diff --git a/lib/Froxlor/Cron/Http/LetsEncrypt/AcmeSh.php b/lib/Froxlor/Cron/Http/LetsEncrypt/AcmeSh.php index 41974d8e..fabfa888 100644 --- a/lib/Froxlor/Cron/Http/LetsEncrypt/AcmeSh.php +++ b/lib/Froxlor/Cron/Http/LetsEncrypt/AcmeSh.php @@ -378,7 +378,9 @@ class AcmeSh extends \Froxlor\Cron\FroxlorCron private static function checkUpgrade() { - $acmesh_result = \Froxlor\FileDir::safe_exec(self::$acmesh . " --upgrade"); FroxlorLogger::getInstanceOf()->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, "Checking for LetsEncrypt client upgrades before renewing certificates:\n" . implode("\n", $acmesh_result)); + \Froxlor\FileDir::safe_exec(self::$acmesh . " --upgrade"); + // check for activated cron (which is installed automatically) but we don't need it + \Froxlor\FileDir::safe_exec(self::$acmesh . " --uninstall-cronjob"); } } diff --git a/lib/navigation/00.froxlor.main.php b/lib/navigation/00.froxlor.main.php index bbc6896a..241d048f 100644 --- a/lib/navigation/00.froxlor.main.php +++ b/lib/navigation/00.froxlor.main.php @@ -44,7 +44,7 @@ return array( 'show_element' => (\Froxlor\Settings::Get('api.enabled') == true) ), array( - 'url' => 'customer_index.php?page=apihelp', + 'url' => 'https://api.froxlor.org/doc/?v='.\Froxlor\Froxlor::getVersion(), 'label' => $lng['menue']['main']['apihelp'], 'show_element' => (\Froxlor\Settings::Get('api.enabled') == true) ), @@ -195,7 +195,7 @@ return array( 'show_element' => (\Froxlor\Settings::Get('api.enabled') == true) ), array( - 'url' => 'admin_index.php?page=apihelp', + 'url' => 'https://api.froxlor.org/doc/?v='.\Froxlor\Froxlor::getVersion(), 'label' => $lng['menue']['main']['apihelp'], 'show_element' => (\Froxlor\Settings::Get('api.enabled') == true) ), diff --git a/templates/Sparkle/header.tpl b/templates/Sparkle/header.tpl index 1b1e9fe8..cfb3f205 100644 --- a/templates/Sparkle/header.tpl +++ b/templates/Sparkle/header.tpl @@ -65,7 +65,7 @@
  • {$lng['menue']['main']['apikeys']}
  • -
  • {$lng['menue']['main']['apihelp']}
  • +
  • {$lng['menue']['main']['apihelp']}