Merge branch 'user-admin-logout-everywhere' into staging

pull/1/head
ansuz 5 years ago
commit 87ef2b0899

@ -3386,6 +3386,13 @@ define([
options.push({ tag: 'hr' });
// Add login or logout button depending on the current status
if (accountName) {
options.push({
tag: 'a',
attributes: {
'class': 'cp-toolbar-menu-logout-everywhere fa fa-plug',
},
content: h('span', "CLOSE REMOTE SESSIONS") // XXX Messages.settings_logoutEverywhereTitle)
});
options.push({
tag: 'a',
attributes: {'class': 'cp-toolbar-menu-logout fa fa-sign-out'},
@ -3472,6 +3479,10 @@ define([
window.parent.location = origin+'/';
});
});
$userAdmin.find('a.cp-toolbar-menu-logout-everywhere').click(function () {
Common.getSframeChannel().query('Q_LOGOUT_EVERYWHERE', null, function () { });
});
$userAdmin.find('a.cp-toolbar-menu-settings').click(function () {
if (padType) {
window.open(origin+'/settings/');

@ -783,6 +783,10 @@ define([
Utils.LocalStore.logout(cb);
});
sframeChan.on('Q_LOGOUT_EVERYWHERE', function (data, cb) {
Cryptpad.logoutFromAll(cb);
});
sframeChan.on('EV_NOTIFY', function (data) {
Notifier.notify(data);
});

Loading…
Cancel
Save