does PEAR auth expects the username & password encrypted in the database?



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";
}
?>

.



Relevant Pages

  • Re: Enter user name, enter password, then press enter...
    ... What do you do when the customer asks that the database login in be the same ... username and password to use all of the stuff that she is permitted to use. ... I have implemented this type of security for Access, VB, and Web Based ASP ...
    (microsoft.public.access.forms)
  • RE: Receiving JDBC error when executing program - Login failed for user sa
    ... says we're using 'sa' so I would think that's the username being passed in. ... | I am receiving the following error when attempting to run my database ... I tried to login the 'sa' account ...
    (microsoft.public.sqlserver.jdbcdriver)
  • Re: Dynamic SQL
    ... Don't need to login to the database. ... OF course entering username N00bHax0r') will cause an error. ... // is the Validators good for this ????? ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Login fails. Why?
    ... the 'UserName' login has not been granted access to the ... The user will need permissions on referenced database objects, ... SQL Server MVP ...
    (microsoft.public.sqlserver.security)
  • Re: Synchronize Active Directory with a SQL-Server database
    ... users of the Active Directory. ... on the login I check if the user exist in the AD too. ... username and the password on the database. ... So I need the record of the users in the database to have the same ...
    (microsoft.public.windows.server.scripting)