summaryrefslogtreecommitdiffstats
path: root/php/Attic/examples/sample-sp
diff options
context:
space:
mode:
authorChristophe Nowicki <cnowicki@easter-eggs.com>2004-08-18 15:49:49 +0000
committerChristophe Nowicki <cnowicki@easter-eggs.com>2004-08-18 15:49:49 +0000
commit0950f7558cc378dad1493713278e392562b221f0 (patch)
tree879d77f6882aea0d0c1a057f256a7900151429d4 /php/Attic/examples/sample-sp
parent1a599c2608fd2b337993c39a9d378a176b7077e0 (diff)
downloadlasso-0950f7558cc378dad1493713278e392562b221f0.tar.gz
lasso-0950f7558cc378dad1493713278e392562b221f0.tar.xz
lasso-0950f7558cc378dad1493713278e392562b221f0.zip
Rename install.php to setup.php
Diffstat (limited to 'php/Attic/examples/sample-sp')
-rw-r--r--php/Attic/examples/sample-sp/assertionConsumer.php13
-rw-r--r--php/Attic/examples/sample-sp/index.php43
-rw-r--r--[-rwxr-xr-x]php/Attic/examples/sample-sp/setup.php (renamed from php/Attic/examples/sample-sp/install.php)2
3 files changed, 53 insertions, 5 deletions
diff --git a/php/Attic/examples/sample-sp/assertionConsumer.php b/php/Attic/examples/sample-sp/assertionConsumer.php
index a84cb847..f5a1b8c4 100644
--- a/php/Attic/examples/sample-sp/assertionConsumer.php
+++ b/php/Attic/examples/sample-sp/assertionConsumer.php
@@ -102,7 +102,6 @@
{
$row =& $res->fetchRow();
$user_id = $row[0];
- // print "user id : " . $user_id . "<br>\n";
# Get Identity Dump from the data base
$query = "SELECT identity_dump FROM users WHERE user_id='$user_id'";
@@ -119,6 +118,12 @@
$res->free();
lasso_login_accept_sso($login);
+
+ $_SESSION["nameidentifier"] = $nameidentifier;
+ $_SESSION["session_dump"] = $session_dump;
+ $_SESSION["user_id"] = $user_id;
+
+ $url = "index.php";
}
else
{
@@ -162,6 +167,12 @@
$url = "register.php";
}
+
+ // Update last_login
+ $query = "UPDATE users SET last_login=NOW() WHERE user_id='$user_id'";
+ $res =& $db->query($query);
+ if (DB::isError($res))
+ print $res->getMessage(). "\n";
$db->disconnect();
diff --git a/php/Attic/examples/sample-sp/index.php b/php/Attic/examples/sample-sp/index.php
index 73179fb6..0a232742 100644
--- a/php/Attic/examples/sample-sp/index.php
+++ b/php/Attic/examples/sample-sp/index.php
@@ -35,6 +35,10 @@
}
}
+ include 'config.php.inc';
+
+ require_once 'DB.php';
+
session_start();
lasso_init();
@@ -51,8 +55,18 @@
<br><br>
<table border="1" align="center" frame="above">
<tr>
- <td><b>Serice Provider Administration</b></td>
+ <td><b>Service Provider Administration</b></td>
+</tr>
+<?php
+ if (!file_exists($server_dump_filename)) {
+?>
+<tr>
+ <td><a href="setup.php">Setup</a></td>
</tr>
+</table>
+<?php
+} else {
+?>
<tr>
<td><a href="admin_user.php">Users Management</a></td>
</tr>
@@ -60,7 +74,6 @@
<td><a href="admin_fed.php">Federation Administration</a></td>
</tr>
<tr>
-<tr>
<td><b>Serice Provider Fonctionnality</b></td>
</tr>
<?php
@@ -95,17 +108,41 @@
<tr>
<td><b>UserID:</b></td><td><?php echo $_SESSION["user_id"]; ?></td>
</tr>
+<?php
+ $db = &DB::connect($dsn);
+
+ if (DB::isError($db))
+ die($db->getMessage());
+
+ $query = "SELECT * FROM users WHERE user_id='". $_SESSION["user_id"] ."'";
+
+ $res =& $db->query($query);
+ if (DB::isError($res))
+ print $res->getMessage(). "\n";
+
+ list($user_id, $identity_dump, $first_name, $last_name, $created, $last_login) = $res->fetchRow();
+
+ ?>
<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>
+</tr>
+<tr>
+ <td><b>Account Created:</b></td><td><?php echo $created; ?></td>
+</tr>
+<tr>
+ <td><b>Last Login:</b></td><td><?php echo $last_login; ?></td>
<?php
+ $db->disconnect();
}
?>
</tr>
</table>
-
+<?php
+}
+?>
<p>Lasso Version : <?php echo lasso_version(); ?></p>
<br>
diff --git a/php/Attic/examples/sample-sp/install.php b/php/Attic/examples/sample-sp/setup.php
index 7304a27b..2f3540ee 100755..100644
--- a/php/Attic/examples/sample-sp/install.php
+++ b/php/Attic/examples/sample-sp/setup.php
@@ -27,7 +27,7 @@
require_once 'DB.php';
- print "Install script for L.A.S.S.O (Liberty Alliance Single Sign On)\n";
+ print "Setup script for L.A.S.S.O (Liberty Alliance Single Sign On)\n";
lasso_init();
print "$server_dump_filename: ";