summaryrefslogtreecommitdiffstats
path: root/settings/js
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2014-12-04 14:15:55 +0100
committerLukas Reschke <lukas@owncloud.com>2014-12-08 12:11:01 +0100
commitfe7d9a7ca07bb21905c6483dee49bf37dd131674 (patch)
treef37a25e518c0ce38530a452d63386a525f5121f3 /settings/js
parente6908f8b890414451dfc32af4d76562016d75d0f (diff)
downloadnextcloud-server-fe7d9a7ca07bb21905c6483dee49bf37dd131674.tar.gz
nextcloud-server-fe7d9a7ca07bb21905c6483dee49bf37dd131674.zip
Add REST route for user & group management
First step of a somewhat testable user management. - I know, the JSON returns are in an ugly format but the JS expects it that way. So let's keep it that way until we have time to fix the JS in the future.
Diffstat (limited to 'settings/js')
-rw-r--r--settings/js/settings.js2
-rw-r--r--settings/js/users/deleteHandler.js5
-rw-r--r--settings/js/users/groups.js6
-rw-r--r--settings/js/users/users.js6
4 files changed, 9 insertions, 10 deletions
diff --git a/settings/js/settings.js b/settings/js/settings.js
index 13c56a8f53a..e98bd2cc895 100644
--- a/settings/js/settings.js
+++ b/settings/js/settings.js
@@ -41,7 +41,7 @@ OC.Settings = _.extend(OC.Settings, {
};
}
$.ajax({
- url: OC.generateUrl('/settings/ajax/grouplist'),
+ url: OC.generateUrl('/settings/users/groups'),
data: queryData,
dataType: 'json',
success: function(data) {
diff --git a/settings/js/users/deleteHandler.js b/settings/js/users/deleteHandler.js
index c89a844044e..942bae91cd3 100644
--- a/settings/js/users/deleteHandler.js
+++ b/settings/js/users/deleteHandler.js
@@ -189,11 +189,10 @@ DeleteHandler.prototype.deleteEntry = function(keepNotification) {
var payload = {};
payload[dh.ajaxParamID] = dh.oidToDelete;
$.ajax({
- type: 'POST',
- url: OC.filePath('settings', 'ajax', dh.ajaxEndpoint),
+ type: 'DELETE',
+ url: OC.generateUrl(dh.ajaxEndpoint+'/'+this.oidToDelete),
// FIXME: do not use synchronous ajax calls as they block the browser !
async: false,
- data: payload,
success: function (result) {
if (result.status === 'success') {
// Remove undo option, & remove user from table
diff --git a/settings/js/users/groups.js b/settings/js/users/groups.js
index 081842734f0..284d5598ed5 100644
--- a/settings/js/users/groups.js
+++ b/settings/js/users/groups.js
@@ -84,9 +84,9 @@ GroupList = {
createGroup: function (groupname) {
$.post(
- OC.filePath('settings', 'ajax', 'creategroup.php'),
+ OC.generateUrl('/settings/users/groups'),
{
- groupname: groupname
+ id: groupname
},
function (result) {
if (result.status !== 'success') {
@@ -221,7 +221,7 @@ GroupList = {
},
initDeleteHandling: function () {
//set up handler
- GroupDeleteHandler = new DeleteHandler('removegroup.php', 'groupname',
+ GroupDeleteHandler = new DeleteHandler('/settings/users/groups', 'groupname',
GroupList.hide, GroupList.remove);
//configure undo
diff --git a/settings/js/users/users.js b/settings/js/users/users.js
index 5e0c0cac189..6de8b7029ed 100644
--- a/settings/js/users/users.js
+++ b/settings/js/users/users.js
@@ -292,7 +292,7 @@ var UserList = {
},
initDeleteHandling: function() {
//set up handler
- UserDeleteHandler = new DeleteHandler('removeuser.php', 'username',
+ UserDeleteHandler = new DeleteHandler('/settings/users/users', 'username',
UserList.markRemove, UserList.remove);
//configure undo
@@ -326,7 +326,7 @@ var UserList = {
UserList.currentGid = gid;
var pattern = filter.getPattern();
$.get(
- OC.generateUrl('/settings/ajax/userlist'),
+ OC.generateUrl('/settings/users/users'),
{ offset: UserList.offset, limit: UserList.usersToLoad, gid: gid, pattern: pattern },
function (result) {
var loadedUsers = 0;
@@ -667,7 +667,7 @@ $(document).ready(function () {
var groups = $('#newusergroups').val();
$('#newuser').get(0).reset();
$.post(
- OC.filePath('settings', 'ajax', 'createuser.php'),
+ OC.generateUrl('/settings/users/users'),
{
username: username,
password: password,