NxTIC/view/settings.php

69 lines
2.0 KiB
PHP
Executable File

<?php define('__ROOT__', dirname(dirname(__FILE__)) );
require_once __ROOT__.'/manager/autoloader.php';
use \manager\Repo;
use \manager\ModuleRequest;
use \manager\ManagerError;
use \manager\ResourceDispatcher;
use \manager\Database;
/* [1] On recupere les tokens
=========================================================*/
$req_tokens = new Repo('token/getAll');
$tokens = $req_tokens->answer();
?>
<section data-sublink='tokens'>
<h6 class='center'>Gestion des TOKENS</h6><br>
<!-- [1] Panel d'ajout/suppression de token -->
<section data-panel-list>
<!-- Header -->
<div data-header>
<span>Gestion des accès distants</span>
<button id='add-token'>Ajouter un accès</button>
</div>
<!-- Description -->
<div data-description>Liste des accès distants actifs. Ils seront automatiquement désactivés a la date d'expiration.</div>
<!-- Conteneur de la liste des elements -->
<ul data-list>
<!-- Elements de la liste -->
<?php
foreach($tokens as $token){
echo "<li data-element data-id='".$token['id']."'>";
echo "<div><span data-prefix='Type'>token</span></div>";
echo "<div>";
echo "<span>".$token['name']."</span>";
echo "<span data-prefix='Creation'>".Database::frDate($token['creation'])."</span>";
echo "<span data-prefix='Expiration'>".Database::frDate($token['expires'])."</span>";
echo "<span data-prefix='Token'>".$token['token']."</span>";
echo "</div>";
echo "<button class='remove-token'>Supprimer</button>";
echo "</li>";
}
?>
</ul>
<!-- 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' placeholder='110' id='add-duration'><br>
<input type='button' value='Ajouter un accès'>
</div>
</section>
</section>
<section data-sublink='users'>
Gestion des utilisateurs
</section>