Commit 548ee47a by Carl Bergquist

Merge pull request #3122 from shoonoise/hide_signout

Disable sign out button in case of auth proxy enabled
parents 55448de9 5cf3425b
...@@ -114,6 +114,7 @@ func getFrontendSettingsMap(c *middleware.Context) (map[string]interface{}, erro ...@@ -114,6 +114,7 @@ func getFrontendSettingsMap(c *middleware.Context) (map[string]interface{}, erro
"datasources": datasources, "datasources": datasources,
"appSubUrl": setting.AppSubUrl, "appSubUrl": setting.AppSubUrl,
"allowOrgCreate": (setting.AllowUserOrgCreate && c.IsSignedIn) || c.IsGrafanaAdmin, "allowOrgCreate": (setting.AllowUserOrgCreate && c.IsSignedIn) || c.IsGrafanaAdmin,
"authProxyEnabled": setting.AuthProxyEnabled,
"buildInfo": map[string]interface{}{ "buildInfo": map[string]interface{}{
"version": setting.BuildVersion, "version": setting.BuildVersion,
"commit": setting.BuildCommit, "commit": setting.BuildCommit,
......
...@@ -120,6 +120,7 @@ function (angular, _, $, coreModule, config) { ...@@ -120,6 +120,7 @@ function (angular, _, $, coreModule, config) {
}; };
$scope.init = function() { $scope.init = function() {
$scope.showSignup = contextSrv.isSignedIn && !config['authProxyEnabled'];
$scope.updateMenu(); $scope.updateMenu();
$scope.$on('$routeChangeSuccess', $scope.updateMenu); $scope.$on('$routeChangeSuccess', $scope.updateMenu);
}; };
......
...@@ -60,8 +60,7 @@ ...@@ -60,8 +60,7 @@
<span class="sidemenu-item-text">Grafana admin</span> <span class="sidemenu-item-text">Grafana admin</span>
</a> </a>
</li> </li>
<li ng-if="showSignup">
<li ng-if="contextSrv.isSignedIn">
<a href="logout" class="sidemenu-item" target="_self"> <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="icon-circle sidemenu-icon"><i class="fa fa-fw fa-sign-out"></i></span>
<span class="sidemenu-item-text">Sign out</span> <span class="sidemenu-item-text">Sign out</span>
...@@ -83,7 +82,7 @@ ...@@ -83,7 +82,7 @@
<span class="sidemenu-item-text">Exit admin</span> <span class="sidemenu-item-text">Exit admin</span>
</a> </a>
</li> </li>
<li> <li ng-if="showSignup">
<a href="logout" class="sidemenu-item" target="_self"> <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="icon-circle sidemenu-icon"><i class="fa fa-fw fa-sign-out"></i></span>
<span class="sidemenu-item-text">Sign out</span> <span class="sidemenu-item-text">Sign out</span>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment