Commit 740709da by Torkel Ödegaard

Added disable user sign up feature

parent 3b5c813b
......@@ -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">
......
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