From: Robin Appelman Date: Tue, 5 Jul 2011 22:34:24 +0000 (+0200) Subject: only try to create the user once X-Git-Tag: v3.0~267^2~435 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e6bc6a29b958139ce9d4a2c9d0d05380b1cf6bf4;p=nextcloud-server.git only try to create the user once --- 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; });