mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-27 15:04:36 +00:00
Fix status returned to banned user.
This commit is contained in:
parent
6f14b34470
commit
651bf4f9aa
@ -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_;
|
||||
}
|
||||
|
||||
|
@ -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.") {
|
||||
|
Loading…
x
Reference in New Issue
Block a user