mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Added disable user sign up feature
This commit is contained in:
parent
3b5c813be7
commit
740709da04
@ -7,8 +7,7 @@ function (angular, config) {
|
||||
|
||||
var module = angular.module('grafana.controllers');
|
||||
|
||||
module.controller('LoginCtrl', function($scope, backendSrv, $location, $routeParams) {
|
||||
|
||||
module.controller('LoginCtrl', function($scope, backendSrv) {
|
||||
$scope.formModel = {
|
||||
user: '',
|
||||
email: '',
|
||||
@ -19,6 +18,7 @@ function (angular, config) {
|
||||
|
||||
$scope.googleAuthEnabled = config.googleAuthEnabled;
|
||||
$scope.githubAuthEnabled = config.githubAuthEnabled;
|
||||
$scope.disableUserSignUp = config.disableUserSignUp;
|
||||
|
||||
$scope.loginMode = true;
|
||||
$scope.submitBtnClass = 'btn-inverse';
|
||||
@ -26,10 +26,6 @@ function (angular, config) {
|
||||
$scope.strengthClass = '';
|
||||
|
||||
$scope.init = function() {
|
||||
if ($routeParams.logout) {
|
||||
$scope.logout();
|
||||
}
|
||||
|
||||
$scope.$watch("loginMode", $scope.loginModeChanged);
|
||||
$scope.passwordChanged();
|
||||
};
|
||||
@ -84,13 +80,6 @@ function (angular, config) {
|
||||
});
|
||||
};
|
||||
|
||||
$scope.logout = function() {
|
||||
backendSrv.post('/logout').then(function() {
|
||||
$scope.appEvent('logged-out');
|
||||
$location.search({});
|
||||
});
|
||||
};
|
||||
|
||||
$scope.login = function() {
|
||||
delete $scope.loginError;
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
<button class="btn-login-tab" ng-click="loginMode = true;" ng-class="{active: loginMode}">
|
||||
Log in
|
||||
</button>
|
||||
<button class="btn-login-tab" ng-click="loginMode = false;" ng-class="{active: !loginMode}">
|
||||
<button class="btn-login-tab" ng-click="loginMode = false;" ng-class="{active: !loginMode}" ng-if="!disableUserSignUp">
|
||||
Sign up
|
||||
</button>
|
||||
</div>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<span class="gravatar-email small">{{grafana.user.login}}</span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="{{appSubUrl}}/login?logout">Logout</a></li>
|
||||
<li><a href="{{appSubUrl}}/logout" target="_self">Logout</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li ng-if="!grafana.user.isSignedIn">
|
||||
|
Loading…
Reference in New Issue
Block a user