Skip to content

Commit

Permalink
Fixed issue #15768: After adding new admin users the user it not redi…
Browse files Browse the repository at this point in the history
…rected to setting user rights afterwards (#1824)

Dev Opening modal after creating user
  • Loading branch information
gabrieljenik committed Mar 29, 2021
1 parent 93fa87d commit 0959a61
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
3 changes: 2 additions & 1 deletion application/controllers/UserManagementController.php
Expand Up @@ -1184,7 +1184,8 @@ private function createAdminUser($aUser)
if ($success) {
$data = [
'success' => $success,
'message' => $sReturnMessage
'message' => $sReturnMessage,
'href' => Yii::app()->getController()->createUrl('userManagement/userPermissions', ['userid' => $newUser['uid']]),
];
} else {
$data = [
Expand Down
24 changes: 16 additions & 8 deletions assets/packages/usermanagement/js/usermanagement.js
Expand Up @@ -83,6 +83,11 @@ var UserManagement = function () {
if (!result.hasOwnProperty('html')) {
triggerModalClose();
window.LS.notifyFader(result.message, 'well-lg text-center ' + (result.success ? 'bg-primary' : 'bg-danger'));
if (result.hasOwnProperty('href')) {
setTimeout(function() {
openModal(result.href);
}, 500);
}
return;
}
$('#exitForm').on('click.USERMANAGERMODAL', function (e) {
Expand Down Expand Up @@ -265,14 +270,7 @@ var UserManagement = function () {
});
$('.UserManagement--action--openmodal').on('click', function () {
var href = $(this).data('href');
startModalLoader();
$.ajax({
url: href,
success: function (html) {
applyModalHtml(html);
}
});

openModal(href);
});
bindListItemclick();
};
Expand All @@ -287,6 +285,16 @@ var UserManagement = function () {
});
};

var openModal = function(href) {
startModalLoader();
$.ajax({
url: href,
success: function (html) {
applyModalHtml(html);
}
});
};

$(document).on('ready pjax:scriptcomplete', function () {
bindButtons();
bindModals();
Expand Down

0 comments on commit 0959a61

Please sign in to comment.