mirror of
https://github.com/discourse/discourse.git
synced 2025-02-06 11:28:18 +00:00
FIX: some admin actions redirect to wrong path when deployed to subdirectory
This commit is contained in:
parent
1a4a2f5fc0
commit
91588bed8b
@ -227,7 +227,7 @@ const AdminUser = Discourse.User.extend({
|
|||||||
type: 'POST',
|
type: 'POST',
|
||||||
data: { username_or_email: this.get('username') }
|
data: { username_or_email: this.get('username') }
|
||||||
}).then(function() {
|
}).then(function() {
|
||||||
document.location = "/";
|
document.location = Discourse.getURL("/");
|
||||||
}).catch(function(e) {
|
}).catch(function(e) {
|
||||||
if (e.status === 404) {
|
if (e.status === 404) {
|
||||||
bootbox.alert(I18n.t('admin.impersonate.not_found'));
|
bootbox.alert(I18n.t('admin.impersonate.not_found'));
|
||||||
@ -305,9 +305,9 @@ const AdminUser = Discourse.User.extend({
|
|||||||
}).then(function(data) {
|
}).then(function(data) {
|
||||||
if (data.success) {
|
if (data.success) {
|
||||||
if (data.username) {
|
if (data.username) {
|
||||||
document.location = "/admin/users/" + data.username;
|
document.location = Discourse.getURL("/admin/users/" + data.username);
|
||||||
} else {
|
} else {
|
||||||
document.location = "/admin/users/list/active";
|
document.location = Discourse.getURL("/admin/users/list/active");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
bootbox.alert(I18n.t("admin.user.anonymize_failed"));
|
bootbox.alert(I18n.t("admin.user.anonymize_failed"));
|
||||||
@ -370,7 +370,7 @@ const AdminUser = Discourse.User.extend({
|
|||||||
if (/^\/admin\/users\/list\//.test(location)) {
|
if (/^\/admin\/users\/list\//.test(location)) {
|
||||||
document.location = location;
|
document.location = location;
|
||||||
} else {
|
} else {
|
||||||
document.location = "/admin/users/list/active";
|
document.location = Discourse.getURL("/admin/users/list/active");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
bootbox.alert(I18n.t("admin.user.delete_failed"));
|
bootbox.alert(I18n.t("admin.user.delete_failed"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user