Rev 322 | Blame | Compare with Previous | Last modification | View Log | RSS feed
<?php
//Inclusion du framework
require '../../framework/Framework.php';
// Ajout d'information concernant cette application
Framework::setCheminAppli(__FILE__);// Obligatoire
Framework::setInfoAppli(Config::get('info'));// Optionnel
$status = "";
if (isset($_POST['openid_action']) &&
$_POST['openid_action'] == "login" &&
!empty($_POST['openid_identifier'])) {
$consumer = new OpenIdClient();
if (!$consumer->login($_POST['openid_identifier'])) {
$status = "OpenID login failed.";
}
} else if (isset($_GET['openid_mode'])) {
if ($_GET['openid_mode'] == "id_res") {
$consumer = new OpenIdClient();
if ($consumer->verify($_GET, $id)) {
$status = "VALID " . htmlspecialchars($id);
} else {
$status = "INVALID " . htmlspecialchars($id);
}
} else if ($_GET['openid_mode'] == "cancel") {
$status = "CANCELLED";
}
}
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
<title>Client Open Id de Tela Botanica - Identification</title>
<meta name="DC.title" content="Client Open Id de Tela Botanica - Identification" />
<meta name="description" content="Client de l'application Open Id de Tela Botanica, Identification unique" />
<meta name="keywords" content="OpenId, identification automatique, Tela Botanica" />
<meta name="author" content="Grégoire Duché" />
</head>
<body>
<h1>Identification par OpenId</h1>
<?php echo "$status<br>" ?>
<p>Veuillez saisir les informations de connexion ci-dessous : </p>
<!-- TODO : ajouter action="" -->
<form name="identication" method="post">
<input type="text" name="openid_identifier">
<input type="submit" name="openid_action" value="login">
</form>
</body>
</html>