ldap: add username field

This commit is contained in:
Girish Ramakrishnan
2019-10-25 16:38:59 -07:00
parent 99aea3ed60
commit ff84149623
2 changed files with 9 additions and 0 deletions

View File

@@ -444,6 +444,7 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio
filter: '',
bindDn: '',
bindPassword: '',
usernameField: '',
sync: function () {
$scope.externalLdap.syncBusy = true;
@@ -491,6 +492,7 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio
config.url = $scope.externalLdap.url;
config.baseDn = $scope.externalLdap.baseDn;
config.filter = $scope.externalLdap.filter;
config.usernameField = $scope.externalLdap.usernameField;
if ($scope.externalLdap.bindDn) {
config.bindDn = $scope.externalLdap.bindDn;
@@ -511,6 +513,8 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio
$scope.externalLdap.error.filter = true;
} else if (error.statusCode === 400 && error.message === 'invalid bind credentials') {
$scope.externalLdap.error.credentials = true;
} else if (error.statusCode === 400 && error.message === 'invalid usernameField') {
$scope.externalLdap.error.usernameField = true;
} else {
$scope.externalLdap.error.generic = error.message;
}