Disable sign out button in case of auth proxy enabled

This commit is contained in:
shoonoise 2015-10-30 16:02:29 +03:00
parent 9e2ef543ed
commit 5cf3425b93
3 changed files with 4 additions and 3 deletions

View File

@ -111,6 +111,7 @@ func getFrontendSettingsMap(c *middleware.Context) (map[string]interface{}, erro
"datasources": datasources,
"appSubUrl": setting.AppSubUrl,
"allowOrgCreate": (setting.AllowUserOrgCreate && c.IsSignedIn) || c.IsGrafanaAdmin,
"authProxyEnabled": setting.AuthProxyEnabled,
"buildInfo": map[string]interface{}{
"version": setting.BuildVersion,
"commit": setting.BuildCommit,

View File

@ -120,6 +120,7 @@ function (angular, _, $, coreModule, config) {
};
$scope.init = function() {
$scope.showSignup = contextSrv.isSignedIn && !config['authProxyEnabled'];
$scope.updateMenu();
$scope.$on('$routeChangeSuccess', $scope.updateMenu);
};

View File

@ -60,8 +60,7 @@
<span class="sidemenu-item-text">Grafana admin</span>
</a>
</li>
<li ng-if="contextSrv.isSignedIn">
<li ng-if="showSignup">
<a href="logout" class="sidemenu-item" target="_self">
<span class="icon-circle sidemenu-icon"><i class="fa fa-fw fa-sign-out"></i></span>
<span class="sidemenu-item-text">Sign out</span>
@ -83,7 +82,7 @@
<span class="sidemenu-item-text">Exit admin</span>
</a>
</li>
<li>
<li ng-if="showSignup">
<a href="logout" class="sidemenu-item" target="_self">
<span class="icon-circle sidemenu-icon"><i class="fa fa-fw fa-sign-out"></i></span>
<span class="sidemenu-item-text">Sign out</span>