Commit 32037c04 authored by Remi Rampin's avatar Remi Rampin

Convert logins to lowercase

parent 9a0b3eff
......@@ -1197,7 +1197,7 @@ function showMembers() {
document.getElementById('members-add').addEventListener('submit', function(e) {
e.preventDefault();
var login = document.getElementById('member-add-name').value;
var login = document.getElementById('member-add-name').value.toLowerCase();
if(!login) { return; }
var privileges = document.getElementById('member-add-privileges').value;
......
......@@ -49,7 +49,11 @@ class CheckUser(BaseHandler):
if not self.application.config['MULTIUSER']:
raise HTTPError(404)
login = self.get_json()['login']
if validate.user_login(login):
try:
login = validate.user_login(login)
except validate.InvalidFormat:
pass
else:
user = self.db.query(database.User).get(login)
if user is not None:
return self.send_json({'exists': True})
......
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