Re: does PEAR auth expects the username & password encrypted in the database?
- From: odaldecoa@xxxxxxxxx
- Date: 19 Aug 2006 07:06:11 -0700
I found the answer to my problem:
By default, the *username* is in plain text and the *password* must be
stored in the database with md5 encryption.
Found this in the source code: pear/Auth/container.php line 104, within
function verifyPasssword.
It might be helpfull to someone else.
Cheers,
Oscar
Fun
odaldecoa@xxxxxxxxx wrote:
Hi all in php.general,
I would appreciate very much if any of you could help me to get this
simple auth example to work.
When running a pear auth example (below), Auth connects correctly to
the database, but the username and password I type in the login-form
are never recognized, so I cannot login.
I think it's a problem with the way I've stored my username and
password in the database.
I've tried plain text, MD5 encryption for the password, MD5 for both
user name and password (using phpmyadmin), but yet I cannot login.
Do the username & password in the database need to be encrypted?
Would you have any hints of what I am doing wrong?
Many thanks in advance for any help you can provide.
Best wishes,
Oscar
: )
This is the example script from
http://pear.php.net/manual/en/package.authentication.auth.intro.php:
<?php
require_once "Auth.php";
function loginFunction()
{
echo "<form method=\"post\" action=\"testauth.php\">";
echo "<input type=\"text\" name=\"username\">";
echo "<input type=\"password\" name=\"password\">";
echo "<input type=\"submit\">";
echo "</form>";
}
$dsn = "mysql://admin:xxxxxx@localhost/testoscar";
$a = new Auth("DB", $dsn, "loginFunction");
$a->start();
if ($a->checkAuth()) {
echo "welcome";
}
else {
echo "login error";
}
?>
.
- References:
- Prev by Date: PHP and VMware: SLOW
- Next by Date: PHP and Curl (CURLOPT_RANGE - not working)
- Previous by thread: does PEAR auth expects the username & password encrypted in the database?
- Next by thread: PHP and VMware: SLOW
- Index(es):
Relevant Pages
|