2016-04-04 09:47:17 +00:00
|
|
|
<?php define('__ROOT__', dirname(dirname(__FILE__)) );
|
|
|
|
require_once __ROOT__.'/manager/autoloader.php';
|
2016-04-10 14:40:49 +00:00
|
|
|
use \manager\Repo;
|
2016-04-04 09:47:17 +00:00
|
|
|
use \manager\ModuleRequest;
|
|
|
|
use \manager\ManagerError;
|
|
|
|
use \manager\ResourceDispatcher;
|
2016-04-10 15:01:44 +00:00
|
|
|
use \manager\Database;
|
2016-04-10 14:40:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* [1] On recupere les tokens
|
|
|
|
=========================================================*/
|
|
|
|
$req_tokens = new Repo('token/getAll');
|
|
|
|
$tokens = $req_tokens->answer();
|
|
|
|
|
2016-04-04 09:47:17 +00:00
|
|
|
?>
|
|
|
|
|
|
|
|
|
2016-04-10 16:27:38 +00:00
|
|
|
<section data-sublink='tokens'>
|
2016-04-10 13:33:36 +00:00
|
|
|
|
2016-04-10 16:27:38 +00:00
|
|
|
<h6 class='center'>Gestion des TOKENS</h6><br>
|
2016-04-10 13:33:36 +00:00
|
|
|
|
|
|
|
<!-- [1] Panel d'ajout/suppression de token -->
|
|
|
|
<section data-panel-list>
|
|
|
|
<!-- Header -->
|
|
|
|
<div data-header>
|
|
|
|
<span>Gestion des accès distants</span>
|
2016-04-10 16:27:38 +00:00
|
|
|
<button id='add-token'>Ajouter un accès</button>
|
2016-04-10 13:33:36 +00:00
|
|
|
</div>
|
|
|
|
|
2016-04-10 16:50:07 +00:00
|
|
|
<!-- Description des tokens actifs -->
|
2016-04-11 10:20:34 +00:00
|
|
|
<div data-description>Liste des accès distants actifs. Ils seront automatiquement désactivés a la date d'expiration. Veuillez toutefois les supprimer.</div>
|
|
|
|
<!-- Creation d'un nouvel element (cache) -->
|
|
|
|
<div data-add>
|
|
|
|
<label for='add-name'>Nom de l'accès</label><br><input type='text' placeholder='token' id='add-name'><br>
|
|
|
|
<label for='add-duration'>Duree de vie (jours)</label><br><input type='text' value='10' id='add-duration'><br>
|
|
|
|
<input type='button' value='Ajouter un accès' id='add-submit'>
|
|
|
|
</div>
|
2016-04-10 13:33:36 +00:00
|
|
|
|
|
|
|
<!-- Conteneur de la liste des elements -->
|
|
|
|
<ul data-list>
|
|
|
|
|
2016-04-10 14:40:49 +00:00
|
|
|
<!-- Elements de la liste -->
|
|
|
|
<?php
|
|
|
|
foreach($tokens as $token){
|
|
|
|
echo "<li data-element data-id='".$token['id']."'>";
|
2016-04-10 16:50:07 +00:00
|
|
|
// Si token actif
|
|
|
|
if( !$token['expired'] )
|
|
|
|
echo "<div class='active'><span>actif</span></div>";
|
|
|
|
else
|
|
|
|
echo "<div><span>Expiré</span></div>";
|
|
|
|
|
|
|
|
|
2016-04-10 14:40:49 +00:00
|
|
|
echo "<div>";
|
|
|
|
echo "<span>".$token['name']."</span>";
|
2016-04-10 15:01:44 +00:00
|
|
|
echo "<span data-prefix='Expiration'>".Database::frDate($token['expires'])."</span>";
|
|
|
|
echo "<span data-prefix='Token'>".$token['token']."</span>";
|
2016-04-10 14:40:49 +00:00
|
|
|
echo "</div>";
|
2016-04-10 16:50:07 +00:00
|
|
|
|
2016-04-10 16:27:38 +00:00
|
|
|
echo "<button class='remove-token'>Supprimer</button>";
|
2016-04-10 14:40:49 +00:00
|
|
|
echo "</li>";
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
|
2016-04-10 13:33:36 +00:00
|
|
|
|
2016-04-10 16:27:38 +00:00
|
|
|
|
2016-04-10 13:33:36 +00:00
|
|
|
</ul>
|
2016-04-10 16:27:38 +00:00
|
|
|
|
2016-04-10 13:33:36 +00:00
|
|
|
</section>
|
2016-04-10 11:20:37 +00:00
|
|
|
</section>
|
|
|
|
|
|
|
|
<section data-sublink='users'>
|
|
|
|
Gestion des utilisateurs
|
|
|
|
</section>
|