[auth] Fixed error handling for signon auth method.

The message is now stored in caller session data and properly displayed
in example script.
This commit is contained in:
Michal Čihař
2011-05-23 10:33:14 +02:00
parent e936257d44
commit adc6de0685
3 changed files with 38 additions and 19 deletions

View File

@@ -11,14 +11,15 @@
* @subpackage Example
*/
/* Need to have cookie visible from parent directory */
session_set_cookie_params(0, '/', '', 0);
/* Create signon session */
$session_name = 'SignonSession';
session_name($session_name);
session_start();
/* Was data posted? */
if (isset($_POST['user'])) {
/* Need to have cookie visible from parent directory */
session_set_cookie_params(0, '/', '', 0);
/* Create signon session */
$session_name = 'SignonSession';
session_name($session_name);
session_start();
/* Store there credentials */
$_SESSION['PMA_single_signon_user'] = $_POST['user'];
$_SESSION['PMA_single_signon_password'] = $_POST['password'];
@@ -47,7 +48,7 @@ if (isset($_POST['user'])) {
<body>
<?php
if (isset($_SESSION['PMA_single_signon_error_message'])) {
echo '<p class="error">' . $_SESSION['PMA_single_signon_message'] . '</p>';
echo '<p class="error">' . $_SESSION['PMA_single_signon_error_message'] . '</p>';
}
?>
<form action="signon.php" method="post">