doLogin, fix sql, improve user