summaryrefslogtreecommitdiffstats
path: root/php/Attic/examples/sample-idp/login.php
diff options
context:
space:
mode:
authorChristophe Nowicki <cnowicki@easter-eggs.com>2004-09-17 16:02:24 +0000
committerChristophe Nowicki <cnowicki@easter-eggs.com>2004-09-17 16:02:24 +0000
commit1db82e571dd29835ee669472de1a646314e12aa9 (patch)
treea5327193d410a974e21dc27e6554420c5bec8a1b /php/Attic/examples/sample-idp/login.php
parentcc5bffb4bd9a1f3f057be78bfcd71db51a74dfc8 (diff)
log viewer for the Service Provider and the Identity Provider
added logger for in many files updated idp1 metadata, added .php extension added session viewer for the sp (you will be able to view online users)
Diffstat (limited to 'php/Attic/examples/sample-idp/login.php')
-rw-r--r--php/Attic/examples/sample-idp/login.php17
1 files changed, 9 insertions, 8 deletions
diff --git a/php/Attic/examples/sample-idp/login.php b/php/Attic/examples/sample-idp/login.php
index 21b196f9..db24681e 100644
--- a/php/Attic/examples/sample-idp/login.php
+++ b/php/Attic/examples/sample-idp/login.php
@@ -37,6 +37,8 @@
$conf['db'] = $db;
$logger = &Log::factory($config['log_handler'], 'log', $_SERVER['PHP_SELF'], $conf);
+ session_start();
+
/*
*
*/
@@ -67,7 +69,7 @@
$logger->log("DB Error :" . $db->getMessage(), PEAR_LOG_CRIT);
$logger->log("DB Error :" . $db->getDebugInfo(), PEAR_LOG_DEBUG);
die("Internal Server Error");
- }
+ } send by
if ($res->numRows())
{
@@ -90,17 +92,17 @@
// Check Login and Password
if (!($user_id = authentificateUser($db, $_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'])))
{
- $logger->log("Authentication failure with login '".$form->exportValue('username')." password '". $form->exportValue('password') ."' IP '" . $_SERVER['REMOTE_ADDR']."'", PEAR_LOG_WARNING);
+ $logger->log("Authentication failure with login '".$form->exportValue('username')." password '". $form->exportValue('password') ."' IP " . $_SERVER['REMOTE_ADDR'], PEAR_LOG_WARNING);
sendHTTPBasicAuth();
$db->disconnect();
exit;
}
else
{
- $_SESSION['user_id'] = $user_id;
- $_SESSION['username'] = $_SERVER['PHP_AUTH_USER'];
-
- $logger->log("User '".$_SERVER['PHP_AUTH_USER']."'($user_id) authenticated, local session started", PEAR_LOG_NOTICE);
+ $_SESSION['user_id'] = $user_id;
+ $_SESSION['username'] = $_SERVER['PHP_AUTH_USER'];
+
+ $logger->log("User '".$_SERVER['PHP_AUTH_USER']."' ($user_id) authenticated, local session started", PEAR_LOG_NOTICE);
/* TODO : load identity and session dump
@@ -148,11 +150,10 @@
{
if (($user_id = authentificateUser($db, $form->exportValue('username'), $form->exportValue('password'))))
{
- session_start();
$_SESSION['user_id'] = $user_id;
$_SESSION['username'] = $form->exportValue('username');
- $logger->log("User '".$form->exportValue('username')."'($user_id) authenticated, local session started", PEAR_LOG_NOTICE);
+ $logger->log("User '".$form->exportValue('username')."'($user_id) authenticated, local session started", PEAR_LOG_NOTICE);
$url = 'index.php';
header("Request-URI: $url");