From 3d81bcb1fe7fb82c11e2ccd006b1456df4a682aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 15 Jan 2018 10:52:33 -0500 Subject: [PATCH] closes #6238 --- public/src/client/account/edit/email.js | 2 +- public/src/client/account/edit/password.js | 7 +++++-- public/src/client/account/edit/username.js | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/public/src/client/account/edit/email.js b/public/src/client/account/edit/email.js index e1a068979a..ae182029f0 100644 --- a/public/src/client/account/edit/email.js +++ b/public/src/client/account/edit/email.js @@ -31,7 +31,7 @@ define('forum/account/edit/email', ['forum/account/header'], function (header) { return app.alertError(err.message); } - ajaxify.go('user/' + ajaxify.data.userslug); + ajaxify.go('user/' + ajaxify.data.userslug + '/edit'); }); return false; diff --git a/public/src/client/account/edit/password.js b/public/src/client/account/edit/password.js index 1585a85577..6aa66a13d8 100644 --- a/public/src/client/account/edit/password.js +++ b/public/src/client/account/edit/password.js @@ -82,8 +82,11 @@ define('forum/account/edit/password', ['forum/account/header', 'translator', 'zx onPasswordConfirmChanged(); return app.alertError(err.message); } - - window.location.href = config.relative_path + '/login'; + if (parseInt(app.user.uid, 10) === parseInt(ajaxify.data.uid, 10)) { + window.location.href = config.relative_path + '/login'; + } else { + ajaxify.go('user/' + ajaxify.data.userslug + '/edit'); + } }); } else { if (!passwordsmatch) { diff --git a/public/src/client/account/edit/username.js b/public/src/client/account/edit/username.js index f00e4d16fe..6178466f24 100644 --- a/public/src/client/account/edit/username.js +++ b/public/src/client/account/edit/username.js @@ -39,7 +39,7 @@ define('forum/account/edit/username', ['forum/account/header'], function (header $('[component="header/usericon"]').css('background-color', data['icon:bgColor']).text(data['icon:text']); } - ajaxify.go('user/' + userslug); + ajaxify.go('user/' + userslug + '/edit'); }); return false;