]> source.dussan.org Git - nextcloud-server.git/commitdiff
only try to create the user once
authorRobin Appelman <icewind1991@gmail.com>
Tue, 5 Jul 2011 22:34:24 +0000 (00:34 +0200)
committerRobin Appelman <icewind1991@gmail.com>
Tue, 5 Jul 2011 22:34:24 +0000 (00:34 +0200)
admin/js/users.js

index 1ef02c650a0a90d55e818b94bc66fd286a219350..48f3b15e3b80b881885575ab5059dfd4f1300c39 100644 (file)
@@ -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;
                });