diff options
author | Robin Appelman <icewind1991@gmail.com> | 2011-07-06 00:34:24 +0200 |
---|---|---|
committer | Robin Appelman <icewind1991@gmail.com> | 2011-07-06 00:34:24 +0200 |
commit | e6bc6a29b958139ce9d4a2c9d0d05380b1cf6bf4 (patch) | |
tree | 967a6bd76e25b6f4436e6e8ac7b4551eb1f70911 /admin | |
parent | 7362f103ed092bee05c2aa228b55fbedfd5aa4ed (diff) | |
download | nextcloud-server-e6bc6a29b958139ce9d4a2c9d0d05380b1cf6bf4.tar.gz nextcloud-server-e6bc6a29b958139ce9d4a2c9d0d05380b1cf6bf4.zip |
only try to create the user once
Diffstat (limited to 'admin')
-rw-r--r-- | admin/js/users.js | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/admin/js/users.js b/admin/js/users.js index 1ef02c650a0..48f3b15e3b8 100644 --- a/admin/js/users.js +++ b/admin/js/users.js @@ -216,19 +216,25 @@ $(document).ready(function(){ // Create a new user $( "#createuserbutton" ) .click(function(){ - // Create the post data - var post = $( "#createuserdata" ).serialize(); - - // Ajax call - $.post( 'ajax/createuser.php', post, function(data){ - // If it says "success" then we are happy - if( data.status == "success" ){ - userCreated( data.data.username, data.data.groups ); - } - else{ - printError( data.data.message ); - } - }); + if(!$( "#createuserbutton" ).data('active')){ + $( "#createuserbutton" ).data('active',true); + + // Create the post data + var post = $( "#createuserdata" ).serialize(); + + // Ajax call + $.post( 'ajax/createuser.php', post, function(data){ + $( "#createuserbutton" ).data('active',false); + + // If it says "success" then we are happy + if( data.status == "success" ){ + userCreated( data.data.username, data.data.groups ); + } + else{ + printError( data.data.message ); + } + }); + } return false; }); |