diff --git a/src/Icons/qbittorrent.png b/src/Icons/qbittorrent.png new file mode 100644 index 000000000..7d95a1a2f Binary files /dev/null and b/src/Icons/qbittorrent.png differ diff --git a/src/icons.qrc b/src/icons.qrc index e338bd2f7..6a167c293 100644 --- a/src/icons.qrc +++ b/src/icons.qrc @@ -1,5 +1,6 @@ + Icons/qbittorrent.png Icons/3-state-checkbox.gif Icons/L.gif Icons/loading.png diff --git a/src/webui/abstractrequesthandler.cpp b/src/webui/abstractrequesthandler.cpp index 8e6d97d19..fc9479100 100644 --- a/src/webui/abstractrequesthandler.cpp +++ b/src/webui/abstractrequesthandler.cpp @@ -38,22 +38,25 @@ AbstractRequestHandler::AbstractRequestHandler(const HttpRequest &request, const HttpEnvironment &env, WebApplication *app) : app_(app), session_(0), request_(request), env_(env) { - if (isBanned()) - { - status(403, "Forbidden"); - print(QObject::tr("Your IP address has been banned after too many failed authentication attempts.")); - return; - } - sessionInitialize(); - - if (!sessionActive() && !isAuthNeeded()) sessionStart(); + if (!sessionActive() && !isAuthNeeded()) + sessionStart(); } HttpResponse AbstractRequestHandler::run() { response_ = HttpResponse(); - processRequest(); + + if (isBanned()) + { + status(403, "Forbidden"); + print(QObject::tr("Your IP address has been banned after too many failed authentication attempts.")); + } + else + { + processRequest(); + } + return response_; } diff --git a/src/webui/www/private/login.html b/src/webui/www/private/login.html index e59fd2441..ed25e261b 100644 --- a/src/webui/www/private/login.html +++ b/src/webui/www/private/login.html @@ -20,8 +20,15 @@ url: '/login', method: 'post', data: $('loginform').toQueryString(), - onFailure: function() { - alert("_(Unable to log in, qBittorrent is probably unreachable.)"); + onComplete: function() { + $('password').set('value', ''); + }, + onFailure: function(xhr) { + if (xhr.responseText != "") { + $('error_msg').set('html', xhr.responseText); + } else { + $('error_msg').set('html', '_(Unable to log in, qBittorrent is probably unreachable.)'); + } }, onSuccess: function(text) { if (text == "Ok.") { @@ -61,7 +68,7 @@

_(qBittorrent web User Interface)