From a7feb91282744b2f52b1a9a9d4fba99fa1ad4a9a Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 3 Nov 2016 09:58:47 +0100 Subject: [PATCH] Confirm on create/delete group Signed-off-by: Joas Schilling --- settings/js/users/groups.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/settings/js/users/groups.js b/settings/js/users/groups.js index 8f4d95432a8..cfe01c17530 100644 --- a/settings/js/users/groups.js +++ b/settings/js/users/groups.js @@ -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 () { -- 2.39.5