mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-19 04:49:47 -07:00
Avoid leaking user locale preference to the web
This commit is contained in:
parent
3f2b4afc21
commit
66c34ddb6e
2 changed files with 8 additions and 8 deletions
|
@ -5,7 +5,7 @@
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="color-scheme" content="light dark" />
|
<meta name="color-scheme" content="light dark" />
|
||||||
<meta name="description" content="qBittorrent WebUI">
|
<meta name="description" content="qBittorrent WebUI">
|
||||||
<title>qBittorrent QBT_TR(WebUI)QBT_TR[CONTEXT=OptionsDialog]</title>
|
<title>qBittorrent WebUI</title>
|
||||||
<link rel="icon" type="image/png" href="images/qbittorrent32.png" />
|
<link rel="icon" type="image/png" href="images/qbittorrent32.png" />
|
||||||
<link rel="icon" type="image/svg+xml" href="images/qbittorrent-tray.svg" />
|
<link rel="icon" type="image/svg+xml" href="images/qbittorrent-tray.svg" />
|
||||||
<link rel="stylesheet" type="text/css" href="css/login.css?v=${CACHEID}" />
|
<link rel="stylesheet" type="text/css" href="css/login.css?v=${CACHEID}" />
|
||||||
|
@ -17,25 +17,25 @@
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<noscript id="noscript">
|
<noscript id="noscript">
|
||||||
<h1>QBT_TR(JavaScript Required! You must enable JavaScript for the WebUI to work properly)QBT_TR[CONTEXT=HttpServer]</h1>
|
<h1>JavaScript Required! You must enable JavaScript for the WebUI to work properly</h1>
|
||||||
</noscript>
|
</noscript>
|
||||||
<div id="main">
|
<div id="main">
|
||||||
<h1>qBittorrent QBT_TR(WebUI)QBT_TR[CONTEXT=OptionsDialog]</h1>
|
<h1>qBittorrent WebUI</h1>
|
||||||
<div id="logo" class="col">
|
<div id="logo" class="col">
|
||||||
<img src="images/qbittorrent-tray.svg" alt="qBittorrent logo" />
|
<img src="images/qbittorrent-tray.svg" alt="qBittorrent logo" />
|
||||||
</div>
|
</div>
|
||||||
<div id="formplace" class="col">
|
<div id="formplace" class="col">
|
||||||
<form id="loginform" method="post" onsubmit="submitLoginForm(event);">
|
<form id="loginform" method="post" onsubmit="submitLoginForm(event);">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<label for="username">QBT_TR(Username)QBT_TR[CONTEXT=HttpServer]</label><br />
|
<label for="username">Username</label><br />
|
||||||
<input type="text" id="username" name="username" autocomplete="username" required />
|
<input type="text" id="username" name="username" autocomplete="username" required />
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<label for="password">QBT_TR(Password)QBT_TR[CONTEXT=HttpServer]</label><br />
|
<label for="password">Password</label><br />
|
||||||
<input type="password" id="password" name="password" autocomplete="current-password" required />
|
<input type="password" id="password" name="password" autocomplete="current-password" required />
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<input type="submit" id="login" value="QBT_TR(Login)QBT_TR[CONTEXT=HttpServer]" />
|
<input type="submit" id="login" value="Login" />
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -45,13 +45,13 @@ function submitLoginForm(event) {
|
||||||
if ((xhr.status === 200) && (xhr.responseText === "Ok."))
|
if ((xhr.status === 200) && (xhr.responseText === "Ok."))
|
||||||
location.reload(true);
|
location.reload(true);
|
||||||
else
|
else
|
||||||
errorMsgElement.textContent = 'QBT_TR(Invalid Username or Password.)QBT_TR[CONTEXT=HttpServer]';
|
errorMsgElement.textContent = 'Invalid Username or Password.';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
xhr.addEventListener('error', function() {
|
xhr.addEventListener('error', function() {
|
||||||
errorMsgElement.textContent = (xhr.responseText !== "")
|
errorMsgElement.textContent = (xhr.responseText !== "")
|
||||||
? xhr.responseText
|
? xhr.responseText
|
||||||
: 'QBT_TR(Unable to log in, qBittorrent is probably unreachable.)QBT_TR[CONTEXT=HttpServer]';
|
: 'Unable to log in, qBittorrent is probably unreachable.';
|
||||||
});
|
});
|
||||||
|
|
||||||
const usernameElement = document.getElementById('username');
|
const usernameElement = document.getElementById('username');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue