]> source.dussan.org Git - nextcloud-server.git/commitdiff
Confirm on create/delete group
authorJoas Schilling <coding@schilljs.com>
Thu, 3 Nov 2016 08:58:47 +0000 (09:58 +0100)
committerLukas Reschke <lukas@statuscode.ch>
Fri, 18 Nov 2016 11:10:51 +0000 (12:10 +0100)
Signed-off-by: Joas Schilling <coding@schilljs.com>
settings/js/users/groups.js

index 8f4d95432a81a9836333419f3a34531c7d3cbbc6..cfe01c17530940609eedcd52463b553c102e1fdf 100644 (file)
@@ -128,6 +128,11 @@ GroupList = {
        },
 
        createGroup: function (groupname) {
+               if (OC.PasswordConfirmation.requiresPasswordConfirmation()) {
+                       OC.PasswordConfirmation.requirePasswordConfirmation(_.bind(this.createGroup, this, groupname));
+                       return;
+               }
+
                $.post(
                        OC.generateUrl('/settings/users/groups'),
                        {
@@ -278,10 +283,16 @@ GroupList = {
                        GroupList.show);
 
                //when to mark user for delete
-               $userGroupList.on('click', '.delete', function () {
+               var deleteAction = function () {
+                       if (OC.PasswordConfirmation.requiresPasswordConfirmation()) {
+                               OC.PasswordConfirmation.requirePasswordConfirmation(_.bind(deleteAction, this));
+                               return;
+                       }
+
                        // Call function for handling delete/undo
                        GroupDeleteHandler.mark(GroupList.getElementGID(this));
-               });
+               };
+               $userGroupList.on('click', '.delete', deleteAction);
 
                //delete a marked user when leaving the page
                $(window).on('beforeunload', function () {