From 42e6495ad11c6b6a4265e7ad378ba4dfde0e6df8 Mon Sep 17 00:00:00 2001 From: Christophe Nowicki Date: Fri, 20 Aug 2004 09:45:38 +0000 Subject: new setup system --- php/Attic/examples/sample-sp/setup.php | 140 +++++++++++++++++++++++++++++---- 1 file changed, 125 insertions(+), 15 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 e475d74a..ea0fd03c 100644 --- a/php/Attic/examples/sample-sp/setup.php +++ b/php/Attic/examples/sample-sp/setup.php @@ -22,7 +22,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - +?> + + "pgsql://sp:sp@localhost/sp", + 'server_dump_filename' => "lasso_server_dump.xml", + 'sp-metadata' => "/home/cnowicki/mcvs/lasso/tests/data/sp1-la/metadata.xml", + 'sp-public_key' => "/home/cnowicki/mcvs/lasso/tests/data/sp1-la/public-key.pem", + 'sp-private_key' => "/home/cnowicki/mcvs/lasso/tests/data/sp1-la/private-key-raw.pem", + 'sp-ca' => "/home/cnowicki/mcvs/lasso/tests/data/sp1-la/certificate.pem", + 'idp-metadata' => "/home/cnowicki/mcvs/lasso/tests/data/idp1-la/metadata.xml", + 'idp-public_key' => "/home/cnowicki/mcvs/lasso/tests/data/idp1-la/public-key.pem", + 'idp-ca' => "/home/cnowicki/mcvs/lasso/tests/data/ca1-la/certificate.pem", + ); + + $config_ser = serialize($config); + + if (($fd = fopen(getcwd()."/config.inc", "w"))) + { + fwrite($fd, $config_ser); + fclose($fd); + } + else + die("Could not write default config file"); + } + else + { + $config = unserialize(file_get_contents('config.inc')); + } - switch($_POST['action']) + if ($_POST['action'] == 'setup') { - case 'setup' : + ob_start(); + + $setup = FALSE; + print "Lasso Service Provider Setup
"; unset($_POST['action']); @@ -83,6 +117,7 @@ identity_dump text, first_name varchar(50), last_name varchar(50), + last_login timestamp, created timestamp)"; $res =& $db->query($query); if (DB::isError($res)) @@ -131,8 +166,7 @@ if (empty($server)) { - print "Failed"; - break; + die("Failed"); } else print "OK"; @@ -161,23 +195,51 @@ print "OK"; } else - print "Failed"; + die("Failed"); lasso_shutdown(); + print "
Save configuration file : "; + # Save configuration file $config_ser = serialize($config); if (($fd = fopen("config.inc", "w"))) { fwrite($fd, $config_ser); fclose($fd); + print "OK"; + } + else + { + print("Failed"); + break; } - - break; - default: + $setup = TRUE; + } + ob_start(); +?> + + +Setup script for Lasso (Liberty Alliance Single Sign On) + + + + + + + + + + - Setup script for Lasso (Liberty Alliance Single Sign On) @@ -188,16 +250,64 @@ - + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - +
Lasso Service Provider Setup
DSN:' maxlength='100'>Database Configuration
DSN (Data Source Name) :' maxlength='100'>Help
Server XML Dump:' maxlength='100'> 
Service Provider
Metadata'> 
Public Key'> 
Server XML Dump:' maxlength='100'>Private Key'> 
Certificate'> 
Identity Provider
Metadata'> 
Public Key'> 
Certificate'> 
 
+ -- cgit