refactoring
This commit is contained in:
parent
cc5b18abc9
commit
8b0ad29532
|
@ -499,4 +499,6 @@ composer.phar
|
|||
|
||||
config.php
|
||||
|
||||
*password*
|
||||
*password*
|
||||
|
||||
custom-*.*
|
|
@ -34,4 +34,7 @@ define( 'ENABLE_TECHNICAL_SUPPORT', true );
|
|||
define( 'TECHNICAL_SUPPORT_KEY', '7e1d39b8d1a7e234c56a2da730e9ce5b95508dbc' );
|
||||
|
||||
/* Insert your organization name */
|
||||
define( 'DISTACCAMENTO', 'Assoc VVF Vol Darfo' );
|
||||
define( 'DISTACCAMENTO', 'Assoc VVF Vol Darfo' );
|
||||
|
||||
/* Do you want to use a custom error message? (filename: custom-error.mp3) */
|
||||
define( 'USE_CUSTOM_ERROR_SOUND', false );
|
|
@ -22,6 +22,11 @@ function loadtemplate($templatename, $data, $richiedilogin=true){
|
|||
$data['enable_technical_support'] = ENABLE_TECHNICAL_SUPPORT;
|
||||
$data['technical_support_key'] = TECHNICAL_SUPPORT_KEY;
|
||||
$data['technical_support_open'] = isset($_COOKIE["chat"]);
|
||||
if(USE_CUSTOM_ERROR_SOUND){
|
||||
$data['error_sound'] = "custom-error.mp3";
|
||||
} else {
|
||||
$data['error_sound'] = "error.mp3";
|
||||
}
|
||||
$template = $twig->load($templatename);
|
||||
echo $template->render($data);
|
||||
}
|
||||
|
|
137
server/index.php
137
server/index.php
|
@ -13,139 +13,4 @@ if(isset($_POST['nome']) & isset($_POST['password'])){
|
|||
$errore = $login;
|
||||
}
|
||||
}
|
||||
loadtemplate('index.html', ['errore' => $errore, 'titolo' => 'Login', 'distaccamento' => 'VVF Darfo', 'urlsoftware' => '', 'utente' => $utente->info(false)], false);
|
||||
/*
|
||||
if(isset($_SESSION['accesso'])){
|
||||
if($_SESSION['accesso'] == "loggato"){
|
||||
if($_SESSION['admin'] == 1){
|
||||
$tools->redirect("lista_admin.php");
|
||||
} else {
|
||||
$tools->redirect("lista.php");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['nome']) & isset($_POST['password'])){
|
||||
$nome = $_POST['nome'];
|
||||
$password = md5($_POST['password']);
|
||||
$sql = "SELECT * FROM vigili WHERE nome='$nome' AND password='$password';";
|
||||
if ($result=mysqli_query($connessione, $sql))
|
||||
{
|
||||
// Return the number of rows in result set
|
||||
$rowcount=mysqli_num_rows($result);
|
||||
if($rowcount > 0){
|
||||
$_SESSION['accesso'] = "loggato";
|
||||
while ($row = mysqli_fetch_array($result)){
|
||||
$_SESSION['admin'] = $row['caposquadra'];
|
||||
$_SESSION['nome'] = $row['nome'];
|
||||
}
|
||||
$connesso = isset($_POST['connesso']) ? $_POST['connesso'] : '0';
|
||||
if($connesso == 1){
|
||||
$cookie = bin2hex(implode("-", array($_SESSION['admin'], $_SESSION['nome'])));
|
||||
//$cookie = "ciao";
|
||||
setcookie("l53o453g35i34434n", $cookie, time() + 108000);
|
||||
}
|
||||
if($_SESSION['admin'] == 1){
|
||||
$tools->redirect("lista_admin.php");
|
||||
|
||||
} else {
|
||||
$tools->redirect("lista.php");
|
||||
}
|
||||
} else {
|
||||
$err = <<<HTML
|
||||
<div class='text-center' id="err">
|
||||
<script>
|
||||
var sound = new Howl({
|
||||
src: ['non_hai_detto_la_parola_magica.mp3'],
|
||||
autoplay: true,
|
||||
volume: 0.9,
|
||||
onend: function() {
|
||||
console.log('Finito');
|
||||
}
|
||||
});
|
||||
sound.play();
|
||||
//var myVar = setInterval(function(){ sound.play(); }, 10000);
|
||||
</script>
|
||||
<script>
|
||||
$("#err").delay(5000).fadeOut(300);
|
||||
</script>
|
||||
Password non valida
|
||||
<img src='./images/nonono.gif'></img>
|
||||
</div>
|
||||
HTML;
|
||||
}
|
||||
// Free result set
|
||||
mysqli_free_result($result);
|
||||
}
|
||||
} else if(isset($_COOKIE['l53o453g35i34434n'])){
|
||||
$cookie = pack("H*",$_COOKIE['l53o453g35i34434n']);
|
||||
$cookie = explode("-", $cookie);
|
||||
if(is_array($cookie)){
|
||||
$_SESSION['accesso'] = "loggato";
|
||||
$_SESSION['admin'] = $cookie[0];
|
||||
$_SESSION['nome'] = $cookie[1];
|
||||
if($_SESSION['admin'] == 1){
|
||||
redirect("lista_admin.php");
|
||||
} else {
|
||||
redirect("lista.php");
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="it">
|
||||
<head>
|
||||
<?php head(); ?>
|
||||
|
||||
<style>
|
||||
center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#modulogin {
|
||||
|
||||
margin-top: 60px;
|
||||
padding: 30px 0 30px 0;
|
||||
width: 90%;
|
||||
height: auto;
|
||||
background: #fafafa;
|
||||
border-radius: 15px;
|
||||
box-shadow: 0px 0px 10px rgba(0,0,0,0.5);
|
||||
}
|
||||
|
||||
input::placeholder {
|
||||
|
||||
color: lightgray;
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php $tools->body() ?>
|
||||
<?php if(!is_null($err)) echo $err; ?>
|
||||
<div class="container text-center" id="modulogin">
|
||||
<form method="post">
|
||||
|
||||
<img alt="VVF" src="./risorse/images/logo.jpg" class="img-resposive"><br><br><br>
|
||||
<input type="text" name="nome" placeholder="Nome" required><br><br>
|
||||
<input type="password" name="password" placeholder="Password" required><br><br>
|
||||
<input type="checkbox" name="connesso" value='1' id="connesso" checked><label for='connesso'>Rimani Connesso</label><br>
|
||||
<input type="submit" name="login" class="btn btn-lg btn-success" value="Accedi">
|
||||
</form>
|
||||
</div>
|
||||
<br>
|
||||
<div id="panico" style='display: none' class="text-center"><i class="fa fa-exclamation-triangle"></i><br>
|
||||
<p>Se hai premuto “Accedi” ma non è successo niente premi <a href=lista_admin.php>qui (admin)</a> o <a href=lista.php>qui (non-admin)</a></p></div>
|
||||
<br><br>
|
||||
<a hidden class="text-center" href="https://www.abuseipdb.com/user/30576" title="AbuseIPDB is an IP address blacklist for webmasters and sysadmins to report IP addresses engaging in abusive behavior on their networks" alt="AbuseIPDB Contributor Badge">
|
||||
<img class="text-center" src="https://www.abuseipdb.com/contributor/30576.svg" style="width: 376px;">
|
||||
</a>
|
||||
<?php
|
||||
//debug
|
||||
//print_r($_SESSION);
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
*/
|
||||
loadtemplate('index.html', ['errore' => $errore, 'titolo' => 'Login', 'distaccamento' => 'VVF Darfo', 'urlsoftware' => '', 'utente' => $utente->info(false)], false);
|
|
@ -6,7 +6,7 @@
|
|||
<div class='text-center' id="err">
|
||||
<script>
|
||||
var sound = new Howl({
|
||||
src: ['risorse/musiche/non_hai_detto_la_parola_magica.mp3'],
|
||||
src: ['risorse/musiche/error.mp3'],
|
||||
autoplay: true,
|
||||
volume: 0.9,
|
||||
onend: function() {
|
||||
|
@ -14,10 +14,6 @@ var sound = new Howl({
|
|||
}
|
||||
});
|
||||
sound.play();
|
||||
//var myVar = setInterval(function(){ sound.play(); }, 10000);
|
||||
</script>
|
||||
<script>
|
||||
//$("#err").delay(5000).fadeOut(300);
|
||||
</script>
|
||||
Possibile attività di hacking del software rilevata
|
||||
<img src='./risorse/images/nonono.gif'></img>
|
||||
|
|
|
@ -1,52 +0,0 @@
|
|||
{
|
||||
"name": "Allerta Vvf Volontari DARFO",
|
||||
"short_name": "Allerta",
|
||||
"theme_color": "#ff0000",
|
||||
"background_color": "#4181b4",
|
||||
"display": "standalone",
|
||||
"Scope": "/",
|
||||
"start_url": "/?utm_source=a2hs",
|
||||
"icons": [
|
||||
{
|
||||
"src": "images/icons/icon-72x72.png",
|
||||
"sizes": "72x72",
|
||||
"type": "image/png"
|
||||
},
|
||||
{
|
||||
"src": "images/icons/icon-96x96.png",
|
||||
"sizes": "96x96",
|
||||
"type": "image/png"
|
||||
},
|
||||
{
|
||||
"src": "images/icons/icon-128x128.png",
|
||||
"sizes": "128x128",
|
||||
"type": "image/png"
|
||||
},
|
||||
{
|
||||
"src": "images/icons/icon-144x144.png",
|
||||
"sizes": "144x144",
|
||||
"type": "image/png"
|
||||
},
|
||||
{
|
||||
"src": "images/icons/icon-152x152.png",
|
||||
"sizes": "152x152",
|
||||
"type": "image/png"
|
||||
},
|
||||
{
|
||||
"src": "images/icons/icon-192x192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png"
|
||||
},
|
||||
{
|
||||
"src": "images/icons/icon-384x384.png",
|
||||
"sizes": "384x384",
|
||||
"type": "image/png"
|
||||
},
|
||||
{
|
||||
"src": "images/icons/icon-512x512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png"
|
||||
}
|
||||
],
|
||||
"splash_pages": null
|
||||
}
|
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
|
@ -8,7 +8,7 @@
|
|||
<div class='text-center' id="err">
|
||||
<script>
|
||||
var sound = new Howl({
|
||||
src: ['./risorse/musiche/non_hai_detto_la_parola_magica.mp3'],
|
||||
src: ['{{ urlsoftware }}/risorse/musiche/{{ error_sound }}'],
|
||||
autoplay: true,
|
||||
volume: 0.9,
|
||||
onend: function() {
|
||||
|
@ -22,26 +22,17 @@ sound.play();
|
|||
$("#err").delay(5000).fadeOut(300);
|
||||
</script>
|
||||
{{ errore.spiegazione }}
|
||||
<img src='./risorse/images/nonono.gif'></img>
|
||||
<img src='{{ urlsoftware }}/risorse/images/nonono.gif'></img>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="container text-center" id="modulogin">
|
||||
<form method="post">
|
||||
<img alt="VVF" src="./risorse/images/logo.jpg" class="img-resposive"><br><br><br>
|
||||
<img alt="VVF" src="{{ urlsoftware }}/risorse/images/logo.jpg" class="img-resposive"><br><br><br>
|
||||
<input type="text" name="nome" placeholder="Nome" required autocomplete="username"><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>
|
||||
<input type="submit" name="login" class="btn btn-lg btn-success" value="Accedi">
|
||||
</form>
|
||||
</div>
|
||||
<br>
|
||||
<div id="panico" style='display: none' class="text-center"><i class="fa fa-exclamation-triangle"></i><br>
|
||||
<p>Se hai premuto “Accedi” ma non è successo niente premi <a href=lista_admin.php>qui (admin)</a> o <a href=lista.php>qui (non-admin)</a></p>
|
||||
</div>
|
||||
<br><br>
|
||||
<a hidden class="text-center" href="https://www.abuseipdb.com/user/30576" title="AbuseIPDB is an IP address blacklist for webmasters and sysadmins to report IP addresses engaging in abusive behavior on their networks"
|
||||
alt="AbuseIPDB Contributor Badge">
|
||||
<img class="text-center" src="https://www.abuseipdb.com/contributor/30576.svg" style="width: 376px;">
|
||||
</a>
|
||||
<br>
|
||||
{% endblock %}
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
.checkbox .cr {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
border: 1px solid #a9a9a9;
|
||||
border-radius: .25em;
|
||||
width: 1.3em;
|
||||
|
|
Loading…
Reference in New Issue