]> source.dussan.org Git - nextcloud-server.git/commitdiff
dont show new user when an error occured
authorRobin Appelman <icewind@owncloud.com>
Mon, 23 Jan 2012 16:33:12 +0000 (17:33 +0100)
committerRobin Appelman <icewind@owncloud.com>
Mon, 23 Jan 2012 16:33:12 +0000 (17:33 +0100)
settings/js/users.js

index b45038e5b043aa276270a03cb7ce72005ba6d2ed..46ab12b857aac7286777378c44f3d6b1728b16e4 100644 (file)
@@ -133,6 +133,7 @@ $(document).ready(function(){
                }
                var password=$('#newuserpassword').val();
                var groups=$('#newusergroups').prev().children('div').data('settings').checked;
+               var tr
                $.post(
                        OC.filePath('settings','ajax','createuser.php'),
                        {
@@ -141,10 +142,12 @@ $(document).ready(function(){
                                groups:groups,
                        },
                        function(result){
-                               
+                               if(result.status!='success'){
+                                       tr.remove();
+                               }
                        }
                );
-               var tr=$('#content table tbody tr').first().clone();
+               tr=$('#content table tbody tr').first().clone();
                tr.attr('data-uid',username);
                tr.find('td.name').text(username);
                var select=$('<select multiple="multiple" data-placehoder="Groups" title="Groups">');