|
|
@@ -10,41 +10,114 @@ |
|
|
|
<link rel="stylesheet" href="bootstrap.css" media="screen"> |
|
|
|
</head> |
|
|
|
|
|
|
|
<?php |
|
|
|
if (isset($_POST['password']) && $_POST['password'] == 'ogg') { |
|
|
|
|
|
|
|
$message[0]=' |
|
|
|
<hr/> |
|
|
|
<div class="alert alert-dismissible alert-danger"> |
|
|
|
<button type="button" class="close" data-dismiss="alert">×</button> |
|
|
|
<h4>Erreur !</h4> |
|
|
|
<p>Houston, nous avons un petit problème ...</p> |
|
|
|
</div> |
|
|
|
'; |
|
|
|
$message[1]=' |
|
|
|
<hr/> |
|
|
|
<div class="alert alert-dismissible alert-primary"> |
|
|
|
<button type="button" class="close" data-dismiss="alert">×</button> |
|
|
|
<h4>YOU SHALL NOT PASS !</h4> |
|
|
|
<p>La porte est ouverte ! ✌️</p> |
|
|
|
</div> |
|
|
|
'; |
|
|
|
$message[2]=' |
|
|
|
<hr/> |
|
|
|
<div class="alert alert-dismissible alert-success"> |
|
|
|
<button type="button" class="close" data-dismiss="alert">×</button> |
|
|
|
<h4>SUCCESS !</h4> |
|
|
|
<p>👍</p> |
|
|
|
</div> |
|
|
|
'; |
|
|
|
|
|
|
|
if ($_GET["action"] == "test") |
|
|
|
{ |
|
|
|
$test = exec("/bin/bash ../scripts/test.sh"); |
|
|
|
echo "<pre>$test</pre>"; |
|
|
|
} |
|
|
|
|
|
|
|
elseif ($_GET["action"] == "open") |
|
|
|
{ |
|
|
|
exec("../scripts/open.sh"); |
|
|
|
} |
|
|
|
|
|
|
|
elseif ($_GET['action'] == "sound") |
|
|
|
{ |
|
|
|
exec("../scripts/sound.sh"); |
|
|
|
} |
|
|
|
|
|
|
|
elseif ($_GET['action'] == "mute") |
|
|
|
{ |
|
|
|
exec("../scripts/mute.sh"); |
|
|
|
} |
|
|
|
|
|
|
|
elseif ($_GET['action'] == "update") |
|
|
|
{ |
|
|
|
exec("../scripts/update.sh"); |
|
|
|
} |
|
|
|
|
|
|
|
elseif ($_GET['action'] == "reboot") |
|
|
|
{ |
|
|
|
exec("../scripts/reboot.sh"); |
|
|
|
} |
|
|
|
?> |
|
|
|
|
|
|
|
<body> |
|
|
|
<div class="container" style="text-align:center;"> |
|
|
|
<hr/> |
|
|
|
|
|
|
|
<?php echo $message[$_GET["msg"]]; ?> |
|
|
|
|
|
|
|
<hr/> |
|
|
|
<div class="page-header"> |
|
|
|
<div class="row"> |
|
|
|
<div class="col-lg-12"> |
|
|
|
<img src="../logo/allo-gg-logo.png" class="img-fluid" alt="Responsive image"> |
|
|
|
<a href="index.php"><img src="../logo/allo-gg-logo.png" class="img-fluid" alt="Responsive image"></a> |
|
|
|
<br/><br/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<h2 class="text-primary">Interface de contrôle du module</h2> |
|
|
|
<a href="index.php?action=test">Executer le script test.sh ✔️</a> |
|
|
|
<hr/> |
|
|
|
|
|
|
|
<div class="row"> |
|
|
|
<div class="col-lg-12"> |
|
|
|
<form action="actions.php" method="post"> |
|
|
|
<p class="bs-component"> |
|
|
|
<button type="submit" name="action" class="btn btn-primary btn-lg" id="OPEN">🚪 <strong>OUVERTURE DE LA PORTE</strong> 🔑</button> |
|
|
|
<a href="index.php?action=open&msg=1"> |
|
|
|
<button type="submit" name="action" class="btn btn-primary btn-lg" id="open">🚪 <strong>OUVERTURE DE LA PORTE</strong> 🔑</button> |
|
|
|
</a> |
|
|
|
</p> |
|
|
|
<hr/> |
|
|
|
<p class="bs-component"> |
|
|
|
<button type="submit" name="action" class="btn btn-outline-warning" id="MUTE">🔇 Éteindre la sonette 🔔</button> pour 1 Heure ... |
|
|
|
<a href="index.php?action=sound&msg=2"> |
|
|
|
<button type="submit" name="action" class="btn btn-outline-info" id="sound">🔊 Allumer la sonette 🔔</button> |
|
|
|
</a> |
|
|
|
|
|
|
|
<a href="index.php?action=mute&msg=2"> |
|
|
|
<button type="submit" name="action" class="btn btn-outline-warning" id="mute">🔇 Éteindre la sonette 🔔</button> |
|
|
|
</a> |
|
|
|
</p> |
|
|
|
<hr/> |
|
|
|
<p class="bs-component"> |
|
|
|
<button type="submit" name="action" name="actions" class="btn btn-outline-success" id="UPDATE">🔄 Mettre à jour le module 🔍</button> |
|
|
|
<a href="index.php?action=update&msg=2"> |
|
|
|
<button type="submit" name="action" name="actions" class="btn btn-outline-success" id="update">🔄 Mettre à jour le module 🔍</button> |
|
|
|
</a> |
|
|
|
</p> |
|
|
|
<hr/> |
|
|
|
<p class="bs-component"> |
|
|
|
<button type="submit" name="action" class="btn btn-outline-danger" id="REBOOT">⚡️ Redémarrer le module 🔌</button> |
|
|
|
<a href="index.php?action=reboot&msg=2"> |
|
|
|
<button type="submit" name="action" class="btn btn-outline-danger" id="reboot">⚡️ Redémarrer le module 🔌</button> |
|
|
|
</a> |
|
|
|
</p> |
|
|
|
</form> |
|
|
|
</div> |
|
|
|
<hr/> |
|
|
|
</div> |
|
|
@@ -56,3 +129,30 @@ |
|
|
|
|
|
|
|
</body> |
|
|
|
</html> |
|
|
|
|
|
|
|
<?php |
|
|
|
} |
|
|
|
else { |
|
|
|
echo ' |
|
|
|
<p class="text-muted"><em>🔓 La réponse pour mon Gégé :</em> <span class="badge badge-pill badge-secondary">ogg</span></p> |
|
|
|
<br/><br/><br/><br/> |
|
|
|
<div class="row"> |
|
|
|
<div class="col-lg-4"></div> |
|
|
|
<div class="col-lg-4"> |
|
|
|
<hr/> |
|
|
|
<form action="" method="post"> |
|
|
|
<div class="input-group"> |
|
|
|
<div class="input-group-prepend"> |
|
|
|
<span class="input-group-text">🔒</span> |
|
|
|
</div> |
|
|
|
<input class="form-control" name="password" placeholder="Mot de passe" type="password"> |
|
|
|
<button type="submit" class="btn btn-light">🔑 OK</button> |
|
|
|
</div> |
|
|
|
</form> |
|
|
|
<hr/> |
|
|
|
</div> |
|
|
|
<div class="col-lg-4"></div> |
|
|
|
</div> |
|
|
|
'; |
|
|
|
} |
|
|
|
?> |