summaryrefslogtreecommitdiffstats
path: root/settings/js/users
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2014-12-08 22:38:54 +0100
committerLukas Reschke <lukas@owncloud.com>2014-12-09 12:04:19 +0100
commit4c13918bd8b12ac4bd341c846a50accc1bf9704d (patch)
tree7b3a4e39511e401ef8b75b49a117d2a8fbe3ab7c /settings/js/users
parent25a87d4058b3ec7f21649940949b6fc0237968dc (diff)
downloadnextcloud-server-4c13918bd8b12ac4bd341c846a50accc1bf9704d.tar.gz
nextcloud-server-4c13918bd8b12ac4bd341c846a50accc1bf9704d.zip
Expose backend type via REST API
This change will expose the user backend via the REST API which is a pre-requisite for https://github.com/owncloud/core/issues/12620. For example: ````json [{"name":"9707A09E-CA9A-4ABE-A66A-3F632F16C409","displayname":"Document Conversion User Account","groups":[],"subadmin":[],"quota":"default","storageLocation":"\/Users\/lreschke\/Programming\/core\/data\/9707A09E-CA9A-4ABE-A66A-3F632F16C409","lastLogin":0,"backend":"OCA\\user_ldap\\USER_LDAP"},{"name":"ED86733E-745C-4E4D-90CB-278A9737DB3C","displayname":"Hacker","groups":[],"subadmin":[],"quota":"default","storageLocation":"\/Users\/lreschke\/Programming\/core\/data\/ED86733E-745C-4E4D-90CB-278A9737DB3C","lastLogin":0,"backend":"OCA\\user_ldap\\USER_LDAP"},{"name":"71CDF45B-E125-450D-983C-D9192F36EC88","displayname":"admin","groups":[],"subadmin":[],"quota":"default","storageLocation":"\/Users\/lreschke\/Programming\/core\/data\/71CDF45B-E125-450D-983C-D9192F36EC88","lastLogin":0,"backend":"OCA\\user_ldap\\USER_LDAP"},{"name":"admin","displayname":"admin","groups":["admin"],"subadmin":[],"quota":"default","storageLocation":"\/Users\/lreschke\/Programming\/core\/data\/admin","lastLogin":"1418057287","backend":"OC_User_Database"},{"name":"test","displayname":"test","groups":[],"subadmin":[],"quota":"default","storageLocation":"\/Users\/lreschke\/Programming\/core\/data\/test","lastLogin":0,"backend":"OC_User_Database"}] ```
Diffstat (limited to 'settings/js/users')
-rw-r--r--settings/js/users/users.js53
1 files changed, 26 insertions, 27 deletions
diff --git a/settings/js/users/users.js b/settings/js/users/users.js
index 1bca6d06b33..9c48da32c5a 100644
--- a/settings/js/users/users.js
+++ b/settings/js/users/users.js
@@ -331,35 +331,34 @@ var UserList = {
function (result) {
var loadedUsers = 0;
var trs = [];
- if (result.status === 'success') {
- //The offset does not mirror the amount of users available,
- //because it is backend-dependent. For correct retrieval,
- //always the limit(requested amount of users) needs to be added.
- $.each(result.data, function (index, user) {
- if(UserList.has(user.name)) {
- return true;
- }
- var $tr = UserList.add(user.name, user.displayname, user.groups, user.subadmin, user.quota, user.storageLocation, user.lastLogin, false);
- $tr.addClass('appear transparent');
- trs.push($tr);
- loadedUsers++;
- });
- if (result.data.length > 0) {
- UserList.doSort();
- $userList.siblings('.loading').css('visibility', 'hidden');
- }
- else {
- UserList.noMoreEntries = true;
- $userList.siblings('.loading').remove();
+ //The offset does not mirror the amount of users available,
+ //because it is backend-dependent. For correct retrieval,
+ //always the limit(requested amount of users) needs to be added.
+ $.each(result, function (index, user) {
+ if(UserList.has(user.name)) {
+ return true;
}
- UserList.offset += loadedUsers;
- // animate
- setTimeout(function() {
- for (var i = 0; i < trs.length; i++) {
- trs[i].removeClass('transparent');
- }
- }, 0);
+ var $tr = UserList.add(user.name, user.displayname, user.groups, user.subadmin, user.quota, user.storageLocation, user.lastLogin, false);
+ $tr.addClass('appear transparent');
+ trs.push($tr);
+ loadedUsers++;
+ });
+ if (result.length > 0) {
+ UserList.doSort();
+ $userList.siblings('.loading').css('visibility', 'hidden');
}
+ else {
+ UserList.noMoreEntries = true;
+ $userList.siblings('.loading').remove();
+ }
+ UserList.offset += loadedUsers;
+ // animate
+ setTimeout(function() {
+ for (var i = 0; i < trs.length; i++) {
+ trs[i].removeClass('transparent');
+ }
+ }, 0);
+ }).always(function() {
UserList.updating = false;
});
},