From 1db82e571dd29835ee669472de1a646314e12aa9 Mon Sep 17 00:00:00 2001 From: Christophe Nowicki Date: Fri, 17 Sep 2004 16:02:24 +0000 Subject: 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) --- php/Attic/examples/sample-sp/setup.php | 58 +++++++++++++++++++++++++++++++--- 1 file changed, 53 insertions(+), 5 deletions(-) (limited to 'php/Attic/examples/sample-sp/setup.php') diff --git a/php/Attic/examples/sample-sp/setup.php b/php/Attic/examples/sample-sp/setup.php index eebd81ed..c6c44228 100644 --- a/php/Attic/examples/sample-sp/setup.php +++ b/php/Attic/examples/sample-sp/setup.php @@ -22,8 +22,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + require_once 'DB.php'; ?> - + http://lasso.entrouvert.org/

"; exit(); } - } + } - require_once 'DB.php'; # default config if (!file_exists('config.inc')) @@ -46,6 +47,7 @@ $config = array( 'dsn' => "pgsql://sp:sp@localhost/sp", 'server_dump_filename' => "lasso_server_dump.xml", + 'log_handler' => "sql", 'sp-metadata' => $cwd . "/metadata_sp1.xml", 'sp-public_key' => $cwd . "/public-key_sp1.pem", 'sp-private_key' => $cwd . "/private-key-raw_sp1.pem", @@ -140,7 +142,41 @@ die($res->getMessage()); print "OK"; + + print "
Create table 'log' : "; + $query = "DROP TABLE log CASCADE"; + $res =& $db->query($query); + + $query = "CREATE TABLE log ( + id integer primary key, + logtime timestamp, + ident varchar(16), + priority integer, + message text)"; + + $res =& $db->query($query); + if (DB::isError($res)) + die($res->getMessage()); + + print "OK"; + + + print "
Create table 'sessions' : "; + $query = "DROP TABLE sessions CASCADE"; + $res =& $db->query($query); + + $query = "CREATE TABLE sessions ( + id varchar(32) primary key, + expiry integer, + data text + )"; + $res =& $db->query($query); + if (DB::isError($res)) + die($res->getMessage()); + + print "OK"; + $db->disconnect(); $keys = array_keys($config); @@ -151,9 +187,7 @@ { print "
Check file " . $config[$file] . " : "; if (!file_exists($config[$file])) - { die("Failed (file does not exist)"); - } else print "OK"; } @@ -261,6 +295,20 @@ Server XML Dump :' maxlength='100'>  + + Logging + + + Handler : + + +   + + Service Provider -- cgit