3
* Service Provider Example -- Index File
5
* Copyright (C) 2004 Entr'ouvert
6
* http://lasso.entrouvert.org
8
* Authors: Christophe Nowicki <cnowicki@easter-eggs.com>
10
* This program is free software; you can redistribute it and/or modify
11
* it under the terms of the GNU General Public License as published by
12
* the Free Software Foundation; either version 2 of the License, or
13
* (at your option) any later version.
15
* This program is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU General Public License for more details.
20
* You should have received a copy of the GNU General Public License
21
* along with this program; if not, write to the Free Software
22
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25
if(!extension_loaded('lasso')) {
26
$ret = @dl('lasso.' . PHP_SHLIB_SUFFIX);
30
<p align='center'><b>The Lasso Extension is not available</b><br>
31
Please check your PHP extensions<br>
32
You can get more informations about <b>Lasso</b> at <br>
33
<a href='http://lasso.entrouvert.org/'>http://lasso.entrouvert.org/</a></p>
39
if (!file_exists('config.inc'))
42
<p align='center'><b>Service Provider Configuration file is not available</b><br>
43
Please run the setup script :<br>
44
<a href='setup.php'>Lasso Service Provider Setup</a><br>
45
You can get more informations about <b>Lasso</b> at <br>
46
<a href='http://lasso.entrouvert.org/'>http://lasso.entrouvert.org/</a></p>
51
$config = unserialize(file_get_contents('config.inc'));
53
require_once 'DB.php';
55
if (!empty($_GET['SID']))
56
session_start($_GET['SID']);
63
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
64
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
66
<title>Lasso Service Provider Example</title>
67
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15" />
72
<table border="1" frame="above">
74
<td><b>Service Provider Administration</b></td>
77
<td><a href="setup.php">Setup</a></td>
80
<td><a href="admin_user.php">Users Management</a></td>
83
<td><b>Serice Provider Fonctionnality</b></td>
86
if (!isset($_SESSION["nameidentifier"])) {
89
<td><a href="login.php">Login!</a></td>
93
<td><a href="logout.php?SID=<?php echo $SID ?>">Logout!</a></td>
99
<table border="1" frame="above">
100
<caption><b>Status</b></caption>
103
if (!isset($_SESSION["nameidentifier"]))
105
echo "<td>User is <b>not</b> logged in!</td>";
110
<td colspan='2' align="center">User <b>is</b> logged in!</td>
113
<td><b>Name Identifier:</b></td><td><?php echo $_SESSION["nameidentifier"]; ?></td>
116
<td><b>UserID:</b></td><td><?php echo $_SESSION["user_id"]; ?></td>
119
$db = &DB::connect($config['dsn']);
121
if (DB::isError($db))
122
die($db->getMessage());
124
$query = "SELECT * FROM users WHERE user_id='". $_SESSION["user_id"] ."'";
126
$res =& $db->query($query);
127
if (DB::isError($res))
128
print $res->getMessage(). "\n";
130
list($user_id, $identity_dump, $first_name, $last_name, $created, $last_login) = $res->fetchRow();
134
<td><b>Last Name:</b></td><td><?php echo $last_name; ?></td>
137
<td><b>First Name:</b></td><td><?php echo $first_name; ?></td>
140
<td><b>PHP Session ID:</b></td><td><?php echo session_id(); ?></td>
143
<td><b>Account Created:</b></td><td><?php echo $created; ?></td>
146
<td><b>Last Login:</b></td><td><?php echo $last_login; ?></td>
154
<!-- <p>Lasso Version : <?php // echo lasso_version(); ?></p> -->
157
<p>Copyright © 2004 Entr'ouvert</p>