New file |
0,0 → 1,131 |
<html lang="fr"> |
<head> |
<title>Chorodep</title> |
<meta charset="utf-8"> |
|
<meta name="revisit-after" content="15 days" /> |
<meta name="robots" content="index,follow" /> |
<meta name="keywords" content="Tela Botanica, eFlore, chorodep" /> |
<meta name="description" content="eFlore - Widget de saisie pour Chorologie départementale" /> |
<style></style> |
<script src="http://www.tela-botanica.org/commun/jquery/1.9.1/jquery-1.9.1.min.js"></script> |
|
<script type="text/javascript"> |
$(document).ready(function() { |
chargerStatutSSO("https://www.tela-botanica.org/service:annuaire:auth"); |
}); |
/** |
* Interroge le SSO pour connaître le statut de l'utilisateur, et change le menu |
* Ã droite de la barre en fonction |
*/ |
function chargerStatutSSO(urlBaseAuth) { |
var urlAuth = urlBaseAuth + '/identite'; |
$.ajax({ |
url: urlAuth, |
type: "GET", |
dataType: 'json', |
xhrFields: { |
withCredentials: true |
} |
}).done(function(data) { |
// connecté |
definirUtilisateur(data.token); |
}); |
} |
|
function definirUtilisateur(jeton) { |
var nomComplet = ''; |
if (jeton != undefined) { |
// décodage jeton |
var jetonDecode = decoderJeton(jeton); |
nomComplet = jetonDecode.intitule; |
} |
// affichage |
$('#bouton-connexion').hide(); |
$('#utilisateur-connecte').show(); |
$('#nom-complet').html(nomComplet); |
} |
|
/** |
* Décodage à l'arrache d'un jeton JWT, ATTENTION CONSIDERE QUE LE |
* JETON EST VALIDE, ne pas décoder n'importe quoi - pas trouvé de lib simple |
* Si pb de cross-browser, tenter ceci : https://code.google.com/p/javascriptbase64/ |
* ou ceci : https://code.google.com/p/crypto-js |
*/ |
function decoderJeton(jeton) { |
parts = jeton.split('.'); |
payload = parts[1]; |
payload = atob(payload); |
payload = JSON.parse(payload, true); |
|
return payload; |
}</script> |
<!-- CSS --> |
<link rel="stylesheet" href="http://resources.tela-botanica.org/bootstrap/3.2.0/css/bootstrap.min.css" /> |
<link rel="stylesheet" href="http://resources.tela-botanica.org/bootstrap/3.2.0/css/bootstrap-theme.min.css" /> |
|
</head> |
<body> |
<ul class="nav navbar-nav navbar-right"> |
<li id="bouton-connexion" class="dropdown"> |
<a href="http://www.tela-botanica.org/widget:reseau:auth?origine=http://localhost/eflore-consultation/widget/chorodep/">Connexion</a> |
</li> |
<li class="dropdown" id="utilisateur-connecte" style="display: none;"> |
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><span id="nom-complet"></span> <b class="caret"></b></a> |
<ul class="dropdown-menu"> |
<li id="profil-utilisateur"><a href="http://www.tela-botanica.org/inscription">Mon profil</a></li> |
<li id="deconnexion"><a href="http://www.tela-botanica.org/widget:reseau:auth?action=deconnexion&origine=http://localhost/eflore-consultation/widget/chorodep/">Déconnexion</a></li> |
</ul> |
</li> |
</ul> |
|
|
<form class="" id="valid" name="valid" action="../Chorodep/validation" method="get"> |
<div class="panel panel-default"> |
<!-- Default panel contents --> |
<div class="panel-heading">Propositions à valider</div> |
<div class="panel-body"> |
Propositions de présence d'une espèce dans un département à valider pour intégration à la base Chorodep. |
</div> |
<!-- Table --> |
<table class="table"> |
<thead> |
<tr> |
<th>#</th> |
<th>Auteur</th> |
<th>Espece</th> |
<th>Département</th> |
<th>Statut</th> |
<th>Sources</th> |
<th>Notes</th> |
<th>Provenance</th> |
<th>Date proposition</th> |
<th>Accepter</th> |
<th>Supprimer</th> |
</tr> |
</thead> |
<tbody> |
<?php foreach ($liste_prop as $prop) { ?> |
<tr> |
<th scope="row"><?=$prop['id'];?></th> |
<td><?=$prop['auteur_courriel'];?></td> |
<td><?=$prop['nom_sci'];?></td> |
<td><?=$prop['dept'];?></td> |
<td><?=$prop['statut'];?></td> |
<td><?=$prop['source'];?></td> |
<td><?=$prop['notes'];?></td> |
<td><?=$prop['provenance'];?></td> |
<td><?=$prop['date_creation'];?></td> |
<td><input type="radio" name="<?=$prop['id'];?>" value="1" id="accepter" <?= isset($prop['validation']) && $prop['validation'] == 1 ? "checked='checked'": "";?> /></td> |
<td><input type="radio" name="<?=$prop['id'];?>" value="0" id="refuser" <?= isset($prop['validation']) && $prop['validation'] == 0 ? "checked='checked'": "";?> /></td> |
</tr> |
<?php } ?> |
</tbody> |
</table> |
</div> |
<input type="submit" name="envoyer" id="valider" value="Valider" style="position:relative;left:87%;"/> |
</form> |
|
</body> |
</html> |
|