diff options
author | blizzz <blizzz@arthur-schiwon.de> | 2018-08-13 23:52:57 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-13 23:52:57 +0300 |
commit | c8f147d82dec2e33d2244d6893dbb7811a2288f6 (patch) | |
tree | 75d4a76dc46608b90397ad59471d33f8b54a66d6 | |
parent | 677ac044ff95b9734a59b14f7bc8c19e340ec509 (diff) | |
parent | 5e3b5edbafb3e43d342a75cb060464306dd63442 (diff) |
Merge pull request #54 from nextcloud/fix/53/nc14-compatv1.1.0
Adopt to overhauled user management in Nc 14
-rw-r--r-- | .drone.yml | 1 | ||||
-rw-r--r-- | js/impersonate.js | 15 |
2 files changed, 5 insertions, 11 deletions
@@ -46,6 +46,7 @@ pipeline: - bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB - cd ../server - php ./build/signed-off-checker.php + secrets: [ github_token ] when: matrix: TESTS: signed-off-check diff --git a/js/impersonate.js b/js/impersonate.js index db38e41..13974f7 100644 --- a/js/impersonate.js +++ b/js/impersonate.js @@ -13,16 +13,8 @@ }); } - var $impersonateAction = $('<li>').append( - $('<a>').attr('href', '#').addClass('menuitem action-impersonate permanent') - .append($('<span>').addClass('icon icon-user')) - .append($('<span>').text(t('impersonate', 'Impersonate'))) - ); - - $impersonateAction.insertAfter($(".userActionsMenu").find("li:last-child")); - - $('body').on('click', '.action-impersonate', function() { - var userId = $(this).parents('tr').find('.name').text(); + function impersonateDialog(event) { + let userId = event.target.closest('.row').dataset.id; OC.dialogs.confirm( t('impersonate', 'Are you sure you want to impersonate "{userId}"?', {userId: userId}), t('impersonate', 'Impersonate user' ), @@ -33,8 +25,9 @@ }, true ); - }); + } + OCA.Settings.UserList.registerAction('icon-user', t('impersonate', 'Impersonate'), impersonateDialog); }); })(OC, $); |