diff --git a/hydro/handler/home.js b/hydro/handler/home.js index af14de74..7e74332b 100644 --- a/hydro/handler/home.js +++ b/hydro/handler/home.js @@ -109,7 +109,7 @@ class HomeSecurityHandler extends Handler { if (geoip) session.updateGeoip = geoip.lookup(session.updateIp || session.createIp); } this.response.template = 'home_security.html'; - this.response.body = { sessions: parsed }; + this.response.body = { sessions: parsed, geoipProvider: (geoip || {}).provider }; } async postChangePassword({ current, password, verifyPassword }) { diff --git a/hydro/model/contest.js b/hydro/model/contest.js index 1ec98af4..a5e8beab 100644 --- a/hydro/model/contest.js +++ b/hydro/model/contest.js @@ -365,7 +365,7 @@ function count(domainId, query, type = document.TYPE_CONTEST) { } function getMulti(domainId, query = {}, type = document.TYPE_CONTEST) { - return document.getMulti(domainId, type, query); + return document.getMulti(domainId, type, query).sort('beginAt', -1); } function _getStatusJournal(tsdoc) { diff --git a/templates/home_security.html b/templates/home_security.html index 67ebf432..3aca6a9c 100644 --- a/templates/home_security.html +++ b/templates/home_security.html @@ -21,7 +21,7 @@ label:'Current Email', columns:10, name:'currentEmail', - value:this.user.email, + value:handler.user.mail, disabled:true }) }} {{ form.form_text({ @@ -123,9 +123,11 @@ + {% if geoipProvider %}
-

IP geo-location data is provided by MaxMind.

+

IP geo-location data is provided by {{ geoipProvider|safe }}.

+ {% endif %}