diff --git a/data/security/securitylog.txt b/data/security/securitylog.txt new file mode 100644 index 0000000..b4d0e61 --- /dev/null +++ b/data/security/securitylog.txt @@ -0,0 +1 @@ +127.0.0.1;2024-03-25 21:48:49;login: wrong password diff --git a/system/typemill/Controllers/ControllerApiSystemUsers.php b/system/typemill/Controllers/ControllerApiSystemUsers.php index a596aad..9bc189a 100644 --- a/system/typemill/Controllers/ControllerApiSystemUsers.php +++ b/system/typemill/Controllers/ControllerApiSystemUsers.php @@ -394,15 +394,17 @@ class ControllerApiSystemUsers extends Controller return $response->withHeader('Content-Type', 'application/json')->withStatus(500); } + $logout = false; # if user deleted his own account if($username == $request->getAttribute('c_username')) { + $logout = true; Session::stopSession(); } $response->getBody()->write(json_encode([ 'message' => Translations::translate('User deleted.'), - 'logout' => true + 'logout' => $logout ])); return $response->withHeader('Content-Type', 'application/json'); diff --git a/system/typemill/author/js/vue-user.js b/system/typemill/author/js/vue-user.js index 6113a84..fa160b5 100644 --- a/system/typemill/author/js/vue-user.js +++ b/system/typemill/author/js/vue-user.js @@ -115,11 +115,14 @@ const app = Vue.createApp({ self.showModal = false; self.messageClass = 'bg-teal-500'; self.message = response.data.message; - if(response.data.logout !== undefined) + if(response.data.logout == true) { window.location.replace(data.urlinfo.baseurl + '/tm/logout'); } - window.location.replace(data.urlinfo.baseurl + '/tm/users'); + else + { + window.location.replace(data.urlinfo.baseurl + '/tm/users'); + } }) .catch(function (error) {