example using new public functions for logout and login initiation

This commit is contained in:
<bdauvergne@entrouvert.com> 1209043458 +0200 0001-01-01 00:00:00 +00:00
parent 48db9ce5b8
commit 28d7422686
1 changed files with 15 additions and 3 deletions

View File

@ -2,6 +2,16 @@
require_once('spkitlasso/lassospkit_public_api.inc.php');
require_once('spkitlasso/lassospkit_debug.inc.php');
require_once('spkitlasso/lassospkit_utils.inc.php');
$myself = LassoSPKitUtils::myself();
if (isset($_SERVER['PATH_INFO']) && $_SERVER['PATH_INFO'] == '/logout') {
echo lassospkit_soap_logout();
header('Location: ..');
exit(0);
}
if (isset($_SERVER['PATH_INFO']) && $_SERVER['PATH_INFO'] == '/login') {
echo lassospkit_redirect_login('http://localhost/~bdauvergne/spkittest/');
exit(0);
}
echo '<?xml version="1.0" encoding="UTF-8"?>';
function show($a) {
@ -13,15 +23,17 @@ function show($a) {
<html>
<head>
<link type="text/css" rel="stylesheet" href="endpoints/style.css">
<link type="text/css" rel="stylesheet" href="style.css">
</head>
<h1>Points d'accès</h1>
<ul>
<?
$myself = LassoSPKitUtils::myself();
show(lassospkit_login_url($myself));
show(lassospkit_login_url($myself, array('passive' => TRUE)));
show(lassospkit_login_url($myself, array('passive' => TRUE, 'persistent' => FALSE)));
show(lassospkit_federate_url($myself));
show(lassospkit_logout_url($myself));
show("$myself/logout");
show("$myself/login");
show(lassospkit_defederation_url($myself));
show(lassospkit_configure_url());