mirror of
https://github.com/rejetto/hfs2.git
synced 2025-12-19 10:03:56 +01:00
tpl: warn the user if the current credentials are not enough
This commit is contained in:
parent
ad33cbf263
commit
64b3f5b906
22
default.tpl
22
default.tpl
@ -849,14 +849,20 @@ function selectionMask() {
|
|||||||
function showLogin(options) {
|
function showLogin(options) {
|
||||||
if (!HFS.sid) // the session was just deleted
|
if (!HFS.sid) // the session was just deleted
|
||||||
return location.reload() // but it's necessary for login
|
return location.reload() // but it's necessary for login
|
||||||
var d = dialog('\
|
var d = dialog(`
|
||||||
<form style="line-height:1.9em">\
|
<form style="line-height:1.9em">
|
||||||
Username\
|
{.!Username.}
|
||||||
<br><input name=usr />\
|
<br><input name=usr />
|
||||||
<br>Password\
|
<br>{.!Password.}
|
||||||
<br><input name=pwd type=password />\
|
<br><input name=pwd type=password />
|
||||||
<br><br><button type=submit>Login</button>\
|
<br><br><button type=submit>{.!Login.}</button>
|
||||||
</form>', options)
|
</form>`, options)
|
||||||
|
|
||||||
|
if (HFS.user)
|
||||||
|
d.find('form').prepend(`<div style='border-bottom:1px solid #888; margin-bottom:1em; padding-bottom:1em;'>
|
||||||
|
The current account (${HFS.user}) has no access to this resource.
|
||||||
|
<br>Please enter different credentials.
|
||||||
|
</div>`)
|
||||||
|
|
||||||
d.find('form').submit(function(){
|
d.find('form').submit(function(){
|
||||||
var vals = d.find('[name]').get().map(x=> x.value.trim())
|
var vals = d.find('[name]').get().map(x=> x.value.trim())
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user