Commit 2dffc17a authored by Piotr Gawron's avatar Piotr Gawron
Browse files

login is properly escaped

parent 49b185da
......@@ -5,6 +5,8 @@ minerva (12.2.2) stable; urgency=medium
ordered overlays (#777)
* Bug fix: chemical search didn't use updated disease identifier, original
disease id from project upload was used instead (#779)
* Bug fix: user login with special characters (like '@') could cause
problems in admin panel (#780)
minerva (12.2.1) stable; urgency=medium
* Bug fix: export of reaction colorsi in SBML is properly encoded (COPASI can
......
......@@ -1017,8 +1017,6 @@ EditProjectDialog.prototype.saveOverlay = function (overlayId) {
overlay.setCreator(creator);
overlay.setOrder(order);
}
console.log("output");
console.log(overlay);
return self.getServerConnector().updateOverlay(overlay);
};
......
......@@ -299,7 +299,7 @@ UsersAdminPanel.prototype.addUpdateListener = function (user, dataTableRow) {
}
}
var listener = function () {
var login = user.getLogin().replace(".", "\\.");
var login = $.escapeSelector(user.getLogin());
self.userToTableRow(user, dataTableRow);
var row = $($("[name='usersTable']", self.getElement())[0]).DataTable().row("#" + login);
if (row.length > 0) {
......
......@@ -102,6 +102,18 @@ describe('UsersAdminPanel', function () {
});
});
it('onUpdateUserListener', function () {
helper.loginAsAdmin();
var usersTab = createUserAdminPanel();
return usersTab.init().then(function () {
var user = helper.createUser();
user.setLogin("x@y.lu");
var data = [];
usersTab.addUpdateListener(user, data);
user.callListeners("onreload");
assert.ok(data.indexOf("x@y.lu") >= 0);
return usersTab.destroy();
});
});
})
;
});
Markdown is supported
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