Merge pull request #7 from allerta-vvf/patch-custom_image

Custom access denied image
This commit is contained in:
MatteoGheza 2020-05-02 14:44:45 +02:00 committed by GitHub
commit 5e1e069818
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 12 additions and 5 deletions

View File

@ -37,4 +37,7 @@ define( 'TECHNICAL_SUPPORT_KEY', '' );
define( 'DISTACCAMENTO', 'Distaccamento' );
/* Do you want to use a custom error message? (filename: custom-error.mp3) */
define( 'USE_CUSTOM_ERROR_SOUND', false );
define( 'USE_CUSTOM_ERROR_SOUND', false );
/* Do you want to use a custom error message? (filename: custom-error.gif) */
define( 'USE_CUSTOM_ERROR_IMAGE', false );

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

View File

@ -16,7 +16,7 @@ var sound = new Howl({
sound.play();
</script>
Possibile attività di hacking del software rilevata
<img src='{{ urlsoftware }}/risorse/images/nonono.gif'></img>
<img src='{{ urlsoftware }}/risorse/images/{{ error_image }}'></img>
</div>
<h1>Abbiamo rilevato un' attività sospetta provenire dal tuo dispositivo o dalla tua rete.<br>Se non stavi facendo niente di brutto, e ritieni che questo sia un errore, la<br>preghiamo di contattare l'assistenza.</h1>
</body>

View File

@ -16,18 +16,17 @@ var sound = new Howl({
}
});
sound.play();
//var myVar = setInterval(function(){ sound.play(); }, 10000);
</script>
<script>
$("#err").delay(5000).fadeOut(300);
</script>
{{ errore.spiegazione }}
<img src='{{ urlsoftware }}/risorse/images/nonono.gif'></img>
<img src='{{ urlsoftware }}/risorse/images/{{ error_image }}'></img>
</div>
{% endif %}
<div class="container text-center" id="modulogin">
<form method="post">
<img alt="VVF" src="{{ urlsoftware }}/risorse/images/logo.jpg" class="img-resposive"><br><br><br>
<img alt="VVF" src="{{ urlsoftware }}/risorse/images/{{ error_image }}" class="img-resposive"><br><br><br>
<input type="text" name="nome" placeholder="Nome" required autocomplete="username" autofocus><br><br>
<input type="password" name="password" placeholder="Password" required autocomplete="current-password"><br><br>
<input type="checkbox" name="connesso" value='1' id="connesso" hidden checked><label hidden for='connesso'>Rimani Connesso</label><br>

View File

@ -27,6 +27,11 @@ function loadtemplate($templatename, $data, $richiedilogin=true){
} else {
$data['error_sound'] = "error.mp3";
}
if(USE_CUSTOM_ERROR_IMAGE){
$data['error_image'] = "custom-error.gif";
} else {
$data['error_image'] = "error.gif";
}
$template = $twig->load($templatename);
echo $template->render($data);
}