3
* Service Provider Example -- Register Form
5
* Copyright (C) 2004 Entr'ouvert
6
* http://lasso.entrouvert.org
8
* Authors: Christophe Nowicki <cnowicki@easter-eggs.com>
10
* This program is free software; you can redistribute it and/or modify
11
* it under the terms of the GNU General Public License as published by
12
* the Free Software Foundation; either version 2 of the License, or
13
* (at your option) any later version.
15
* This program is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU General Public License for more details.
20
* You should have received a copy of the GNU General Public License
21
* along with this program; if not, write to the Free Software
22
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25
$config = unserialize(file_get_contents('config.inc'));
27
require_once 'DB.php';
29
if (!empty($_GET['SID']))
30
session_start($_GET['SID']);
34
if (!isset($_SESSION["nameidentifier"])) {
35
print "User is not logged in";
39
switch($_POST['action']) {
41
$db = &DB::connect($config['dsn']);
44
die($db->getMessage());
46
$query = "UPDATE users SET first_name='" . $_POST['first_name'] . "',last_name='". $_POST['last_name'] ."' WHERE user_id='".$_SESSION["user_id"]."'";
47
$res =& $db->query($query);
48
if (DB::isError($res))
49
print $res->getMessage(). "\n";
52
header("Request-URI: $url");
53
header("Content-Location: $url");
54
header("Location: $url");
58
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
59
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
62
<title>Lasso Service Provider Example : Registration Form</title>
66
<form name='frm' action="<?php echo $PHP_SELF; ?>" method='post'>
67
<table align="center">
68
<caption>Registration Form</caption>
70
<td>First Name:</td><td><input type='text' name="first_name" maxlength='50'></td>
73
<td>Last Name:</td><td><input type='text' name="last_name" maxlength='50'></td>
76
<td> </td><td><input type='submit' value="Ok"></td>
79
<input type='hidden' name='action' value='submit'>