2
/* $Id: signon.php 9366 2006-08-27 11:46:12Z lem9 $ */
3
// vim: expandtab sw=4 ts=4 sts=4:
5
// Single signon for phpMyAdmin
7
// This is just example how to use single signon with phpMyAdmin, it is
8
// not intended to be perfect code and look, only shows how you can
9
// integrate this functionality in your application.
11
/* Was data posted? */
12
if (isset($_POST['user'])) {
13
/* Need to have cookie visible from parent directory */
14
session_set_cookie_params(0, '/', '', 0);
15
/* Create signon session */
16
$session_name = 'SignonSession';
17
session_name($session_name);
19
/* Store there credentials */
20
$_SESSION['PMA_single_signon_user'] = $_POST['user'];
21
$_SESSION['PMA_single_signon_password'] = $_POST['password'];
23
/* Close that session */
24
session_write_close();
25
/* Redirect to phpMyAdmin (should use absolute URL here!) */
26
header('Location: ../index.php');
28
/* Show simple form */
29
header('Content-Type: text/html; charset=utf-8');
30
echo '<?xml version="1.0" encoding="utf-8"?>' . "\n";
32
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
33
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
34
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
36
<link rel="icon" href="../favicon.ico" type="image/x-icon" />
37
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
38
<title>phpMyAdmin single signon example</title>
41
<form action="signon.php" method="post">
42
Username: <input type="text" name="user" /><br />
43
Password: <input type="password" name="password" /><br />
44
<input type="submit" />