Skip to content

Commit 153890b

Browse files
Merge pull request #6439 from mailcow/fix/6430
[SOGo] Use JS for mailcow logout
2 parents a741c2b + e452917 commit 153890b

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed
+3-8
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
1-
59,65d58
2-
< ng-show="::!activeUser.isSuperUser"
1+
60,65d58
32
< var:ng-click="navButtonClick"
43
< ng-href="/user">
54
< <md-icon>build</md-icon>
6-
< <md-tooltip><var:string label:value="mailcow"/></md-tooltip>
5+
< <md-tooltip>mailcow <var:string label:value="Preferences"/></md-tooltip>
76
< </md-button>
87
< <md-button class="md-icon-button"
98
83c76
10-
< onclick="document.getElementById('mc_logout').setAttribute('action', '/'); document.getElementById('mc_logout').submit();"
9+
< onclick="mc_logout();"
1110
---
1211
> ng-show="::activeUser.path.logoff.length"
1312
85c78
1413
< ng-href="#">
1514
---
1615
> ng-href="{{::activeUser.path.logoff}}">
17-
89,91d81
18-
< <form method="POST" id="mc_logout" action="user">
19-
< <input type="hidden" name="logout" value="1">
20-
< </form>

data/conf/sogo/custom-sogo.js

+10
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ document.addEventListener('DOMContentLoaded', function () {
55
window.location.href = '/user';
66
}
77
});
8+
// logout function
9+
function mc_logout() {
10+
fetch("/", {
11+
method: "POST",
12+
headers: {
13+
"Content-Type": "application/x-www-form-urlencoded"
14+
},
15+
body: "logout=1"
16+
}).then(() => window.location.href = '/');
17+
}
818

919
// Custom SOGo JS
1020

docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ services:
199199
- phpfpm
200200

201201
sogo-mailcow:
202-
image: ghcr.io/mailcow/sogo:1.131
202+
image: ghcr.io/mailcow/sogo:1.133
203203
environment:
204204
- DBNAME=${DBNAME}
205205
- DBUSER=${DBUSER}

0 commit comments

Comments
 (0)