summaryrefslogtreecommitdiffstats
path: root/admin/js
diff options
context:
space:
mode:
authorJakob Sack <kde@jakobsack.de>2011-04-16 23:26:55 +0200
committerJakob Sack <kde@jakobsack.de>2011-04-16 23:26:55 +0200
commitda5d38826625c59ee4fe4aaf9c1b5f35bd2bbbbb (patch)
tree129131f7e0d18a7328e7ac434fa1358b0df97ff3 /admin/js
parent9947428d793937b8a168a1153c3c6e16b07f0baa (diff)
downloadnextcloud-server-da5d38826625c59ee4fe4aaf9c1b5f35bd2bbbbb.tar.gz
nextcloud-server-da5d38826625c59ee4fe4aaf9c1b5f35bd2bbbbb.zip
Advanced user management
Diffstat (limited to 'admin/js')
-rw-r--r--admin/js/users.js37
1 files changed, 29 insertions, 8 deletions
diff --git a/admin/js/users.js b/admin/js/users.js
index 6d59a2efb7c..0713cf8e5dc 100644
--- a/admin/js/users.js
+++ b/admin/js/users.js
@@ -1,4 +1,7 @@
$(document).ready(function(){
+ // Vars we need
+ var uid = "";
+ var gid = "";
// Dialog for adding users
$( "#adduser-form" ).dialog({
autoOpen: false,
@@ -7,6 +10,13 @@ $(document).ready(function(){
modal: true,
buttons: {
"Create an account": function() {
+ var post = $( "#createuserdata" ).serialize();
+ $.post( 'ajax/createuser.php', post, function(data){
+ var newrow = '<tr><td>' + data.data.username + '</td>';
+ newrow = newrow + '<td>' + data.data.groups + '</td>';
+ newrow = newrow + '<td><a href="" class="edituser-button">edit</a> | <a class="removeuser-button" href="">remove</a></td></tr>';
+ $("#userstable").append( newrow );
+ });
$( this ).dialog( "close" );
},
Cancel: function() {
@@ -14,7 +24,7 @@ $(document).ready(function(){
}
},
close: function() {
- allFields.val( "" ).removeClass( "ui-state-error" );
+ true;
}
});
@@ -39,13 +49,15 @@ $(document).ready(function(){
}
},
close: function() {
- allFields.val( "" ).removeClass( "ui-state-error" );
+ true;
}
});
$( ".edituser-button" )
- .click(function() {
- $( "#edituser-form" ).dialog( "open" );
+ .click(function(){
+ uid = $( this ).parent().attr( 'x-uid' );
+ $("#edituserusername").html(uid);
+ $("#edituser-form").dialog("open");
return false;
});
@@ -70,6 +82,8 @@ $(document).ready(function(){
$( ".removeuser-button" )
.click(function() {
+ uid = $( this ).parent().attr( 'x-uid' );
+ $("#deleteuserusername").html(uid);
$( "#removeuser-form" ).dialog( "open" );
return false;
});
@@ -81,21 +95,28 @@ $(document).ready(function(){
width: 350,
modal: true,
buttons: {
- "Remove group": function() {
+ "Remove group": function(){
+ var post = $( "#deletegroupdata" ).serialize();
+ $.post( 'ajax/deletegroup.php', post, function(data){
+ $( "a[x-gid='"+gid+"']" ).parent().remove();
+ });
$( this ).dialog( "close" );
},
Cancel: function() {
$( this ).dialog( "close" );
}
},
- close: function() {
+ close: function(){
allFields.val( "" ).removeClass( "ui-state-error" );
}
});
$( ".removegroup-button" )
- .click(function() {
- $( "#removegroup-form" ).dialog( "open" );
+ .click(function(){
+ gid = $( this ).parent().attr( 'x-gid' );
+ $("#deletegroupgroupname").html(gid);
+ $("#deletegroupnamefield").val(gid);
+ $("#removegroup-form").dialog( "open" );
return false;
});
} );