PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Authentication » Auth » Bug #9313

Using start() page stop

Details

Submitted2006-11-12 15:03 UTC
Fromandreboni2002 at yahoo dot com dot br
Assignedaashley
StatusClosed
PackageAuth
PHP Version4.3.10
OSWin XP Pro
Roadmaps(Not assigned)

Comments

[2006-11-12 15:03 UTC] andreboni2002 at yahoo dot com dot br

Description:
------------
I used a sample from documentation and when I comment the line:

$a->start();

the page run until the end (I put a echo statement at the bottom of code) but all variables from $a object return no value. If I not comment this line the page stop and not run until the end.

Test script:
---------------
<?php
require_once "Auth.php";
echo "Test";

function myOutput($username, $status)
{
echo "<form method=\"post\" action=\"test.php\">";
echo "<input type=\"text\" name=\"username\">";
echo "<input type=\"password\" name=\"password\">";
echo "<input type=\"submit\">";
echo "</form>";
}
$params = array("dsn" => "mysql://root@localhost/mysql","table" => "auth","usernamecol" => "username","passwordcol" => "password");

$a = new Auth("DB", $params, "myOutput");
$a->start();
if ($a->getAuth()) {
echo "You have been authenticated successfully.";
}
?>

Expected result:
----------------
See the message "You have been authenticated successfully."

Actual result:
--------------
A blank page without any error message

[2006-12-06 01:13 UTC] aashley at php dot net

Using the following test script I have been unable to replicate your problem. I suspect your problem might have to do with connecting to the database, try turning error reporting up to the maximum and see what is said.

<?php
require_once "Auth.php";

function myOutput($username, $status)
{
echo "<form method=\"post\" action=\"test.php\">";
echo "<input type=\"text\" name=\"username\">";
echo "<input type=\"password\" name=\"password\">";
echo "<input type=\"submit\">";
echo "</form>";
}
$params = array(
'users' => array(
'user' => 'pass',
),
'cryptType' => 'none',
);

$a = new Auth("Array", $params, "myOutput");
$a->start();
if ($a->getAuth()) {
echo "You have been authenticated successfully.";
} else {
echo "Not Authed.";
}
?>