mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-31 04:38:04 -06:00
Check WebUI username and password length. Closes #4191
This commit is contained in:
@@ -58,8 +58,6 @@ static const char *__TRANSLATIONS__[] = {
|
||||
QT_TRANSLATE_NOOP("HttpServer", "Language"),
|
||||
QT_TRANSLATE_NOOP("HttpServer", "The port used for incoming connections must be between 1 and 65535."),
|
||||
QT_TRANSLATE_NOOP("HttpServer", "The port used for the Web UI must be between 1 and 65535."),
|
||||
QT_TRANSLATE_NOOP("HttpServer", "The Web UI username must be at least 3 characters long."),
|
||||
QT_TRANSLATE_NOOP("HttpServer", "The Web UI password must be at least 3 characters long."),
|
||||
QT_TRANSLATE_NOOP("HttpServer", "Save"),
|
||||
QT_TRANSLATE_NOOP("HttpServer", "qBittorrent client is not reachable"),
|
||||
QT_TRANSLATE_NOOP("HttpServer", "HTTP Server"),
|
||||
|
||||
@@ -1239,14 +1239,13 @@ applyPreferences = function() {
|
||||
|
||||
// Authentication
|
||||
var web_ui_username = $('webui_username_text').getProperty('value');
|
||||
var web_ui_password = $('webui_password_text').getProperty('value');
|
||||
// Add some username/password length checking
|
||||
if(web_ui_username.length < 3) {
|
||||
alert("QBT_TR(The Web UI username must be at least 3 characters long.)QBT_TR");
|
||||
return;
|
||||
}
|
||||
if(web_ui_password.length < 3) {
|
||||
alert("QBT_TR(The Web UI password must be at least 3 characters long.)QBT_TR");
|
||||
var web_ui_password = $('webui_password_text').getProperty('value');
|
||||
if(web_ui_password.length < 6) {
|
||||
alert("QBT_TR(The Web UI password must be at least 6 characters long.)QBT_TR");
|
||||
return;
|
||||
}
|
||||
settings.set('web_ui_username', web_ui_username);
|
||||
|
||||
Reference in New Issue
Block a user