Commit eac90770 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '928-anonymous-logged-in-after-reopening-the-browser' into 'master'

Resolve "anonymous logged in after reopening the browser"

Closes #928

See merge request minerva/core!916
parents f94ea25c a31edec8
......@@ -15,7 +15,7 @@ minerva (14.0.0~beta.0) unstable; urgency=low
* Small improvement: user role introduced in edit user dialog (#924)
* Small improvement: tab with list of glyps is available when adding project
with glyphs (#925)
* Bug fix: work on FF Private Window mode could cause logout or raise an
* Bug fix: work on FF Private Window mode could cause logout or raise an
error on when opening new tab with minerva (#892)
* Bug fix: fetching list of miRnas resulted sometimes in "Internal Server
Error" (#889)
......@@ -51,6 +51,8 @@ minerva (14.0.0~beta.0) unstable; urgency=low
* Bug fix: too long name for data overlay in info window is trimmed (#919)
* Bug fix: too long name in general overlay list is wrapped (#857)
* Bug fix: after genome is removed list of genomes is refreshed (#922)
* Bug fix: when session expired anonymous user could access admin panel with
very limited access (#928)
* Bug fix: migrating from old minerva will grant WRITE_PROJECT privilege to
users who have manage comments or manage overlays privilege (#902)
......
......@@ -280,6 +280,7 @@ function createDivStructure(element) {
function initGlobals(params) {
if (global.ServerConnector === undefined) {
global.ServerConnector = ServerConnector;
global.$ = global.jQuery = $;
if (params.isDebug()) {
logger.level = "debug";
} else {
......@@ -882,26 +883,28 @@ function createAdmin(params) {
params.getElement().style.display = "table";
params.getElement().innerHTML = "<div style='vertical-align:middle;display:table-cell;text-align: center'>"
+ "<img src='resources/images/icons/ajax-loader.gif'/>" + "</div>";
if (ServerConnector.getSessionData(null).getLogin() === "anonymous" ||
ServerConnector.getSessionData(null).getLogin() === null ||
ServerConnector.getSessionData(null).getLogin() === undefined) {
window.location.href = ServerConnector.getServerBaseUrl() + "login.xhtml?from=" + encodeURI(window.location.href);
return Promise.resolve()
}
var result;
// make sure that we are logged in
return ServerConnector.createSession().then(function () {
if (ServerConnector.getSessionData(null).getLogin() === "anonymous" ||
ServerConnector.getSessionData(null).getLogin() === null ||
ServerConnector.getSessionData(null).getLogin() === undefined) {
window.location.href = ServerConnector.getServerBaseUrl() + "login.xhtml?from=" + encodeURI(window.location.href);
return Promise.resolve();
}
return ServerConnector.getConfiguration();
}).then(function (configuration) {
params.setConfiguration(configuration);
result = new Admin(params);
return createFooter();
}).then(function (footer) {
params.getElement().appendChild(footer);
return result.init();
}).then(function () {
return result;
if (configuration !== undefined) {
params.setConfiguration(configuration);
result = new Admin(params);
return createFooter().then(function (footer) {
params.getElement().appendChild(footer);
return result.init();
}).then(function () {
return result;
});
}
});
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment