Also refresh groups on LDAP sync

This commit is contained in:
Johannes Zellner
2022-04-23 11:12:26 +02:00
parent 8dfc142905
commit a8a995ca05

View File

@@ -1003,7 +1003,10 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio
$scope.externalLdap.percent = 100; // indicates that 'result' is valid
$scope.externalLdap.errorMessage = data.success ? '' : data.error.message;
return refreshUsers();
refreshGroups();
refreshUsers();
return;
}
$scope.externalLdap.syncBusy = true;
@@ -1142,9 +1145,12 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio
});
}
function refresh() {
function refreshGroups(callback) {
Client.getGroups(function (error, result) {
if (error) return console.error('Unable to get group listing.', error);
if (error) {
if (callback) return callback(error);
else return console.error('Unable to get group listing.', error);
}
angular.copy(result, $scope.groups);
$scope.groupsById = { };
@@ -1152,6 +1158,13 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio
$scope.groupsById[result[i].id] = result[i];
}
if (callback) callback();
});
}
function refresh() {
refreshGroups(function (error) {
if (error) return console.error('Unable to get group listing.', error);
refreshUsers(true);
});
}