summaryrefslogtreecommitdiffstats
path: root/library/Director/Dashboard/BranchesDashboard.php
diff options
context:
space:
mode:
Diffstat (limited to 'library/Director/Dashboard/BranchesDashboard.php')
-rw-r--r--library/Director/Dashboard/BranchesDashboard.php10
1 files changed, 10 insertions, 0 deletions
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');