summaryrefslogtreecommitdiffstats
path: root/php/Attic/examples/sample-sp/index.php
diff options
context:
space:
mode:
authorChristophe Nowicki <cnowicki@easter-eggs.com>2004-08-18 15:03:56 +0000
committerChristophe Nowicki <cnowicki@easter-eggs.com>2004-08-18 15:03:56 +0000
commit131a818d244eea55a4e038c654c72ceee0a17526 (patch)
tree3a11a9fa8260bd3a1b0f1d46b15373fe4160f0c2 /php/Attic/examples/sample-sp/index.php
parent712ff1a9f7f68c8ade853f3ae031666a63120fa8 (diff)
Service Provider written in PHP (login is working and logout will work soon ;0)
Diffstat (limited to 'php/Attic/examples/sample-sp/index.php')
-rw-r--r--php/Attic/examples/sample-sp/index.php119
1 files changed, 119 insertions, 0 deletions
diff --git a/php/Attic/examples/sample-sp/index.php b/php/Attic/examples/sample-sp/index.php
new file mode 100644
index 00000000..73179fb6
--- /dev/null
+++ b/php/Attic/examples/sample-sp/index.php
@@ -0,0 +1,119 @@
+<?php
+/*
+ * Service Provider Example -- Configuration File
+ *
+ * Copyright (C) 2004 Entr'ouvert
+ * http://lasso.entrouvert.org
+ *
+ * Authors: Christophe Nowicki <cnowicki@easter-eggs.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+ if(!extension_loaded('lasso')) {
+ $ret = @dl('lasso.' . PHP_SHLIB_SUFFIX);
+ if ($ret == FALSE)
+ {
+
+ print "<p align='center'><b>The Lasso Extension is not available</b><br>";
+ print "Please check your PHP extensions<br>";
+ print "You can get more informations about <b>Lasso</b> at <br>";
+ print "<a href='http://lasso.entrouvert.org/'>http://lasso.entrouvert.org/</a></p>";
+ exit();
+ }
+ }
+
+ session_start();
+
+ lasso_init();
+
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head>
+<title>Lasso Service Provider Example</title>
+</head>
+
+<body>
+<br><br>
+<table border="1" align="center" frame="above">
+<tr>
+ <td><b>Serice Provider Administration</b></td>
+</tr>
+<tr>
+ <td><a href="admin_user.php">Users Management</a></td>
+</tr>
+<tr>
+ <td><a href="admin_fed.php">Federation Administration</a></td>
+</tr>
+<tr>
+<tr>
+ <td><b>Serice Provider Fonctionnality</b></td>
+</tr>
+<?php
+ if (!isset($_SESSION["nameidentifier"])) {
+ ?>
+<tr>
+ <td><a href="login.php">Login!</a></td>
+</tr>
+<?php } else { ?>
+<tr>
+ <td><a href="logout.php">Logout!</a></td>
+</tr>
+<?php } ?>
+</table>
+
+<table border="1" align="center" frame="above">
+<caption><b>Status</b></caption>
+<tr>
+ <?php
+ if (!isset($_SESSION["nameidentifier"]))
+ {
+ echo "<td>User is <b>not</b> logged in!</td>";
+ }
+ else
+ {
+ ?>
+ <td colspan='2' align="center">User <b>is</b> logged in!</td>
+</tr>
+<tr>
+ <td><b>Name Identifier:</b></td><td><?php echo $_SESSION["nameidentifier"]; ?></td>
+</tr>
+<tr>
+ <td><b>UserID:</b></td><td><?php echo $_SESSION["user_id"]; ?></td>
+</tr>
+<tr>
+ <td><b>Last Name:</b></td><td><?php echo $last_name; ?></td>
+</tr>
+<tr>
+ <td><b>First Name:</b></td><td><?php echo $first_name; ?></td>
+ <?php
+ }
+ ?>
+</tr>
+</table>
+
+<p>Lasso Version : <?php echo lasso_version(); ?></p>
+
+<br>
+<p align="right">Copyright &copy; 2004 Entr'ouvert</p>
+
+</body>
+
+</html>
+<?php
+ lasso_shutdown();
+ ?>