From 5419d4428c86c488a43124f85e5407d7cbae6541 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 14 Apr 2024 15:17:47 +0200 Subject: Adding upstream version 1.11.1. Signed-off-by: Daniel Baumann --- library/Director/Dashboard/BranchesDashboard.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'library/Director/Dashboard/BranchesDashboard.php') diff --git a/library/Director/Dashboard/BranchesDashboard.php b/library/Director/Dashboard/BranchesDashboard.php index fe8b385..faeb8bf 100644 --- a/library/Director/Dashboard/BranchesDashboard.php +++ b/library/Director/Dashboard/BranchesDashboard.php @@ -4,8 +4,10 @@ namespace Icinga\Module\Director\Dashboard; use gipfl\Web\Widget\Hint; use Icinga\Application\Hook; +use Icinga\Authentication\Auth; use Icinga\Module\Director\Db\Branch\Branch; use Icinga\Module\Director\Db\Branch\BranchStore; +use Icinga\Module\Director\Db\Branch\PreferredBranchSupport; use Icinga\Module\Director\Hook\BranchSupportHook; use ipl\Html\Html; @@ -19,6 +21,14 @@ class BranchesDashboard extends Dashboard $this->translate('You\'re currently working in a Configuration Branch: %s'), Branch::requireHook()->linkToBranch($branch, $this->getAuth(), $branch->getName()) ))); + } else { + if (($implementation = Branch::optionalHook()) && $implementation instanceof PreferredBranchSupport) { + if ($implementation->hasPreferredBranch(Auth::getInstance())) { + $this->prepend(Hint::warning( + $this->translate('You\'re currently working in the main Configuration Branch') + )); + } + } } return $this->translate('Prepare your configuration in a safe Environment'); -- cgit v1.2.3