can't authenticate
| From: | Gema | Date: | Thu, 03 Jul 2003 10:12:07 +0000 |
| Subject: | can't authenticate | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-6427@lists.php.net to get a copy of this message | ||
hi,
I´d like to authenticate with pear, but it always gives me a
AUTH_WRONG_LOGIN
and also a Warning: session_start(): Cannot send session cache limiter -
headers already sent
May the problem be my dsn?
I´ve created a table AUTENTICA with the username and password columns USUARI
and PASSWOR and filled with test values in a db that works correctly with
this dsn
so my code is like:
<?
require_once("PEAR.php");
require_once("DB.php");
require_once("DB/ibase.php");
require_once("Auth/Auth.php");
function MostrarFormulari()
{...}
$dsnNostre['phptype']='ibase';
$dsnNostre['dbsyntax']='firebird';
$dsnNostre['username']=...
$dsnNostre['password']=...
$dsnNostre['hostspec']='localhost';
$dsnNostre['database']=...
$dsnNostre['dialect']=3;
$dsnNostre['role']=...
$params = array(
"dsn" => $dsnNostre,
"table" => "AUTENTICA",
"usernamecol" => "USUARI",
"passwordcol" => "PASSWOR"
);
echo "sempre<br>";
$a = &new Auth("DB", $params ,"MostrarFormulari");
$a->setExpire(3);
$a->start();
if ($a->getAuth())
{
echo "t´has autenticat !!!!!!!!!!!!!!<br>";
if($_GET[acccio] == "logout")
{
$a->logout();
echo "You have been logged out<br>";
echo "<a href=\"...\">Log in</a><br>";
}
else
{
echo "Welcome user ". $a->getUsername() ."<br>";
echo "<a href=\"...\">Log out</a><br>";
}
}
else
{
echo "no autenticat<br>";
echo "estat es ".$a->getStatus()."<br>"; //always gives me
-3
!!!!!!!!!!!!!!1
$a->logout();
}
?>