Hide unneeded user elements when in LDAP

This commit is contained in:
Joseph Schorr 2015-05-11 13:32:24 -04:00
parent 1c83def15b
commit 4feb2a2032
3 changed files with 11 additions and 5 deletions

View file

@ -1,4 +1,5 @@
<div class="signup-form-element" quay-show="Features.USER_CREATION">
<div class="signup-form-element"
quay-show="Features.USER_CREATION && Config.AUTHENTICATION_TYPE == 'Database'">
<form class="form-signup" name="signupForm" ng-submit="register()" ng-show="!awaitingConfirmation && !registering">
<input type="text" class="form-control" placeholder="Create a username" name="username" ng-model="newUser.username" autofocus required ng-pattern="/^[a-z0-9_]{4,30}$/">
<input type="email" class="form-control" placeholder="Email address" ng-model="newUser.email" required>

View file

@ -14,7 +14,8 @@
</div>
</div>
</div>
<div class="panel panel-default" quay-show="Features.USER_CREATION">
<div class="panel panel-default"
quay-show="Features.USER_CREATION && Config.AUTHENTICATION_TYPE == 'Database'">
<div class="panel-heading">
<h6 class="panel-title accordion-title">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" data-target="#collapseRegister">
@ -28,7 +29,8 @@
</div>
</div>
</div>
<div class="panel panel-default" quay-show="Features.MAILING">
<div class="panel panel-default"
quay-show="Features.MAILING && Config.AUTHENTICATION_TYPE == 'Database'">
<div class="panel-heading">
<h6 class="panel-title accordion-title">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" data-target="#collapseForgot">

View file

@ -17,7 +17,10 @@ angular.module('quay').directive('userSetup', function () {
'signedIn': '&signedIn',
'userRegistered': '&userRegistered'
},
controller: function($scope, $location, $timeout, ApiService, KeyService, UserService) {
controller: function($scope, $location, $timeout, ApiService, KeyService, UserService, Config, Features) {
$scope.Config = Config;
$scope.Features = Features;
$scope.sendRecovery = function() {
$scope.sendingRecovery = true;
@ -39,7 +42,7 @@ angular.module('quay').directive('userSetup', function () {
};
$scope.hasSignedIn = function() {
return UserService.hasEverLoggedIn();
return UserService.hasEverLoggedIn() || Config.AUTHENTICATION_TYPE != 'Database';
};
}
};