Merge pull request #6439 from mailcow/fix/6430

[SOGo] Use JS for mailcow logout
This commit is contained in:
FreddleSpl0it 2025-04-03 12:57:24 +02:00 committed by GitHub
commit 153890b283
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 14 additions and 9 deletions

View file

@ -1,20 +1,15 @@
59,65d58
< ng-show="::!activeUser.isSuperUser"
60,65d58
< var:ng-click="navButtonClick"
< ng-href="/user">
< <md-icon>build</md-icon>
< <md-tooltip><var:string label:value="mailcow"/></md-tooltip>
< <md-tooltip>mailcow <var:string label:value="Preferences"/></md-tooltip>
< </md-button>
< <md-button class="md-icon-button"
83c76
< onclick="document.getElementById('mc_logout').setAttribute('action', '/'); document.getElementById('mc_logout').submit();"
< onclick="mc_logout();"
---
> ng-show="::activeUser.path.logoff.length"
85c78
< ng-href="#">
---
> ng-href="{{::activeUser.path.logoff}}">
89,91d81
< <form method="POST" id="mc_logout" action="user">
< <input type="hidden" name="logout" value="1">
< </form>

View file

@ -5,6 +5,16 @@ document.addEventListener('DOMContentLoaded', function () {
window.location.href = '/user';
}
});
// logout function
function mc_logout() {
fetch("/", {
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded"
},
body: "logout=1"
}).then(() => window.location.href = '/');
}
// Custom SOGo JS

View file

@ -199,7 +199,7 @@ services:
- phpfpm
sogo-mailcow:
image: ghcr.io/mailcow/sogo:1.131
image: ghcr.io/mailcow/sogo:1.133
environment:
- DBNAME=${DBNAME}
- DBUSER=${DBUSER}